/* The class */ Opal::Sip::EndPoint::EndPoint (Opal::EndPoint & _endpoint, const Ekiga::ServiceCore& _core): SIPEndPoint (_endpoint), core (_core) { /* Timeouts */ SetRetryTimeouts (500, 4000); SetMaxRetries (20); /* Update the User Agent */ SetUserAgent ("Ekiga/" PACKAGE_VERSION); /* Ready to take calls */ GetManager ().AddRouteEntry("sip:.* = pc:*"); GetManager ().AddRouteEntry("pc:.* = sip:<da>"); /* Keepalive */ PTimeInterval timeout; KeepAliveType type; GetKeepAlive (timeout, type); SetKeepAlive (timeout, KeepAliveByOPTION); }
/* virtual */ OP_STATUS OpScopeConsoleLogger::OnPostInitialization() { #ifdef SCOPE_WINDOW_MANAGER_SUPPORT if (OpScopeServiceManager *manager = GetManager()) window_manager = OpScopeFindService<OpScopeWindowManager>(manager, "window-manager"); if (!window_manager) return OpStatus::ERR_NULL_POINTER; #endif // SCOPE_WINDOW_MANAGER_SUPPORT return OpStatus::OK; }
void DisplayElement::SetManager (DisplayManager *pManager) { if (pManager != GetManager()) { DisplayManager *pOldManager = GetManager(); mManager.Set(pManager); if (pOldManager) { pOldManager->RemoveElementReferences(this); // remove all references to this element } // Propogate down the tree DisplayElement *pChild = mpFirstChild; while (pChild) { pChild->SetManager(pManager); pChild = pChild->mpNext; } } }
int CPluginWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) { if ( CMDIChildWnd::OnCreate( lpCreateStruct ) == -1 ) return -1; m_bAlert = 1982; OnSkinChange(); m_bAlert = FALSE; GetManager()->Add( this ); return 0; }
bool ButtonBase::OnMouseUp(float x, float y, int button) { if( GetManager()->GetCapture() == this ) { GetManager()->SetCapture(NULL); bool click = (GetState() == statePushed); WindowWeakPtr wwp(this); if( eventMouseUp ) INVOKE(eventMouseUp) (x, y); // handler may destroy this object if( click && wwp.Get() ) { OnClick(); // handler may destroy this object if( eventClick && wwp.Get() ) INVOKE(eventClick) (); // handler may destroy this object } if( wwp.Get() && GetEnabled() ) // handler may disable this button SetState(stateHottrack); return true; } return false; }
int ManagerList::GetConnectionRate(TargetType type) { int m, mgr_count, mgr_result; if (!(mgr_count = ManagerCount(type))) return AMBIGUOUS_VALUE; // Get the value of the first manager. mgr_result = GetManager(0, type)->GetConnectionRate(type); // Compare each manager's value with the first manager. for (m = 1; m < mgr_count; m++) { if (GetManager(m, type)->WorkerCount(type) && mgr_result != GetManager(m, type)->GetConnectionRate(type)) { // The values are not the same. return AMBIGUOUS_VALUE; } } // All managers have the same value. return mgr_result; }
void dAnimIKController::PreUpdate(dFloat timestep, int threadIndex) { // dAssert(0); // RigidBodyToStates(); if (m_animationTree) { m_animationTree->Update(timestep); } // m_solver.Update(timestep); // UpdateJointAcceleration(); dAnimIKManager* const manager = (dAnimIKManager*)GetManager(); manager->UpdatePlayer(this, timestep); }
// // Get the fallback placement // Placement * Placement::GetFallback() { if (fallback.Null()) { return (NULL); } else { LOG_AI(("Getting fallback '%s'", fallback.str)) return (&GetManager().GetPlacement(fallback)); } }
// // Verify that all assigned configuration parameters are valid. // BOOL ManagerList::InvalidSetup() { int m, w; Manager *mgr; Worker *wkr; BOOL nonidle_worker_with_targets = FALSE; BOOL all_workers_idle = TRUE; // Verify that at least one spec was assigned, even if Idle. if ( !GetMaxAccessSpecCount() ) { ErrorMessage( "You must assign at least one access specification " "to a worker." ); return TRUE; } // We need to loop through all workers of all managers to verify // their assigned specs are valid. for ( m = 0; m < ManagerCount(); m++ ) { mgr = GetManager( m ); if ( mgr->InvalidSetup() ) return TRUE; // Verify that at least one worker has targets assigned with a // non-idle spec or all specs are idle. for ( w = 0; w < mgr->WorkerCount(); w++ ) { wkr = mgr->GetWorker( w ); // Keep track if all workers have only the idle spec. if ( wkr->AccessSpecCount() != wkr->IdleAccessSpecCount() ) { all_workers_idle = FALSE; // Keep track if any non-idle worker has targets. if ( wkr->TargetCount() ) nonidle_worker_with_targets = TRUE; } } } // Verify that at least one worker has targets assigned with a // non-idle spec or all specs are idle. if ( !all_workers_idle && !nonidle_worker_with_targets ) { ErrorMessage( "If no worker has targets selected, then all workers " "must have the idle spec assigned." ); return TRUE; } return FALSE; }
bool ButtonBase::OnMouseDown(float x, float y, int button) { if( 1 == button ) // left button only { GetManager()->SetCapture(this); SetState(statePushed); if( eventMouseDown ) INVOKE(eventMouseDown) (x, y); return true; } return false; }
bool Iop::PowerOff( SsapiResponder *pResponder ){ if( m_serviceState ){ pResponder->RespondToRequest( SSAPI_EXCEPTION_INVALID_STATE, CTS_SSAPI_EXCEPTION_DEVICE_IN_SERVICE ); return true; } ((DeviceManager *)GetManager())->ChangeIopPowerState( this, true, pResponder ); return true; }
bool Iop::PowerOn( SsapiResponder *pResponder ){ if( !m_isLocked ){ pResponder->RespondToRequest( SSAPI_EXCEPTION_INVALID_STATE, CTS_SSAPI_EXCEPTION_DEVICE_NOT_LOCKED ); return true; } ((DeviceManager *)GetManager())->ChangeIopPowerState( this, false, pResponder ); return true; }
Dialog::Dialog(UIWindow *parent, float width, float height, bool modal) : UIWindow(/*modal ? new Substrate(parent) :*/ parent) , _mouseX(0) , _mouseY(0) , _easyMove(false) { SetTexture("ui/window", false); Resize(width, height); Move(std::floor((parent->GetWidth() - GetWidth()) / 2), std::floor((parent->GetHeight() - GetHeight()) / 2)); SetDrawBorder(true); SetDrawBackground(true); GetManager().SetFocusWnd(this); }
~ManagerMediator() { MT4Adapter::IntegrationMT4Server* manager = GetManager(); if (manager != NULL) { manager->UnInitialize(); } CloseHandle(_mutexHandle); _mutexHandle = NULL; gcHandle.Free(); }
// ok, this is a silly thing to do but it will work. void HTMLBodyDisplay::SetHtmlFocus (HTMLElement *pElement) { if (!GetManager()) { return; } if (!(mKeyCatcher1.mFlags & DISPLAY_FLAG_FOCUS) && (mKeyCatcher2.GetElement() != pElement)) { // this is the default case mKeyCatcher1.SetElement(pElement); GetManager()->SetFocus(&mKeyCatcher1); mKeyCatcher2.SetElement(0); } else if (!(mKeyCatcher2.mFlags & DISPLAY_FLAG_FOCUS) && (mKeyCatcher1.GetElement() != pElement)) { // give it to key catcher number 2 mKeyCatcher2.SetElement(pElement); GetManager()->SetFocus(&mKeyCatcher2); mKeyCatcher1.SetElement(0); } }
// // Retrieving a pointer to a specified worker item in the view. // HTREEITEM CWorkerView::GetWorker(Worker * worker) { HTREEITEM hworker; // Get the first worker. hworker = m_TWorkers.GetChildItem(GetManager(worker->manager)); // Loop through manager's workers until we find the correct one. while (m_TWorkers.GetItemData(hworker) != (DWORD_PTR) worker) hworker = m_TWorkers.GetNextSiblingItem(hworker); return hworker; }
// // Disambiguate same-named managers. This allows managers // to be uniquely identified in saved files and other places. // This should be called any time managers are added, removed, or renamed. // void ManagerList::IndexManagers() { Manager *mgr, *othermgr; int count_up, count_down; const int mgr_count = ManagerCount(); for (count_up = 0; count_up < mgr_count; count_up++) { mgr = GetManager(count_up); mgr->id = 1; // Assume this is unique, unless proven otherwise. for (count_down = count_up - 1; count_down >= 0; count_down--) { othermgr = GetManager(count_down); if (CString(mgr->name).CompareNoCase(othermgr->name) == 0) { // If the managers' names are identical, assign // this manager an ID value one greater. mgr->id = othermgr->id + 1; break; } } } }
bool CWebBrowserUI::DoCreateControl() { if (!CActiveXUI::DoCreateControl()) return false; GetManager()->AddTranslateAccelerator(this); GetControl(IID_IWebBrowser2,(LPVOID*)&m_pWebBrowser2); if ( m_bAutoNavi && !m_sHomePage.IsEmpty()) { this->Navigate2(m_sHomePage); } RegisterEventHandler(TRUE); return true; }
void CustomTriggerController::Init (NewtonCollision* const convexShape, const dMatrix& matrix, void* const userData) { m_userData = userData; NewtonWorld* const world = ((CustomTriggerManager*)GetManager())->GetWorld(); // create a trigger body and place in the scene m_body = NewtonCreateKinematicBody(world, convexShape, &matrix[0][0]); // set this shape do not collide with other bodies NewtonCollision* const collision = NewtonBodyGetCollision (m_body); NewtonCollisionSetMode(collision, 0); }
void Frame::OnClose(wxCloseEvent& event) { wxExFileDialog dlg(this, &m_Query->GetFile()); if (dlg.ShowModalIfChanged() == wxID_CANCEL) { return; } wxConfigBase::Get()->Write("Perspective", GetManager().SavePerspective()); event.Skip(); }
void MeshDrawer::Render() { Controller * ctrl = static_cast<Controller*>(GetManager()->Get("Controller")); DataManager * dm = static_cast<DataManager*>(GetManager()->Get("DataManager")); MeshShader * shader = static_cast<MeshShader*>((GetManager()->Get("Pipeline"))->Get("MeshWrapper")); Techniques * tech = static_cast<Techniques*>(dm->Get("Techniques")); EntityManager * entity_manager = static_cast<EntityManager*>(Get("EntityManager")); EntityPalette * entity_palette = static_cast<EntityPalette*>(Get("EntityPalette")); shader->SetSpecular(0.0f, 1.0f); if (tech->GetShadow()->OnShadowPass()) { glCullFace(GL_FRONT); entity_manager->Enable(); entity_palette->Enable(); glCullFace(GL_BACK); } else { entity_manager->Enable(); entity_palette->Enable(); } }
bool Opal::Sip::EndPoint::StartListener (unsigned port) { unsigned udp_min = GetManager ().GetUDPPortBase (); unsigned udp_max = GetManager ().GetUDPPortMax (); unsigned tcp_min = GetManager ().GetTCPPortBase (); unsigned tcp_max = GetManager ().GetTCPPortMax (); const std::string protocols[] = { "udp", "tcp", "" }; const unsigned ports[][2] = { { udp_min, udp_max }, { tcp_min, tcp_max } }; if (port > 0) { RemoveListener (NULL); for (int i = 0 ; !protocols[i].empty () ; i++) { std::stringstream str; str << protocols[i] << "$*:" << port; if (!StartListeners (PStringArray (str.str ()))) { port = ports[i][0]; while (port <= ports[i][1]) { str << protocols[i] << "$*:" << port; if (StartListeners (PStringArray (str.str ()))) { PTRACE (4, "Opal::Sip::EndPoint\tSet listen port to " << port << " (" << protocols[i] << ")"); break; } port++; } } else PTRACE (4, "Opal::Sip::EndPoint\tSet listen port to " << port << " (" << protocols[i] << ")"); } } return false; }
// // Save the manager/worker configuration to the specified stream. // save_aspecs --> should each worker's access spec assignments be saved? // save_targets --> should each worker's target assignments be saved? // BOOL ManagerList::SaveConfig(ostream & outfile, BOOL save_aspecs, BOOL save_targets) { int mgr_count = ManagerCount(); outfile << "'MANAGER LIST ==========================" "========================================" << endl; for (int counter = 0; counter < mgr_count; counter++) if (!GetManager(counter)->SaveConfig(outfile, save_aspecs, save_targets)) return FALSE; // error saving data - propagate back outfile << "'END manager list" << endl; return TRUE; }
WEBC_BOOL DisplayManager::ClaimPointer (DisplayElement *pElem) { if (!mpPointerOwner) { mpPointerOwner = pElem; if (GetManager()) { GetManager()->ClaimPointer(this); } else { if (mpGC) { mpGC->ClaimPointer(); } } return (1); } // someone else already has it return (0); }
int ManagerList::GetTransPerConn( TargetType type ) { int m, mgr_count, mgr_result; if ( !( mgr_count = ManagerCount( type ) ) ) return AMBIGUOUS_VALUE; // Get the value of the first manager. mgr_result = GetManager( 0, type )->GetTransPerConn( type ); // Compare each manager's value with the first manager, if it has any // workers of the specified type. for ( m = 1; m < mgr_count; m++ ) { if ( GetManager( m, type )->WorkerCount( type ) && mgr_result != GetManager( m, type )->GetTransPerConn( type ) ) { // The values are not the same. return AMBIGUOUS_VALUE; } } return mgr_result; }
void DisplayElement::GetDisplayPosition (DisplayElement *pChild, DISPLAY_INT *piX, DISPLAY_INT *piY) { if (pChild->mFlags & DISPLAY_FLAG_FIXED_POS) { if (GetManager()) { *piX = GetManager()->mViewRect.left + pChild->mRect.left; *piY = GetManager()->mViewRect.top + pChild->mRect.top; } } else { DISPLAY_INT x = 0, y = 0; if (mpParent) { mpParent->GetDisplayPosition(this, &x, &y); } *piX = pChild->mRect.left + x; *piY = pChild->mRect.top + y; } }
/*---------------------------------------------------------------------------*/ void HTMLBodyDisplay::GetSpecifiedHeight (DISPLAY_INT *heightValue, WEBC_BOOL *boolHeightIsAuto) { DisplayManager *manager = GetManager(); if (manager) { *heightValue = manager->mViewRect.Height(); *boolHeightIsAuto = 0; } else { *heightValue = 0; *boolHeightIsAuto = 1; } }
void CProgressUI::PaintStatusImage(HDC hDC) { if( m_nMax <= m_nMin ) m_nMax = m_nMin + 1; if( m_nValue > m_nMax ) m_nValue = m_nMax; if( m_nValue < m_nMin ) m_nValue = m_nMin; RECT rc = {0}; if( m_bHorizontal ) { rc.right = (m_nValue - m_nMin) * (m_rcItem.right - m_rcItem.left) / (m_nMax - m_nMin); rc.bottom = m_rcItem.bottom - m_rcItem.top; } else { rc.top = (m_rcItem.bottom - m_rcItem.top) * (m_nMax - m_nValue) / (m_nMax - m_nMin); rc.right = m_rcItem.right - m_rcItem.left; rc.bottom = m_rcItem.bottom - m_rcItem.top; } if( m_foreImage.IsLoadSuccess() ) { m_sForeImageModify.Empty(); int sw = MulDiv( rc.right - rc.left,100, GetManager()->GetDPIObj()->GetScale()); int sh = MulDiv(rc.bottom - rc.top,100, GetManager()->GetDPIObj()->GetScale()); rc.left = MulDiv(rc.left ,100 , GetManager()->GetDPIObj()->GetScale()); rc.top = MulDiv(rc.top , 100 , GetManager()->GetDPIObj()->GetScale()); rc.right = rc.left + sw; rc.bottom = rc.top + sh; if (m_bStretchForeImage) m_sForeImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rc.left, rc.top, rc.right, rc.bottom); else m_sForeImageModify.SmallFormat(_T("dest='%d,%d,%d,%d' source='%d,%d,%d,%d'") , rc.left, rc.top, rc.right, rc.bottom , rc.left, rc.top, rc.right, rc.bottom); DrawImage(hDC, m_foreImage, m_sForeImageModify); } }
HTMLEventStatus DisplayManager::SetFocus (DisplayElement *pFocus) { if (mpFocus != pFocus) { HTMLEvent e; DisplayElement *oldFocus = mpFocus; if (oldFocus) { oldFocus->ClearFlag(DISPLAY_FLAG_FOCUS); e.type = HTML_EVENT_UNFOCUS; if (oldFocus->Event(&e) == HTML_EVENT_STATUS_HALT) { return (HTML_EVENT_STATUS_HALT); } } if (pFocus) { e.type = HTML_EVENT_FOCUS; if (pFocus->Event(&e) == HTML_EVENT_STATUS_HALT) { return (HTML_EVENT_STATUS_HALT); } pFocus->SetFlag(DISPLAY_FLAG_FOCUS); } mpFocus = pFocus; if (GetManager()) { GetManager()->SetFocus(this); } } return (HTML_EVENT_STATUS_CONTINUE); }
Desktop::Desktop(LayoutManager* manager) : Window(NULL, manager) , _font(GetManager()->GetTextureManager()->FindSprite("font_default")) { SetTexture("ui/window", false); _msg = new MessageArea(this, 100, 100); _editor = new EditorLayout(this); _editor->SetVisible(false); _con = Console::Create(this, 10, 0, 100, 100, &GetConsole()); _con->eventOnSendCommand = std::bind( &Desktop::OnCommand, this, _1 ); _con->eventOnRequestCompleteCommand = std::bind( &Desktop::OnCompleteCommand, this, _1, _2, _3 ); _con->SetVisible(false); _con->SetTopMost(true); SpriteColor colors[] = {0xffffffff, 0xffff7fff}; _con->SetColors(colors, sizeof(colors) / sizeof(colors[0])); _con->SetHistory(&_history); _score = new ScoreTable(this); _score->SetVisible(false); _fps = new FpsCounter(this, 0, 0, alignTextLB); g_conf.ui_showfps.eventChange = std::bind(&Desktop::OnChangeShowFps, this); OnChangeShowFps(); _time = new TimeElapsed(this, 0, 0, alignTextRB); g_conf.ui_showtime.eventChange = std::bind(&Desktop::OnChangeShowTime, this); OnChangeShowTime(); if( g_conf.dbg_graph.Get() ) { float xx = 200; float yy = 3; float hh = 50; for( size_t i = 0; i < CounterBase::GetMarkerCountStatic(); ++i ) { Oscilloscope *os = new Oscilloscope(this, xx, yy); os->Resize(400, hh); os->SetRange(-1/15.0f, 1/15.0f); os->SetTitle(CounterBase::GetMarkerInfoStatic(i).title); CounterBase::SetMarkerCallbackStatic(i, CreateDelegate(&Oscilloscope::Push, os)); yy += hh+5; } } OnRawChar(VK_ESCAPE); // to invoke main menu dialog }