您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wxLogDebug函数代码示例

51自学网 2021-06-03 10:10:38
  C++
这篇教程C++ wxLogDebug函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中wxLogDebug函数的典型用法代码示例。如果您正苦于以下问题:C++ wxLogDebug函数的具体用法?C++ wxLogDebug怎么用?C++ wxLogDebug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了wxLogDebug函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: OnMouseOverDisplayable

//.........这里部分代码省略.........        if (MMalloc.assigned<seec::cm::MallocState>()) {          auto const &Malloc = MMalloc.get<seec::cm::MallocState>();          if (Malloc.getAllocatorStmt())            Notifier->createNotify<ConEvHighlightStmt>(nullptr);        }      }    }  }  MouseOver = Ev.getDisplayableShared();  auto const Node = MouseOver.get();  if (!Node) {    if (Recording)      Recording->recordEventL("StateGraphViewer.MouseOverNone");  }  else if (auto const DV = llvm::dyn_cast<DisplayableValue>(Node)) {    if (auto Access = CurrentAccess->getAccess()) {      Notifier->createNotify<ConEvHighlightValue>(&(DV->getValue()),                                                  CurrentAccess);    }    if (Recording) {      std::vector<std::unique_ptr<IAttributeReadOnly>> Attrs;      addAttributesForValue(Attrs, DV->getValue());      Recording->recordEventV("StateGraphViewer.MouseOverValue", Attrs);    }  }  else if (auto const DD = llvm::dyn_cast<DisplayableDereference>(Node)) {    if (auto Access = CurrentAccess->getAccess()) {      Notifier->createNotify<ConEvHighlightValue>(&(DD->getPointer()),                                                  CurrentAccess);    }    if (Recording) {      std::vector<std::unique_ptr<IAttributeReadOnly>> Attrs;      addAttributesForValue(Attrs, DD->getPointer());      Recording->recordEventV("StateGraphViewer.MouseOverDereference", Attrs);    }  }  else if (auto const DF = llvm::dyn_cast<DisplayableFunctionState>(Node)) {    auto const Decl = DF->getFunctionState().getFunctionDecl();    Notifier->createNotify<ConEvHighlightDecl>(Decl);    if (Recording) {      auto const &FS = DF->getFunctionState();      Recording->recordEventL("StateGraphViewer.MouseOverFunctionState",                              make_attribute("function", FS.getNameAsString()));    }  }  else if (auto const DL = llvm::dyn_cast<DisplayableLocalState>(Node)) {    auto const Decl = DL->getLocalState().getDecl();    Notifier->createNotify<ConEvHighlightDecl>(Decl);    if (Recording) {      // TODO    }  }  else if (auto const DP = llvm::dyn_cast<DisplayableParamState>(Node)) {    auto const Decl = DP->getParamState().getDecl();    Notifier->createNotify<ConEvHighlightDecl>(Decl);    if (Recording) {      // TODO    }  }  else if (auto const DG = llvm::dyn_cast<DisplayableGlobalVariable>(Node)) {    auto const Decl = DG->getGlobalVariable().getClangValueDecl();    Notifier->createNotify<ConEvHighlightDecl>(Decl);    if (Recording) {      // TODO    }  }  else if (auto const DA = llvm::dyn_cast<DisplayableReferencedArea>(Node)) {    if (auto Access = CurrentAccess->getAccess()) {      auto const Start = DA->getAreaStart();      auto const MayMalloc = CurrentProcess->getDynamicMemoryAllocation(Start);      if (MayMalloc.assigned<seec::cm::MallocState>()) {        auto const &Malloc = MayMalloc.get<seec::cm::MallocState>();        if (auto const S = Malloc.getAllocatorStmt())          Notifier->createNotify<ConEvHighlightStmt>(S);      }    }    if (Recording) {      Recording->recordEventL("StateGraphViewer.MouseOverReferencedArea",                              make_attribute("start", DA->getAreaStart()),                              make_attribute("end", DA->getAreaEnd()));    }  }  else {    wxLogDebug("Mouse over unknown Displayable.");    if (Recording) {      Recording->recordEventL("StateGraphViewer.MouseOverUnknown");    }  }}
开发者ID:mheinsen,项目名称:seec,代码行数:101,


示例2: wxPanel

raBid::raBid(const wxWindow* parent): wxPanel((wxWindow*)parent) {	int i = 0;	int j = 0;	int best_width = 0;	int temp_width = 0;	int temp_height = 0;	m_game = NULL;	m_min_bid = 0;	// Initializing the value of all the buttons to NULL	for(i = 0; i < raBID_TOTAL_BTNS; ++i)		m_buttons[i] = NULL;	m_button_all = NULL;	m_button_pass = NULL;	// Calculate the best width for the buttons	// The best width should be able to contain all bids from 14	// to 28 and the strings "All" and "Pass"	best_width = 0;	for(i = 0 ; i < raBID_TOTAL_BTNS; i++) {		this->GetTextExtent(wxString::Format(wxT("%d"), i + 14),							&temp_width, &temp_height);		best_width = std::max(best_width, temp_width);	}	this->GetTextExtent(wxT("All"), &temp_width, &temp_height);	best_width = std::max(best_width, temp_width);	this->GetTextExtent(wxT("Pass"), &temp_width, &temp_height);	best_width = std::max(best_width, temp_width);	wxLogDebug(wxString::Format(wxT("Best width %d"), best_width));#ifdef __WXMSW__	this->SetWindowStyle(wxRAISED_BORDER);#endif	m_main_panel = new wxPanel(this);	if(!m_main_panel) {		wxLogError(wxString::Format(wxT("Failed to create main panel. %s:%d"), wxT(__FILE__), __LINE__));		return;	}#ifdef __WXMSW__	m_main_panel->SetWindowStyle(wxSUNKEN_BORDER);#endif	m_main_panel->SetBackgroundColour(*wxWHITE);	m_main_sizer = new wxGridSizer(0, 0, 0, 0);	// TODO : Add error checks	m_main_panel_sizer = new wxBoxSizer(wxVERTICAL);	m_head_panel = new wxPanel(m_main_panel);	//m_head_panel->SetWindowStyle(wxRAISED_BORDER);	m_head_panel->SetBackgroundColour(raCLR_HEAD_DARK);	m_head_panel->SetForegroundColour(*wxWHITE);	m_bold_font = m_head_panel->GetFont();	m_bold_font.SetWeight(wxFONTWEIGHT_BOLD);	m_head_panel->SetFont(m_bold_font);	m_head_panel_sizer = new wxGridSizer(0, 0, 0, 0);	m_head_panel_text = new wxStaticText(m_head_panel, -1, wxT("Enter Bid"));	m_head_panel_sizer->Add(m_head_panel_text, 0,							wxALIGN_CENTER_HORIZONTAL| wxALIGN_CENTER_VERTICAL|wxALL, 2);	m_head_panel->SetSizer(m_head_panel_sizer);	m_bidbtn_panel = new wxPanel(m_main_panel);	//m_bidbtn_panel->SetWindowStyle(wxSUNKEN_BORDER);	m_bidbtn_panel_sizer = new wxGridSizer(5, 3, 0, 0);	for(i = 0; i < raBID_BTN_ROWS; i++) {		for(j = 0; j < raBID_BTN_COLS; j++) {			m_buttons[(i * raBID_BTN_COLS) + j] = new wxButton(m_bidbtn_panel,					raBID_BTN_ID_START + (i * raBID_BTN_COLS) + j,					wxString::Format(wxT("%d"), (i * raBID_BTN_COLS) + j + 14),					wxDefaultPosition, wxSize(best_width, -1));			m_bidbtn_panel_sizer->Add(m_buttons[(i * raBID_BTN_COLS) + j], 0,									  wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 1);			//m_buttons[(i * raBID_BTN_COLS) + j]->SetSize(10, 20);			//m_buttons[(i * raBID_BTN_COLS) + j]->SetWindowStyle(wxNO_BORDER);			m_buttons[(i * raBID_BTN_COLS) + j]->SetEventHandler(this->GetEventHandler());		}	}	m_bidbtn_panel->SetSizer(m_bidbtn_panel_sizer);	m_bidbtn_panel_sizer->Fit(m_bidbtn_panel);	// Create panel, assosiated sizer to hold the buttons	// to bid "All" and "Pass"	m_btns_panel = new wxPanel(m_main_panel);	m_btns_panel_sizer = new wxGridSizer(1, 2, 0, 0);	m_button_all = new wxButton(m_btns_panel, raBID_BTN_ID_ALL, wxT("All"));//.........这里部分代码省略.........
开发者ID:TodorBalabanov,项目名称:rosanne,代码行数:101,


示例3: UnRef

bool wxAnimation::Load(wxInputStream &stream, wxAnimationType type){    UnRef();    char anim_type[12];    switch (type)    {    case wxANIMATION_TYPE_GIF:        strcpy(anim_type, "gif");        break;    case wxANIMATION_TYPE_ANI:        strcpy(anim_type, "ani");        break;    default:        anim_type[0] = '/0';        break;    }    // create a GdkPixbufLoader    GError *error = NULL;    GdkPixbufLoader *loader;    if (type != wxANIMATION_TYPE_INVALID && type != wxANIMATION_TYPE_ANY)        loader = gdk_pixbuf_loader_new_with_type(anim_type, &error);    else        loader = gdk_pixbuf_loader_new();    if (!loader)    {        wxLogDebug(wxT("Could not create the loader for '%s' animation type"), anim_type);        return false;    }    // connect to loader signals    g_signal_connect(loader, "area-updated", G_CALLBACK(gdk_pixbuf_area_updated), this);    guchar buf[2048];    while (stream.IsOk())    {        // read a chunk of data        stream.Read(buf, sizeof(buf));        // fetch all data into the loader        if (!gdk_pixbuf_loader_write(loader, buf, stream.LastRead(), &error))        {            gdk_pixbuf_loader_close(loader, &error);            wxLogDebug(wxT("Could not write to the loader"));            return false;        }    }    // load complete    if (!gdk_pixbuf_loader_close(loader, &error))    {        wxLogDebug(wxT("Could not close the loader"));        return false;    }    // wait until we get the last area_updated signal    return true;}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:62,


示例4: wxCharCodeWXToOSX

//.........这里部分代码省略.........        case 'o': case 'O':   keycode = kVK_ANSI_O; break;        case 'p': case 'P':   keycode = kVK_ANSI_P; break;        case 'q': case 'Q':   keycode = kVK_ANSI_Q; break;        case 'r': case 'R':   keycode = kVK_ANSI_R; break;        case 's': case 'S':   keycode = kVK_ANSI_S; break;        case 't': case 'T':   keycode = kVK_ANSI_T; break;        case 'u': case 'U':   keycode = kVK_ANSI_U; break;        case 'v': case 'V':   keycode = kVK_ANSI_V; break;        case 'w': case 'W':   keycode = kVK_ANSI_W; break;        case 'x': case 'X':   keycode = kVK_ANSI_X; break;        case 'y': case 'Y':   keycode = kVK_ANSI_Y; break;        case 'z': case 'Z':   keycode = kVK_ANSI_Z; break;                    case '0':             keycode = kVK_ANSI_0; break;        case '1':             keycode = kVK_ANSI_1; break;        case '2':             keycode = kVK_ANSI_2; break;        case '3':             keycode = kVK_ANSI_3; break;        case '4':             keycode = kVK_ANSI_4; break;        case '5':             keycode = kVK_ANSI_5; break;        case '6':             keycode = kVK_ANSI_6; break;        case '7':             keycode = kVK_ANSI_7; break;        case '8':             keycode = kVK_ANSI_8; break;        case '9':             keycode = kVK_ANSI_9; break;#ifdef __clang__    #pragma clang diagnostic pop#endif // __clang__                    case WXK_BACK:        keycode = kVK_Delete; break;        case WXK_TAB:         keycode = kVK_Tab; break;        case WXK_RETURN:      keycode = kVK_Return; break;        case WXK_ESCAPE:      keycode = kVK_Escape; break;        case WXK_SPACE:       keycode = kVK_Space; break;        case WXK_DELETE:      keycode = kVK_ForwardDelete; break;                    case WXK_SHIFT:       keycode = kVK_Shift; break;        case WXK_ALT:         keycode = kVK_Option; break;        case WXK_RAW_CONTROL: keycode = kVK_Control; break;        case WXK_CONTROL:     keycode = kVK_Command; break;                    case WXK_CAPITAL:     keycode = kVK_CapsLock; break;        case WXK_END:         keycode = kVK_End; break;        case WXK_HOME:        keycode = kVK_Home; break;        case WXK_LEFT:        keycode = kVK_LeftArrow; break;        case WXK_UP:          keycode = kVK_UpArrow; break;        case WXK_RIGHT:       keycode = kVK_RightArrow; break;        case WXK_DOWN:        keycode = kVK_DownArrow; break;                    case WXK_HELP:        keycode = kVK_Help; break;                                case WXK_NUMPAD0:     keycode = kVK_ANSI_Keypad0; break;        case WXK_NUMPAD1:     keycode = kVK_ANSI_Keypad1; break;        case WXK_NUMPAD2:     keycode = kVK_ANSI_Keypad2; break;        case WXK_NUMPAD3:     keycode = kVK_ANSI_Keypad3; break;        case WXK_NUMPAD4:     keycode = kVK_ANSI_Keypad4; break;        case WXK_NUMPAD5:     keycode = kVK_ANSI_Keypad5; break;        case WXK_NUMPAD6:     keycode = kVK_ANSI_Keypad6; break;        case WXK_NUMPAD7:     keycode = kVK_ANSI_Keypad7; break;        case WXK_NUMPAD8:     keycode = kVK_ANSI_Keypad8; break;        case WXK_NUMPAD9:     keycode = kVK_ANSI_Keypad9; break;        case WXK_F1:          keycode = kVK_F1; break;        case WXK_F2:          keycode = kVK_F2; break;        case WXK_F3:          keycode = kVK_F3; break;        case WXK_F4:          keycode = kVK_F4; break;        case WXK_F5:          keycode = kVK_F5; break;        case WXK_F6:          keycode = kVK_F6; break;        case WXK_F7:          keycode = kVK_F7; break;        case WXK_F8:          keycode = kVK_F8; break;        case WXK_F9:          keycode = kVK_F9; break;        case WXK_F10:         keycode = kVK_F10; break;        case WXK_F11:         keycode = kVK_F11; break;        case WXK_F12:         keycode = kVK_F12; break;        case WXK_F13:         keycode = kVK_F13; break;        case WXK_F14:         keycode = kVK_F14; break;        case WXK_F15:         keycode = kVK_F15; break;        case WXK_F16:         keycode = kVK_F16; break;        case WXK_F17:         keycode = kVK_F17; break;        case WXK_F18:         keycode = kVK_F18; break;        case WXK_F19:         keycode = kVK_F19; break;        case WXK_F20:         keycode = kVK_F20; break;                    case WXK_PAGEUP:      keycode = kVK_PageUp; break;        case WXK_PAGEDOWN:    keycode = kVK_PageDown; break;                    case WXK_NUMPAD_DELETE:    keycode = kVK_ANSI_KeypadClear; break;        case WXK_NUMPAD_EQUAL:     keycode = kVK_ANSI_KeypadEquals; break;        case WXK_NUMPAD_MULTIPLY:  keycode = kVK_ANSI_KeypadMultiply; break;        case WXK_NUMPAD_ADD:       keycode = kVK_ANSI_KeypadPlus; break;        case WXK_NUMPAD_SUBTRACT:  keycode = kVK_ANSI_KeypadMinus; break;        case WXK_NUMPAD_DECIMAL:   keycode = kVK_ANSI_KeypadDecimal; break;        case WXK_NUMPAD_DIVIDE:    keycode = kVK_ANSI_KeypadDivide; break;                    default:            wxLogDebug( "Unrecognised keycode %d", code );            keycode = static_cast<CGKeyCode>(-1);    }        return keycode;}
开发者ID:emutavchi,项目名称:pxCore,代码行数:101,


示例5: wxMkdir

bool BundleManager::DownloadDir(const wxString& url, const wxFileName& path, wxProgressDialog& dlg) {	// Get list of files and folders	RemoteProfile rp;	vector<cxFileInfo> fiList;	CURLcode errorCode = m_remoteThread.GetRemoteListWait(url, rp, fiList);	if (errorCode != CURLE_OK) goto error;	// Download files and folders	{		unsigned int retryCount = 0;		for (vector<cxFileInfo>::const_iterator p = fiList.begin(); p != fiList.end(); ++p) {			if (p->m_isDir) {				// Create subdir				wxFileName dir = path;				dir.AppendDir(p->m_name);				wxMkdir(dir.GetPath());				const wxString dirName = p->m_name + wxT('/');				if (!dlg.Pulse(dirName)) return false;				// Download contents				const wxString dirUrl = url + dirName;				if (!DownloadDir(dirUrl, dir, dlg)) return false;			}			else {				wxString filename = p->m_name;#ifdef __WXMSW__				filename = UrlEncode::EncodeFilename(filename); // Make filename safe for win#endif				wxFileName filePath = path;				filePath.SetFullName(filename);				const wxString pathStr = filePath.GetFullPath();				if (!dlg.Pulse(filename)) return false;				// Download file				const wxString fileUrl = url + p->m_name;				errorCode = m_remoteThread.Download(fileUrl, pathStr, rp);								// Check for errors				if (errorCode != CURLE_OK) goto error;				// There has been some cases where the download has ended				// up with an empty file but no error. As a workaround				// we give it one more try and then return an error.				if (filePath.GetSize() == 0 && p->m_size != 0) {					if (retryCount == 0) {						wxLogDebug(wxT("Received empty file! Retrying download"));						++retryCount;						--p;						continue;					}					else {						errorCode = CURLE_PARTIAL_FILE;						goto error;					}				}				// Set modDate				filePath.SetTimes(NULL, &p->m_modDate, NULL);				retryCount = 0;			}		}	}	return true;error:	wxMessageBox(m_remoteThread.GetErrorText(errorCode), _("Download Error"), wxICON_ERROR|wxOK, this);	return false;}
开发者ID:dxtravi,项目名称:e,代码行数:72,


示例6: wxLogDebug

void wxHandheldInstallCtrl::InsertUserDestinations( handheld_dest_array_type& handheld_dest_array ){    wxLogDebug( wxT( "Entering wxHandheldInstallCtrl::InsertUserDestinations()" ) );    if ( handheld_dest_array.IsEmpty() ) {        return;    }    // Insert by rows, starting at index zero. Achieve by getting number    // of items in listctrl.    int             row_to_insert;    wxString        ram_or_card_string;    wxString		is_usb_pause_string;    wxArrayString   row_cells_contents;    wxArrayInt      matching_row_numbers;    // Insert them    for ( size_t n = 0; n < handheld_dest_array.GetCount(); n++ )     {        row_to_insert =  m_usersListCtrl->GetItemCount();            // Convert our handheld_target_storage_mode to the string in the column            if( handheld_dest_array[ n ]->handheld_target_storage_mode == plkrHANDHELD_TARGET_STORAGE_MODE_SD_CARD )            {                ram_or_card_string = _( "SD Card" );            }             else if( handheld_dest_array[ n ]->handheld_target_storage_mode == plkrHANDHELD_TARGET_STORAGE_MODE_MEMORY_STICK )             {                ram_or_card_string = _( "M.Stick" );            }             else if( handheld_dest_array[ n ]->handheld_target_storage_mode == plkrHANDHELD_TARGET_STORAGE_MODE_COMPACT_FLASH )            {                ram_or_card_string = _( "CF Card" );            }             else             {                // All others are RAM.                ram_or_card_string = _( "RAM" );            }            // Convert our is_usb_pause to the string in the column            if( handheld_dest_array[ n ]->is_usb_pause == 1 )            {                is_usb_pause_string = _( "Yes" );            }             else             {                is_usb_pause_string = _( "No" );             }        // Only insert it if that user/RAM combo doesn't doesn't already exists in the        // Empty matches from last iteration        matching_row_numbers.Empty();        row_cells_contents.Empty();                // Make the row cell contents to look for:        // NOTE: these must be added in the order of the columns!        row_cells_contents.Add( handheld_dest_array[ n ]->user_name );        row_cells_contents.Add( ram_or_card_string );        // The card directory column goes in here        row_cells_contents.Add( is_usb_pause_string );                // Look to see if there is matching rows...        m_usersListCtrl->find_matching_rows( row_cells_contents, &matching_row_numbers );        // ...and if there isn't any matches...        if ( matching_row_numbers.IsEmpty() )         {            // ..then insert row:            m_usersListCtrl->InsertItem( row_to_insert, handheld_dest_array[ n ]->user_name, m_usersListCtrlImageId );            m_usersListCtrl->SetItem( row_to_insert, RAM_OR_CARD_COLUMN, ram_or_card_string );            // The 3rd column, DIRECTORY_ON_CARD_COLUMN, would go here.            m_usersListCtrl->SetItem( row_to_insert, IS_USB_PAUSE_COLUMN, is_usb_pause_string );        }    }    // Clear arrays to free memory    matching_row_numbers.Clear();    row_cells_contents.Clear();    wxLogDebug( wxT( "Finished wxHandheldInstallCtrl::InsertUserDestinations()" ) );}
开发者ID:TimofonicJunkRoom,项目名称:plucker-1,代码行数:74,


示例7: wxExecute

long wxExecute( const wxString& command, int flags, wxProcess *process ){    wxCHECK_MSG( !command.empty(), 0, wxT("can't exec empty command") );    wxLogDebug(wxString(wxT("Launching: ")) + command);#if wxUSE_THREADS    // fork() doesn't mix well with POSIX threads: on many systems the program    // deadlocks or crashes for some reason. Probably our code is buggy and    // doesn't do something which must be done to allow this to work, but I    // don't know what yet, so for now just warn the user (this is the least we    // can do) about it    wxASSERT_MSG( wxThread::IsMain(),                    _T("wxExecute() can be called only from the main thread") );#endif // wxUSE_THREADS    int argc = 0;    wxChar *argv[WXEXECUTE_NARGS];    wxString argument;    const wxChar *cptr = command.c_str();    wxChar quotechar = wxT('/0'); // is arg quoted?    bool escaped = false;    // split the command line in arguments    do    {        argument=wxT("");        quotechar = wxT('/0');        // eat leading whitespace:        while ( wxIsspace(*cptr) )            cptr++;        if ( *cptr == wxT('/'') || *cptr == wxT('"') )            quotechar = *cptr++;        do        {            if ( *cptr == wxT('//') && ! escaped )            {                escaped = true;                cptr++;                continue;            }            // all other characters:            argument += *cptr++;            escaped = false;            // have we reached the end of the argument?            if ( (*cptr == quotechar && ! escaped)                 || (quotechar == wxT('/0') && wxIsspace(*cptr))                 || *cptr == wxT('/0') )            {                wxASSERT_MSG( argc < WXEXECUTE_NARGS,                              wxT("too many arguments in wxExecute") );                argv[argc] = new wxChar[argument.length() + 1];                wxStrcpy(argv[argc], argument.c_str());                argc++;                // if not at end of buffer, swallow last character:                if(*cptr)                    cptr++;                break; // done with this one, start over            }        } while(*cptr);    } while(*cptr);    argv[argc] = NULL;    long lRc;#if defined(__DARWIN__)    // wxMacExecute only executes app bundles.    // It returns an error code if the target is not an app bundle, thus falling    // through to the regular wxExecute for non app bundles.    lRc = wxMacExecute(argv, flags, process);    if( lRc != ((flags & wxEXEC_SYNC) ? -1 : 0))        return lRc;#endif    // do execute the command    lRc = wxExecute(argv, flags, process);    // clean up    argc = 0;    while( argv[argc] )        delete [] argv[argc++];    return lRc;}
开发者ID:project-renard-survey,项目名称:chandler,代码行数:90,


示例8: wxLogSysError

// ----------------------------------------------------------------------------// wxHIDDevice::Create////  nClass is the HID Page such as//      kHIDPage_GenericDesktop//  nType is the HID Usage such as//      kHIDUsage_GD_Joystick,kHIDUsage_GD_Mouse,kHIDUsage_GD_Keyboard//  nDev is the device number to use//// ----------------------------------------------------------------------------bool wxHIDDevice::Create (int nClass, int nType, int nDev){    //Create the mach port    if(IOMasterPort(bootstrap_port, &m_pPort) != kIOReturnSuccess)    {        wxLogSysError(wxT("Could not create mach port"));        return false;    }    //Dictionary that will hold first    //the matching dictionary for determining which kind of devices we want,    //then later some registry properties from an iterator (see below)    //    //The call to IOServiceMatching filters down the    //the services we want to hid services (and also eats the    //dictionary up for us (consumes one reference))    CFMutableDictionaryRef pDictionary = IOServiceMatching(kIOHIDDeviceKey);    if(pDictionary == NULL)    {        wxLogSysError( wxT("IOServiceMatching(kIOHIDDeviceKey) failed") );        return false;    }    //Here we'll filter down the services to what we want    if (nType != -1)    {        CFNumberRef pType = CFNumberCreate(kCFAllocatorDefault,                                    kCFNumberIntType, &nType);        CFDictionarySetValue(pDictionary, CFSTR(kIOHIDPrimaryUsageKey), pType);        CFRelease(pType);    }    if (nClass != -1)    {        CFNumberRef pClass = CFNumberCreate(kCFAllocatorDefault,                                    kCFNumberIntType, &nClass);        CFDictionarySetValue(pDictionary, CFSTR(kIOHIDPrimaryUsagePageKey), pClass);        CFRelease(pClass);    }    //Now get the matching services    io_iterator_t pIterator;    if( IOServiceGetMatchingServices(m_pPort,                        pDictionary, &pIterator) != kIOReturnSuccess )    {        wxLogSysError(wxT("No Matching HID Services"));        return false;    }    //Were there any devices matched?    if(pIterator == 0)        return false; // No devices found    //Now we iterate through them    io_object_t pObject;    while ( (pObject = IOIteratorNext(pIterator)) != 0)    {        if(--nDev != 0)        {            IOObjectRelease(pObject);            continue;        }        if ( IORegistryEntryCreateCFProperties             (                pObject,                &pDictionary,                kCFAllocatorDefault,                kNilOptions             ) != KERN_SUCCESS )        {            wxLogDebug(wxT("IORegistryEntryCreateCFProperties failed"));        }        //        // Now we get the attributes of each "product" in the iterator        //        //Get [product] name        CFStringRef cfsProduct = (CFStringRef)            CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductKey));        m_szProductName =            wxCFStringRef( wxCFRetain(cfsProduct)                               ).AsString();        //Get the Product ID Key        CFNumberRef cfnProductId = (CFNumberRef)            CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductIDKey));        if (cfnProductId)        {            CFNumberGetValue(cfnProductId, kCFNumberIntType, &m_nProductId);//.........这里部分代码省略.........
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:101,


示例9: wxLogDebug

bool MyPicsApp::OnInit(){        wxImage::AddHandler( new wxJPEGHandler );    wxImage::AddHandler( new wxICOHandler );    // extract the applications resources to files, so we can use them.    // we could have just put all    // the resources in the .zip file, but then how would i have     // demostrated the other ExtractXXX functions? :)    // extract all resources of same type (in this case imagess     // pecified as type "image" in the .rc file),in one call,     // u can specify any type you want, but if you    // use a number, make shure its an unsigned int OVER 255.    // Also note that the exCount param passed here is optional.    int exCount=0;    bool resOk = m_Resources.ExtractResources(wxT("image"), &exCount);    if(resOk)    {        wxLogDebug(wxT("%d files extracted to %s using ExtractResources()"),        exCount, m_Resources.GetResourceDir());    }    // extract a single resource file "wxmswres.h" of type "txtfile"    // note that the resource name sould be the same in the .rc file    // as the desired extracted file name INCLUDING EXTENSION, same    // goes for ExtractResources()    resOk = resOk && m_Resources.ExtractResource(wxT("wxmswres.h"),        wxT("txtfile"));    if(resOk)    {        wxLogDebug(wxT("resource file wxmswres.h extracted to %s using ExtractResource()"),            m_Resources.GetResourceDir());    }    // extract resources contained in a zip file, in this case, the .mo     // catalog files, compressed to reduce .exe size    exCount=0;    resOk = resOk && m_Resources.ExtractZipResources(wxT("langcats"),        wxT("zipfile"), &exCount);    if(resOk)    {        wxLogDebug(wxT("%d files extracted to %s using ExtractZipResources()"),            exCount, m_Resources.GetResourceDir());    }    // if the ExtractXXX functions returned true, the resources were    // extracted successfully, but still you can check if some    // resource is actually there using this function    if(m_Resources.RcExtracted(wxT("wx_es.mo")))        wxLogDebug(wxT("guess what??, wx_ex.mo was extracted successfully"));    if(!resOk)    {        // oops! something went wrong, we better quit here        wxMessageBox(_("Failed to extract the app
C++ wxLogDebugFunc函数代码示例
C++ wxLogApiError函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。