Code::Blocks
SVN r11506
|
#include <cbplugin.h>
Public Member Functions | |
cbSmartIndentPlugin () | |
virtual void | OnEditorHook (cbEditor *editor, wxScintillaEvent &event) const =0 |
When this is called, the smartIndent mechanism must get to work ;). More... | |
virtual void | OnCCDone (cb_unused cbEditor *ed) |
This is called after a code completion operation finishes. 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 cbConfigurationPanel * | GetConfigurationPanel (cb_optional wxWindow *parent) |
Return plugin's configuration panel. More... | |
virtual cbConfigurationPanel * | GetProjectConfigurationPanel (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... | |
Protected Member Functions | |
void | OnAttach () override |
Any descendent plugin should override this virtual method and perform any necessary initialization. More... | |
void | OnRelease (bool appShutDown) override |
wxString | GetLastNonCommentWord (cbEditor *ed, int position=-1, unsigned int NumberOfWords=1) const |
(reverse) search for the last word which is not comment More... | |
wxString | GetLastNonWhitespaceChars (cbEditor *ed, int position=-1, unsigned int NumberOfChars=1) const |
(reverse) search for the last characters, which are not whitespace and not comment More... | |
wxChar | GetLastNonWhitespaceChar (cbEditor *ed, int position=-1) const |
forward search to the next character which is not a whitespace More... | |
wxChar | GetNextNonWhitespaceCharOnLine (cbStyledTextCtrl *stc, int position=-1, int *pos=nullptr) const |
int | FindBlockStart (cbStyledTextCtrl *stc, int position, wxChar blockStart, wxChar blockEnd, bool skipNested=true) const |
int | FindBlockStart (cbStyledTextCtrl *stc, int position, wxString blockStart, wxString blockEnd, bool CaseSensitive=true) const |
void | Indent (cbStyledTextCtrl *stc, wxString &indent) const |
bool | Indent (cbStyledTextCtrl *stc, wxString &indent, int posInLine) const |
int | GetFirstBraceInLine (cbStyledTextCtrl *stc, int string_style) const |
Get the first brace in the line according to the line style. More... | |
wxChar | GetNextNonWhitespaceCharOfLine (cbStyledTextCtrl *stc, int position=-1, int *pos=nullptr) const |
Get the last non-whitespace character from position in line. More... | |
bool | AutoIndentEnabled () const |
bool | SmartIndentEnabled () const |
bool | BraceSmartIndentEnabled () const |
bool | BraceCompletionEnabled () const |
bool | SelectionBraceCompletionEnabled () const |
void | OnCCDoneEvent (CodeBlocksEvent &event) |
Protected Member Functions inherited from cbPlugin | |
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... | |
Private Member Functions | |
void | BuildMenu (cb_unused wxMenuBar *menuBar) override |
void | RemoveMenu (cb_unused wxMenuBar *menuBar) |
void | BuildModuleMenu (cb_unused const ModuleType type, cb_unused wxMenu *menu, cb_unused const FileTreeData *data=nullptr) override |
bool | BuildToolBar (cb_unused wxToolBar *toolBar) override |
void | RemoveToolBar (cb_unused wxToolBar *toolBar) |
Private Attributes | |
int | m_FunctorId |
Additional Inherited Members | |
Protected Attributes inherited from cbPlugin | |
PluginType | m_Type |
Holds the plugin's type. More... | |
bool | m_IsAttached |
Holds the "attached" state. More... | |
Definition at line 1025 of file cbplugin.h.
cbSmartIndentPlugin::cbSmartIndentPlugin | ( | ) |
Definition at line 1037 of file cbplugin.cpp.
References cbPlugin::m_Type, and ptSmartIndent.
|
protected |
Definition at line 1053 of file cbplugin.cpp.
References _T, Manager::Get(), Manager::GetConfigManager(), and ConfigManager::ReadBool().
|
protected |
Definition at line 1068 of file cbplugin.cpp.
References _T, Manager::Get(), Manager::GetConfigManager(), and ConfigManager::ReadBool().
|
protected |
Definition at line 1063 of file cbplugin.cpp.
References _T, Manager::Get(), Manager::GetConfigManager(), and ConfigManager::ReadBool().
|
inlineoverrideprivate |
Definition at line 1031 of file cbplugin.h.
|
inlineoverrideprivate |
Definition at line 1033 of file cbplugin.h.
|
inlineoverrideprivate |
Definition at line 1034 of file cbplugin.h.
|
protected |
Referenced by GetNextNonWhitespaceCharOnLine().
|
protected |
Definition at line 1223 of file cbplugin.cpp.
References wxScintilla::FindText(), wxSCI_FIND_MATCHCASE, and wxSCI_FIND_WHOLEWORD.
|
protected |
Get the first brace in the line according to the line style.
Definition at line 1253 of file cbplugin.cpp.
References _T, wxScintilla::GetCharAt(), wxScintilla::GetCurrentPos(), wxScintilla::GetStyleAt(), wxScintilla::GetTabWidth(), and wxScintilla::GetUseTabs().
|
protected |
(reverse) search for the last word which is not comment
Definition at line 1099 of file cbplugin.cpp.
References _T, wxString::Empty(), wxScintilla::GetCharAt(), cbEditor::GetControl(), wxScintilla::GetCurrentPos(), wxScintilla::GetStyleAt(), wxScintilla::GetTextRange(), cbStyledTextCtrl::IsComment(), wxScintilla::WordEndPosition(), wxScintilla::WordStartPosition(), and wxEmptyString.
|
protected |
forward search to the next character which is not a whitespace
Definition at line 1142 of file cbplugin.cpp.
|
protected |
(reverse) search for the last characters, which are not whitespace and not comment
Definition at line 1147 of file cbplugin.cpp.
References _T, wxScintilla::GetCharAt(), cbEditor::GetControl(), wxScintilla::GetCurrentPos(), wxScintilla::GetStyleAt(), wxScintilla::GetTextRange(), cbStyledTextCtrl::IsComment(), and wxEmptyString.
|
protected |
Get the last non-whitespace character from position in line.
Definition at line 1321 of file cbplugin.cpp.
References _T, wxScintilla::GetCharAt(), and wxScintilla::GetCurrentPos().
|
protected |
Definition at line 1179 of file cbplugin.cpp.
References _T, FindBlockStart(), wxScintilla::GetCharAt(), and wxScintilla::GetCurrentPos().
|
protected |
Definition at line 1078 of file cbplugin.cpp.
References _T, wxScintilla::GetTabWidth(), and wxScintilla::GetUseTabs().
|
protected |
Definition at line 1086 of file cbplugin.cpp.
References _T, wxScintilla::GetTabWidth(), and wxScintilla::GetUseTabs().
|
overrideprotectedvirtual |
Any descendent plugin should override this virtual method and perform any necessary initialization.
This method is called by Code::Blocks (PluginManager actually) when the plugin has been loaded and should attach in Code::Blocks. When Code::Blocks starts up, it finds and loads all plugins but does not activate (attaches) them. It then activates all plugins that the user has selected to be activated on start-up.
This means that a plugin might be loaded but not activated...
Think of this method as the actual constructor...
Reimplemented from cbPlugin.
Definition at line 1042 of file cbplugin.cpp.
References cbEVT_EDITOR_CC_DONE, Manager::Get(), OnCCDoneEvent(), Manager::RegisterEventSink(), and EditorHooks::RegisterHook().
|
inlinevirtual |
This is called after a code completion operation finishes.
Use it as an opportunity to tidy up CC's formating. Don't indent for languages you don't know.
Definition at line 1053 of file cbplugin.h.
References CodeCompletionHelper::GetLastNonWhitespaceChar().
|
protected |
Definition at line 1345 of file cbplugin.cpp.
References EditorBase::IsBuiltinEditor().
Referenced by OnAttach().
|
pure virtual |
When this is called, the smartIndent mechanism must get to work ;).
Please check if this is the right smartIndent mechanism first: Don't indent for languages you don't know.
Referenced by EditorHooks::cbSmartIndentEditorHookFunctor::Call().
|
overrideprotected |
Definition at line 1048 of file cbplugin.cpp.
References EditorHooks::UnregisterHook().
|
inlineprivate |
Definition at line 1032 of file cbplugin.h.
|
inlineprivate |
Definition at line 1035 of file cbplugin.h.
|
protected |
Definition at line 1073 of file cbplugin.cpp.
References _T, Manager::Get(), Manager::GetConfigManager(), and ConfigManager::ReadBool().
|
protected |
Definition at line 1058 of file cbplugin.cpp.
References _T, Manager::Get(), Manager::GetConfigManager(), and ConfigManager::ReadBool().
|
private |
Definition at line 1083 of file cbplugin.h.