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); }
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 ); }
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 ); }
void DifficultyMeter::SetFromTrail( const Trail* pTrail ) { if( pTrail == NULL ) { Unset(); return; } CourseDifficulty cd = pTrail->m_CourseDifficulty; SetInternal( pTrail->GetMeter(), cd, GetCourseDifficultyCommandName( cd ), CString() ); }
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() ); }
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); } }
/* ============ idCVarSystemLocal::SetCVarFloat ============ */ void idCVarSystemLocal::SetCVarFloat( const char *name, const float value, int flags ) { SetInternal( name, idStr( value ), flags ); }
/* ============ idCVarSystemLocal::SetCVarBool ============ */ void idCVarSystemLocal::SetCVarBool( const char *name, const bool value, int flags ) { SetInternal( name, idStr( value ), flags ); }
/* ============ idCVarSystemLocal::SetCVarString ============ */ void idCVarSystemLocal::SetCVarString( const char *name, const char *value, int flags ) { SetInternal( name, value, flags ); }
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; }
String::String(LPCTSTR Value) { SetInternal(Value); }
void String::Set(LPCTSTR Value) { delete[] Buffer; SetInternal(Value); }
void DifficultyMeter::SetFromMeterAndCourseDifficulty( int iMeter, CourseDifficulty cd ) { SetInternal( 0, cd, GetCourseDifficultyCommandName(cd), CString() ); }
void DifficultyMeter::SetFromMeterAndDifficulty( int iMeter, Difficulty dc ) { SetInternal( 0, dc, GetDifficultyCommandName(dc), CString() ); }
void DifficultyMeter::Unset() { SetInternal( 0, DIFFICULTY_EDIT, DIFFICULTY_COMMAND_NAME_NONE, CString() ); }
void StepsDisplay::SetFromStepsTypeAndMeterAndDifficultyAndCourseType( StepsType st, int iMeter, Difficulty dc, CourseType ct ) { SetParams params = { NULL, NULL, iMeter, st, dc, ct }; SetInternal( params ); }
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 ); }