void DrawPolygon(clipper::Polygons &pgs) { glColor4f(0.0f, 0.0f, 0.0f, 0.4f); GLUtesselator* tess = gluNewTess(); gluTessCallback(tess, GLU_TESS_BEGIN, (void (CALLBACK*)())&BeginCallback); gluTessCallback(tess, GLU_TESS_VERTEX, (void (CALLBACK*)())&VertexCallback); gluTessCallback(tess, GLU_TESS_END, (void (CALLBACK*)())&EndCallback); gluTessCallback(tess, GLU_TESS_COMBINE, (void (CALLBACK*)())&CombineCallback); gluTessCallback(tess, GLU_TESS_ERROR, (void (CALLBACK*)())&ErrorCallback); gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_NONZERO); gluTessProperty(tess, GLU_TESS_BOUNDARY_ONLY, GL_FALSE); gluTessBeginPolygon(tess, NULL); for (clipper::Polygons::size_type i = 0; i < pgs.size(); ++i) { gluTessBeginContour(tess); for (clipper::Polygon::size_type j = 0; j < pgs[i].size(); ++j) { GLdouble *vert = new GLdouble[3]; vert[0] = (GLdouble)pgs[i][j].X; vert[1] = (GLdouble)pgs[i][j].Y; vert[2] = 0; AddToCleanup(vert); gluTessVertex(tess, vert, vert); } gluTessEndContour(tess); } gluTessEndPolygon(tess); DoCleanup(); glColor4f(0.0f, 0.0f, 0.0f, 0.4f); glLineWidth(1.2f); gluTessProperty(tess, GLU_TESS_BOUNDARY_ONLY, GL_TRUE); //GL_FALSE gluTessBeginPolygon(tess, NULL); for (clipper::Polygons::size_type i = 0; i < pgs.size(); ++i) { gluTessBeginContour(tess); for (clipper::Polygon::size_type j = 0; j < pgs[i].size(); ++j) { GLdouble *vert = new GLdouble[3]; vert[0] = (GLdouble)pgs[i][j].X; vert[1] = (GLdouble)pgs[i][j].Y; vert[2] = 0; AddToCleanup(vert); gluTessVertex(tess, vert, vert); } gluTessEndContour(tess); } gluTessEndPolygon(tess); //final cleanup ... gluDeleteTess(tess); DoCleanup(); }
CT_EntryData::~CT_EntryData() /** * Destructor. */ { DoCleanup(); }
send_job( V2_PROC *proc, char *host ) #endif { int reason, retval, sd1, sd2; dprintf( D_FULLDEBUG, "Shadow: Entering send_job()\n" ); /* starter 0 - Regular starter */ /* starter 1 - PVM starter */ retval = part_send_job(0, host, reason, GlobalCap, schedd, proc, sd1, sd2, NULL); if (retval == -1) { DoCleanup(); dprintf( D_ALWAYS, "********** Shadow Exiting(%d) **********\n", reason); exit( reason ); } if( sd1 != RSC_SOCK ) { ASSERT(dup2(sd1, RSC_SOCK) >= 0); (void)close(sd1); } dprintf( D_ALWAYS, "Shadow: RSC_SOCK connected, fd = %d\n", RSC_SOCK ); if( sd2 != CLIENT_LOG ) { ASSERT(dup2(sd2, CLIENT_LOG) >= 0); (void)close(sd2); } dprintf( D_ALWAYS, "Shadow: CLIENT_LOG connected, fd = %d\n", CLIENT_LOG ); sock_RSC1 = RSC_ShadowInit( RSC_SOCK, CLIENT_LOG ); }
void ZoomNavigator::DoUpdate() { // sanity tests CHECK_CONDITION(m_enabled); CHECK_CONDITION(!m_mgr->IsShutdownInProgress()); IEditor* curEditor = m_mgr->GetActiveEditor(); if(!curEditor && !m_text->IsEmpty()) { DoCleanup(); } CHECK_CONDITION(curEditor); wxStyledTextCtrl* stc = curEditor->GetCtrl(); CHECK_CONDITION(stc); if(curEditor->GetFileName().GetFullPath() != m_curfile) { SetEditorText(curEditor); } int first = stc->GetFirstVisibleLine(); int last = stc->LinesOnScreen() + first; if(m_markerFirstLine != first || m_markerLastLine != last) { PatchUpHighlights(first, last); SetZoomTextScrollPosToMiddle(stc); } }
void tesselate(const std::vector<std::vector<Point2f> >& pgs, bool evenodd = true) { GLUtesselator* tess = internal_gluNewTess(); internal_gluTessCallback(tess, GLU_TESS_BEGIN_DATA, (void (*)())&BeginCallback_s); internal_gluTessCallback(tess, GLU_TESS_VERTEX_DATA, (void (*)())&VertexCallback_s); internal_gluTessCallback(tess, GLU_TESS_END_DATA, (void (*)())&EndCallback_s); internal_gluTessCallback(tess, GLU_TESS_COMBINE_DATA, (void (*)())&CombineCallback_s); internal_gluTessCallback(tess, GLU_TESS_ERROR_DATA, (void (*)())&ErrorCallback_s); internal_gluTessCallback(tess, GLU_TESS_EDGE_FLAG_DATA, (void (*)())&EdgeCallback_s); if (evenodd) internal_gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_ODD); else internal_gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_NONZERO); internal_gluTessProperty(tess, GLU_TESS_BOUNDARY_ONLY, 0); //GL_FALSE internal_gluTessBeginPolygon(tess, this); for (std::size_t i = 0; i < pgs.size(); ++i) { internal_gluTessBeginContour(tess); for (std::size_t j = 0; j < pgs[i].size(); ++j) { GLdouble *vert = new GLdouble[3]; vert[0] = (GLdouble)pgs[i][j].x; vert[1] = (GLdouble)pgs[i][j].y; vert[2] = 0; AddToCleanup(vert); internal_gluTessVertex(tess, vert, vert); } internal_gluTessEndContour(tess); } internal_gluTessEndPolygon(tess); DoCleanup(); internal_gluDeleteTess(tess); }
DLLMapInfo::~DLLMapInfo() { if (m_ulCount != 0) { DoCleanup(); } }
void LLDBPlugin::OnLLDBExited(LLDBEvent& event) { event.Skip(); m_connector.SetGoingDown(true); // Stop the debugger ( do not notify about it, since we are in the handler...) m_connector.Cleanup(); // Save current perspective before destroying the session if(m_isPerspectiveLoaded) { m_mgr->SavePerspective("LLDB-debugger"); // Restore the old perspective m_mgr->LoadPerspective("Default"); m_isPerspectiveLoaded = false; } DestroyUI(); // Reset various state variables DoCleanup(); CL_DEBUG("CODELITE>> LLDB exited"); // Also notify codelite's event clDebugEvent e2(wxEVT_DEBUG_ENDED); EventNotifier::Get()->AddPendingEvent(e2); { clDebugEvent e(wxEVT_DEBUG_ENDED); EventNotifier::Get()->AddPendingEvent(e); } }
void CT_EntryArrayData::DoCmdDelete() /** * Deletes TEntryArray class instance */ { DoCleanup(); }
void CT_EntryData::SetObjectL( TAny* aAny ) /** * Set the wrapped data object with new value */ { DoCleanup(); iEntry = static_cast<TEntry*> ( aAny ); }
void DbgGdb::OnProcessEnd( wxCommandEvent &e ) { ProcessEventData *ped = ( ProcessEventData * )e.GetClientData(); delete ped; DoCleanup(); m_observer->UpdateGotControl( DBG_EXITED_NORMALLY ); }
bool LLDBPlugin::DoInitializeDebugger(clDebugEvent& event, bool redirectOutput, const wxString& terminalTitle) { if(event.GetDebuggerName() != LLDB_DEBUGGER_NAME) { event.Skip(); return false; } if(m_connector.IsRunning()) { // Another debug session is already in progress ::wxMessageBox(_("Another debug session is already in progress. Please stop it first"), "CodeLite", wxOK | wxCENTER | wxICON_WARNING); return false; } TerminateTerminal(); // If terminal is required, launch it now bool isWindows = wxPlatformInfo::Get().GetOperatingSystemId() & wxOS_WINDOWS; if(redirectOutput && !isWindows) { wxString realPts; ::LaunchTerminalForDebugger( terminalTitle.IsEmpty() ? event.GetExecutableName() : terminalTitle, m_terminalTTY, realPts, m_terminalPID); if(m_terminalPID != wxNOT_FOUND) { CL_DEBUG("Successfully launched terminal"); } else { // Failed to launch it... DoCleanup(); ::wxMessageBox(_("Failed to start terminal for debugger"), "CodeLite", wxICON_ERROR | wxOK | wxCENTER); return false; } } // Launch local server if needed LLDBSettings settings; settings.Load(); if(!settings.IsUsingRemoteProxy() && !m_connector.LaunchLocalDebugServer()) { DoCleanup(); return false; } return true; }
// Handle CTRL+BREAK or CTRL+C events BOOL ConsoleCtrlHandler(DWORD dwEvent) { UNREFERENCED_PARAMETER( dwEvent ); DoCleanup(); printf("Server terminated. Bye!\n"); return FALSE; }
void ClangDriver::OnTUCreateError(wxCommandEvent& e) { e.Skip(); ClangThreadReply* reply = reinterpret_cast<ClangThreadReply*>(e.GetClientData()); if(reply) { DoDeleteTempFile(reply->filename); wxDELETE(reply); } DoCleanup(); }
// ----------------------------------------------------------------------------- // CSIPPrflStateBase::HandleError() // (other items were commented in a header). // ----------------------------------------------------------------------------- // void CSIPPrflStateBase::HandleError( MSIPProfileContext& aContext, TInt aError, CSIPPrflStateBase* aNextState) { __ASSERT_DEBUG(aContext.Profile()!=0, User::Invariant()); TUint32 contextId(0); CSIPConcreteProfile& profile = DoCleanup(aContext,contextId); aContext.SetNextState(*aNextState); aContext.AgentObserver().SIPProfileErrorEvent(profile,aError); }
/* Connect to the startd on the remote host and gracefully vacate our claim. */ void send_vacate( char *host, char *capability ) { if( send_cmd_to_startd( host, capability, DEACTIVATE_CLAIM ) < 0 ) { dprintf( D_ALWAYS, "Shadow: Can't connect to condor_startd on %s\n", host ); DoCleanup(); dprintf( D_ALWAYS, "********** Shadow Parent Exiting(%d) **********\n", JOB_NOT_STARTED ); exit( JOB_NOT_STARTED ); } }
/***************************************************************** * * method :void CEasyReport::Start(void) * * parameters : none * * returns : * * description: Start the report generation. Create all the fonts, etc * Try and get the printer device context, If no printer is set up as * the default printer on the system, create a screen device context. * ****************************************************************/ void CEasyReport::Start() { ASSERT( m_PrinterDC == NULL ); DoCleanup(); // set up a print date .. CTime aNow = CTime::GetCurrentTime(); m_ReportDate.Format("Date: %2d/%2d/%4d", aNow.GetMonth(), aNow.GetDay(), aNow.GetYear()); // NOTE: The following is most certainly not correct if there is // no default printer defined ! If you do not have ANY printer, then // you might install a Fax printer (eg Microsoft Fax or Bitware etc) CPrintDialog aPD(false); if(aPD.GetDefaults()) { m_PrinterDC = aPD.m_pd.hDC; } else { m_PrinterDC = ::GetDC(NULL); // get the screen device context } //::SetMapMode(m_PrinterDC, MM_ANISOTROPIC); //::SetWindowExtEx( m_PrinterDC, 254,254,NULL); //::SetViewportExtEx(m_PrinterDC, GetDeviceCaps(m_PrinterDC,LOGPIXELSX),GetDeviceCaps(m_PrinterDC,LOGPIXELSY),NULL); SetMapMode( m_PrinterDC, MM_LOMETRIC); SetupTextStyles( m_PrinterDC ); m_DataTop = m_TopMargin; m_PageCount = 0; m_CurPage = 0; CRect aRect; // Write the report header... if( m_ReportHdrHt > 0 ) { aRect.SetRect(m_LeftMargin, m_TopMargin, m_PageWidth - m_RightMargin,m_TopMargin + m_ReportHdrHt ); aRect.bottom = aRect.top + m_ReportHdrHt; WriteReportHeader(aRect); m_DataTop += m_ReportHdrHt; } if( m_PageHdrHt > 0) { aRect.SetRect(m_LeftMargin, m_DataTop, m_PageWidth - m_RightMargin, m_DataTop + m_PageHdrHt); WritePageHeader(aRect); m_DataTop += m_PageHdrHt; } }
void LLDBTooltip::Show(const wxString& displayName, LLDBVariable::Ptr_t variable) { DoCleanup(); wxTreeItemId item = m_treeCtrl->AddRoot( variable->ToString(displayName), wxNOT_FOUND, wxNOT_FOUND, new LLDBVariableClientData(variable)); if(variable->HasChildren()) { m_treeCtrl->AppendItem(item, "<dummy>"); } Move(::wxGetMousePosition()); wxPopupWindow::Show(); m_treeCtrl->SetFocus(); }
void CAsyncRequest::MarkForDeletion() /** Mark this outstanding request for deletion, so it is cleaned up when the cleanup AO runs. */ { DoCleanup(); // The deletion is processed at priority CActive::EPriorityHigh, // so should happen ahead of any pending or new requests. CAsyncCallBack* acb = iSession->iServer.iAsyncCleanup; acb->CallBack(); // no effect if already queued iSession = NULL; // mark for deletion }
extern "C" void WINAPI Cleanup() { #ifdef NEED_LOG OutputDebugString(_T("XD:void WINAPI Cleanup()")); #endif //EnterCriticalSection(&_Module.m_csStaticDataInit); if( g_bIsRunning == true ) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); DoCleanup(); g_bIsRunning = false; } //LeaveCriticalSection(&_Module.m_csStaticDataInit); }
void LLDBPlugin::OnDebugQuickDebug(clDebugEvent& event) { #ifdef __WXMSW__ ::wxMessageBox( _("Quick Debug with LLDB is not supported under Windows"), "CodeLite", wxOK | wxCENTER | wxICON_WARNING); return; #endif if(!DoInitializeDebugger(event, true)) { return; } LLDBConnectReturnObject retObj; LLDBSettings settings; settings.Load(); if(m_connector.Connect(retObj, settings, 5)) { // Apply the environment EnvSetter env; // Get list of breakpoints and add them ( we will apply them later on ) BreakpointInfo::Vec_t gdbBps; m_mgr->GetAllBreakpoints(gdbBps); // remove all breakpoints from previous session m_connector.DeleteAllBreakpoints(); // apply the serialized breakpoints // In 'Quick Debug' we stop on main m_connector.AddBreakpoint("main"); m_connector.AddBreakpoints(gdbBps); LLDBCommand startCommand; startCommand.FillEnvFromMemory(); startCommand.SetExecutable(event.GetExecutableName()); startCommand.SetCommandArguments(event.GetArguments()); startCommand.SetWorkingDirectory(event.GetWorkingDirectory()); startCommand.SetStartupCommands(event.GetStartupCommands()); startCommand.SetRedirectTTY(m_terminalTTY); m_connector.Start(startCommand); } else { // Failed to connect, notify and perform cleanup DoCleanup(); wxString message; message << _("Could not connect to codelite-lldb at '") << m_connector.GetConnectString() << "'"; ::wxMessageBox(message, "CodeLite", wxICON_ERROR | wxOK | wxCENTER); return; } }
void LLDBPlugin::OnDebugAttachToProcess(clDebugEvent& event) { if(event.GetDebuggerName() != LLDB_DEBUGGER_NAME) { event.Skip(); return; } #ifdef __WXMSW__ ::wxMessageBox( _("Attach to process with LLDB is not supported under Windows"), "CodeLite", wxOK | wxCENTER | wxICON_WARNING); return; #endif wxString terminalTitle; terminalTitle << "Console PID " << event.GetInt(); if(!DoInitializeDebugger(event, true, terminalTitle)) return; LLDBConnectReturnObject retObj; LLDBSettings settings; settings.Load(); if(m_connector.Connect(retObj, settings, 5)) { // Apply the environment EnvSetter env; // remove all breakpoints from previous session m_connector.DeleteAllBreakpoints(); LLDBSettings settings; settings.Load(); // Attach to the process LLDBCommand command; command.SetCommandType(kCommandAttachProcess); command.SetProcessID(event.GetInt()); command.SetSettings(settings); m_connector.AttachProcessWithPID(command); } else { // Failed to connect, notify and perform cleanup DoCleanup(); wxString message; message << _("Could not connect to codelite-lldb at '") << m_connector.GetConnectString() << "'"; ::wxMessageBox(message, "CodeLite", wxICON_ERROR | wxOK | wxCENTER); return; } }
void LLDBPlugin::OnDebugCoreFile(clDebugEvent& event) { if(event.GetDebuggerName() != LLDB_DEBUGGER_NAME) { event.Skip(); return; } #ifdef __WXMSW__ ::wxMessageBox( _("Debug core file with LLDB is not supported under Windows"), "CodeLite", wxOK | wxCENTER | wxICON_WARNING); return; #endif if(!DoInitializeDebugger(event, false)) { return; } LLDBConnectReturnObject retObj; LLDBSettings settings; settings.Load(); if(m_connector.Connect(retObj, settings, 5)) { // Apply the environment EnvSetter env; // remove all breakpoints from previous session m_connector.DeleteAllBreakpoints(); LLDBCommand startCommand; startCommand.FillEnvFromMemory(); startCommand.SetCommandType(kCommandDebugCoreFile); startCommand.SetExecutable(event.GetExecutableName()); startCommand.SetCorefile(event.GetCoreFile()); startCommand.SetWorkingDirectory(event.GetWorkingDirectory()); startCommand.SetRedirectTTY(m_terminalTTY); m_connector.OpenCoreFile(startCommand); } else { // Failed to connect, notify and perform cleanup DoCleanup(); wxString message; message << _("Could not connect to codelite-lldb at '") << m_connector.GetConnectString() << "'"; ::wxMessageBox(message, "CodeLite", wxICON_ERROR | wxOK | wxCENTER); return; } }
void ZoomNavigator::OnSettingsChanged(wxCommandEvent& e) { e.Skip(); m_config->Reload(); znConfigItem data; if(m_config->ReadItem(&data)) { m_enabled = data.IsEnabled(); if(!m_enabled) { // Clear selection m_text->UpdateText(NULL); } else { DoCleanup(); DoUpdate(); } } }
HXBOOL DLLMapInfo::OnUnload() { HXBOOL bRet = FALSE; HX_ASSERT(m_ulCount); if (m_ulCount > 0) { m_ulCount--; if (m_ulCount == 0) { DoCleanup(); bRet = TRUE; } } return bRet; }
BOOL CtrlHandler(DWORD fdwCtrlType) { switch (fdwCtrlType) { // Handle the CTRL+C signal. case CTRL_C_EVENT: case CTRL_CLOSE_EVENT: case CTRL_BREAK_EVENT: case CTRL_LOGOFF_EVENT: case CTRL_SHUTDOWN_EVENT: { //APPF_EVENT("DoCleanup"); DoCleanup(); Sleep(1000); return FALSE; } default: return FALSE; } }
void CT_EntryData::DoCmdNew( const TDesC& aSection ) /** Creates new TEntry class instance */ { DoCleanup(); TPtrC entryObjectName; if( GET_OPTIONAL_STRING_PARAMETER( KParamObject, aSection, entryObjectName ) ) { INFO_PRINTF1( _L( "Create new TEntry(TEntry) class instance." ) ); TEntry* entryObject = NULL; TRAPD( err, entryObject = (TEntry*)GetDataObjectL(entryObjectName)); if ( err == KErrNone ) { TRAPD( err, iEntry = new (ELeave) TEntry(*entryObject) ); if ( err != KErrNone ) { ERR_PRINTF2( _L( "new TEntry(TEntry) error %d" ), err ); SetError( err ); } } else { ERR_PRINTF3( _L( "Unrecognized object name parameter value: %S. Error %d"), &entryObjectName, err ); SetBlockResult( EFail ); } } else { INFO_PRINTF1( _L( "Create new TEntry() class instance." ) ); TRAPD( err, iEntry = new (ELeave) TEntry() ); if ( err!=KErrNone ) { ERR_PRINTF2( _L( "new TEntry() error %d" ), err ); SetError( err ); } } }
void LLDBThreadsView::OnLLDBStopped(LLDBEvent& event) { event.Skip(); DoCleanup(); // Update the thread view const LLDBThread::Vect_t& threads = event.GetThreads(); for(size_t i = 0; i < threads.size(); ++i) { const LLDBThread& thr = threads.at(i); if(thr.IsActive()) { m_selectedThread = i; } wxVector<wxVariant> cols; cols.push_back(thr.GetId() == wxNOT_FOUND ? wxString() : wxString() << thr.GetId()); cols.push_back(thr.GetName()); cols.push_back(thr.GetStopReasonString()); cols.push_back(thr.GetFunc()); cols.push_back(m_plugin->GetFilenameForDisplay(thr.GetFile())); cols.push_back(thr.GetLine() == wxNOT_FOUND ? wxString() : wxString() << thr.GetLine()); m_dvListCtrlThreads->AppendItem(cols, (wxUIntPtr) new LLDBThreadViewClientData(thr)); } if((wxNOT_FOUND != m_selectedThread) && ((int)m_dvListCtrlThreads->GetItemCount() > m_selectedThread)) { const auto item = m_dvListCtrlThreads->RowToItem(m_selectedThread); if(item.IsOk()) { m_dvListCtrlThreads->EnsureVisible(item); } } }
/***************************************************************** * * method :CEasyReport::~CEasyReport() * * parameters : * * returns : * * description: Destructor. Clean up the resources we allocated. * ****************************************************************/ CEasyReport::~CEasyReport() { DoCleanup(); }
TBool CT_EntryData::DoCommandL( const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/) /** * Process a command read from the ini file * * @param aCommand the command to process * @param aSection the entry in the ini file requiring the command to be processed * * @return ETrue if the command is processed */ { TBool retVal = ETrue; if ( aCommand == KCmdAssignmentOperator ) { DoCmdAssignmentOperatorL( aSection ); } else if ( aCommand == KCmdIndexOperator ) { DoCmdIndexOperator( aSection ); } else if ( aCommand == KCmdDelete ) { DoCleanup(); } else if ( aCommand == KCmdIsArchive ) { DoCmdIsArchive( aSection ); } else if ( aCommand == KCmdIsDir ) { DoCmdIsDir( aSection ); } else if ( aCommand == KCmdIsHidden ) { DoCmdIsHidden( aSection ); } else if ( aCommand == KCmdIsReadOnly ) { DoCmdIsReadOnly( aSection ); } else if ( aCommand == KCmdIsSystem ) { DoCmdIsSystem( aSection ); } else if ( aCommand == KCmdIsTypeValid ) { DoCmdIsTypeValid( aSection ); } else if ( aCommand == KCmdIsUidPresent ) { DoCmdIsUidPresent( aSection ); } else if ( aCommand == KCmdMostDerivedUid ) { DoCmdMostDerived( aSection ); } else if ( aCommand == KCmdNew ) { DoCmdNew( aSection ); } else if ( aCommand == KCmdSetAttribute ) { DoCmdSetAttribute( aSection ); } else { retVal = EFalse; } return retVal; }
int ExceptCleanup(int, int, const char *buf) { log_except(buf); return DoCleanup(); }