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

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

51自学网 2021-06-01 21:07:27
  C++
这篇教程C++ GetEventParameter函数代码示例写得很实用,希望能帮到您。

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

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

示例1: CustomEventHandler

pascal OSStatus CustomEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData){	DWORD id=0;	GetEventParameter(inEvent,'evid',0,NULL,sizeof(id),NULL,&id);	switch (id) {		case 'open':			SetStaticText(31,"connecting...");			SetStaticText(30,"");			SetStaticText(32,"");			break;		case 'end ':			SetStaticText(31,"not playing");			SetStaticText(30,"");			SetStaticText(32,"");			break;		case 'stat':			{				char *status;				GetEventParameter(inEvent,'data',0,NULL,sizeof(status),NULL,&status);				SetStaticText(32,status); // display connection status				free(status);			}			break;		case 'meta':			DoMeta();			break;	}	return noErr;}
开发者ID:bagnz0r,项目名称:ichigo-audio,代码行数:29,


示例2: DoMouseUp

//------------------------------------------------------------------------pascal OSStatus DoMouseUp (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData){	Point wheresMyMouse;	UInt32 modifier;		GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &wheresMyMouse);	GlobalToLocal (&wheresMyMouse);	GetEventParameter (theEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifier);    platform_support * app = reinterpret_cast<platform_support*>(userData);    app->m_specific->m_cur_x = wheresMyMouse.h;    if(app->flip_y())    {        app->m_specific->m_cur_y = app->rbuf_window().height() - wheresMyMouse.v;    }    else    {        app->m_specific->m_cur_y = wheresMyMouse.v;    }    app->m_specific->m_input_flags = mouse_left | get_key_flags(modifier);    if(app->m_ctrls.on_mouse_button_up(app->m_specific->m_cur_x,                                        app->m_specific->m_cur_y))    {        app->on_ctrl_change();        app->force_redraw();    }    app->on_mouse_button_up(app->m_specific->m_cur_x,                             app->m_specific->m_cur_y,                             app->m_specific->m_input_flags);	return CallNextEventHandler (nextHandler, theEvent);}
开发者ID:asmboom,项目名称:PixelFarm,代码行数:35,


示例3: NPServerDialogEventHandler

static 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,


示例4: GetEventParameter

pascal OSStatus pxWindowNative::doMouseUp(EventHandlerCallRef nextHandler, EventRef theEvent, void* userData){	pxWindowNative* w = (pxWindowNative*)userData;		Point loc;	UInt16 button;	UInt32 modifier;		GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &loc);	SetPort(GetWindowPort(w->mWindowRef));	GlobalToLocal(&loc);	GetEventParameter(theEvent, kEventParamMouseButton, typeMouseButton, NULL, sizeof(button), NULL, &button);	GetEventParameter(theEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifier);			unsigned long flags = 0;	if (button == kEventMouseButtonPrimary) flags |= PX_LEFTBUTTON;	else if (button == kEventMouseButtonSecondary) flags |= PX_RIGHTBUTTON;	else if (button == kEventMouseButtonTertiary) flags |= PX_MIDDLEBUTTON;		if (modifier & shiftKey) flags |= PX_MOD_SHIFT;	if (modifier & optionKey) flags |= PX_MOD_ALT;	if (modifier & controlKey) flags |= PX_MOD_CONTROL;	w->onMouseUp(loc.h, loc.v, flags);	return CallNextEventHandler (nextHandler, theEvent);}	
开发者ID:dtbinh,项目名称:pxcore,代码行数:28,


示例5: handle_unicode

static OSStatushandle_unicode(EventRef event){	UInt32 actual_size, i;	UniChar *text;	UniCharCount num_chars;	OSStatus result = noErr;	// hack to keep sequences like Cmd+f from writing to buffer	if(! cmdPressed) {		result = GetEventParameter (event, kEventParamTextInputSendText,								typeUnicodeText, NULL, 0, &actual_size, NULL);		if(result == noErr) {			text = (UniChar*) NewPtr(actual_size);			result = GetEventParameter (event, kEventParamTextInputSendText,		   							typeUnicodeText, NULL, actual_size, NULL, text);			if(result == noErr) {				num_chars = actual_size / sizeof(UniChar);				for(i=0; i < num_chars; i++) {					int key = convert_unichar(text[i]);					gkbdputc(gkbdq, key);				}			}		}	}	return result;}
开发者ID:Vykook,项目名称:acme-sac,代码行数:28,


示例6: GetEventParameter

void  wxControl::OnKeyDown( wxKeyEvent &event ) {    if ( (ControlHandle) m_macControl == NULL )        return ;    #if TARGET_CARBON    char charCode ;    UInt32 keyCode ;        UInt32 modifiers ;    GetEventParameter( (EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyMacCharCodes, typeChar, NULL,sizeof(char), NULL,&charCode );    GetEventParameter( (EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyCode, typeUInt32, NULL,  sizeof(UInt32), NULL, &keyCode );       GetEventParameter((EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers);    ::HandleControlKey( (ControlHandle) m_macControl , keyCode , charCode , modifiers ) ;    #else    EventRecord *ev = (EventRecord*) wxTheApp->MacGetCurrentEvent() ;    short keycode ;    short keychar ;    keychar = short(ev->message & charCodeMask);    keycode = short(ev->message & keyCodeMask) >> 8 ;    ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ;#endif}
开发者ID:Duion,项目名称:Torsion,代码行数:27,


示例7: handleWindowEvent

static OSStatus handleWindowEvent(EventHandlerCallRef nextHandler, EventRef event, void *userData){    OSStatus err;    // Get the window    WindowRef window;    err = GetEventParameter(event, kEventParamDirectObject, typeWindowRef, 0, sizeof(window), 0, &window);    if (err != noErr)        return err;    // Handle the different kinds of events    ::UInt32 eventKind = GetEventKind(event);    switch (eventKind)    {    // Quit the application when the user closes the window    case kEventWindowClose:        QuitApplicationEventLoop();        return noErr;    // Draw the contents of the window    case kEventWindowDrawContent:        redraw();        return noErr;    case kEventWindowBoundsChanged:        {            // Update the GL context            aglUpdateContext(win->getContext());            // Find out if we have a move or a resize situation            ::UInt32 attributes;            GetEventParameter(event, kEventParamAttributes, typeUInt32, 0, sizeof(attributes), 0, &attributes);            if ((attributes & kWindowBoundsChangeSizeChanged) != 0)            {                // Get the new bounds of the window                Rect bounds;                GetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, 0, sizeof(Rect), 0, &bounds);                // Resize the OpenSG Window                GLsizei width = bounds.right - bounds.left;                GLsizei height = bounds.bottom - bounds.top;                win->resize(width, height);                // Redraw the whole window                Rect portRect;                GetWindowPortBounds(window, &portRect);                InvalWindowRect(window, &portRect);            }            return noErr;        }    default:        return eventNotHandledErr;    }}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:57,


示例8: TkMacOSXProcessCommandEvent

intTkMacOSXProcessCommandEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr){    HICommand	    command;    int 	    menuContext;    OSStatus	    status;    switch (eventPtr->eKind) {	case kEventCommandProcess:	case kEventCommandUpdateStatus:	    break;	default:	    return 0;	    break;    }    status = GetEventParameter(eventPtr->eventRef, 	    kEventParamDirectObject,	    typeHICommand, NULL, 	    sizeof(command), NULL,	    &command);    if (status == noErr && (command.attributes & kHICommandFromMenu)) {	if (eventPtr->eKind == kEventCommandProcess) {	    status = GetEventParameter(eventPtr->eventRef, 		    kEventParamMenuContext,		    typeUInt32, NULL, 		    sizeof(menuContext), NULL,		    &menuContext);	    if (status == noErr && (menuContext & kMenuContextMenuBar) &&		    (menuContext & kMenuContextMenuBarTracking)) {		TkMacOSXHandleMenuSelect(GetMenuID(command.menu.menuRef),			command.menu.menuItemIndex,			GetCurrentEventKeyModifiers() & optionKey);		return 1;	    }	} else {	    Tcl_CmdInfo dummy;	    if (command.commandID == kHICommandPreferences && eventPtr->interp) {		if (Tcl_GetCommandInfo(eventPtr->interp, 			"::tk::mac::ShowPreferences", &dummy)) {		    if (!IsMenuItemEnabled(command.menu.menuRef, 			    command.menu.menuItemIndex)) {			EnableMenuItem(command.menu.menuRef,				command.menu.menuItemIndex);		    }		} else {		    if (IsMenuItemEnabled(command.menu.menuRef, 			    command.menu.menuItemIndex)) {			DisableMenuItem(command.menu.menuRef,				command.menu.menuItemIndex);		    }		}		return 1;	    }	}    }    return 0;}
开发者ID:SASfit,项目名称:SASfit,代码行数:57,


示例9: dialogHandler

OSStatus 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,


示例10: handleKeyEvent

static OSStatus handleKeyEvent(EventHandlerCallRef nextHandler, EventRef event, void *userData){    OSStatus err;    // Try to determine the size of the text input    ::UInt32 actualSize; 					    err = GetEventParameter(event, kEventParamTextInputSendText, typeUnicodeText, 0, 0, &actualSize, 0);    if (err != noErr)        return err;    // The input can actually consist of more than one character.    // We are only interested in single character input    if (actualSize == sizeof(UniChar))    {        // Get the character unicode        UniChar c;        err = GetEventParameter(event, kEventParamTextInputSendText, typeUnicodeText, 0, sizeof(UniChar), 0, &c);        if (err != noErr)            return err;        // Handle different keyboard commands        CGLSetCurrentContext(win->getContext());        switch (c)        {        case kEscapeCharCode:            QuitApplicationEventLoop();            break;        case 'a':            glDisable( GL_LIGHTING );            redraw();            break;        case 's':            glEnable( GL_LIGHTING );            redraw();            break;        case 'z':            glPolygonMode( GL_FRONT_AND_BACK, GL_POINT);            redraw();            break;        case 'x':            glPolygonMode( GL_FRONT_AND_BACK, GL_LINE);            redraw();            break;        case 'c':            glPolygonMode( GL_FRONT_AND_BACK, GL_FILL);            redraw();            break;        }    }    return noErr;}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:52,


示例11: TextInputEventHandler

static pascal OSStatus TextInputEventHandler( EventHandlerCallRef handler , EventRef event , void *data ){    OSStatus result = eventNotHandledErr ;    wxWindow* focus = wxWindow::FindFocus() ;    char charCode ;    UInt32 keyCode ;    UInt32 modifiers ;    Point point ;    EventRef rawEvent ;    GetEventParameter( event , kEventParamTextInputSendKeyboardEvent ,typeEventRef,NULL,sizeof(rawEvent),NULL,&rawEvent ) ;    GetEventParameter( rawEvent, kEventParamKeyMacCharCodes, typeChar, NULL,sizeof(char), NULL,&charCode );    GetEventParameter( rawEvent, kEventParamKeyCode, typeUInt32, NULL,  sizeof(UInt32), NULL, &keyCode );       GetEventParameter( rawEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers);    GetEventParameter( rawEvent, kEventParamMouseLocation, typeQDPoint, NULL,        sizeof( Point ), NULL, &point );    switch ( GetEventKind( event ) )    {        case kEventTextInputUnicodeForKeyEvent :            // this is only called when no default handler has jumped in, eg a wxControl on a floater window does not            // get its own kEventTextInputUnicodeForKeyEvent, so we route back the            wxControl* control = wxDynamicCast( focus , wxControl ) ;            if ( control )            {                ControlHandle macControl = (ControlHandle) control->GetMacControl() ;                if ( macControl )                {                    ::HandleControlKey( macControl , keyCode , charCode , modifiers ) ;                    result = noErr ;                }            }            /*            // this may lead to double events sent to a window in case all handlers have skipped the key down event            UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ;            UInt32 message = (keyCode << 8) + charCode;            if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent(                focus , message , modifiers , when , point.h , point.v ) )            {                result = noErr ;            }            */            break ;    }    return result ;}
开发者ID:Duion,项目名称:Torsion,代码行数:51,


示例12: AppEventHandler

static OSStatus AppEventHandler(EventHandlerCallRef inCaller, EventRef inEvent, void* inRefcon){    OSStatus    result = eventNotHandledErr;        switch ( GetEventClass( inEvent ) )    {        case kEventClassCommand:        {            HICommandExtended cmd;            verify_noerr( GetEventParameter( inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof( cmd ), NULL, &cmd ) );                        switch ( GetEventKind( inEvent ) )            {                case kEventCommandProcess:					CContextOSX* pContext = (CContextOSX*)inRefcon;					pContext->OnMenuEventHandler(cmd.source.menu.menuItemIndex, (tint32)cmd.source.menu.menuRef);							            }            break;        }		case kCoreEventClass:		{			HICommandExtended cmd;            verify_noerr( GetEventParameter( inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof( cmd ), NULL, &cmd ) );                        switch ( GetEventKind( inEvent ) )            {                case kAEOpenDocuments:{										tuint32 ui = 0;					ui++;					break;					}				case kAEOpenApplication:{										tuint32 ui = 0;					ui++;					break;					}			}		}				          default:  break;    }        return result;}
开发者ID:grimtraveller,项目名称:koblo_software,代码行数:49,


示例13: GetEventParameter

OSStatus CSMNativeWindow::handleKeyEvent(EventHandlerCallRef  nextHandler,                                          EventRef             event      ){    OSStatus err;    // Try to determine the size of the text input    ::UInt32 actualSize; 					        err = GetEventParameter(event,                             kEventParamTextInputSendText,                             typeUnicodeText, 0, 0, &actualSize, 0);    if (err != noErr)        return err;    // The input can actually consist of more than one character.    // We are only interested in single character input    if (actualSize == sizeof(UniChar))    {        // Get the character unicode        UniChar c;        err = GetEventParameter(event,                                 kEventParamTextInputSendText,                                 typeUnicodeText, 0,                                 sizeof(UniChar), 0, &c);        if (err != noErr)            return err;        switch (c)        {            case kEscapeCharCode:                //QuitApplicationEventLoop();                _bRun = false;                break;            default:                ComplexSceneManager::the()->key(                    0,                    0,                    CSMKeyData::ButtonDown,                    c);                break;        }    }    return noErr;}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:49,


示例14: GetEventParameter

void  wxControl::OnKeyDown( wxKeyEvent &event ) {    if ( m_peer == NULL || !m_peer->Ok() )        return ;        char charCode ;    UInt32 keyCode ;        UInt32 modifiers ;    GetEventParameter( (EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyMacCharCodes, typeChar, NULL,sizeof(char), NULL,&charCode );    GetEventParameter( (EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyCode, typeUInt32, NULL,  sizeof(UInt32), NULL, &keyCode );       GetEventParameter((EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers);    m_peer->HandleKey( keyCode , charCode , modifiers ) ;}
开发者ID:gitrider,项目名称:wxsj2,代码行数:15,


示例15: HITestViewSetData

// -----------------------------------------------------------------------------//	HITestViewSetData// -----------------------------------------------------------------------------//OSStatus HITestViewSetData(	EventRef				inEvent,	HITestViewData*			inData ){#pragma unused( inData )	OSStatus				err;	ControlPartCode			part;	OSType					tag;	Ptr						ptr;	Size					size;		// Extract the part -- we don't use it here, but it might be important	// in a non-trivial view	err = GetEventParameter( inEvent, kEventParamControlPart, typeControlPartCode,			NULL, sizeof( ControlPartCode ), NULL, &part );	require_noerr( err, ParameterMissing );	// Extract the rest of the info needs for data handling	err = GetEventParameter( inEvent, kEventParamControlDataTag, typeEnumeration,			NULL, sizeof( OSType ), NULL, &tag );	require_noerr( err, ParameterMissing );	err = GetEventParameter( inEvent, kEventParamControlDataBuffer, typePtr,			NULL, sizeof( Ptr ), NULL, &ptr );	require_noerr( err, ParameterMissing );	err = GetEventParameter( inEvent, kEventParamControlDataBufferSize, typeLongInteger,			NULL, sizeof( Size ), NULL, &size );	require_noerr( err, ParameterMissing );	switch ( tag )	{/*		case kControlHITest_YourTagHere_Tag:			if ( size == sizeof( HITest_YourTypeHere ) )				inData->HITest_YourDataMemberHere = *( (HITest_YourTypeHere*) ptr );			else				err = errDataSizeMismatch;			break;*/		default:			err = errDataNotSupported;			break;	}ParameterMissing:	return err;}
开发者ID:arnelh,项目名称:Examples,代码行数:52,


示例16: RomInfoEventHandler

static pascal OSStatus RomInfoEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData){	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))			{				HICommand	tHICommand;				case kEventCommandUpdateStatus:					err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand);					if (err == noErr && tHICommand.commandID == 'clos')					{						UpdateMenuCommandStatus(true);						result = noErr;					}					break;				case kEventCommandProcess:					err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand);					if (err == noErr)					{						switch (tHICommand.commandID)						{							case 'Clip':								RomInfoCopyToClipboard();								result = noErr;						}					}			}	}	return (result);}
开发者ID:OV2,项目名称:snes9x-libsnes,代码行数:48,


示例17: HITestViewHitTest

// -----------------------------------------------------------------------------//	HITestViewHitTest// -----------------------------------------------------------------------------//	Check to see if a point hits the view//OSStatus HITestViewHitTest(	EventRef				inEvent,	HITestViewData*			inData ){	OSStatus				err;	HIRect					bounds;	HIPoint					where;	ControlPartCode			part;	// Extract the mouse location	err = GetEventParameter( inEvent, kEventParamMouseLocation, typeHIPoint,			NULL, sizeof( HIPoint ), NULL, &where );	require_noerr( err, ParameterMissing );	// Is the mouse in the view?	err = HIViewGetBounds( inData->view, &bounds );	if ( CGRectContainsPoint( bounds, where ) )		part = 1;	else		part = kControlNoPart;	// Send back the value of the hit part	err = SetEventParameter( inEvent, kEventParamControlPart, typeControlPartCode,			sizeof( ControlPartCode ), &part ); ParameterMissing:	return err;}
开发者ID:arnelh,项目名称:Examples,代码行数:33,


示例18: GetEventParameter

boolCOSXScreen::onHotKey(EventRef event) const{	// get the hotkey id	EventHotKeyID hkid;	GetEventParameter(event, kEventParamDirectObject, typeEventHotKeyID,							NULL, sizeof(EventHotKeyID), NULL, &hkid);	UInt32 id = hkid.id;	// determine event type	CEvent::Type type;	UInt32 eventKind = GetEventKind(event);	if (eventKind == kEventHotKeyPressed) {		type = m_events->forIPrimaryScreen().hotKeyDown();	}	else if (eventKind == kEventHotKeyReleased) {		type = m_events->forIPrimaryScreen().hotKeyUp();	}	else {		return false;	}	m_events->addEvent(CEvent(type, getEventTarget(),								CHotKeyInfo::alloc(id)));	return true;}
开发者ID:rakete,项目名称:synergy-foss,代码行数:27,


示例19: HITestViewConstruct

// -----------------------------------------------------------------------------//	HITestViewConstruct// -----------------------------------------------------------------------------//	Do any instatiation-time preparation for the view.//OSStatus HITestViewConstruct(	EventRef				inEvent ){	OSStatus				err;	HITestViewData*			data;	// don't CallNextEventHandler!	data = (HITestViewData*) malloc( sizeof( HITestViewData ) );	require_action( data != NULL, CantMalloc, err = memFullErr );	err = GetEventParameter( inEvent, kEventParamHIObjectInstance, typeHIObjectRef,			NULL, sizeof( HIObjectRef ), NULL, (HIObjectRef*) &data->view );	require_noerr( err, ParameterMissing );		// Set the userData that will be used with all subsequent eventHandler calls	err = SetEventParameter( inEvent, kEventParamHIObjectInstance, typeVoidPtr,			sizeof( HITestViewData* ), &data ); ParameterMissing:	if ( err != noErr )		free( data );CantMalloc:	return err;}
开发者ID:arnelh,项目名称:Examples,代码行数:30,


示例20: Handle_CommandUpdateStatus

/******************************************************* Handle_CommandUpdateStatus(inHandlerCallRef, inEvent, inUserData) ** Purpose:  called to update status of the commands, enabling or disabling the menu items** Inputs:   inHandlerCallRef    - reference to the current handler call chain*			inEvent             - the event*           inUserData          - app-specified data you passed in the call to InstallEventHandler** Returns:  OSStatus            - noErr indicates the event was handled*                                 eventNotHandledErr indicates the event was not handled and the Toolbox should take over*/static pascal OSStatus Handle_CommandUpdateStatus(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData){	OSStatus status = eventNotHandledErr;		HICommand aCommand;	GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &aCommand);		WindowRef aWindowRef = GetFrontWindowOfClass(kDocumentWindowClass, true);			if (aWindowRef == NULL)	{		switch (aCommand.commandID)		{			case kHICommandClose:				DisableMenuItem(aCommand.menu.menuRef, aCommand.menu.menuItemIndex);				break;		}	}	else	{		switch (aCommand.commandID)		{			case kHICommandClose:				EnableMenuItem(aCommand.menu.menuRef, aCommand.menu.menuItemIndex);				break;		}	}	return status;}   // Handle_CommandUpdateStatus
开发者ID:fruitsamples,项目名称:LittleArrowsShowcase,代码行数:43,


示例21: GetEventParameter

pascal OSStatusCOSXScreenSaver::launchTerminationCallback(				EventHandlerCallRef nextHandler,				EventRef theEvent, void* userData){	OSStatus		result;    ProcessSerialNumber psn;     EventParamType	actualType;    UInt32			actualSize;    result = GetEventParameter(theEvent, kEventParamProcessID,							   typeProcessSerialNumber, &actualType,							   sizeof(psn), &actualSize, &psn);	if ((result == noErr) &&		(actualSize > 0) &&		(actualType == typeProcessSerialNumber)) {		COSXScreenSaver* screenSaver = (COSXScreenSaver*)userData;		UInt32 eventKind = GetEventKind(theEvent);		if (eventKind == kEventAppLaunched) {			screenSaver->processLaunched(psn);		}		else if (eventKind == kEventAppTerminated) {			screenSaver->processTerminated(psn);		}	}    return (CallNextEventHandler(nextHandler, theEvent));}
开发者ID:ali1234,项目名称:synergy-old,代码行数:28,


示例22: 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,


示例23: 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,


示例24: group_setting_event_proc

static pascal OSStatus group_setting_event_proc(EventHandlerCallRef handler,EventRef event,void *data){	HICommand		cmd;		switch (GetEventKind(event)) {			case kEventProcessCommand:			GetEventParameter(event,kEventParamDirectObject,typeHICommand,NULL,sizeof(HICommand),NULL,&cmd);						switch (cmd.commandID) {								case kHICommandCancel:					dialog_group_settings_cancel=TRUE;					QuitAppModalLoopForWindow(dialog_group_settings_wind);					return(noErr);									case kHICommandOK:					QuitAppModalLoopForWindow(dialog_group_settings_wind);					return(noErr);								}			return(eventNotHandledErr);		}		return(eventNotHandledErr);}
开发者ID:prophile,项目名称:dim3,代码行数:28,


示例25: IndicatorEventHandler

static 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,


示例26: get_short_event_parm

static uint16 get_short_event_parm(EventRef evt, EventParamName n, EventParamType t) {  uint16 r = NULL;  OSStatus e = GetEventParameter(evt, n, t, NULL, sizeof(r), NULL, &r);  uint32 nb = EndianU32_NtoB(n);  if (e) lprintf("scalar event parm failed: %4.4s, %d/n", (char*)&n, e);  return r;}
开发者ID:ardeujho,项目名称:self,代码行数:7,


示例27: PickMonitorHandler

static pascal OSStatus PickMonitorHandler( EventHandlerCallRef inHandler, EventRef inEvent, void* inUserData ){	#pragma unused( inHandler )		HICommand			cmd;	OSStatus			result = eventNotHandledErr;	WindowRef			theWindow = (WindowRef)inUserData;	// The direct object for a 'process commmand' event is the HICommand.	// Extract it here and switch off the command ID.	GetEventParameter( inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof( cmd ), NULL, &cmd );	switch ( cmd.commandID )	{		case kHICommandOK:						QuitAppModalLoopForWindow( theWindow );			result = noErr;			break;				case kHICommandCancel:						// Setting sSelectedDevice to zero will signal that the user cancelled.			sSelectedDevice = 0;			QuitAppModalLoopForWindow( theWindow );			result = noErr;			break;	}		return result;}
开发者ID:0culus,项目名称:Doom3-for-MacOSX-,代码行数:30,


示例28: MacOSXDialogCommandProcess

static pascal OSStatus MacOSXDialogCommandProcess(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void* inUserData){	HICommand aCommand;	OSStatus status = eventNotHandledErr;		GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &aCommand);		switch (aCommand.commandID)	{		case kHICommandOK:			// we got a valid click on the OK button so let's quit our local run loop			QuitAppModalLoopForWindow((WindowRef) inUserData);			break;		case 'CBED':		{			// we still enable or disable the custom spot view depending on whether the box is checked or not			HIViewRef checkBox = ((HICommandExtended *)&aCommand)->source.control;			SInt32 enable = GetControl32BitValue(checkBox);			HIViewID hidcsv = {0, 13};			HIViewRef customSpotView;			HIViewFindByID(HIViewGetRoot(GetControlOwner(checkBox)), hidcsv, &customSpotView);			if (enable)				ActivateControl(customSpotView);			else				DeactivateControl(customSpotView);			HIViewSetNeedsDisplay(customSpotView, true);		}			break;	}		return status;}
开发者ID:fruitsamples,项目名称:DialogsToHIViews,代码行数:32,



注:本文中的GetEventParameter函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetEventTypeCount函数代码示例
C++ GetEventKind函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。