这篇教程C++ GetEventClass函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetEventClass函数的典型用法代码示例。如果您正苦于以下问题:C++ GetEventClass函数的具体用法?C++ GetEventClass怎么用?C++ GetEventClass使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetEventClass函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: playerEvtHandlerstatic OSStatus playerEvtHandler(EventHandlerCallRef nextHdlr, EventRef thisEvt, void *pvUserData){ ControlRef cRef; ControlID cID; OSStatus iErr; UInt32 iSize, iPos; HIPoint pMouse; Rect rDims; int iPct; if ( (kEventClassWindow == GetEventClass(thisEvt)) && (kEventWindowClose == GetEventKind(thisEvt)) ) { HideWindow(g_refPlayerWin); g_bVisible = false; return noErr; } else if ( (kEventClassControl == GetEventClass(thisEvt)) && (kEventControlClick == GetEventKind(thisEvt)) ) { if (noErr != (iErr = GetEventParameter(thisEvt, kEventParamWindowMouseLocation, typeHIPoint, NULL, sizeof(Point), NULL, &pMouse))) { fprintf(stderr, "playerEvtHandler() - GetEventParameter(HitTest) failed, returning %lu!/n", (unsigned long) iErr); } cID.signature = FOUR_CHAR_CODE('fpos'); cID.id = 7; if (noErr == (iErr = GetControlByID(g_refPlayerWin, &cID, &cRef))) { GetControlBounds(cRef, &rDims); iSize = rDims.right - rDims.left; iPos = (UInt32) pMouse.x - rDims.left; iPct = (int) (100.0 * ((double) iPos) / ((double) iSize)); } else { fprintf(stderr, "playerEvtHandler() - GetControlByID() failed, returning %lu!/n", (unsigned long) iErr); } attemptSeekTo(iPct); return CallNextEventHandler(nextHdlr, thisEvt); } else { return CallNextEventHandler(nextHdlr, thisEvt); }}
开发者ID:ullerrm,项目名称:frogg,代码行数:49,
示例2: AppEventHandlerProc//-----------------------------------------------------------------------------------------------------------------------static pascal OSStatus AppEventHandlerProc( EventHandlerCallRef inCallRef, EventRef inEvent, void* inUserData ){ #pragma unused(inCallRef, inUserData) OSStatus err = eventNotHandledErr; UInt32 eventClass = GetEventClass(inEvent); UInt32 eventKind = GetEventKind(inEvent); if ( (eventClass == kEventClassCommand) && (eventKind == kEventCommandProcess) ) { HICommand command; GetEventParameter( inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &command ); switch ( command.commandID) { case kHICommandNew: NewCSkWindow(gOurNibRef, CSkToolPalette(gOurNibRef)); err = noErr; break; case kHICommandOpen: err = OpenAFile(); break; } } return err;} // AppEventHandlerProc
开发者ID:fruitsamples,项目名称:CarbonSketch,代码行数:28,
示例3: simpleDialogHandlerOSStatus simpleDialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata){ OSStatus result = eventNotHandledErr; OSStatus err; UInt32 evtClass = GetEventClass(event); UInt32 evtKind = GetEventKind(event); WindowRef window = (WindowRef)userdata; if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) { HICommand cmd; err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); if(err == noErr) { switch(cmd.commandID) { case kHICommandOK: QuitAppModalLoopForWindow(window); result = noErr; break; case kHICommandCancel: QuitAppModalLoopForWindow(window); result = userCanceledErr; break; } } } return(result);}
开发者ID:Boy,项目名称:netbook,代码行数:32,
示例4: GetEventClassbool AUCarbonViewBase::HandleEvent(EventRef event){ UInt32 eclass = GetEventClass(event); UInt32 ekind = GetEventKind(event); ControlRef control; switch (eclass) { case kEventClassControl: switch (ekind) { case kEventControlClick: GetEventParameter(event, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &control); if (control == mCarbonPane) { ClearKeyboardFocus(mCarbonWindow); return true; } } break; case kEventClassWindow: switch (ekind) { case kEventWindowClosed: printf("caught window-closed/n"); break; } break; } return false;}
开发者ID:fruitsamples,项目名称:AudioUnits,代码行数:28,
示例5: NPClientSheetEventHandlerstatic pascal OSStatus NPClientSheetEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData){ #pragma unused (inHandlerRef, inUserData) if (!npclient.dialogsheet) return (eventNotHandledErr); OSStatus err, result = eventNotHandledErr; switch (GetEventClass(inEvent)) { case kEventClassCommand: switch (GetEventKind(inEvent)) { case kEventCommandProcess: HICommand tHICommand; err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, nil, sizeof(HICommand), nil, &tHICommand); if (err == noErr) { switch (tHICommand.commandID) { case 'ok ': npclient.dialogprocess = kNPCDialogDone; result = noErr; } } } } return (result);}
开发者ID:alesegdia,项目名称:snes-sdk,代码行数:32,
示例6: switchOSStatusTabbedWindow::WindowHandleEvent( EventHandlerCallRef handler, EventRef event ){ OSStatus status = eventNotHandledErr; // process the event based on what type it is switch ( GetEventClass( event ) ) { case kEventClassControl: status = this->WindowHandleControlEvent( handler, event ); break; case kEventClassCommand: status = this->WindowHandleCommandEvent( handler, event ); break; case kEventClassMenu: status = this->WindowHandleMenuEvent( handler, event ); break; case kEventClassWindow: status = this->WindowHandleWindowEvent( handler, event ); break; default: status = eventNotHandledErr; break; } return status;}
开发者ID:fruitsamples,项目名称:InkSample,代码行数:26,
示例7: NPServerDialogEventHandlerstatic pascal OSStatus NPServerDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData){ OSStatus err, result = eventNotHandledErr; WindowRef tWindowRef = (WindowRef) inUserData; switch (GetEventClass(inEvent)) { case kEventClassCommand: switch (GetEventKind(inEvent)) { HICommand tHICommand; case kEventCommandUpdateStatus: err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); if (err == noErr && tHICommand.commandID == 'clos') { UpdateMenuCommandStatus(false); result = noErr; } break; case kEventCommandProcess: err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); if (err == noErr) { switch (tHICommand.commandID) { case 'OKAY': HIViewRef ctl, root; HIViewID cid; root = HIViewGetRoot(tWindowRef); cid.id = 0; cid.signature = 'OKAY'; HIViewFindByID(root, cid, &ctl); DeactivateControl(ctl); cid.signature = 'CNSL'; HIViewFindByID(root, cid, &ctl); DeactivateControl(ctl); npserver.dialogprocess = kNPSDialogProcess; result = noErr; break; case 'CNSL': npserver.dialogprocess = kNPSDialogCancel; result = noErr; break; } } break; } break; } return (result);}
开发者ID:OV2,项目名称:snes9x-libsnes,代码行数:60,
示例8: ViewClassHandlerstatic pascal OSStatus ViewClassHandler(EventHandlerCallRef inCaller, EventRef inEvent, void* inRefcon){ OSStatus result = eventNotHandledErr; int* pain = (int*)inRefcon; if (GetEventClass(inEvent) == kEventClassHIObject) { switch (GetEventKind(inEvent)) { case kEventHIObjectConstruct: { int* pa = new int; GetEventParameter(inEvent,kEventParamHIObjectInstance, typeHIObjectRef, NULL, sizeof(int), NULL, &pa); result = SetEventParameter(inEvent, kEventParamHIObjectInstance, typeVoidPtr, sizeof(int), &pa); break; } case kEventHIObjectDestruct: { if (pain != NULL) { delete pain; } result = noErr; break; } } } return result;}
开发者ID:hirano,项目名称:koblo_software,代码行数:26,
示例9: wd_event// ---------------------------------------------------------------------------// // ------------bool bvDefScaleRef::wd_event(EventRef evt, WindowRef wd){bool b=true;UInt32 clss=GetEventClass(evt); HICommand cmd;ControlRef c;bGenericUnit* u; if(clss==kEventClassCommand){ GetEventParameter(evt,kEventParamDirectObject,typeHICommand,NULL,sizeof(HICommand),NULL,&cmd); switch(cmd.commandID){ case kHICommandOK: write(); break; case kHICommandCancel: break; case kvDefScaleRefPopupCmd: c=get_control(kvDefScaleRefViewSignature,kvDefScaleRefPopupID); _idx=GetControl32BitValue(c); if(_idx>2){ u=_gapp->scaleMgr()->get(_idx-2); _scale=u->coef(); } else{ _scale=0; } break; default: b=false; break; } } return(b);}
开发者ID:CarteBlancheConseil,项目名称:MacMap,代码行数:36,
示例10: AutofireWindowEventHandlerpascal OSStatus AutofireWindowEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData){ #pragma unused (inHandlerRef) OSStatus err, result = eventNotHandledErr; WindowRef tWindowRef = (WindowRef) inUserData; switch (GetEventClass(inEvent)) { case kEventClassWindow: switch (GetEventKind(inEvent)) { case kEventWindowClose: QuitAppModalLoopForWindow(tWindowRef); result = noErr; } break; case kEventClassCommand: switch (GetEventKind(inEvent)) { case kEventCommandProcess: HICommand tHICommand; HIViewRef root; int player = -1; root = HIViewGetRoot(tWindowRef); err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, nil, sizeof(HICommand), nil, &tHICommand); if (err == noErr) { switch (tHICommand.commandID) { case 'DEF1': player = 0; break; case 'DEF2': player = 1; break; } if (player != -1) { autofireRec[player].buttonMask = 0x0000; autofireRec[player].toggleMask = 0xFFF0; autofireRec[player].tcMask = 0x0000; autofireRec[player].invertMask = 0x0000; autofireRec[player].frequency = 10; AutofireReadAllSettings(player + 1, root); result = noErr; } } } } return result;}
开发者ID:alesegdia,项目名称:snes-sdk,代码行数:60,
示例11: windowHandler//-------------------------------------------------------------------------------------------------------pascal OSStatus windowHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData){ OSStatus result = eventNotHandledErr; WindowRef window = (WindowRef) inUserData; UInt32 eventClass = GetEventClass (inEvent); UInt32 eventKind = GetEventKind (inEvent); switch (eventClass) { case kEventClassWindow: { switch (eventKind) { case kEventWindowClose: { QuitAppModalLoopForWindow (window); break; } } break; } } return result;}
开发者ID:ekenberg,项目名称:vstminihost,代码行数:26,
示例12: eventHandlerstatic pascal OSStatus eventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData ){ ::UInt32 eventClass = GetEventClass(event); CSMNativeWindow *pWin = reinterpret_cast<CSMNativeWindow *>(userData); OSG_ASSERT(pWin != NULL); switch (eventClass) { // Mouse events case kEventClassMouse: return pWin->handleMouseEvent(nextHandler, event); // Key press events case kEventClassTextInput: return pWin->handleKeyEvent(nextHandler, event); // Window events case kEventClassWindow: return pWin->handleWindowEvent(nextHandler, event); default: return eventNotHandledErr; }}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:28,
示例13: dialogEventHandler// --------------------------------------------------------------------------------------static pascal OSStatus dialogEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *prefsDialog){#pragma unused (nextHandler) OSStatus result = eventNotHandledErr; UInt32 eventClass, eventKind; ControlRef controlHit; ControlID controlID; eventClass = GetEventClass(event); eventKind = GetEventKind(event); switch (eventClass) { case kEventClassControl: switch (eventKind) { case kEventControlHit: GetEventParameter(event, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &controlHit); GetControlID(controlHit, &controlID); handleDialogItemHit((DialogRef)prefsDialog, (DialogItemIndex)controlID.id); result = noErr; break; } break; } return result;}
开发者ID:fruitsamples,项目名称:CarbonPorting,代码行数:33,
示例14: AppEventEventHandlerProcstatic pascal OSStatus AppEventEventHandlerProc( EventHandlerCallRef inCallRef, EventRef inEvent, void* inUserData ){ #pragma unused ( inCallRef, inUserData ) HICommand command; OSStatus err = eventNotHandledErr; UInt32 eventClass = GetEventClass( inEvent ); UInt32 eventKind = GetEventKind(inEvent); switch ( eventClass ) { case kEventClassCommand: GetEventParameter( inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &command ); if ( eventKind == kEventCommandProcess ) { if ( command.commandID == kHICommandNew ) { DisplaySimpleWindow(); } else if ( command.commandID == kHICommandOpen ) // Open... menu choice { OpenFiles(); } } break; } return( err );}
开发者ID:fruitsamples,项目名称:WindowFun,代码行数:28,
示例15: GetEventClassbool XControl::HandleEvent(EventRef event){ if (!mListener) return false; UInt32 eclass = GetEventClass(event); UInt32 ekind = GetEventKind(event); ControlRef control; switch (eclass) { case kEventClassControl: switch (ekind) { case kEventControlValueFieldChanged: { GetEventParameter(event, kEventParamDirectObject, kEventParamControlRef, NULL, sizeof(ControlRef), NULL, &control); mListener->ControlValueChanged (this); return true; } } } return false;}
开发者ID:fruitsamples,项目名称:XFramework,代码行数:28,
示例16: IndicatorEventHandlerstatic pascal OSStatus IndicatorEventHandler(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *userData){ #pragma unused (inHandlerCallRef) OSStatus err, result = eventNotHandledErr; HIViewRef view = (HIViewRef) userData; switch (GetEventClass(inEvent)) { case kEventClassControl: switch (GetEventKind(inEvent)) { case kEventControlDraw: CGContextRef ctx; err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, nil, sizeof(CGContextRef), nil, &ctx); if (err == noErr) { HIRect bounds; HIViewGetBounds(view, &bounds); CGContextTranslateCTM(ctx, 0, bounds.size.height); CGContextScaleCTM(ctx, 1.0, -1.0); MusicBoxDrawIndicator(view, ctx); result = noErr; } } } return result;}
开发者ID:BruceJawn,项目名称:flashsnes,代码行数:32,
示例17: s86procstatic pascal OSStatus s86proc(EventHandlerCallRef myHandler, EventRef event, void* userData) { OSStatus err = eventNotHandledErr; HIPoint pos; Point p; Rect ctrlbounds, winbounds; PicHandle pict; if (GetEventClass(event)==kEventClassControl && GetEventKind(event)==kEventControlClick ) { err = noErr; GetEventParameter(event, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(HIPoint), NULL, &pos); GetControlBounds((ControlRef)userData, &ctrlbounds); GetWindowBounds(soundWin, kWindowContentRgn, &winbounds); p.h = (short)pos.x; p.h -= (ctrlbounds.left + winbounds.left); p.h /= 8; if ((p.h < 2) || (p.h >= 10)) { return(err); } p.h -= 2; snd86 ^= (1 << p.h); set86s(); setbmp(dipswbmp_getsnd86(snd86), &pict); SetControlData((ControlRef)userData, kControlNoPart, kControlPictureHandleTag, sizeof(PicHandle), &pict); Draw1Control((ControlRef)userData); } (void)myHandler; (void)userData; return err;}
开发者ID:amuramatsu,项目名称:np2-mod,代码行数:30,
示例18: appEventHandler// --------------------------------------------------------------------------------------static pascal OSStatus appEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *junk){#pragma unused (nextHandler, junk) OSStatus result = eventNotHandledErr; UInt32 eventClass, eventKind; HICommand command; eventClass = GetEventClass(event); eventKind = GetEventKind(event); switch (eventClass) { case kEventClassCommand: switch (eventKind) { case kEventCommandProcess: GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &command); result = handleCommand(command); break; } break; } return result;}
开发者ID:fruitsamples,项目名称:CarbonPorting,代码行数:30,
示例19: edit_event// ---------------------------------------------------------------------------// // -----------bool bToolShape::edit_event(EventRef evt, WindowRef wd){bool b=true;HICommand cmd;ControlRef c;ControlID cid={kShapeEditSign,kShapeCenterID}; if(GetEventClass(evt)==kEventClassCommand){ GetEventParameter(evt,kEventParamDirectObject,typeHICommand,NULL,sizeof(HICommand),NULL,&cmd); switch(cmd.commandID){ case kHICommandOK: GetControlByID(wd,&cid,&c); _ctr=GetControl32BitValue(c); cid.id=kShapeOpenFicheID; GetControlByID(wd,&cid,&c); _opn=GetControl32BitValue(c); cid.id=kShapeCMMeasID; GetControlByID(wd,&cid,&c); _cm=GetControl32BitValue(c); break; case kHICommandCancel: break; default: b=false; break; } } return(b);}
开发者ID:CarteBlancheConseil,项目名称:MacMap,代码行数:31,
示例20: ApplicationEventHandlerstatic pascal OSStatus ApplicationEventHandler(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) // Dispatches HICommands to their implementations.{ OSStatus err; HICommand command; #pragma unused(inHandlerCallRef) #pragma unused(inUserData) assert( GetEventClass(inEvent) == kEventClassCommand ); assert( GetEventKind(inEvent) == kEventCommandProcess); err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(command), NULL, &command); if (err == noErr) { switch (command.commandID) { case kHICommandAbout: DoAbout(); break; case 'DShw': DoRefresh(); break; case 'DAdd': DoAddTest(); break; case 'DRem': DoRemoveTest(); break; default: err = eventNotHandledErr; break; } } return err;}
开发者ID:xin3liang,项目名称:platform_external_login-items-ae,代码行数:35,
示例21: handle_spy_eventstatic OSStatus handle_spy_event(EventHandlerCallRef handler_call_chain, EventRef e, void* data) { QuartzWindow *w = (QuartzWindow*)data; if ( GetEventClass(e) == kEventClassWindow ) switch (GetEventKind(e)) { case kEventWindowBoundsChanged: w->set_bounds_changed(); break; case kEventWindowClose: w->set_was_closed(); break; } return noErr;}
开发者ID:ardeujho,项目名称:self,代码行数:9,
示例22: HIOpenGLViewEventProcpascal OSStatus HIOpenGLViewEventProc (EventHandlerCallRef inCall, EventRef inEvent, void* inUserData){ HIOpenGLViewData* data = (HIOpenGLViewData*)inUserData; switch (GetEventClass(inEvent)) { case kEventClassHIObject: return HIOpenGLViewEventHIObject(inCall, inEvent, data); break; case kEventClassControl: return HIOpenGLViewEventControl(inCall, inEvent, data); break; default: return eventNotHandledErr; break; }}
开发者ID:toddlipcon,项目名称:PScope,代码行数:10,
示例23: dialogHandlerOSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata){ OSStatus result = eventNotHandledErr; OSStatus err; UInt32 evtClass = GetEventClass(event); UInt32 evtKind = GetEventKind(event); if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) { HICommand cmd; err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); if(err == noErr) { switch(cmd.commandID) { case kHICommandCancel: gCancelled = true;// QuitAppModalLoopForWindow(gWindow); result = noErr; break; } } } else if((evtClass == kEventClassCustom) && (evtKind == kEventCustomProgress)) { // Request to update the progress dialog long cur = 0; long max = 0; CFStringRef text = NULL; (void) GetEventParameter(event, kEventParamCustomCurValue, typeLongInteger, NULL, sizeof(cur), NULL, &cur); (void) GetEventParameter(event, kEventParamCustomMaxValue, typeLongInteger, NULL, sizeof(max), NULL, &max); (void) GetEventParameter(event, kEventParamCustomText, typeCFStringRef, NULL, sizeof(text), NULL, &text); err = setProgress(cur, max); if(err == noErr) { if(text != NULL) { setProgressText(text); } } result = noErr; } else if((evtClass == kEventClassCustom) && (evtKind == kEventCustomDone)) { // We're done. Exit the modal loop. QuitAppModalLoopForWindow(gWindow); result = noErr; } return(result);}
开发者ID:Xara,项目名称:Astra-Viewer-2,代码行数:54,
示例24: nativeEventFilterbool QxtGlobalShortcutPrivate::nativeEventFilter(const QByteArray &, void *message, long *){ EventRef event = (EventRef) message; if (GetEventClass(event) == kEventClassKeyboard && GetEventKind(event) == kEventHotKeyPressed) { EventHotKeyID keyID; GetEventParameter(event, kEventParamDirectObject, typeEventHotKeyID, nullptr, sizeof(keyID), nullptr, &keyID); Identifier id = keyIDs.key(keyID.id); activateShortcut(id.second, id.first); } return false;}
开发者ID:Greedysky,项目名称:TTKDownloader,代码行数:12,
示例25: print_eventvoid print_event(EventRef evt) { uint32 cl = EndianU32_NtoB(GetEventClass(evt)); uint32 ki = /*EndianU32_NtoB*/(GetEventKind(evt)); lprintf("Event class: %4.4s kind: %d ", (char*)&cl, ki); lprintf("/tbtn: 0x%x ", get_scalar_event_parm(evt, kEventParamMouseButton, typeMouseButton)); // lprintf("/ttarg: 0x%x/n", get_scalar_event_parm(evt, kEventParamDirectObject, typeWildCard)); lprintf("/ttarg: 0x%x ", get_scalar_event_parm(evt, kEventParamPostTarget, typeEventTargetRef)); lprintf("/twind: 0x%x ", get_scalar_event_parm(evt, kEventParamWindowRef, typeWindowRef)); lprintf("/tgrafport: 0x%x/n", get_scalar_event_parm(evt, kEventParamGrafPort, typeGrafPtr));}
开发者ID:ardeujho,项目名称:self,代码行数:12,
示例26: infoEvtHandlerstatic OSStatus infoEvtHandler(EventHandlerCallRef nextHdlr, EventRef thisEvt, void *pvUserData){ if ( (kEventClassWindow != GetEventClass(thisEvt)) || (kEventWindowClose != GetEventKind(thisEvt)) ) { return CallNextEventHandler(nextHdlr, thisEvt); } HideWindow(g_refInfoWin); g_bVisible = false; return noErr;}
开发者ID:ullerrm,项目名称:frogg,代码行数:12,
示例27: wxMacAppEventHandlerpascal OSStatus wxMacAppEventHandler( EventHandlerCallRef handler , EventRef event , void *data ){ EventRef formerEvent = (EventRef) wxTheApp->MacGetCurrentEvent() ; EventHandlerCallRef formerEventHandlerCallRef = (EventHandlerCallRef) wxTheApp->MacGetCurrentEventHandlerCallRef() ; wxTheApp->MacSetCurrentEvent( event , handler ) ; OSStatus result = eventNotHandledErr ; switch ( GetEventClass( event ) ) { case kEventClassCommand : result = wxMacAppCommandEventHandler( handler , event , data ) ; break ; case kEventClassApplication : result = wxMacAppApplicationEventHandler( handler , event , data ) ; break ; case kEventClassMenu : result = wxMacAppMenuEventHandler( handler , event , data ) ; break ; case kEventClassMouse : { wxMacCarbonEvent cEvent( event ) ; WindowRef window ; Point screenMouseLocation = cEvent.GetParameter<Point>(kEventParamMouseLocation) ; ::FindWindow(screenMouseLocation, &window); // only send this event in case it had not already been sent to a tlw, as we get // double events otherwise (in case event.skip) was called if ( window == NULL ) result = wxMacTopLevelMouseEventHandler( handler , event , NULL ) ; } break ; case kEventClassAppleEvent : { EventRecord rec ; wxMacConvertEventToRecord( event , &rec ) ; result = AEProcessAppleEvent( &rec ) ; } break ; default : break ; } wxTheApp->MacSetCurrentEvent( formerEvent, formerEventHandlerCallRef ) ; return result ;}
开发者ID:hgwells,项目名称:tive,代码行数:52,
示例28: qxt_mac_handle_hot_keyOSStatus qxt_mac_handle_hot_key(EventHandlerCallRef nextHandler, EventRef event, void* data){ Q_UNUSED(nextHandler); Q_UNUSED(data); if (GetEventClass(event) == kEventClassKeyboard && GetEventKind(event) == kEventHotKeyPressed) { EventHotKeyID keyID; GetEventParameter(event, kEventParamDirectObject, typeEventHotKeyID, NULL, sizeof(keyID), NULL, &keyID); Identifier id = keyIDs.key(keyID.id); QxtGlobalShortcutPrivate::activateShortcut(id.second, id.first); } return noErr;}
开发者ID:Ack0,项目名称:CopyQ,代码行数:13,
注:本文中的GetEventClass函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetEventHandler函数代码示例 C++ GetEvent函数代码示例 |