当前位置: 首页>>代码示例>>C++>>正文


C++ ReleaseEvent函数代码示例

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


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

示例1: NiFreeNat

// Release the NAT
void NiFreeNat(NAT *n)
{
	// Validate arguments
	if (n == NULL)
	{
		return;
	}

	// Complete management command
	//NiFreeAdminAccept(n);

	// Stop if the virtual host is running
	Lock(n->lock);
	{
		if (n->Virtual != NULL)
		{
			StopVirtualHost(n->Virtual);
			ReleaseVirtual(n->Virtual);
			n->Virtual = NULL;
		}
	}
	Unlock(n->lock);

	// Release the settings
	NiFreeConfig(n);

	// Delete the object
	ReleaseCedar(n->Cedar);
	ReleaseEvent(n->HaltEvent);
	DeleteLock(n->lock);

	Free(n);
}
开发者ID:benapetr,项目名称:SoftEtherVPN,代码行数:34,代码来源:Nat.c

示例2: NiFreeNat

// NAT の解放
void NiFreeNat(NAT *n)
{
	// 引数チェック
	if (n == NULL)
	{
		return;
	}

	// 管理コマンド終了
	//NiFreeAdminAccept(n);

	// 仮想ホストが動作中の場合は停止
	Lock(n->lock);
	{
		if (n->Virtual != NULL)
		{
			StopVirtualHost(n->Virtual);
			ReleaseVirtual(n->Virtual);
			n->Virtual = NULL;
		}
	}
	Unlock(n->lock);

	// 設定の解放
	NiFreeConfig(n);

	// オブジェクトの削除
	ReleaseCedar(n->Cedar);
	ReleaseEvent(n->HaltEvent);
	DeleteLock(n->lock);

	Free(n);
}
开发者ID:falcon8823,项目名称:utvpn,代码行数:34,代码来源:Nat.c

示例3: FindSpecificEventInQueue

void MacOpMessageLoop::DispatchAllPostedMessagesNow()
{
#ifdef USE_UNTESTED_DISPATCH_CODE
	OpVector<EventRef> eventList;
	OSStatus err;
	EventRef nextEvent;

	do
	{
		nextEvent = FindSpecificEventInQueue(gMainEventQueue, OperaEventComparatorProc, NULL);
		if(nextEvent)
		{
			if(noErr == RemoveEventFromQueue(gMainEventQueue, nextEvent))
			{
				eventList.Add(&nextEvent);
			}
		}
	} while(nextEvent);


	if(eventList.GetCount() > 0)
	{
		for(int i = 0; i < eventList.GetCount(); i++)
		{
			nextEvent = *eventList.Get(i);
			err = SendEventToEventTarget(nextEvent, GetEventDispatcherTarget());
			ReleaseEvent(nextEvent);
		}
	}
#endif
}
开发者ID:prestocore,项目名称:browser,代码行数:31,代码来源:MacOpMessageHandler.cpp

示例4: NullPaFree

// Release
void NullPaFree(SESSION *s)
{
	// Validate arguments
	NULL_LAN *n;
	BLOCK *b;
	if (s == NULL || (n = s->PacketAdapter->Param) == NULL)
	{
		return;
	}

	n->Halt = true;
	Set(n->Event);

	WaitThread(n->PacketGeneratorThread, INFINITE);
	ReleaseThread(n->PacketGeneratorThread);

	LockQueue(n->PacketQueue);
	{
		while (b = GetNext(n->PacketQueue))
		{
			FreeBlock(b);
		}
	}
	UnlockQueue(n->PacketQueue);

	ReleaseQueue(n->PacketQueue);

	ReleaseCancel(n->Cancel);

	ReleaseEvent(n->Event);

	s->PacketAdapter->Param = NULL;
	Free(n);
}
开发者ID:m-a-n-a-v,项目名称:SoftEtherVPN_Stable,代码行数:35,代码来源:NullLan.c

示例5: TkMacOSXReceiveAndProcessEvent

OSStatus
TkMacOSXReceiveAndProcessEvent()
{
    static EventTargetRef targetRef = NULL;
    EventRef eventRef;
    OSStatus err;

    /*
     * This is a poll, since we have already counted the events coming
     * into this routine, and are guaranteed to have one waiting.
     */
     
    err = ReceiveNextEvent(0, NULL, kEventDurationNoWait, true, &eventRef);
    if (err == noErr) {
        if (!targetRef) {
            targetRef = GetEventDispatcherTarget();
        }
        TkMacOSXStartTclEventLoopCarbonTimer();
        err = SendEventToEventTarget(eventRef,targetRef);
        TkMacOSXStopTclEventLoopCarbonTimer();
#ifdef TK_MAC_DEBUG
        if (err != noErr && err != eventLoopTimedOutErr
                && err != eventNotHandledErr
        ) {
            char buf [256];
            fprintf(stderr,
                    "RCNE SendEventToEventTarget (%s) failed, %d\n",
                    CarbonEventToAscii(eventRef, buf), (int)err);
        }
#endif
        ReleaseEvent(eventRef);
    }
    return err;
}
开发者ID:SASfit,项目名称:SASfit,代码行数:34,代码来源:tkMacOSXEvent.c

示例6: contentView

/*
	Position the contentView (presumed to be a subview of the frameView) by
	asking the content view for its metrics and positioning it appropriately.
*/
OSStatus PositionContentViewWithMetrics(HIViewRef frameView, HIViewRef contentView)
{
	HIViewFrameMetrics metrics = { 0, 0, 0, 0 };
	EventRef getMetricsEvent = NULL;

	// First we check the frame metrics of the content view by asking it (politely) for the
	// metrics it wants
	verify_noerr(CreateEvent(NULL, kEventClassControl, kEventControlGetFrameMetrics, GetCurrentEventTime(), 0, &getMetricsEvent));
	if(NULL != getMetricsEvent) {
		SetEventParameter(getMetricsEvent, kEventParamDirectObject, typeControlRef, sizeof(contentView), &contentView);
		SetEventParameter(getMetricsEvent, kEventParamControlFrameMetrics, typeControlFrameMetrics, sizeof(metrics), &metrics);

		OSStatus result = SendEventToEventTarget(getMetricsEvent, HIObjectGetEventTarget((HIObjectRef)contentView));
		if(result == noErr) {
			verify_noerr(GetEventParameter(getMetricsEvent, kEventParamControlFrameMetrics, typeControlFrameMetrics, NULL, sizeof(metrics), NULL, &metrics));
		}

		ReleaseEvent(getMetricsEvent);
		getMetricsEvent = NULL;
	}

	// Now we reposition the content view based on the metrics we got from it.
	HIRect bounds, contentRect;
	HIViewGetBounds(frameView, &bounds);

	contentRect.origin.x = metrics.left;
	contentRect.origin.y = metrics.top;
	contentRect.size.width = bounds.size.width - (metrics.left + metrics.right);
	contentRect.size.height = bounds.size.height - (metrics.top + metrics.bottom);

	HIViewSetFrame(contentView, &contentRect);

	return noErr;
}
开发者ID:fruitsamples,项目名称:StarMenu,代码行数:38,代码来源:StarMenuFrame.cpp

示例7: _initReceiverQueue

void MessagePump::dispatchAll()
{
    _initReceiverQueue();

    while( true )
    {
        EventRef       event;

        if( _needGlobalLock )
            Global::enterCarbon(); 
        const OSStatus status = ReceiveNextEvent( 0, 0, 0.0, true, &event );

        if( status == eventLoopTimedOutErr )
            break;

        if( status != noErr )
        {
            EQWARN << "ReceiveNextEvent failed: " << status << std::endl;
            break;
        }

        EQVERB << "Dispatch Carbon event " << event << std::endl;

        if( !_needGlobalLock )
            Global::enterCarbon();
        const EventTargetRef target = GetEventDispatcherTarget();
        SendEventToEventTarget( event, target );
        Global::leaveCarbon();

        ReleaseEvent( event );
    }

    if( _needGlobalLock )
        Global::leaveCarbon();
}
开发者ID:MichaelVlad,项目名称:Equalizer,代码行数:35,代码来源:messagePump.cpp

示例8: CreateCustomToolbarItem

//-----------------------------------------------------------------------------
//	CreateCustomToolbarItem
//-----------------------------------------------------------------------------
//	Our 'public' API to create our custom URL item.
//
HIToolbarItemRef
CreateCustomToolbarItem( CFStringRef inIdentifier, CFTypeRef inURL )
{
	OSStatus			err;
	EventRef			event;
	UInt32				options = kHIToolbarItemAllowDuplicates;
	HIToolbarItemRef	result = NULL;
	
	RegisterCustomToolbarItemClass();
	
	err = CreateEvent( NULL, kEventClassHIObject, kEventHIObjectInitialize,
			GetCurrentEventTime(), 0, &event );
	require_noerr( err, CantCreateEvent );

	SetEventParameter( event, kEventParamToolbarItemIdentifier, typeCFStringRef, sizeof( CFStringRef ), &inIdentifier );
	SetEventParameter( event, kEventParamAttributes, typeUInt32, sizeof( UInt32 ), &options );

	if ( inURL )
		SetEventParameter( event, kEventParamToolbarItemConfigData, typeCFTypeRef, sizeof( CFTypeRef ), &inURL );
	
	err = HIObjectCreate( kCustomToolbarItemClassID, event, (HIObjectRef*)&result );
	check_noerr( err );

	ReleaseEvent( event );
	
CantCreateEvent:
	return result;
}
开发者ID:fruitsamples,项目名称:CarbonToolbar,代码行数:33,代码来源:CustomToolbarItem.c

示例9: ReceiveNextEvent

void wxApp::MacDoOneEvent()
{
    wxMacAutoreleasePool autoreleasepool;
    EventRef theEvent;

    s_inReceiveEvent = true ;
    OSStatus status = ReceiveNextEvent(0, NULL, sleepTime, true, &theEvent) ;
    s_inReceiveEvent = false ;

    switch (status)
    {
    case eventLoopTimedOutErr :
        if ( wxTheApp->ProcessIdle() )
            sleepTime = kEventDurationNoWait ;
        else
            sleepTime = kEventDurationSecond;
        break;

    case eventLoopQuitErr :
        // according to QA1061 this may also occur
        // when a WakeUp Process is executed
        break;

    default:
        MacHandleOneEvent( theEvent ) ;
        ReleaseEvent( theEvent );
        sleepTime = kEventDurationNoWait ;
        break;
    }
    // repeaters

    DeletePendingObjects() ;
    wxMacProcessNotifierAndPendingEvents() ;
}
开发者ID:hgwells,项目名称:tive,代码行数:34,代码来源:app.cpp

示例10: FreeTick64

// Release of the Tick64
void FreeTick64()
{
	UINT i;
	if (tk64 == NULL)
	{
		// Uninitialized
		return;
	}

	// Termination process
	tk64->Halt = true;
	Set(halt_tick_event);
	WaitThread(tk64->Thread, INFINITE);
	ReleaseThread(tk64->Thread);

	// Releasing process
	for (i = 0;i < LIST_NUM(tk64->AdjustTime);i++)
	{
		ADJUST_TIME *t = LIST_DATA(tk64->AdjustTime, i);
		Free(t);
	}
	ReleaseList(tk64->AdjustTime);
	DeleteLock(tk64->TickLock);
	Free(tk64);
	tk64 = NULL;

	ReleaseEvent(halt_tick_event);
	halt_tick_event = NULL;
}
开发者ID:13eatrice,项目名称:SoftEtherVPN,代码行数:30,代码来源:Tick64.c

示例11: ReceiveNextEvent

void wxApp::MacDoOneEvent()
{
    EventRef theEvent;

    s_inReceiveEvent = true ;
    OSStatus status = ReceiveNextEvent(0, NULL,sleepTime,true,&theEvent) ;
    s_inReceiveEvent = false ;
    if ( status == eventLoopTimedOutErr )
    {
        if ( wxTheApp->ProcessIdle() )
            sleepTime = kEventDurationNoWait ;
        else
            sleepTime = kEventDurationSecond;
    }
    else if ( status == eventLoopQuitErr )
    {
        // according to QA1061 this may also occur when a WakeUp Process
        // is executed
    }
    else
    {
        MacHandleOneEvent( theEvent ) ;
        ReleaseEvent(theEvent);
        sleepTime = kEventDurationNoWait ;
    }
    // repeaters

    DeletePendingObjects() ;
    wxMacProcessNotifierAndPendingEvents() ;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:30,代码来源:app.cpp

示例12: wxFAIL_MSG

bool wxApp::Yield(bool onlyIfNeeded)
{
    if (s_inYield)
    {
        if ( !onlyIfNeeded )
        {
            wxFAIL_MSG( wxT("wxYield called recursively" ) );
        }

        return false;
    }

#if wxUSE_THREADS
    // Yielding from a non-gui thread needs to bail out, otherwise we end up
    // possibly sending events in the thread too.
    if ( !wxThread::IsMain() )
    {
        return true;
    }
#endif // wxUSE_THREADS

    s_inYield = true;

    // by definition yield should handle all non-processed events

    EventRef theEvent;

    OSStatus status = noErr ;

    while ( status == noErr )
    {
        s_inReceiveEvent = true ;
        status = ReceiveNextEvent(0, NULL,kEventDurationNoWait,true,&theEvent) ;
        s_inReceiveEvent = false ;

        if ( status == eventLoopTimedOutErr )
        {
            // make sure next time the event loop will trigger idle events
            sleepTime = kEventDurationNoWait ;
        }
        else if ( status == eventLoopQuitErr )
        {
            // according to QA1061 this may also occur when a WakeUp Process
            // is executed
        }
        else
        {
            MacHandleOneEvent( theEvent ) ;
            ReleaseEvent(theEvent);
        }
    }

    wxMacProcessNotifierAndPendingEvents() ;
    s_inYield = false;

    return true;
}
开发者ID:hgwells,项目名称:tive,代码行数:57,代码来源:app.cpp

示例13: PostCustomEvent

void PostCustomEvent(DWORD id, void *data, DWORD size)
{
	EventRef e;
	CreateEvent(NULL,'blah','blah',0,0,&e);
	SetEventParameter(e,'evid',0,sizeof(id),&id);
	SetEventParameter(e,'data',0,size,data);
	PostEventToQueue(GetMainEventQueue(),e,kEventPriorityHigh);
	ReleaseEvent(e);
}
开发者ID:bagnz0r,项目名称:ichigo-audio,代码行数:9,代码来源:netradio.c

示例14: RetainEvent

void QMacInputContext::setLastKeydownEvent(EventRef event)
{
    EventRef tmpEvent = keydownEvent;
    keydownEvent = event;
    if (keydownEvent)
        RetainEvent(keydownEvent);
    if (tmpEvent)
        ReleaseEvent(tmpEvent);
}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:9,代码来源:qmacinputcontext_mac.cpp

示例15: while

//--------------------------------------------------------------------------------//
void WindowEventUtilities::messagePump()
{
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
	// Windows Message Loop (NULL means check all HWNDs belonging to this context)
	MSG  msg;
	while( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
	{
		TranslateMessage( &msg );
		DispatchMessage( &msg );
	}
#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
	//GLX Message Pump
	RenderWindowList::iterator win = _msWindows.begin();
	RenderWindowList::iterator end = _msWindows.end();

	Display* xDisplay = 0; // same for all windows
	
	for (; win != end; win++)
	{
	    XID xid;
	    XEvent event;

	    if (!xDisplay)
		(*win)->getCustomAttribute("XDISPLAY", &xDisplay);

	    (*win)->getCustomAttribute("WINDOW", &xid);

	    while (XCheckWindowEvent (xDisplay, xid, StructureNotifyMask | VisibilityChangeMask | FocusChangeMask, &event))
	    {
		GLXProc(*win, event);
	    }

	    // The ClientMessage event does not appear under any Event Mask
	    while (XCheckTypedWindowEvent (xDisplay, xid, ClientMessage, &event))
	    {
		GLXProc(*win, event);
	    }
	}
#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE && !defined __OBJC__ && !defined __LP64__
	// OSX Message Pump
	EventRef event = NULL;
	EventTargetRef targetWindow;
	targetWindow = GetEventDispatcherTarget();
    
    // If we are unable to get the target then we no longer care about events.
    if( !targetWindow ) return;
    
    // Grab the next event, process it if it is a window event
	while( ReceiveNextEvent( 0, NULL, kEventDurationNoWait, true, &event ) == noErr )
	{
        // Dispatch the event
		SendEventToEventTarget( event, targetWindow );
   		ReleaseEvent( event );
	}
#endif
}
开发者ID:Bewolf2,项目名称:LearningGameAI,代码行数:57,代码来源:OgreWindowEventUtilities.cpp


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