Code::Blocks  SVN r11506
Public Member Functions | List of all members
cbCompilerPlugin Class Referenceabstract

Base class for compiler plugins. More...

#include <cbplugin.h>

Inheritance diagram for cbCompilerPlugin:
Collaboration diagram for cbCompilerPlugin:

Public Member Functions

 cbCompilerPlugin ()
 
virtual int Run (ProjectBuildTarget *target=nullptr)=0
 Run the project/target. More...
 
virtual int Run (const wxString &target)=0
 Same as Run(ProjectBuildTarget*) but with a wxString argument. More...
 
virtual int Clean (ProjectBuildTarget *target=nullptr)=0
 Clean the project/target. More...
 
virtual int Clean (const wxString &target)=0
 Same as Clean(ProjectBuildTarget*) but with a wxString argument. More...
 
virtual int DistClean (ProjectBuildTarget *target=nullptr)=0
 DistClean the project/target. More...
 
virtual int DistClean (const wxString &target)=0
 Same as DistClean(ProjectBuildTarget*) but with a wxString argument. More...
 
virtual int Build (ProjectBuildTarget *target=nullptr)=0
 Build the project/target. More...
 
virtual int Build (const wxString &target)=0
 Same as Build(ProjectBuildTarget*) but with a wxString argument. More...
 
virtual int Rebuild (ProjectBuildTarget *target=nullptr)=0
 Rebuild the project/target. More...
 
virtual int Rebuild (const wxString &target)=0
 Same as Rebuild(ProjectBuildTarget*) but with a wxString argument. More...
 
virtual int BuildWorkspace (const wxString &target=wxEmptyString)=0
 Build all open projects. More...
 
virtual int RebuildWorkspace (const wxString &target=wxEmptyString)=0
 Rebuild all open projects. More...
 
virtual int CleanWorkspace (const wxString &target=wxEmptyString)=0
 Clean all open projects. More...
 
virtual int CompileFile (const wxString &file)=0
 Compile a specific file. More...
 
virtual int KillProcess ()=0
 Abort the current build process. More...
 
virtual bool IsRunning () const =0
 Is the plugin currently compiling? More...
 
virtual int GetExitCode () const =0
 Get the exit code of the last build process. More...
 
virtual int Configure (cbProject *project, ProjectBuildTarget *target=nullptr)=0
 Display configuration dialog. More...
 
- Public Member Functions inherited from cbPlugin
 cbPlugin ()
 In default cbPlugin's constructor the associated PluginInfo structure is filled with default values. More...
 
 ~cbPlugin () override
 cbPlugin destructor. More...
 
virtual PluginType GetType () const
 The plugin must return its type on request. More...
 
virtual int GetConfigurationPriority () const
 Return the plugin's configuration priority. More...
 
virtual int GetConfigurationGroup () const
 Return the configuration group for this plugin. More...
 
virtual cbConfigurationPanelGetConfigurationPanel (cb_optional wxWindow *parent)
 Return plugin's configuration panel. More...
 
virtual cbConfigurationPanelGetProjectConfigurationPanel (cb_optional wxWindow *parent, cb_optional cbProject *project)
 Return plugin's configuration panel for projects. More...
 
virtual void BuildMenu (cb_optional wxMenuBar *menuBar)
 This method is called by Code::Blocks and is used by the plugin to add any menu items it needs on Code::Blocks's menu bar. More...
 
virtual void BuildModuleMenu (cb_optional const ModuleType type, cb_optional wxMenu *menu, cb_optional const FileTreeData *data=nullptr)
 This method is called by Code::Blocks core modules (EditorManager, ProjectManager etc) and is used by the plugin to add any menu items it needs in the module's popup menu. More...
 
virtual bool BuildToolBar (cb_optional wxToolBar *toolBar)
 This method is called by Code::Blocks and is used by the plugin to add any toolbar items it needs on Code::Blocks's toolbar. More...
 
virtual int GetToolBarPriority ()
 This method return the priority of the plugin's toolbar, the less value indicates a more preceding position when C::B starts with no configuration file. More...
 
virtual void CreateStatusField (cbStatusBar *statusBar)
 This method is called by Code::Blocks and is used by the plugin to add a field on Code::Blocks's statusbar. More...
 
bool IsAttached () const
 See whether this plugin is attached or not. More...
 
virtual bool CanDetach () const
 See whether this plugin can be detached (unloaded) or not. More...
 

Additional Inherited Members

- Protected Member Functions inherited from cbPlugin
virtual void OnAttach ()
 Any descendent plugin should override this virtual method and perform any necessary initialization. More...
 
virtual void OnRelease (cb_optional bool appShutDown)
 Any descendent plugin should override this virtual method and perform any necessary de-initialization. More...
 
virtual void NotImplemented (const wxString &log) const
 This method logs a "Not implemented" message and is provided for convenience only. More...
 
- Protected Attributes inherited from cbPlugin
PluginType m_Type
 Holds the plugin's type. More...
 
bool m_IsAttached
 Holds the "attached" state. More...
 

Detailed Description

Base class for compiler plugins.

This plugin type must offer some pre-defined build facilities, on top of the generic plugin's.

Definition at line 263 of file cbplugin.h.

Constructor & Destructor Documentation

◆ cbCompilerPlugin()

cbCompilerPlugin::cbCompilerPlugin ( )

Definition at line 118 of file cbplugin.cpp.

References cbPlugin::m_Type, and ptCompiler.

Member Function Documentation

◆ Build() [1/2]

virtual int cbCompilerPlugin::Build ( ProjectBuildTarget target = nullptr)
pure virtual

Build the project/target.

Parameters
targetThe specific build target to build. If NULL, it builds all the targets of the current project.

Implemented in CompilerGCC.

Referenced by CodeBlocksApp::BatchJob(), and cbDebuggerPlugin::EnsureBuildUpToDate().

◆ Build() [2/2]

virtual int cbCompilerPlugin::Build ( const wxString target)
pure virtual

Same as Build(ProjectBuildTarget*) but with a wxString argument.

Implemented in CompilerGCC.

◆ BuildWorkspace()

virtual int cbCompilerPlugin::BuildWorkspace ( const wxString target = wxEmptyString)
pure virtual

Build all open projects.

Parameters
targetIf not empty, the target to build in each project. Else all targets.

Implemented in CompilerGCC.

Referenced by CodeBlocksApp::BatchJob().

◆ Clean() [1/2]

virtual int cbCompilerPlugin::Clean ( ProjectBuildTarget target = nullptr)
pure virtual

Clean the project/target.

Cleaning a project means deleting any files created by building it. This includes any object files, the binary output file, etc.

Parameters
targetThe specific build target to "clean". If NULL, it cleans all the build targets of the current project.

Implemented in CompilerGCC.

Referenced by CodeBlocksApp::BatchJob().

◆ Clean() [2/2]

virtual int cbCompilerPlugin::Clean ( const wxString target)
pure virtual

Same as Clean(ProjectBuildTarget*) but with a wxString argument.

Implemented in CompilerGCC.

◆ CleanWorkspace()

virtual int cbCompilerPlugin::CleanWorkspace ( const wxString target = wxEmptyString)
pure virtual

Clean all open projects.

Parameters
targetIf not empty, the target to clean in each project. Else all targets.

Implemented in CompilerGCC.

Referenced by CodeBlocksApp::BatchJob().

◆ CompileFile()

virtual int cbCompilerPlugin::CompileFile ( const wxString file)
pure virtual

Compile a specific file.

Parameters
fileThe file to compile (must be a project file!)

Implemented in CompilerGCC.

◆ Configure()

virtual int cbCompilerPlugin::Configure ( cbProject project,
ProjectBuildTarget target = nullptr 
)
pure virtual

Display configuration dialog.

Parameters
projectThe selected project (can be NULL).
targetThe selected target (can be NULL).

Implemented in CompilerGCC.

Referenced by ProjectOptionsDlg::OnProjectBuildOptionsClick(), and ProjectOptionsDlg::OnTargetBuildOptionsClick().

◆ DistClean() [1/2]

virtual int cbCompilerPlugin::DistClean ( ProjectBuildTarget target = nullptr)
pure virtual

DistClean the project/target.

DistClean will typically remove any config files and anything else that got created as part of building a software package.

Parameters
targetThe specific build target to "distclean". If NULL, it cleans all the build targets of the current project.

Implemented in CompilerGCC.

◆ DistClean() [2/2]

virtual int cbCompilerPlugin::DistClean ( const wxString target)
pure virtual

Same as DistClean(ProjectBuildTarget*) but with a wxString argument.

Implemented in CompilerGCC.

◆ GetExitCode()

virtual int cbCompilerPlugin::GetExitCode ( ) const
pure virtual

Get the exit code of the last build process.

Implemented in CompilerGCC.

Referenced by CodeBlocksApp::OnBatchBuildDone(), and cbDebuggerPlugin::OnCompilerFinished().

◆ IsRunning()

virtual bool cbCompilerPlugin::IsRunning ( ) const
pure virtual

Is the plugin currently compiling?

Implemented in CompilerGCC.

Referenced by cbDebuggerPlugin::EnsureBuildUpToDate().

◆ KillProcess()

virtual int cbCompilerPlugin::KillProcess ( )
pure virtual

Abort the current build process.

Implemented in CompilerGCC.

◆ Rebuild() [1/2]

virtual int cbCompilerPlugin::Rebuild ( ProjectBuildTarget target = nullptr)
pure virtual

Rebuild the project/target.

Rebuilding a project is equal to calling Clean() and then Build(). This makes sure that all compilable files in the project will be compiled again.

Parameters
targetThe specific build target to rebuild. If NULL, it rebuilds all the build targets of the current project.

Implemented in CompilerGCC.

Referenced by CodeBlocksApp::BatchJob().

◆ Rebuild() [2/2]

virtual int cbCompilerPlugin::Rebuild ( const wxString target)
pure virtual

Same as Rebuild(ProjectBuildTarget*) but with a wxString argument.

Implemented in CompilerGCC.

◆ RebuildWorkspace()

virtual int cbCompilerPlugin::RebuildWorkspace ( const wxString target = wxEmptyString)
pure virtual

Rebuild all open projects.

Parameters
targetIf not empty, the target to rebuild in each project. Else all targets.

Implemented in CompilerGCC.

Referenced by CodeBlocksApp::BatchJob().

◆ Run() [1/2]

virtual int cbCompilerPlugin::Run ( ProjectBuildTarget target = nullptr)
pure virtual

Run the project/target.

Running a project means executing its build output. Of course this depends on the selected build target and its type.

Parameters
targetThe specific build target to "run". If NULL, the plugin should ask the user which target to "run" (except maybe if there is only one build target in the project).

Implemented in CompilerGCC.

◆ Run() [2/2]

virtual int cbCompilerPlugin::Run ( const wxString target)
pure virtual

Same as Run(ProjectBuildTarget*) but with a wxString argument.

Implemented in CompilerGCC.


The documentation for this class was generated from the following files: