Code::Blocks  SVN r11506
cbplugin.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  */
5 
6 #ifndef CBPLUGIN_H
7 #define CBPLUGIN_H
8 
9 #include <wx/arrstr.h>
10 #include <wx/event.h>
11 #include <wx/intl.h>
12 #include <wx/string.h>
13 
14 #include "settings.h" // build settings
15 #include "globals.h"
16 #include "logger.h"
17 #include "manager.h"
18 #include "pluginmanager.h"
19 #include "prep.h"
20 
21 #ifdef __WXMSW__
22  #ifndef PLUGIN_EXPORT
23  #ifdef EXPORT_LIB
24  #define PLUGIN_EXPORT __declspec (dllexport)
25  #else // !EXPORT_LIB
26  #ifdef BUILDING_PLUGIN
27  #define PLUGIN_EXPORT __declspec (dllexport)
28  #else // !BUILDING_PLUGIN
29  #define PLUGIN_EXPORT __declspec (dllimport)
30  #endif // BUILDING_PLUGIN
31  #endif // EXPORT_LIB
32  #endif // PLUGIN_EXPORT
33 #else
34  #define PLUGIN_EXPORT
35 #endif
36 
37 // this is the plugins SDK version number
38 // it will change when the SDK interface breaks
39 #define PLUGIN_SDK_VERSION_MAJOR 1
40 #define PLUGIN_SDK_VERSION_MINOR 36
41 #define PLUGIN_SDK_VERSION_RELEASE 0
42 
43 // class decls
44 class wxMenuBar;
45 class wxMenu;
46 class wxToolBar;
47 class wxPanel;
48 class wxWindow;
49 
50 class cbBreakpoint;
53 class cbEditor;
54 class cbProject;
55 class cbStackFrame;
56 class cbStatusBar;
57 class cbThread;
58 class cbWatch;
59 class Compiler;
60 class CompileTargetBase;
62 class FileTreeData;
63 class ProjectBuildTarget;
64 
65 struct PluginInfo;
66 
67 // Define basic groups for plugins' configuration.
68 static const int cgCompiler = 0x01;
69 static const int cgEditor = 0x02;
70 static const int cgCorePlugin = 0x04;
71 static const int cgContribPlugin = 0x08;
72 static const int cgUnknown = 0x10;
73 
85 {
86  public:
91  cbPlugin();
92 
94  ~cbPlugin() override;
95 
97  virtual PluginType GetType() const { return m_Type; }
98 
104  virtual int GetConfigurationPriority() const { return 50; }
105 
110  virtual int GetConfigurationGroup() const { return cgUnknown; }
111 
116  virtual cbConfigurationPanel* GetConfigurationPanel(cb_optional wxWindow* parent){ return nullptr; }
117 
125  virtual cbConfigurationPanel* GetProjectConfigurationPanel(cb_optional wxWindow* parent, cb_optional cbProject* project){ return nullptr; }
126 
138  virtual void BuildMenu(cb_optional wxMenuBar* menuBar) {}
139 
155  virtual void BuildModuleMenu(cb_optional const ModuleType type, cb_optional wxMenu* menu, cb_optional const FileTreeData* data = nullptr) { }
156 
165  virtual bool BuildToolBar(cb_optional wxToolBar* toolBar ) { return false; }
166 
170  virtual int GetToolBarPriority() { return 50; }
171 
172 #if wxUSE_STATUSBAR
173 
179  virtual void CreateStatusField(cbStatusBar *statusBar) { wxUnusedVar(statusBar); }
180 #endif
181 
187  bool IsAttached() const { return m_IsAttached; }
188 
198  virtual bool CanDetach() const { return true; }
199  protected:
210  virtual void OnAttach(){}
211 
221  virtual void OnRelease(cb_optional bool appShutDown){}
222 
226  virtual void NotImplemented(const wxString& log) const;
227 
230 
233 
234  private:
235  friend class PluginManager; // only the plugin manager has access here
236 
244  void Attach();
245 
255  void Release(bool appShutDown);
256 };
257 
264 {
265  public:
267 
277  virtual int Run(ProjectBuildTarget* target = nullptr) = 0;
278 
280  virtual int Run(const wxString& target) = 0;
281 
290  virtual int Clean(ProjectBuildTarget* target = nullptr) = 0;
291 
293  virtual int Clean(const wxString& target) = 0;
294 
304  virtual int DistClean(ProjectBuildTarget* target = nullptr) = 0;
305 
307  virtual int DistClean(const wxString& target) = 0;
308 
314  virtual int Build(ProjectBuildTarget* target = nullptr) = 0;
315 
317  virtual int Build(const wxString& target) = 0;
318 
328  virtual int Rebuild(ProjectBuildTarget* target = nullptr) = 0;
329 
331  virtual int Rebuild(const wxString& target) = 0;
332 
336  virtual int BuildWorkspace(const wxString& target = wxEmptyString) = 0;
337 
341  virtual int RebuildWorkspace(const wxString& target = wxEmptyString) = 0;
342 
346  virtual int CleanWorkspace(const wxString& target = wxEmptyString) = 0;
347 
352  virtual int CompileFile(const wxString& file) = 0;
353 
355  virtual int KillProcess() = 0;
356 
358  virtual bool IsRunning() const = 0;
359 
361  virtual int GetExitCode() const = 0;
362 
368  virtual int Configure(cbProject* project, ProjectBuildTarget* target = nullptr) = 0;
369  private:
370 };
371 
372 
373 class wxScintillaEvent;
374 
376 {
377  enum Flags
378  {
388  SetNextStatement
389  };
390 };
391 
398 {
399  public:
400  cbDebuggerPlugin(const wxString& guiName, const wxString& settingsName);
401 
402  public:
403  void OnAttach() override;
404  void OnRelease(bool appShutDown) override;
405 
406  void BuildMenu(wxMenuBar* menuBar) override;
407  void BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data = nullptr) override;
408  bool BuildToolBar(wxToolBar* toolBar) override;
409 
418  virtual void EditorLinesAddedOrRemoved(cbEditor* editor, int startline, int lines);
419  public:
420  virtual void OnAttachReal() = 0;
421  virtual void OnReleaseReal(bool appShutDown) = 0;
422 
423  virtual void SetupToolsMenu(wxMenu &menu) = 0;
424  virtual bool ToolMenuEnabled() const;
425 
426  virtual bool SupportsFeature(cbDebuggerFeature::Flags flag) = 0;
427 
428  virtual cbDebuggerConfiguration* LoadConfig(const ConfigManagerWrapper &config) = 0;
429 
430  cbDebuggerConfiguration& GetActiveConfig();
431  void SetActiveConfig(int index);
432  int GetIndexOfActiveConfig() const;
433 
435  virtual void OnConfigurationChange(bool isActive) { wxUnusedVar(isActive); };
436 
438  virtual bool Debug(bool breakOnEntry) = 0;
439 
441  virtual void Continue() = 0;
442 
444  virtual bool RunToCursor(const wxString& filename, int line, const wxString& line_text) = 0;
445 
447  virtual void SetNextStatement(const wxString& filename, int line) = 0;
448 
450  virtual void Next() = 0;
451 
453  virtual void NextInstruction() = 0;
454 
456  virtual void StepIntoInstruction() = 0;
457 
459  virtual void Step() = 0;
460 
462  virtual void StepOut() = 0;
463 
465  virtual void Break() = 0;
466 
468  virtual void Stop() = 0;
469 
471  virtual bool IsRunning() const = 0;
472 
474  virtual bool IsStopped() const = 0;
475 
477  virtual bool IsBusy() const = 0;
478 
480  virtual int GetExitCode() const = 0;
481 
482  // stack frame calls;
483  virtual int GetStackFrameCount() const = 0;
484  virtual cb::shared_ptr<const cbStackFrame> GetStackFrame(int index) const = 0;
485  virtual void SwitchToFrame(int number) = 0;
486  virtual int GetActiveStackFrame() const = 0;
487 
488  // breakpoints calls
494  virtual cb::shared_ptr<cbBreakpoint> AddBreakpoint(const wxString& filename, int line) = 0;
495 
500  virtual cb::shared_ptr<cbBreakpoint> AddDataBreakpoint(const wxString& dataExpression) = 0;
501  virtual int GetBreakpointsCount() const = 0;
502  virtual cb::shared_ptr<cbBreakpoint> GetBreakpoint(int index) = 0;
503  virtual cb::shared_ptr<const cbBreakpoint> GetBreakpoint(int index) const = 0;
504  virtual void UpdateBreakpoint(cb::shared_ptr<cbBreakpoint> breakpoint) = 0;
505  virtual void DeleteBreakpoint(cb::shared_ptr<cbBreakpoint> breakpoint) = 0;
506  virtual void DeleteAllBreakpoints() = 0;
507  virtual void ShiftBreakpoint(int index, int lines_to_shift) = 0;
508  virtual void EnableBreakpoint(cb::shared_ptr<cbBreakpoint> breakpoint, bool enable) = 0;
509  // threads
510  virtual int GetThreadsCount() const = 0;
511  virtual cb::shared_ptr<const cbThread> GetThread(int index) const = 0;
512  virtual bool SwitchToThread(int thread_number) = 0;
513 
514  // watches
515  virtual cb::shared_ptr<cbWatch> AddWatch(const wxString& symbol) = 0;
516  virtual void DeleteWatch(cb::shared_ptr<cbWatch> watch) = 0;
517  virtual bool HasWatch(cb::shared_ptr<cbWatch> watch) = 0;
518  virtual void ShowWatchProperties(cb::shared_ptr<cbWatch> watch) = 0;
519  virtual bool SetWatchValue(cb::shared_ptr<cbWatch> watch, const wxString& value) = 0;
520  virtual void ExpandWatch(cb::shared_ptr<cbWatch> watch) = 0;
521  virtual void CollapseWatch(cb::shared_ptr<cbWatch> watch) = 0;
522  virtual void UpdateWatch(cb::shared_ptr<cbWatch> watch) = 0;
523 
525  {
526  enum
527  {
528  Empty = 0,
529  Rename = 1 << 0,
530  Properties = 1 << 1,
531  Delete = 1 << 2,
532  DeleteAll = 1 << 3,
533  AddDataBreak = 1 << 4,
534  ExamineMemory = 1 << 5
535  };
536  };
537 
541  virtual void OnWatchesContextMenu(wxMenu &menu, const cbWatch &watch, wxObject *property, int &disabledMenus)
542  { wxUnusedVar(menu); wxUnusedVar(watch); wxUnusedVar(property); wxUnusedVar(disabledMenus); };
543 
544  virtual void SendCommand(const wxString& cmd, bool debugLog) = 0;
545 
546  virtual void AttachToProcess(const wxString& pid) = 0;
547  virtual void DetachFromProcess() = 0;
548  virtual bool IsAttachedToProcess() const = 0;
549 
550  virtual void GetCurrentPosition(wxString& filename, int &line) = 0;
551 
552 
553  virtual void OnValueTooltip(const wxString& token, const wxRect &evalRect);
554  virtual bool ShowValueTooltip(int style);
555  private:
556  void RegisterValueTooltip();
557  void ProcessValueTooltip(CodeBlocksEvent& event);
558  void CancelValueTooltip(CodeBlocksEvent& event);
559 
560  protected:
562  {
563  StartTypeUnknown = 0,
565  StartTypeStepInto
566  };
567  protected:
568  virtual void ConvertDirectory(wxString& str, wxString base = _T(""), bool relative = true) = 0;
569  virtual cbProject* GetProject() = 0;
570  virtual void ResetProject() = 0;
571  virtual void CleanupWhenProjectClosed(cbProject *project) = 0;
572 
578  virtual bool CompilerFinished(bool compilerFailed, StartType startType)
579  { wxUnusedVar(compilerFailed); wxUnusedVar(startType); return false; }
580  public:
582  {
588  Watches
589  };
590 
591  virtual void RequestUpdate(DebugWindows window) = 0;
592 
593  public:
594  virtual wxString GetEditorWordAtCaret(const wxPoint *mousePosition = NULL);
595  void ClearActiveMarkFromAllEditors();
596 
598  {
599  SyncOk = 0,
601  SyncFileUnknown
602  };
603 
604  SyncEditorResult SyncEditor(const wxString& filename, int line, bool setMarker = true);
605 
606  void BringCBToFront();
607 
608 
609  void ShowLog(bool clear);
610  void Log(const wxString& msg, Logger::level level = Logger::info);
611  void DebugLog(const wxString& msg, Logger::level level = Logger::info);
612  bool HasDebugLog() const;
613  void ClearLog();
614 
615  // Called only by DebuggerManager, when registering plugin or changing settings
616  void SetupLog(int normalIndex);
617 
618  wxString GetGUIName() const { return m_guiName; }
619  wxString GetSettingsName() const { return m_settingsName; }
620 
621  protected:
622  void SwitchToDebuggingLayout();
623  void SwitchToPreviousLayout();
624 
625  bool GetDebuggee(wxString& pathToDebuggee, wxString& workingDirectory, ProjectBuildTarget* target);
626  bool EnsureBuildUpToDate(StartType startType);
627  bool WaitingCompilerToFinish() const { return m_WaitingCompilerToFinish; }
628 
629  int RunNixConsole(wxString& consoleTty);
630  void MarkAsStopped();
631 
632  private:
633  void OnEditorOpened(CodeBlocksEvent& event);
634  void OnProjectActivated(CodeBlocksEvent& event);
635  void OnProjectClosed(CodeBlocksEvent& event);
636  void OnCompilerFinished(CodeBlocksEvent& event);
637  private:
641 
643 
645 
649 };
650 
659 {
660  public:
661  cbToolPlugin();
662 
669  virtual int Execute() = 0;
670  private:
671  // "Hide" some virtual members, that are not needed in cbToolPlugin
672  void BuildMenu(cb_unused wxMenuBar* menuBar) override{}
673  void RemoveMenu(cb_unused wxMenuBar* menuBar){}
674  void BuildModuleMenu(cb_unused const ModuleType type, cb_unused wxMenu* menu, cb_unused const FileTreeData* data = nullptr) override{}
675  bool BuildToolBar(cb_unused wxToolBar* toolBar) override{ return false; }
676  void RemoveToolBar(cb_unused wxToolBar* toolBar){}
677 };
678 
685 {
686  public:
687  cbMimePlugin();
688 
695  virtual bool CanHandleFile(const wxString& filename) const = 0;
696 
702  virtual int OpenFile(const wxString& filename) = 0;
703 
714  virtual bool HandlesEverything() const = 0;
715  private:
716  // "Hide" some virtual members, that are not needed in cbMimePlugin
717  void BuildMenu(cb_unused wxMenuBar* menuBar) override{}
718  void RemoveMenu(cb_unused wxMenuBar* menuBar){}
719  void BuildModuleMenu(cb_unused const ModuleType type, cb_unused wxMenu* menu, cb_unused const FileTreeData* data = nullptr) override{}
720  bool BuildToolBar(cb_unused wxToolBar* toolBar) override{ return false; }
721  void RemoveToolBar(cb_unused wxToolBar* toolBar){}
722 };
723 
724 class wxHtmlLinkEvent;
725 
733 {
734  public:
736 
739  {
742  ccpsUniversal
743  };
744 
746  struct CCToken
747  {
757  CCToken(int _id, const wxString& dispNm, int categ = -1) :
758  id(_id), category(categ), weight(5), displayName(dispNm), name(dispNm) {}
759 
771  CCToken(int _id, const wxString& dispNm, const wxString& nm, int _weight, int categ = -1) :
772  id(_id), category(categ), weight(_weight), displayName(dispNm), name(nm) {}
773 
774  int id;
775  int category;
776  int weight;
779  };
780 
782  struct CCCallTip
783  {
790  CCCallTip(const wxString& tp) :
791  hlStart(-1), hlEnd(-1), tip(tp) {}
792 
802  CCCallTip(const wxString& tp, int highlightStart, int highlightEnd) :
803  hlStart(highlightStart), hlEnd(highlightEnd), tip(tp) {}
804 
805  int hlStart;
806  int hlEnd;
808  };
809 
819  virtual CCProviderStatus GetProviderStatusFor(cbEditor* ed) = 0;
820 
866  virtual std::vector<CCToken> GetAutocompList(bool isAuto, cbEditor* ed, int& tknStart, int& tknEnd) = 0;
867 
878  virtual wxString GetDocumentation(const CCToken& token) = 0;
879 
899  virtual std::vector<CCCallTip> GetCallTips(int pos, int style, cbEditor* ed, int& argsPos) = 0;
900 
911  virtual std::vector<CCToken> GetTokenAt(int pos, cbEditor* ed, bool& allowCallTip) = 0;
912 
922  virtual wxString OnDocumentationLink(wxHtmlLinkEvent& event, bool& dismissPopup) = 0;
923 
932  virtual void DoAutocomplete(const CCToken& token, cbEditor* ed);
933 
944  virtual void DoAutocomplete(const wxString& token, cbEditor* ed);
945 
946  protected:
954  bool IsProviderFor(cbEditor* ed);
955 };
956 
968 {
969  public:
970  cbWizardPlugin();
971 
973  virtual int GetCount() const = 0;
974 
977  virtual TemplateOutputType GetOutputType(int index) const = 0;
978 
981  virtual wxString GetTitle(int index) const = 0;
982 
985  virtual wxString GetDescription(int index) const = 0;
986 
989  virtual wxString GetCategory(int index) const = 0;
990 
993  virtual const wxBitmap& GetBitmap(int index) const = 0;
994 
997  virtual wxString GetScriptFilename(int index) const = 0;
998 
1008  virtual CompileTargetBase* Launch(int index, wxString* createdFilename = nullptr) = 0; // do your work ;)
1009  private:
1010  // "Hide" some virtual members, that are not needed in cbCreateWizardPlugin
1011  void BuildMenu(cb_unused wxMenuBar* menuBar) override{}
1012  void RemoveMenu(cb_unused wxMenuBar* menuBar){}
1013  void BuildModuleMenu(cb_unused const ModuleType type, cb_unused wxMenu* menu, cb_unused const FileTreeData* data = nullptr) override{}
1014  bool BuildToolBar(cb_unused wxToolBar* toolBar) override{ return false; }
1015  void RemoveToolBar(cb_unused wxToolBar* toolBar){}
1016 };
1017 
1024 class cbStyledTextCtrl;
1026 {
1027  public:
1029  private:
1030  // "Hide" some virtual members, that are not needed in cbSmartIndentPlugin
1031  void BuildMenu(cb_unused wxMenuBar* menuBar) override{}
1032  void RemoveMenu(cb_unused wxMenuBar* menuBar){}
1033  void BuildModuleMenu(cb_unused const ModuleType type, cb_unused wxMenu* menu, cb_unused const FileTreeData* data = nullptr) override{}
1034  bool BuildToolBar(cb_unused wxToolBar* toolBar) override{ return false; }
1035  void RemoveToolBar(cb_unused wxToolBar* toolBar){}
1036  protected:
1037  void OnAttach() override;
1038  void OnRelease(bool appShutDown) override;
1039 
1040  public:
1046  virtual void OnEditorHook(cbEditor* editor, wxScintillaEvent& event) const = 0;
1047 
1053  virtual void OnCCDone(cb_unused cbEditor* ed){}
1054 
1055  protected:
1057  wxString GetLastNonCommentWord(cbEditor* ed, int position = -1, unsigned int NumberOfWords = 1 ) const;
1059  wxString GetLastNonWhitespaceChars(cbEditor* ed, int position = -1, unsigned int NumberOfChars = 1) const;
1060 
1062  wxChar GetLastNonWhitespaceChar(cbEditor* ed, int position = -1) const;
1063  wxChar GetNextNonWhitespaceCharOnLine(cbStyledTextCtrl* stc, int position = -1, int *pos = nullptr) const;
1064 
1065  int FindBlockStart(cbStyledTextCtrl* stc, int position, wxChar blockStart, wxChar blockEnd, bool skipNested = true) const;
1066  int FindBlockStart(cbStyledTextCtrl* stc, int position, wxString blockStart, wxString blockEnd, bool CaseSensitive = true) const;
1067 
1068  void Indent(cbStyledTextCtrl* stc, wxString& indent)const;
1069  bool Indent(cbStyledTextCtrl* stc, wxString& indent, int posInLine)const;
1070 
1072  int GetFirstBraceInLine(cbStyledTextCtrl* stc, int string_style)const;
1073 
1075  wxChar GetNextNonWhitespaceCharOfLine(cbStyledTextCtrl* stc, int position = -1, int *pos = nullptr)const;
1076  bool AutoIndentEnabled()const;
1077  bool SmartIndentEnabled()const;
1078  bool BraceSmartIndentEnabled()const;
1079  bool BraceCompletionEnabled()const;
1080  bool SelectionBraceCompletionEnabled()const;
1081  void OnCCDoneEvent(CodeBlocksEvent& event);
1082  private:
1084 };
1085 
1099 template<class T> class PluginRegistrant
1100 {
1101  public:
1104  {
1105  Manager::Get()->GetPluginManager()->RegisterPlugin(name, // plugin's name
1106  &CreatePlugin, // creation
1107  &FreePlugin, // destruction
1108  &SDKVersion); // SDK version
1109  }
1110 
1112  {
1113  return new T;
1114  }
1115 
1116  static void FreePlugin(cbPlugin* plugin)
1117  {
1118  delete plugin;
1119  }
1120 
1121  static void SDKVersion(int* major, int* minor, int* release)
1122  {
1123  if (major) *major = PLUGIN_SDK_VERSION_MAJOR;
1124  if (minor) *minor = PLUGIN_SDK_VERSION_MINOR;
1125  if (release) *release = PLUGIN_SDK_VERSION_RELEASE;
1126  }
1127 };
1128 
1129 #endif // CBPLUGIN_H
CCToken(int _id, const wxString &dispNm, const wxString &nm, int _weight, int categ=-1)
Construct a fully specified CCToken.
Definition: cbplugin.h:771
void BuildMenu(cb_unused wxMenuBar *menuBar) override
Definition: cbplugin.h:717
Base class for plugins.
Definition: cbplugin.h:84
int Execute(const wxString &command)
Definition: sc_io.cpp:183
void RemoveToolBar(cb_unused wxToolBar *toolBar)
Definition: cbplugin.h:1015
static const int cgCorePlugin
One of the core plugins.
Definition: cbplugin.h:70
static cbPlugin * CreatePlugin()
Definition: cbplugin.h:1111
wxString tip
The content of the calltip.
Definition: cbplugin.h:807
Base class for code-completion plugins.
Definition: cbplugin.h:732
PluginManager * GetPluginManager() const
Definition: manager.cpp:444
void RegisterPlugin(const wxString &name, CreatePluginProc createProc, FreePluginProc freeProc, PluginSDKVersionProc versionProc)
void RemoveToolBar(cb_unused wxToolBar *toolBar)
Definition: cbplugin.h:721
void BuildModuleMenu(cb_unused const ModuleType type, cb_unused wxMenu *menu, cb_unused const FileTreeData *data=nullptr) override
Definition: cbplugin.h:1033
void Delete(std::vector< T > &s)
Definition: safedelete.h:20
CCProviderStatus
Level of functionality a CC plugin is able to provide.
Definition: cbplugin.h:738
void BuildModuleMenu(cb_unused const ModuleType type, cb_unused wxMenu *menu, cb_unused const FileTreeData *data=nullptr) override
Definition: cbplugin.h:1013
Base class for debugger plugins.
Definition: cbplugin.h:397
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
Definition: manager.cpp:182
wxString m_PreviousLayout
Definition: cbplugin.h:638
PluginRegistrant(const wxString &name)
Definition: cbplugin.h:1103
virtual int GetToolBarPriority()
This method return the priority of the plugin&#39;s toolbar, the less value indicates a more preceding po...
Definition: cbplugin.h:170
Information about the plugin.
Definition: pluginmanager.h:38
#define PLUGIN_SDK_VERSION_MINOR
Definition: cbplugin.h:40
Structure representing an individual calltip with an optional highlighted range.
Definition: cbplugin.h:782
void BuildMenu(cb_unused wxMenuBar *menuBar) override
Definition: cbplugin.h:1011
static const int cgCompiler
Compiler related.
Definition: cbplugin.h:68
CC plugin provides no functionality.
Definition: cbplugin.h:740
#define PLUGIN_SDK_VERSION_MAJOR
Definition: cbplugin.h:39
#define _T(string)
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...
Definition: cbplugin.h:155
bool m_lastLineWasNormal
Definition: cbplugin.h:647
void BuildMenu(cb_unused wxMenuBar *menuBar) override
Definition: cbplugin.h:672
virtual bool CanDetach() const
See whether this plugin can be detached (unloaded) or not.
Definition: cbplugin.h:198
bool BuildToolBar(cb_unused wxToolBar *toolBar) override
Definition: cbplugin.h:675
bool BuildToolBar(cb_unused wxToolBar *toolBar) override
Definition: cbplugin.h:1014
static const int cgEditor
Editor related.
Definition: cbplugin.h:69
PluginType m_Type
Holds the plugin&#39;s type.
Definition: cbplugin.h:229
void RemoveToolBar(cb_unused wxToolBar *toolBar)
Definition: cbplugin.h:676
virtual PluginType GetType() const
The plugin must return its type on request.
Definition: cbplugin.h:97
Base class for mime plugins.
Definition: cbplugin.h:684
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 ...
Definition: cbplugin.h:165
A generic Code::Blocks event.
Definition: sdk_events.h:20
int hlStart
The start index of the desired highlighted range.
Definition: cbplugin.h:805
void UpdateWatch(wxPropertyGrid *grid, wxPGProperty *property, cb::shared_ptr< cbWatch > watch, bool readonly)
Definition: watchesdlg.cpp:466
Base class for compiler plugins.
Definition: cbplugin.h:263
bool WaitingCompilerToFinish() const
Definition: cbplugin.h:627
CCCallTip(const wxString &tp)
Convenience constructor.
Definition: cbplugin.h:790
wxUSE_UNICODE_dependent wxChar
void BuildMenu(cb_unused wxMenuBar *menuBar) override
Definition: cbplugin.h:1031
PluginManager manages plugins.
Definition: pluginmanager.h:76
PluginType
Known plugin types.
Definition: globals.h:24
CC plugin provides specialized functionality.
Definition: cbplugin.h:741
int weight
Lower numbers are placed earlier in listing, 5 is default; try to keep 0-10.
Definition: cbplugin.h:776
Represents a Code::Blocks project.
Definition: cbproject.h:96
void DebugLog(wxString cn, int blockSize, int poolSize, int max_refs, int total_refs, int ref_count)
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&#39;s stat...
Definition: cbplugin.h:179
wxString name
Minimal name of the token that CCManager may choose to display in restricted circumstances.
Definition: cbplugin.h:778
ModuleType
The type of module offering a context menu.
Definition: globals.h:38
wxString GetSettingsName() const
Definition: cbplugin.h:619
bool m_IsAttached
Holds the "attached" state.
Definition: cbplugin.h:232
void BuildModuleMenu(cb_unused const ModuleType type, cb_unused wxMenu *menu, cb_unused const FileTreeData *data=nullptr) override
Definition: cbplugin.h:674
wxChar GetLastNonWhitespaceChar(cbStyledTextCtrl *control, int position)
for OnGotoFunction(), search backward
bool BuildToolBar(cb_unused wxToolBar *toolBar) override
Definition: cbplugin.h:720
virtual void OnRelease(cb_optional bool appShutDown)
Any descendent plugin should override this virtual method and perform any necessary de-initialization...
Definition: cbplugin.h:221
bool BuildToolBar(cb_unused wxToolBar *toolBar) override
Definition: cbplugin.h:1034
void RemoveMenu(cb_unused wxMenuBar *menuBar)
Definition: cbplugin.h:1032
virtual void OnConfigurationChange(bool isActive)
Called when the user clicks OK in Settings -> Debugger...
Definition: cbplugin.h:435
cbCompilerPlugin * m_pCompiler
Definition: cbplugin.h:639
Structure representing a generic token, passed between CC plugins and CCManager.
Definition: cbplugin.h:746
wxString m_settingsName
Definition: cbplugin.h:648
wxString displayName
Verbose string representing the token.
Definition: cbplugin.h:777
int category
The category corresponding to the index of the registered image (during autocomplete).
Definition: cbplugin.h:775
virtual int GetConfigurationPriority() const
Return the plugin&#39;s configuration priority.
Definition: cbplugin.h:104
A custom status bar which can contain controls, icons...
Definition: cbstatusbar.h:18
virtual void OnAttach()
Any descendent plugin should override this virtual method and perform any necessary initialization...
Definition: cbplugin.h:210
wxString wxEmptyString
#define PLUGIN_EXPORT
Definition: cbplugin.h:24
Base class for plugin configuration panels.
Plugin registration object.
Definition: cbplugin.h:1099
void RemoveMenu(cb_unused wxMenuBar *menuBar)
Definition: cbplugin.h:673
TemplateOutputType
Template output types.
Definition: globals.h:145
void RemoveMenu(cb_unused wxMenuBar *menuBar)
Definition: cbplugin.h:718
void RemoveMenu(cb_unused wxMenuBar *menuBar)
Definition: cbplugin.h:1012
Abstract base class for compilers.
Definition: compiler.h:274
A file editor.
Definition: cbeditor.h:43
#define PLUGIN_SDK_VERSION_RELEASE
Definition: cbplugin.h:41
wxString GetGUIName() const
Definition: cbplugin.h:618
static void SDKVersion(int *major, int *minor, int *release)
Definition: cbplugin.h:1121
virtual void OnCCDone(cb_unused cbEditor *ed)
This is called after a code completion operation finishes.
Definition: cbplugin.h:1053
level
Definition: logger.h:37
CCCallTip(const wxString &tp, int highlightStart, int highlightEnd)
Construct a calltip, specifying a highlighted range.
Definition: cbplugin.h:802
int hlEnd
The end index of the desired highlighted range.
Definition: cbplugin.h:806
void BuildModuleMenu(cb_unused const ModuleType type, cb_unused wxMenu *menu, cb_unused const FileTreeData *data=nullptr) override
Definition: cbplugin.h:719
static const int cgContribPlugin
One of the contrib plugins (or any third-party plugin for that matter).
Definition: cbplugin.h:71
StartType m_StartType
Definition: cbplugin.h:642
bool m_WaitingCompilerToFinish
Definition: cbplugin.h:640
virtual void OnWatchesContextMenu(wxMenu &menu, const cbWatch &watch, wxObject *property, int &disabledMenus)
Definition: cbplugin.h:541
Base class for tool plugins.
Definition: cbplugin.h:658
virtual cbConfigurationPanel * GetProjectConfigurationPanel(cb_optional wxWindow *parent, cb_optional cbProject *project)
Return plugin&#39;s configuration panel for projects.
Definition: cbplugin.h:125
Represents a Code::Blocks project build target.
virtual int GetConfigurationGroup() const
Return the configuration group for this plugin.
Definition: cbplugin.h:110
bool IsAttached() const
See whether this plugin is attached or not.
Definition: cbplugin.h:187
static const int cgUnknown
Unknown. This will be probably grouped with cgContribPlugin.
Definition: cbplugin.h:72
void RemoveToolBar(cb_unused wxToolBar *toolBar)
Definition: cbplugin.h:1035
virtual bool CompilerFinished(bool compilerFailed, StartType startType)
Called when the compilation has finished.
Definition: cbplugin.h:578
Base class for wizard plugins.
Definition: cbplugin.h:967
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 Cod...
Definition: cbplugin.h:138
CCToken(int _id, const wxString &dispNm, int categ=-1)
Convenience constructor.
Definition: cbplugin.h:757
#define NULL
Definition: prefix.cpp:59
int id
CCManager will pass this back unmodified. Use it as an internal identifier for the token...
Definition: cbplugin.h:774
Wrapper class for reading or writing config values, without the need for the full path...
Base class for build target classes Each Code::Blocks project consists of at least one target...
virtual cbConfigurationPanel * GetConfigurationPanel(cb_optional wxWindow *parent)
Return plugin&#39;s configuration panel.
Definition: cbplugin.h:116
static void FreePlugin(cbPlugin *plugin)
Definition: cbplugin.h:1116