BOOL
WINAPI
StSynchronizationEvent_Set (
    __inout PST_SYNCHRONIZATION_EVENT Event
)
{

    if (SetInternal(Event)) {

        //
        // The event was set to the signalled state. So, if there waiters,
        // try to lock the event's queue and, if we succeed, release
        // the appropriate waiters.
        //

        if (IsReleasePending(Event)) {
            ReleaseWaitersAndUnlockQueue(Event, FALSE);
        }

        //
        // Return the previous state of the event.
        //

        return FALSE;
    }

    //
    // The event is already set. In order to decide if this set
    // is ignored or not, we must lock event queue's and take
    // into account the waiters.
    //

    LockLockedQueue(&Event->Queue, NULL);
    return ReleaseWaitersAndUnlockQueue(Event, TRUE);
}
예제 #2
0
void StepsDisplay::SetFromTrail( const Trail* pTrail )
{
	if( pTrail == NULL )
	{
		Unset();
		return;
	}

	SetParams params = { NULL, pTrail, pTrail->GetMeter(), pTrail->m_StepsType, pTrail->m_CourseDifficulty, pTrail->m_CourseType };
	SetInternal( params );
}
예제 #3
0
void StepsDisplay::SetFromSteps( const Steps* pSteps )
{
	if( pSteps == NULL )
	{
		Unset();
		return;
	}

	SetParams params = { pSteps, NULL, pSteps->GetMeter(), pSteps->m_StepsType, pSteps->GetDifficulty(), CourseType_Invalid };
	SetInternal( params );
}
예제 #4
0
void DifficultyMeter::SetFromTrail( const Trail* pTrail )
{
	if( pTrail == NULL )
	{
		Unset();
		return;
	}

	CourseDifficulty cd = pTrail->m_CourseDifficulty;
	SetInternal( pTrail->GetMeter(), cd, GetCourseDifficultyCommandName( cd ), CString() );
}
예제 #5
0
void DifficultyMeter::SetFromSteps( const Steps* pSteps )
{
	if( pSteps == NULL )
	{
		Unset();
		return;
	}

	Difficulty dc = pSteps->GetDifficulty();
	SetInternal( pSteps->GetMeter(), dc, GetDifficultyCommandName(dc), dc == DIFFICULTY_EDIT ? pSteps->GetDescription() : CString() );
}
예제 #6
0
void String::Append(LPCTSTR Value)
{
    if (Buffer == NULL)
    {
        SetInternal(Value);
    }
    else
    {
        int Len = (int) strlen(Value);
        if (Size + Len > BufSize)
        {
            //realloc
            BufSize = max(Size+Len, Size*2);
            LPTSTR NewBuf = new TCHAR[BufSize+1];
            memcpy(NewBuf, Buffer, Size);
            delete[] Buffer;
            Buffer = NewBuf;
        }
        strcpy(&Buffer[Size], Value);
    }
}
예제 #7
0
/*
============
idCVarSystemLocal::SetCVarFloat
============
*/
void idCVarSystemLocal::SetCVarFloat( const char *name, const float value, int flags ) {
	SetInternal( name, idStr( value ), flags );
}
예제 #8
0
/*
============
idCVarSystemLocal::SetCVarBool
============
*/
void idCVarSystemLocal::SetCVarBool( const char *name, const bool value, int flags ) {
	SetInternal( name, idStr( value ), flags );
}
예제 #9
0
/*
============
idCVarSystemLocal::SetCVarString
============
*/
void idCVarSystemLocal::SetCVarString( const char *name, const char *value, int flags ) {
	SetInternal( name, value, flags );
}
예제 #10
0
bool CD3DScrollBar::LoadFromXml(xml_node * pXMLNode)
{
	if(_tcsnicmp(pXMLNode->name(),_T("ScrollBar"),10)!=0)
		return false;
	if(pXMLNode->has_attribute(_T("Name")))
		SetName(pXMLNode->attribute(_T("Name")).getvalue());

	if(pXMLNode->has_attribute(_T("ID")))
		SetID((long)pXMLNode->attribute(_T("ID")));

	if(pXMLNode->has_attribute(_T("IsInternal")))
		SetInternal((bool)pXMLNode->attribute(_T("IsInternal")));


	for(int i=0;i<(int)pXMLNode->children();i++)
	{
		if(_tcsnicmp(pXMLNode->child(i).name(),_T("Behavior"),9)==0)
		{
			LoadBehaviorFromXML(pXMLNode->child(i));
			if(pXMLNode->child(i).has_attribute(_T("ScrollRange")))
				SetMaxScrollPos((long)pXMLNode->child(i).attribute(_T("ScrollRange")));
			if(pXMLNode->child(i).has_attribute(_T("Style")))
				SetScrollStyle((long)pXMLNode->child(i).attribute(_T("Style")));
		}
		else if(_tcsnicmp(pXMLNode->child(i).name(),_T("Frame"),6)==0)
		{
			LoadFrameFromXML(pXMLNode->child(i));
		}
		else if(_tcsnicmp(pXMLNode->child(i).name(),_T("Borders"),8)==0)
		{
			LoadBorderFromXML(pXMLNode->child(i));
		}		
		else if(_tcsnicmp(pXMLNode->child(i).name(),_T("Texture"),8)==0)
		{
			LoadTextureFromXML(pXMLNode->child(i));
		}
	}
	HandleMessage(this,WM_D3DGUI_WND_LOADED,GetID(),(LPARAM)this);

	//装载子窗口
	for(int i=(int)pXMLNode->children()-1;i>=0;i--)
	{
		if(_tcsnicmp(pXMLNode->child(i).name(),_T("Childs"),7)==0)
		{
			LoadChildsFromXml(pXMLNode->child(i));
			break;
		}
	}
	

	for(int i=(int)m_ChildWndList.GetCount()-1;i>=0;i--)
	{
		if(m_ChildWndList[i]->IsInternal()&&
			m_ChildWndList[i]->IsKindOf(GET_CLASS_INFO(CD3DButton))&&
			(_tcscmp(m_ChildWndList[i]->GetName(),_T("SBDec"))==0)&&
			m_ChildWndList[i]!=m_pDecButton)
		{
			CD3DButton * pButton=(CD3DButton *)m_ChildWndList[i];
			SAFE_RELEASE(m_pDecButton);
			m_pDecButton=pButton;
		}
		else if(m_ChildWndList[i]->IsInternal()&&
			m_ChildWndList[i]->IsKindOf(GET_CLASS_INFO(CD3DButton))&&
			(_tcscmp(m_ChildWndList[i]->GetName(),_T("SBInc"))==0)&&
			m_ChildWndList[i]!=m_pIncButton)
		{
			CD3DButton * pButton=(CD3DButton *)m_ChildWndList[i];
			SAFE_RELEASE(m_pIncButton);
			m_pIncButton=pButton;
		}
		else if(m_ChildWndList[i]->IsInternal()&&
			m_ChildWndList[i]->IsKindOf(GET_CLASS_INFO(CD3DButton))&&
			(_tcscmp(m_ChildWndList[i]->GetName(),_T("SBTrack"))==0)&&
			m_ChildWndList[i]!=m_pTrackButton)
		{
			CD3DButton * pButton=(CD3DButton *)m_ChildWndList[i];
			SAFE_RELEASE(m_pTrackButton);
			m_pTrackButton=pButton;
		}
	}
	TopChild(true);
	HandleMessage(this,WM_D3DGUI_CHILD_LOADED,GetID(),(LPARAM)this);
	return true;
}
예제 #11
0
String::String(LPCTSTR Value)
{
    SetInternal(Value);
}
예제 #12
0
void String::Set(LPCTSTR Value)
{
    delete[] Buffer;
    SetInternal(Value);
}
예제 #13
0
void DifficultyMeter::SetFromMeterAndCourseDifficulty( int iMeter, CourseDifficulty cd )
{
	SetInternal( 0, cd, GetCourseDifficultyCommandName(cd), CString() );
}
예제 #14
0
void DifficultyMeter::SetFromMeterAndDifficulty( int iMeter, Difficulty dc )
{
	SetInternal( 0, dc, GetDifficultyCommandName(dc), CString() );
}
예제 #15
0
void DifficultyMeter::Unset()
{
	SetInternal( 0, DIFFICULTY_EDIT, DIFFICULTY_COMMAND_NAME_NONE, CString() );
}
예제 #16
0
void StepsDisplay::SetFromStepsTypeAndMeterAndDifficultyAndCourseType( StepsType st, int iMeter, Difficulty dc, CourseType ct )
{
	SetParams params = { NULL, NULL, iMeter, st, dc, ct };
	SetInternal( params );
}
예제 #17
0
bool CD3DProgressBar::LoadFromXml(xml_node * pXMLNode)
{
	if(_tcsnicmp(pXMLNode->name(),_T("ProgressBar"),10)!=0)
		return false;
	if(pXMLNode->has_attribute(_T("Name")))
		SetName(pXMLNode->attribute(_T("Name")).getvalue());

	if(pXMLNode->has_attribute(_T("ID")))
		SetID((long)pXMLNode->attribute(_T("ID")));

	if(pXMLNode->has_attribute(_T("IsInternal")))
		SetInternal((bool)pXMLNode->attribute(_T("IsInternal")));


	for(int i=0;i<(int)pXMLNode->children();i++)
	{
		if(_tcsnicmp(pXMLNode->child(i).name(),_T("Behavior"),9)==0)
		{
			LoadBehaviorFromXML(pXMLNode->child(i));
			if(pXMLNode->child(i).has_attribute(_T("Style")))
				SetProgressStyle((long)pXMLNode->child(i).attribute(_T("Style")));
			if(pXMLNode->child(i).has_attribute(_T("WorkMode")))
				SetWorkMode((long)pXMLNode->child(i).attribute(_T("WorkMode")));
			if(pXMLNode->child(i).has_attribute(_T("MaxPos")))
				SetMaxPos((long)pXMLNode->child(i).attribute(_T("MaxPos")));
			if(pXMLNode->child(i).has_attribute(_T("CurPos")))
				SetPos((long)pXMLNode->child(i).attribute(_T("CurPos")));
			
		}
		else if(_tcsnicmp(pXMLNode->child(i).name(),_T("Frame"),6)==0)
		{
			LoadFrameFromXML(pXMLNode->child(i));
		}
		else if(_tcsnicmp(pXMLNode->child(i).name(),_T("Borders"),8)==0)
		{
			LoadBorderFromXML(pXMLNode->child(i));
		}		
		else if(_tcsnicmp(pXMLNode->child(i).name(),_T("Texture"),8)==0)
		{
			LoadTextureFromXML(pXMLNode->child(i));
		}
	}
	HandleMessage(this,WM_D3DGUI_WND_LOADED,GetID(),(LPARAM)this);

	//装载子窗口
	for(int i=(int)pXMLNode->children()-1;i>=0;i--)
	{
		if(_tcsnicmp(pXMLNode->child(i).name(),_T("Childs"),7)==0)
		{
			LoadChildsFromXml(pXMLNode->child(i));
			break;
		}
	}

	for(int i=(int)m_ChildWndList.GetCount()-1;i>=0;i--)
	{
		if(m_ChildWndList[i]->IsInternal()&&
			m_ChildWndList[i]->IsKindOf(GET_CLASS_INFO(CD3DWnd))&&
			(_tcscmp(m_ChildWndList[i]->GetName(),_T("PBBarWnd"))==0)&&
			m_ChildWndList[i]!=m_pBarWnd)
		{
			CD3DWnd * pWnd=(CD3DWnd *)m_ChildWndList[i];
			SAFE_RELEASE(m_pBarWnd);
			m_pBarWnd=pWnd;
		}		
	}
	TopChild(true);
	HandleMessage(this,WM_D3DGUI_CHILD_LOADED,GetID(),(LPARAM)this);
	return true;
}
void WorkoutGraph::SetFromCurrentWorkout()
{
	SetInternal( 0 );
}