SymbolViewPlugin::SymbolViewPlugin(IManager *manager) : IPlugin(manager) { m_longName = _("Outline Plugin"); m_shortName = wxT("Outline"); OutlineSettings os; os.Load(); Notebook *book = m_mgr->GetWorkspacePaneNotebook(); if( IsPaneDetached() ) { // Make the window child of the main panel (which is the grand parent of the notebook) DockablePane *cp = new DockablePane(book->GetParent()->GetParent(), book, _("Outline"), wxNullBitmap, wxSize(200, 200)); m_view = new OutlineTab(cp, m_mgr); cp->SetChildNoReparent(m_view); } else { m_view = new OutlineTab(book, m_mgr); book->AddPage(m_view, _("Outline"), false); } }
DatabaseExplorer::DatabaseExplorer(IManager *manager) : IPlugin(manager) , m_addFileMenu(true) { // create tab (possibly detached) Notebook *book = m_mgr->GetWorkspacePaneNotebook(); wxWindow *editorBook = m_mgr->GetEditorPaneNotebook(); m_mgr->GetTheApp()->Connect(XRCID("erd_open"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(DatabaseExplorer::OnOpenWithDBE), NULL, this); m_mgr->GetTheApp()->Connect(XRCID("erd_open"), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DatabaseExplorer::OnUpdateOpenWithDBE), NULL, this); EventNotifier::Get()->Connect(wxEVT_TREE_ITEM_FILE_ACTIVATED, wxCommandEventHandler(DatabaseExplorer::OnOpenWithDBE), NULL, this); if( IsDbViewDetached() ) { DockablePane *cp = new DockablePane(book->GetParent()->GetParent(), book, wxT("DbExplorer"), wxNullBitmap, wxSize(200, 200)); m_dbViewerPanel = new DbViewerPanel(cp, editorBook, m_mgr ); cp->SetChildNoReparent(m_dbViewerPanel); } else { m_dbViewerPanel = new DbViewerPanel(book, editorBook, m_mgr ); //size_t index = GetSettings().GetSvnTabIndex(); //if(index == Notebook::npos) book->AddPage(m_dbViewerPanel, wxT("DbExplorer"), false); //else // book->InsertPage(index, m_dbViewerPanel, svnCONSOLE_TEXT, false); } // configure autolayout algorithns wxSFAutoLayout layout; wxSFLayoutHorizontalTree *pHTreeAlg = wxDynamicCast( layout.GetAlgorithm( wxT("Horizontal Tree") ), wxSFLayoutHorizontalTree ); if( pHTreeAlg ) pHTreeAlg->SetHSpace( 200 ); wxSFLayoutVerticalTree *pVTreeAlg = wxDynamicCast( layout.GetAlgorithm( wxT("Vertical Tree") ), wxSFLayoutVerticalTree ); if( pVTreeAlg ) pVTreeAlg->SetVSpace( 75 ); m_longName = _("DatabaseExplorer for CodeLite"); m_shortName = wxT("DatabaseExplorer"); }
CMakePlugin::CMakePlugin(IManager* manager) : IPlugin(manager) , m_configuration(NULL) , m_cmake(NULL) { m_longName = _("CMake integration with CodeLite"); m_shortName = "CMakePlugin"; // Create CMake configuration file m_configuration.reset(new CMakeConfiguration( clStandardPaths::Get().GetUserDataDir() + wxFileName::GetPathSeparator() + "config/cmake.ini")); // Create cmake application m_cmake.reset(new CMake(m_configuration->GetProgramPath())); Notebook* book = m_mgr->GetWorkspacePaneNotebook(); cmakeImages images; const wxBitmap& bmp = images.Bitmap("cmake_16"); if(IsPaneDetached()) { DockablePane* cp = new DockablePane(book->GetParent()->GetParent(), book, HELP_TAB_NAME, false, bmp, wxSize(200, 200)); m_helpTab = new CMakeHelpTab(cp, this); cp->SetChildNoReparent(m_helpTab); } else { m_helpTab = new CMakeHelpTab(book, this); book->AddPage(m_helpTab, HELP_TAB_NAME, false, bmp); m_mgr->AddWorkspaceTab(HELP_TAB_NAME); } // Bind events EventNotifier::Get()->Bind(wxEVT_SHOW_WORKSPACE_TAB, &CMakePlugin::OnToggleHelpTab, this); EventNotifier::Get()->Bind(wxEVT_CONTEXT_MENU_PROJECT, &CMakePlugin::OnProjectContextMenu, this); EventNotifier::Get()->Bind(wxEVT_CONTEXT_MENU_WORKSPACE, &CMakePlugin::OnWorkspaceContextMenu, this); EventNotifier::Get()->Bind(wxEVT_PROJ_FILE_ADDED, &CMakePlugin::OnFileAdded, this); EventNotifier::Get()->Bind(wxEVT_PROJ_FILE_REMOVED, &CMakePlugin::OnFileRemoved, this); Bind(wxEVT_ASYNC_PROCESS_OUTPUT, &CMakePlugin::OnCMakeOutput, this); Bind(wxEVT_ASYNC_PROCESS_TERMINATED, &CMakePlugin::OnCMakeTerminated, this); }
CMakePlugin::CMakePlugin(IManager* manager) : IPlugin(manager) , m_configuration(NULL) , m_cmake(NULL) , m_settingsManager(new CMakeSettingsManager(this)) , m_panel(NULL) { m_longName = _("CMake integration with CodeLite"); m_shortName = "CMakePlugin"; // Create CMake configuration file m_configuration.reset(new CMakeConfiguration(wxStandardPaths::Get(). GetUserDataDir() + wxFileName::GetPathSeparator() + "config/cmake.ini") ); // Create cmake application m_cmake.reset(new CMake(m_configuration->GetProgramPath())); Notebook* book = m_mgr->GetWorkspacePaneNotebook(); cmakeImages images; const wxBitmap &bmp = images.Bitmap("cmake_16"); if (IsPaneDetached()) { DockablePane* cp = new DockablePane(book->GetParent()->GetParent(), book, HELP_TAB_NAME, bmp, wxSize(200, 200)); cp->SetChildNoReparent(new CMakeHelpTab(cp, this)); } else { book->AddPage(new CMakeHelpTab(book, this), HELP_TAB_NAME, false, bmp); } // Bind events EventNotifier::Get()->Bind(wxEVT_CMD_PROJ_SETTINGS_SAVED, wxCommandEventHandler(CMakePlugin::OnSaveConfig), this); EventNotifier::Get()->Bind(wxEVT_GET_PROJECT_BUILD_CMD, clBuildEventHandler(CMakePlugin::OnGetBuildCommand), this); EventNotifier::Get()->Bind(wxEVT_GET_PROJECT_CLEAN_CMD, clBuildEventHandler(CMakePlugin::OnGetCleanCommand), this); EventNotifier::Get()->Bind(wxEVT_GET_IS_PLUGIN_MAKEFILE, clBuildEventHandler(CMakePlugin::OnGetIsPluginMakefile), this); EventNotifier::Get()->Bind(wxEVT_PLUGIN_EXPORT_MAKEFILE, clBuildEventHandler(CMakePlugin::OnExportMakefile), this); EventNotifier::Get()->Bind(wxEVT_WORKSPACE_LOADED, wxCommandEventHandler(CMakePlugin::OnWorkspaceLoaded), this); }
void ZoomNavigator::DoInitialize() { znConfigItem data; if(m_config->ReadItem(&data)) { m_enabled = data.IsEnabled(); } // create tab (possibly detached) Notebook* book = m_mgr->GetWorkspacePaneNotebook(); if(IsZoomPaneDetached()) { // Make the window child of the main panel (which is the grand parent of the notebook) DockablePane* cp = new DockablePane( book->GetParent()->GetParent(), book, ZOOM_PANE_TITLE, false, wxNullBitmap, wxSize(200, 200)); zoompane = new wxPanel(cp); cp->SetChildNoReparent(zoompane); } else { zoompane = new wxPanel(book); book->AddPage(zoompane, ZOOM_PANE_TITLE, false); } m_mgr->AddWorkspaceTab(ZOOM_PANE_TITLE); m_text = new ZoomText(zoompane); m_text->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(ZoomNavigator::OnPreviewClicked), NULL, this); m_text->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(ZoomNavigator::OnPreviewClicked), NULL, this); m_text->SetCursor(wxCURSOR_POINT_LEFT); wxBoxSizer* bs = new wxBoxSizer(wxVERTICAL); bs->Add(m_text, 1, wxEXPAND, 0); wxCheckBox* cbEnablePlugin = new wxCheckBox(zoompane, wxID_ANY, _("Enable plugin")); cbEnablePlugin->SetValue(data.IsEnabled()); bs->Add(cbEnablePlugin, 0, wxEXPAND); cbEnablePlugin->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ZoomNavigator::OnEnablePlugin), NULL, this); zoompane->SetSizer(bs); }
PhpPlugin::PhpPlugin(IManager* manager) : IPlugin(manager) , m_clangOldFlag(false) , m_browser(NULL) , m_debuggerPane(NULL) , m_xdebugLocalsView(NULL) , m_xdebugEvalPane(NULL) , m_showWelcomePage(false) { m_longName = wxT("PHP Plugin for the codelite IDE"); m_shortName = wxT("PHP"); // Instantiate the bitmaps, we do this so they will be populated in wxXmlResource // Sigleton class PHPImages images; PHPWorkspace::Get()->SetPluginManager(m_mgr); XDebugManager::Initialize(this); // Add our UI // create tab (possibly detached) Notebook* book = m_mgr->GetWorkspacePaneNotebook(); if(IsWorkspaceViewDetached()) { // Make the window child of the main panel (which is the grand parent of the notebook) DockablePane* cp = new DockablePane( book->GetParent()->GetParent(), book, PHPStrings::PHP_WORKSPACE_VIEW_TITLE, wxNullBitmap, wxSize(200, 200)); m_workspaceView = new PHPWorkspaceView(cp, m_mgr); cp->SetChildNoReparent(m_workspaceView); } else { m_workspaceView = new PHPWorkspaceView(book, m_mgr); book->InsertPage(0, m_workspaceView, PHPStrings::PHP_WORKSPACE_VIEW_TITLE, true); } PHPCodeCompletion::Instance()->SetManager(m_mgr); PHPEditorContextMenu::Instance()->ConnectEvents(); PHPParserThread::Instance()->Start(); // Pass the manager class to the context menu manager PHPEditorContextMenu::Instance()->SetManager(m_mgr); // Connect events EventNotifier::Get()->Connect( wxEVT_CC_SHOW_QUICK_OUTLINE, clCodeCompletionEventHandler(PhpPlugin::OnShowQuickOutline), NULL, this); EventNotifier::Get()->Connect( wxEVT_DBG_UI_DELTE_ALL_BREAKPOINTS, clDebugEventHandler(PhpPlugin::OnXDebugDeleteAllBreakpoints), NULL, this); EventNotifier::Get()->Connect( wxEVT_CMD_CREATE_NEW_WORKSPACE, wxCommandEventHandler(PhpPlugin::OnNewWorkspace), NULL, this); EventNotifier::Get()->Connect( wxEVT_NEW_PROJECT_WIZARD_SHOWING, clNewProjectEventHandler(PhpPlugin::OnNewProject), NULL, this); EventNotifier::Get()->Connect( wxEVT_NEW_PROJECT_WIZARD_FINISHED, clNewProjectEventHandler(PhpPlugin::OnNewProjectFinish), NULL, this); EventNotifier::Get()->Connect( wxEVT_CMD_IS_WORKSPACE_OPEN, clCommandEventHandler(PhpPlugin::OnIsWorkspaceOpen), NULL, this); EventNotifier::Get()->Connect( wxEVT_CMD_CLOSE_WORKSPACE, clCommandEventHandler(PhpPlugin::OnCloseWorkspace), NULL, this); EventNotifier::Get()->Connect( wxEVT_CMD_OPEN_WORKSPACE, clCommandEventHandler(PhpPlugin::OnOpenWorkspace), NULL, this); EventNotifier::Get()->Connect( wxEVT_CMD_RELOAD_WORKSPACE, clCommandEventHandler(PhpPlugin::OnReloadWorkspace), NULL, this); EventNotifier::Get()->Connect( wxEVT_CMD_OPEN_RESOURCE, wxCommandEventHandler(PhpPlugin::OnOpenResource), NULL, this); EventNotifier::Get()->Connect( wxEVT_CMD_GET_WORKSPACE_FILES, wxCommandEventHandler(PhpPlugin::OnGetWorkspaceFiles), NULL, this); EventNotifier::Get()->Connect(wxEVT_CMD_GET_CURRENT_FILE_PROJECT_FILES, wxCommandEventHandler(PhpPlugin::OnGetCurrentFileProjectFiles), NULL, this); EventNotifier::Get()->Connect( wxEVT_CMD_GET_ACTIVE_PROJECT_FILES, wxCommandEventHandler(PhpPlugin::OnGetActiveProjectFiles), NULL, this); EventNotifier::Get()->Connect( wxEVT_CMD_GET_FIND_IN_FILES_MASK, clCommandEventHandler(PhpPlugin::OnGetFiFMask), NULL, this); EventNotifier::Get()->Connect(wxEVT_FILE_SAVED, clCommandEventHandler(PhpPlugin::OnFileSaved), NULL, this); EventNotifier::Get()->Connect(wxEVT_PHP_LOAD_URL, PHPEventHandler(PhpPlugin::OnLoadURL), NULL, this); EventNotifier::Get()->Connect( wxEVT_ALL_EDITORS_CLOSED, wxCommandEventHandler(PhpPlugin::OnAllEditorsClosed), NULL, this); EventNotifier::Get()->Bind(wxEVT_XDEBUG_CONNECTED, &PhpPlugin::OnDebugSatrted, this); EventNotifier::Get()->Bind(wxEVT_XDEBUG_SESSION_ENDED, &PhpPlugin::OnDebugEnded, this); EventNotifier::Get()->Connect(wxEVT_GOING_DOWN, clCommandEventHandler(PhpPlugin::OnGoingDown), NULL, this); CallAfter(&PhpPlugin::DoCreateDebuggerPanes); // Extract all CC files from PHP.zip into the folder ~/.codelite/php-plugin/cc wxFileName phpResources(clStandardPaths::Get().GetDataDir(), "PHP.zip"); if(phpResources.Exists()) { clZipReader zipReader(phpResources); wxFileName targetDir(clStandardPaths::Get().GetUserDataDir(), ""); targetDir.AppendDir("php-plugin"); // Don't extract the zip if one of the files on disk is newer or equal to the zip timestamp wxFileName fnSampleFile(targetDir.GetPath(), "basic.php"); fnSampleFile.AppendDir("cc"); if(!fnSampleFile.Exists() || // the sample file does not exists // Or the resource file (PHP.zip) is newer than the sample file (phpResources.GetModificationTime().GetTicks() > fnSampleFile.GetModificationTime().GetTicks())) { targetDir.Mkdir(wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL); zipReader.Extract("*", targetDir.GetPath()); // Make sure we add this path to the general PHP settings targetDir.AppendDir("cc"); // the CC files are located under an internal folder named "cc" (lowercase) PHPConfigurationData config; if(config.Load().GetCcIncludePath().Index(targetDir.GetPath()) == wxNOT_FOUND) { config.Load().GetCcIncludePath().Add(targetDir.GetPath()); config.Save(); } } } else { CL_WARNING("PHP: Could not locate PHP resources 'PHP.zip' => '%s'", phpResources.GetFullPath()); } }