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


C++ IsActive函数代码示例

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


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

示例1: new


//.........这里部分代码省略.........
        CleanupStack::Pop();    // iContentID;
        CleanupStack::Pop();    // delayData;
        return;
        }

    switch ( aEvent )
        {
        case KEventAddRemove:
            if ( iAddRemoveObservers )
                {
                for ( count = 0; count < iAddRemoveObservers->Count(); ++count )
                    {
                    if ( ( *iAddRemoveObservers )[ count ]->iObserver == &aObserver &&
                         ( *iAddRemoveObservers )[ count ]->iContentID &&
                         !( *iAddRemoveObservers )[ count ]->iContentID->Compare( aContentID ) )
                        {
                        return;
                        }
                    else if( addToServer && 
                        !( *iAddRemoveObservers)[ count ]->iContentID->Compare( aContentID ) ) 
                        {
                        addToServer = EFalse;
                        }
                    }
                }
            break;
        case KEventModify:
            if ( iModifyObservers )
                {
                for ( count = 0; count < iModifyObservers->Count(); ++count )
                    {
                    if ( ( *iModifyObservers )[ count ]->iObserver == &aObserver &&
                         ( *iModifyObservers )[ count ]->iContentID &&
                         !( *iModifyObservers )[ count ]->iContentID->Compare( aContentID ) )
                        {
                        return;
                        }
                    else if( addToServer && 
                        !( *iModifyObservers)[ count ]->iContentID->Compare( aContentID ) ) 
                        {
                        addToServer = EFalse;
                        }
                    }
                }
            break;
        default:
            User::Leave(KErrArgument);
            break;
        }  

    HBufC8* contentID = aContentID.AllocLC();
    struct TObserverData* observer = new (ELeave) TObserverData;
    CleanupStack::PushL(observer);

    observer->iObserver = &aObserver;
    observer->iContentID = contentID;

    switch( aEvent )
        {
        case KEventAddRemove:
            if( this->iAddRemoveObservers ) // coverity check
                {
                iAddRemoveObservers->AppendL( observer );
                }
            break;
        case KEventModify:
            if( this->iModifyObservers ) // coverity check
                {
                iModifyObservers->AppendL( observer );
                }
            break;
        default:
            User::Leave(KErrArgument);
            break;
        }
   
    if ( !IsAdded() )
        {
        CActiveScheduler::Add( this );
        }

    if ( !IsActive() )
        {
        if( iStatus != KRequestPending )
            {
            iStatus = KRequestPending;
            iHandler->WaitForCompletion(iStatus);
            }
        SetActive();
        }

    // Register the type to the server
    if ( addToServer )
        {
        iHandler->RegisterForType(aEvent,contentID);
        }

    CleanupStack::Pop(); // contentID
    CleanupStack::Pop(); // observer;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:101,代码来源:DRMEventHandler.cpp

示例2: Timer

 /**
  * The move constructor may only be used on inactive timers.  This
  * shall only be used by derived classes to pass inactive instances
  * around.
  */
 Timer(Timer &&other) {
   assert(!IsActive());
   assert(!other.IsActive());
 }
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:9,代码来源:Timer.hpp

示例3: MatchesCriteria

bool CMission::MatchesCriteria (CSpaceObject *pSource, const SCriteria &Criteria)

//	MatchesCriteria
//
//	Returns TRUE if the given mission matches the criteria

{
    int i;

    //	By status

    if (Criteria.bIncludeActive && !IsActive())
        return false;

    if (Criteria.bIncludeOpen && m_iStatus != statusOpen)
        return false;

    if (Criteria.bIncludeRecorded && !IsRecorded())
        return false;

    if (Criteria.bIncludeUnavailable && !IsUnavailable())
        return false;

    //	Owned by source

    if (Criteria.bOnlySourceOwner)
    {
        if (pSource)
        {
            if (pSource->GetID() != m_pOwner.GetID())
                return false;
        }
        else
        {
            if (m_pOwner.GetID() != OBJID_NULL)
                return false;
        }
    }

    //	Check required attributes

    for (i = 0; i < Criteria.AttribsRequired.GetCount(); i++)
        if (!HasAttribute(Criteria.AttribsRequired[i]))
            return false;

    //	Check attributes not allowed

    for (i = 0; i < Criteria.AttribsNotAllowed.GetCount(); i++)
        if (HasAttribute(Criteria.AttribsNotAllowed[i]))
            return false;

    //	Check special attribs required

    for (i = 0; i < Criteria.SpecialRequired.GetCount(); i++)
        if (!HasSpecialAttribute(Criteria.SpecialRequired[i]))
            return false;

    //	Check special attribs not allowed

    for (i = 0; i < Criteria.SpecialNotAllowed.GetCount(); i++)
        if (HasSpecialAttribute(Criteria.SpecialNotAllowed[i]))
            return false;

    //	Match

    return true;
}
开发者ID:alanhorizon,项目名称:Transcendence,代码行数:67,代码来源:CMission.cpp

示例4: FLOG

// -----------------------------------------------------------------------------
// CFMSInterruptAob::Start()
// -----------------------------------------------------------------------------
void CFMSInterruptAob::StartL(TFmsIpcCommands aType)
	{	
	FLOG(_L("CFMSInterruptAob::Start- begin"));
	iInterruptType = aType;
	if(iInterruptType == EDLUserInterrupt && iServer->ChargerTobeMonitered())
		{
		FLOG(_L("CFMSInterruptAob::Start--EUserInterrupt"));
		if(!IsActive())
			{
			//RProperty pw;
			iProperty.Attach(KPSUidHWRMPowerState,KHWRMChargingStatus);
			iStatus=KRequestPending;
			iProperty.Subscribe(iStatus);	
			SetActive();	
			}
		}
	else if(iInterruptType == EDLNetworkInterrupt && iServer->NetworkTobeMonitered())
		{	  
		FLOG(_L("CFMSInterruptAob::Start--ENetworkInterrupt"));	
		if(!IsActive())
			{		  
			iStatus=KRequestPending;			  
			TBool phonenotoffline = CheckGlobalRFStateL();
			if ( ( iBearer == EBearerIdGPRS || iBearer == EBearerIdWCDMA )
					&& phonenotoffline )
				{
				FLOG(_L("CFMSInterruptAob::Start--ENetworkInterrupt iBearer is %d"),iBearer);	
				NotifyL();
				return;			  
				}
			else if ( iBearer == EBearerIdWLAN )
				{
				//feature supported check
				iWlanAvailable = EFalse;	  
				iConnMon.GetBoolAttribute( EBearerIdWLAN, 
						0, 
						KBearerAvailability, 
						iWlanAvailable, 
						iStatus );
				SetActive();
				}
			else
				{
				FLOG(_L("CFMSInterruptAob::Start--ENetworkInterrupt--other then GPRS/ WLan bearer "));	  
				//Stop the server	  
				//Dont delete the file if interrupt is network + offline( to differentiate from hard reboot
				iServer->DeleteFile(EFalse);
				StopServer();
				}	  
			}
		}
	else if(iInterruptType == EDLMemoryInterrupt && iServer->MemoryTobeMonitered())
		{
		FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt on drive %d"),(TInt)iDrive );		  
		if(!IsActive())
			{
			User::LeaveIfError(iFs.Connect());
			TBool critical = EFalse;
			TInt err = KErrNone;
			err=IsPkgSizeMoreThanWL(critical);		  
			if(critical)
				{	 
				FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt--critical pkg dont fit on drive %d"),(TInt)iDrive );		  
				iStatus=KRequestPending;					
				iFs.NotifyDiskSpace( iSize, iDrive, iStatus ); 
				FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt-setting as active") );		  
				SetActive();	
				}
			else
				{
				if(err == KErrNone)
					{
					FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt--critical pkg fits on drive %d"),(TInt)iDrive );
					LaunchFotaEngineL();
					}
				else
					{
					FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt--System error %d on memory drive %d"), err,(TInt)iDrive );
					}
				//Stop the server	 
				StopServer();	   
				}
			}
		}  
	else //case where variation fails or by chance if a bad interrupt reason
		{
		StopServer();	  
		}	 
	}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:92,代码来源:fmsinterruptaob.cpp

示例5: GetActiveRCS

 /// \brief
 ///   Returns the current Revision Control System if it's active.
 VBASE_IMPEXP static IVRevisionControlSystem* GetActiveRCS()
 {
   return IsActive() ? GetRCS() : NULL;
 }
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:6,代码来源:VRCSHelper.hpp

示例6: Ast

void CSyncCoreObjectMediator::OnMoveSpeedChangedDerived(const CMoveSpeedChangedDerivedArgs& Args)
{
	Ast(IsActive());
	CSyncCoreObjectDictator::MoveSpeedChangedExtraConn(Args,GetConnection());
}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:5,代码来源:CSyncCoreObjectMediator.cpp

示例7: imgRect

//---------------------------------------------------------------------------
// Draw() draws the control into the parent window
// \param dirtyRect - portion of control (in window coordinates)
//        that requires redrawing.
//---------------------------------------------------------------------------
void CATSwitch::Draw(CATImage* image, const CATRect& dirtyRect)
{
    if (this->IsVisible() == false)
    {
        return;
    }

    // sanity check parent image / dirty rectangle
    CATRect imgRect(0,0,image->Width(), image->Height());
    CATASSERT(imgRect.Inside(dirtyRect), "Update rect is outside of img rect!");

    // Find intersection between dirty rect and us
    CATRect drawRect;
    bool   drawn = false;

    CATImage* disabled = fImageDisabled;
    CATImage* normal   = fImage;
    CATImage* pressed  = fImagePressed;
    CATImage* focus    = fImageFocus;
    CATImage* focusAct = fImageFocusAct;
    CATImage* active   = fImageActive;

    if (fValue > 0.5)
    {
        // All on...
        if (fImageDisabledOn)
            disabled    = fImageDisabledOn;

        if (fImageOn)
            normal      = fImageOn;

        if (fImagePressedOn)
            pressed     = fImagePressedOn;

        if (fImageFocusOn)
            focus       = fImageFocusOn;

        if (fImageFocusActOn)
            focusAct    = fImageFocusActOn;

        if (fImageActiveOn)
            active      = fImageActiveOn;
    }


    // Gracefully degrade depending on flags and whether the images are
    // available.
    if (this->fRect.Intersect(dirtyRect, &drawRect))
    {  
        CATRect ourRect;
        if ( (this->IsEnabled() == false) && (disabled))
        {
            if (drawRect.Intersect(CATRect(fRect.left, 
                fRect.top, 
                fRect.left + disabled->Width(),
                fRect.top  + disabled->Height()),
                &ourRect))
            {
                ourRect.Offset(-fRect.left, -fRect.top);

                image->Overlay(   disabled,
                    drawRect.left, 
                    drawRect.top, 
                    ourRect.left,
                    ourRect.top,
                    ourRect.Width(),
                    ourRect.Height());
                drawn = true;
            }        
        }
        else 
        {
            if (this->IsPressed() && (pressed))
            {
                if (drawRect.Intersect(CATRect(fRect.left, 
                                               fRect.top, 
                                               fRect.left + pressed->Width(),
                                               fRect.top  + pressed->Height()),
                                       &ourRect))
                {
                    ourRect.Offset(-fRect.left, -fRect.top);

                    image->Overlay( pressed,
                                    drawRect.left,
                                    drawRect.top,
                                    ourRect.left,
                                    ourRect.top,
                                    ourRect.Width(),
                                    ourRect.Height());
                    drawn = true;
                }
            }

            if ((!drawn) && ( (IsFocused() && IsActive()) || IsPressed()) && (focusAct))
            {
//.........这里部分代码省略.........
开发者ID:michaelellison,项目名称:Mike-s-Demo-App,代码行数:101,代码来源:CATSwitch.cpp

示例8: InputDecEager

    bool ActiveWidget::AcceptInputKeyboard( const InputKeyboard &key )
    {
        _result = false; //-- Key is handled till something handle it

        if ( !key.Pressed() && key.KeyCode()==_activation_key )
        {// magic sequence of signal sends - to give nice mouse button like effet
            if ( 1 == _mb_down[0] )
            {
                _mb_down[0] = false;
                OnRelease[0].Schedule();
                OnClick[0].Schedule();
                InputDecEager(); NotifyAncestors(this);
            }
        }

        if (!OnFocusWay()) //-- Only widget with focus operates with keyboard
        {
            _pressed_keys.Clear();//-- Clear stored keyboard status
            return false;
        }
        bool likes_this_key = _on_path_key_mask.GetBit( key.KeyCode() );
        if ( HasFocus() ) { likes_this_key |= _key_mask.GetBit( key.KeyCode() ); }

        //-- Local state may be invalid, since focus changes
        bool invalid_state = !IsKeyPressed(key.KeyCode()) && !WasKeyPressed(key.KeyCode());
        if ( invalid_state ) return _result=likes_this_key;

        //-- Store local status
        bool state_changed  = MarkKey( key.KeyCode(), key.Pressed() );

        if ( !likes_this_key ) //-- If key is not handled by derivate, then
        {
            return _result=HandleKeyPress( key.KeyCode(), key.Pressed() );//-- apply internal keyboard handling
        }

        if (!IsActive()) return false; //-- Only ActiveWidget may send signals

        _result = ( _likes_chars && Keys::IsChar(key.KeyCode()) )? true : false;

        if ( !likes_this_key ) { return _result; }
        //-- If key state has changed
        if ( state_changed )
        {   
            if ( key.Pressed() )
            {
                if ( key.Cond() == Widget::FOCUSED )
                {
                    _result=OnKeyPress.Schedule_1( key.KeyCode());
                }
                else
                {
                    _result=OffKeyPress.Schedule_1( key.KeyCode());
                }
            }
            else
            {
                if ( key.Cond() == Widget::FOCUSED )
                {
                    _result=OnKeyRelease.Schedule_1( key.KeyCode()); 
                }
            }
        }
        else //-- If key state repeats
        {
            assert( key.Pressed() );

            if ( key.Cond() == Widget::FOCUSED )
            { 
                _result=WhileKey.Schedule_1( key.KeyCode() ); 
            }
            else
            { 
                _result=WhileOffKey.Schedule_1( key.KeyCode() ); 
            }
        }

        return (_result = _result && (key.Cond() == Widget::FOCUSED) );
    }
开发者ID:BackupTheBerlios,项目名称:utgs-svn,代码行数:78,代码来源:ActiveWidget.cpp

示例9: entry

void
BTextWidget::StartEdit(BRect bounds, BPoseView* view, BPose* pose)
{
	view->SetTextWidgetToCheck(NULL, this);
	if (!IsEditable() || IsActive())
		return;

	BEntry entry(pose->TargetModel()->EntryRef());
	if (entry.InitCheck() == B_OK
		&& !ConfirmChangeIfWellKnownDirectory(&entry,
			B_TRANSLATE_COMMENT("rename",
				"As in 'if you rename this folder...' (en) "
				"'Wird dieser Ordner umbenannt...' (de)"),
			B_TRANSLATE_COMMENT("rename",
				"As in 'to rename this folder...' (en) "
				"'Um diesen Ordner umzubenennen...' (de)"),
			B_TRANSLATE_COMMENT("Rename",
				"Button label, 'Rename' (en), 'Umbenennen' (de)")))
		return;

	// get bounds with full text length
	BRect rect(bounds);
	BRect textRect(bounds);
	rect.OffsetBy(-2, -1);
	rect.right += 1;

	BFont font;
	view->GetFont(&font);
	BTextView* textView = new BTextView(rect, "WidgetTextView", textRect,
		&font, 0, B_FOLLOW_ALL, B_WILL_DRAW);

	textView->SetWordWrap(false);
	DisallowMetaKeys(textView);
	fText->SetUpEditing(textView);

	textView->AddFilter(new BMessageFilter(B_KEY_DOWN, TextViewFilter));

	rect.right = rect.left + textView->LineWidth() + 3;
	// center new width, if necessary
	if (view->ViewMode() == kIconMode
		|| (view->ViewMode() == kListMode && fAlignment == B_ALIGN_CENTER)) {
		rect.OffsetBy(bounds.Width() / 2 - rect.Width() / 2, 0);
	}

	rect.bottom = rect.top + textView->LineHeight() + 1;
	textRect = rect.OffsetToCopy(2, 1);
	textRect.right -= 3;
	textRect.bottom--;
	textView->SetTextRect(textRect);

	BPoint origin = view->LeftTop();
	textRect = view->Bounds();

	bool hitBorder = false;
	if (rect.left <= origin.x)
		rect.left = origin.x + 1, hitBorder = true;
	if (rect.right >= textRect.right)
		rect.right = textRect.right - 1, hitBorder = true;

	textView->MoveTo(rect.LeftTop());
	textView->ResizeTo(rect.Width(), rect.Height());

	BScrollView* scrollView = new BScrollView("BorderView", textView, 0, 0,
		false, false, B_PLAIN_BORDER);
	view->AddChild(scrollView);

	// configure text view
	switch (view->ViewMode()) {
		case kIconMode:
			textView->SetAlignment(B_ALIGN_CENTER);
			break;

		case kMiniIconMode:
			textView->SetAlignment(B_ALIGN_LEFT);
			break;

		case kListMode:
			textView->SetAlignment(fAlignment);
			break;
	}
	textView->MakeResizable(true, hitBorder ? NULL : scrollView);

	view->SetActivePose(pose);
		// tell view about pose
	SetActive(true);
		// for widget

	textView->SelectAll();
	textView->MakeFocus();

	// make this text widget invisible while we edit it
	SetVisible(false);

	ASSERT(view->Window() != NULL);
		// how can I not have a Window here???

	if (view->Window()) {
		// force immediate redraw so TextView appears instantly
		view->Window()->UpdateIfNeeded();
	}
//.........这里部分代码省略.........
开发者ID:AmirAbrams,项目名称:haiku,代码行数:101,代码来源:TextWidget.cpp

示例10: SetNextThink

void CAPCController::TrackTarget( void )
{
	trace_t tr;
	bool updateTime = FALSE, lineOfSight;
	QAngle angles;
	Vector barrelEnd;
	CBaseEntity *pTarget = NULL;

	barrelEnd.Init();

	if ( IsActive() )
	{
		SetNextThink( gpGlobals->curtime + 0.1f );
	}
	else
	{
		return;
	}

	// -----------------------------------
	//  Get world target position
	// -----------------------------------
	barrelEnd = WorldBarrelPosition();
	Vector worldTargetPosition;
	CBaseEntity *pEntity = (CBaseEntity *)m_hTarget;
	if ( !pEntity || ( pEntity->GetFlags() & FL_NOTARGET ) )
	{
		m_hTarget = FindTarget( m_targetEntityName, NULL );
		if ( IsActive() )
		{
			SetNextThink( gpGlobals->curtime + 2 );	// Wait 2 sec s
		}

		return;
	}
	pTarget = pEntity;

	// Calculate angle needed to aim at target
	worldTargetPosition = pEntity->EyePosition();

	float range = (worldTargetPosition - barrelEnd).Length();

	if ( !InRange( range ) )
	{
		m_bFireDelayed = false;
		return;
	}

	UTIL_TraceLine( barrelEnd, worldTargetPosition, MASK_OPAQUE, this, COLLISION_GROUP_NONE, &tr );

	lineOfSight = FALSE;
	// No line of sight, don't track
	if ( tr.fraction == 1.0 || tr.m_pEnt == pTarget )
	{
		lineOfSight = TRUE;

		CBaseEntity *pInstance = pTarget;
		if ( InRange( range ) && pInstance && pInstance->IsAlive() )
		{
			updateTime = TRUE;

			// Sight position is BodyTarget with no noise (so gun doesn't bob up and down)
			m_sightOrigin = pInstance->BodyTarget( GetLocalOrigin(), false );
		}
	}

	// Convert targetPosition to parent
	angles = AimBarrelAt( m_parentMatrix.WorldToLocal( m_sightOrigin ) );


	// Force the angles to be relative to the center position
	float offsetY = UTIL_AngleDistance( angles.y, m_yawCenter );
	float offsetX = UTIL_AngleDistance( angles.x, m_pitchCenter );
	angles.y = m_yawCenter + offsetY;
	angles.x = m_pitchCenter + offsetX;

	// Move toward target at rate or less
	float distY = UTIL_AngleDistance( angles.y, GetLocalAngles().y );

	QAngle vecAngVel = GetLocalAngularVelocity();
	vecAngVel.y = distY * 10;
	vecAngVel.y = clamp( vecAngVel.y, -m_yawRate, m_yawRate );

	// Move toward target at rate or less
	float distX = UTIL_AngleDistance( angles.x, GetLocalAngles().x );
	vecAngVel.x = distX  * 10;
	vecAngVel.x = clamp( vecAngVel.x, -m_pitchRate, m_pitchRate );
	SetLocalAngularVelocity( vecAngVel );

	SetMoveDoneTime( 0.1 );

	Vector forward;
	AngleVectors( GetLocalAngles(), &forward );
	forward = m_parentMatrix.ApplyRotation( forward );

	AngleVectors(angles, &forward);

	if ( lineOfSight == TRUE )
	{
		// FIXME: This will ultimately have to deal with NPCs being in the vehicle as well
//.........这里部分代码省略.........
开发者ID:paralin,项目名称:hl2sdk,代码行数:101,代码来源:point_apc_controller.cpp

示例11: IsOver

    bool ActiveWidget::AcceptInputCursor( const InputCursor &cur)
    {
        DBG_AcceptC
            int i;
        _cursor=cur.Position();
        _result=false;
        bool drag = false;
        bool was_over = IsOver(_cursor);

        if ( !IsActive() )
        {
            PointerIdle( _cursor, false );
            _was_over = was_over;
        }
        else if ( !IsOver(_cursor) || cur.Cond()==Widget::NORMAL )
        {
            for (i=0; i!=NUM_BUTTONS; ++i)
            {
                if (_mb_down[i]) { _result |= PointerMove(_cursor,i); drag=true; }
                if (_is_dragging[i]) { _result |= OnDrag[i].Send_3(_cursor,cur.Move(),_touch_pos[i]); }
            }
            if (!drag)
            {
                _result |= PointerIdle(_cursor, drag);
                _result |= WhileMoving.Schedule_3(_cursor,cur.Move(),_was_over);
            }
            _was_over = was_over; // prevent from changing shape "on-events"
        }
        else
        {
            if ( _was_over )
            {
                DBG_Text("------");
                for (i=0; i!=NUM_BUTTONS; ++i)
                {
                    if (_mb_down[i] && cur.Cond()==Widget::OFFSIDE ) 
                    { 
                        _result |= OnMoveOut[i].Schedule_1(_cursor); InputDecEager(this);
                        DBG_Text("MoveOut+");
                    }
                    else if ( cur.Cond()==Widget::INACTIVE )
                    {
                        if (_mb_down[i]) InputDecEager(this);
                        _is_dragging[i] = _mb_down[i] = false;
                        DBG_Text("ForceOut");
                    }
                }

                _result |= OnMoveOutside.Schedule_1(_cursor); HideHint();

                InputDecEager(this);
                _was_over = false;
                DBG_Text("OffSide");
            }

            if ( cur.Cond()==Widget::OFFSIDE )
            {
                _result |= WhileMoving.Schedule_3( _cursor, cur.Move(), _was_over);
            }
        }
        return ( _result = _was_over && (cur.Cond()==Widget::NORMAL) );
    }
开发者ID:BackupTheBerlios,项目名称:utgs-svn,代码行数:62,代码来源:ActiveWidget.cpp

示例12: switch

void GWindow::SetFocus(GViewI *ctrl, FocusType type)
{
	#if DEBUG_SETFOCUS
	const char *TypeName = NULL;
	switch (type)
	{
		case GainFocus: TypeName = "Gain"; break;
		case LoseFocus: TypeName = "Lose"; break;
		case ViewDelete: TypeName = "Delete"; break;
	}
	#endif

	switch (type)
	{
		case GainFocus:
		{
			if (d->Focus == ctrl)
			{
				#if DEBUG_SETFOCUS
				GAutoString _ctrl = DescribeView(ctrl);
				LgiTrace("SetFocus(%s, %s) already has focus.\n", _ctrl.Get(), TypeName);
				#endif
				return;
			}

			if (d->Focus)
			{
				GView *gv = d->Focus->GetGView();
				if (gv)
				{
					#if DEBUG_SETFOCUS
					GAutoString _foc = DescribeView(d->Focus);
					LgiTrace(".....defocus GView: %s\n", _foc.Get());
					#endif
					gv->_Focus(false);
				}
				else if (IsActive())
				{
					#if DEBUG_SETFOCUS
					GAutoString _foc = DescribeView(d->Focus);
					LgiTrace(".....defocus view: %s (active=%i)\n", _foc.Get(), IsActive());
					#endif
					d->Focus->OnFocus(false);
					d->Focus->Invalidate();
				}
			}

			d->Focus = ctrl;

			if (d->Focus)
			{
				GView *gv = d->Focus->GetGView();
				if (gv)
				{
					#if DEBUG_SETFOCUS
					GAutoString _set = DescribeView(d->Focus);
					LgiTrace("GWindow::SetFocus(%s, %s) focusing GView %p\n",
						_set.Get(),
						TypeName,
						d->Focus->Handle());
					#endif

					gv->_Focus(true);
				}
				else if (IsActive())
				{			
					#if DEBUG_SETFOCUS
					GAutoString _set = DescribeView(d->Focus);
					LgiTrace("GWindow::SetFocus(%s, %s) focusing nonGView %p (active=%i)\n",
						_set.Get(),
						TypeName,
						d->Focus->Handle(),
						IsActive());
					#endif

					d->Focus->OnFocus(true);
					d->Focus->Invalidate();
				}
			}
			break;
		}
		case LoseFocus:
		{
			#if DEBUG_SETFOCUS
			GAutoString _Ctrl = DescribeView(d->Focus);
			GAutoString _Focus = DescribeView(d->Focus);
			LgiTrace("GWindow::SetFocus(%s, %s) d->Focus=%s\n",
				_Ctrl.Get(),
				TypeName,
				_Focus.Get());
			#endif
			if (ctrl == d->Focus)
			{
				d->Focus = NULL;
			}
			break;
		}
		case ViewDelete:
		{
			if (ctrl == d->Focus)
//.........这里部分代码省略.........
开发者ID:FEI17N,项目名称:Lgi,代码行数:101,代码来源:GWindow.cpp

示例13: defined

    bool Call::AddParticipant(int peerId, std::string& peerName, bool bRemoteCall)
    {
        if(m_Observers.end() != m_Observers.find(peerId))
        {
            return false;
        }
        
        if(NULL != m_pEvtQ && true == bRemoteCall)
        {
            ThreadSafeMessageQueue::ParsedMessage event;
            event["type"] = "RemotePeerCall";
            event["message"] = peerName;
            m_pEvtQ->PostMessage(event);
        }
        
        
#if(defined(GOCAST_ENABLE_VIDEO) && defined(GOCAST_LINUX))
        if(false == IsActive())
        {

            std::string title = "me";
            m_pLocalRenderer = VideoRenderer::Create(
                                    
                                    title,
                                    GOCAST_DEFAULT_RENDER_WIDTH,
                                    GOCAST_DEFAULT_RENDER_HEIGHT
                               );
            if(false == m_pLocalRenderer->Init())
            {
                VideoRenderer::Destroy(m_pLocalRenderer);
                return false;
            }
            
            m_pMediaEngine->SetVideoCapture(true);
            m_pMediaEngine->SetLocalRenderer(m_pLocalRenderer);
        }
#endif

        m_Participants[peerId] = peerName;
        m_Observers[peerId] = new PeerConnectionObserver(
                                        m_pMsgQ,
                                        &m_pWorkerThread,
                                        &m_pPeerConnectionFactory
                                  );
        
        if(false == bRemoteCall)
        {
            if(false == m_Observers[peerId]->ConnectToPeer(peerId,peerName))
            {
                RemoveParticipant(peerId, true);
                return false;
            }
        }
        else
        {
            m_Observers[peerId]->SetPeerId(peerId);
            m_Observers[peerId]->SetPeerName(peerName);            
        }

        ListParticipants();
        
        return true;
    }
开发者ID:mweibel,项目名称:webrtc_plugin,代码行数:63,代码来源:WPLCall.cpp

示例14: render_background

void CMenus::OnRender()
{
	/*
	// text rendering test stuff
	render_background();

	CTextCursor cursor;
	TextRender()->SetCursor(&cursor, 10, 10, 20, TEXTFLAG_RENDER);
	TextRender()->TextEx(&cursor, "ようこそ - ガイド", -1);

	TextRender()->SetCursor(&cursor, 10, 30, 15, TEXTFLAG_RENDER);
	TextRender()->TextEx(&cursor, "ようこそ - ガイド", -1);
	
	//Graphics()->TextureSet(-1);
	Graphics()->QuadsBegin();
	Graphics()->QuadsDrawTL(60, 60, 5000, 5000);
	Graphics()->QuadsEnd();
	return;*/
	
	if(Client()->State() != IClient::STATE_ONLINE && Client()->State() != IClient::STATE_DEMOPLAYBACK)
		SetActive(true);

	if(Client()->State() == IClient::STATE_DEMOPLAYBACK)
	{
		CUIRect Screen = *UI()->Screen();
		Graphics()->MapScreen(Screen.x, Screen.y, Screen.w, Screen.h);
		RenderDemoPlayer(Screen);
	}
	
	if(Client()->State() == IClient::STATE_ONLINE && m_pClient->m_ServerMode == m_pClient->SERVERMODE_PUREMOD)
	{
		Client()->Disconnect();
		SetActive(true);
		m_Popup = POPUP_PURE;
	}
	
	if(!IsActive())
	{
		m_EscapePressed = false;
		m_EnterPressed = false;
		m_NumInputEvents = 0;
		return;
	}
	
	// update colors
	vec3 Rgb = HslToRgb(vec3(g_Config.m_UiColorHue/255.0f, g_Config.m_UiColorSat/255.0f, g_Config.m_UiColorLht/255.0f));
	ms_GuiColor = vec4(Rgb.r, Rgb.g, Rgb.b, g_Config.m_UiColorAlpha/255.0f);

	ms_ColorTabbarInactiveOutgame = vec4(0,0,0,0.25f);
	ms_ColorTabbarActiveOutgame = vec4(0,0,0,0.5f);

	float ColorIngameScaleI = 0.5f;
	float ColorIngameAcaleA = 0.2f;
	ms_ColorTabbarInactiveIngame = vec4(
		ms_GuiColor.r*ColorIngameScaleI,
		ms_GuiColor.g*ColorIngameScaleI,
		ms_GuiColor.b*ColorIngameScaleI,
		ms_GuiColor.a*0.8f);
	
	ms_ColorTabbarActiveIngame = vec4(
		ms_GuiColor.r*ColorIngameAcaleA,
		ms_GuiColor.g*ColorIngameAcaleA,
		ms_GuiColor.b*ColorIngameAcaleA,
		ms_GuiColor.a);
    
	// update the ui
	CUIRect *pScreen = UI()->Screen();
	float mx = (m_MousePos.x/(float)Graphics()->ScreenWidth())*pScreen->w;
	float my = (m_MousePos.y/(float)Graphics()->ScreenHeight())*pScreen->h;
		
	int Buttons = 0;
	if(m_UseMouseButtons)
	{
		if(Input()->KeyPressed(KEY_MOUSE_1)) Buttons |= 1;
		if(Input()->KeyPressed(KEY_MOUSE_2)) Buttons |= 2;
		if(Input()->KeyPressed(KEY_MOUSE_3)) Buttons |= 4;
	}
		
	UI()->Update(mx,my,mx*3.0f,my*3.0f,Buttons);
    
	// render
	if(Client()->State() != IClient::STATE_DEMOPLAYBACK)
		Render();

	// render cursor
	Graphics()->TextureSet(g_pData->m_aImages[IMAGE_CURSOR].m_Id);
	Graphics()->QuadsBegin();
	Graphics()->SetColor(1,1,1,1);
	IGraphics::CQuadItem QuadItem(mx, my, 24, 24);
	Graphics()->QuadsDrawTL(&QuadItem, 1);
	Graphics()->QuadsEnd();

	// render debug information
	if(g_Config.m_Debug)
	{
		CUIRect Screen = *UI()->Screen();
		Graphics()->MapScreen(Screen.x, Screen.y, Screen.w, Screen.h);

		char aBuf[512];
		str_format(aBuf, sizeof(aBuf), "%p %p %p", UI()->HotItem(), UI()->ActiveItem(), UI()->LastActiveItem());
//.........这里部分代码省略.........
开发者ID:wthnonck,项目名称:tdtw,代码行数:101,代码来源:menus.cpp

示例15: IsActive

// ----------------------------------------------------------------------------
// CObjectExchangeClient::IsBusy()
// True, if the client is performing some operation..
// ----------------------------------------------------------------------------
//
TBool CObjectExchangeClient::IsBusy()
    {
    return IsActive();
    }
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:9,代码来源:objectexchangeclient.cpp


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