24 #define PLUGIN_EXPORT __declspec (dllexport) 26 #ifdef BUILDING_PLUGIN 27 #define PLUGIN_EXPORT __declspec (dllexport) 28 #else // !BUILDING_PLUGIN 29 #define PLUGIN_EXPORT __declspec (dllimport) 30 #endif // BUILDING_PLUGIN 32 #endif // PLUGIN_EXPORT 39 #define PLUGIN_SDK_VERSION_MAJOR 1 40 #define PLUGIN_SDK_VERSION_MINOR 36 41 #define PLUGIN_SDK_VERSION_RELEASE 0 226 virtual void NotImplemented(
const wxString& log)
const;
255 void Release(
bool appShutDown);
280 virtual int Run(
const wxString& target) = 0;
293 virtual int Clean(
const wxString& target) = 0;
307 virtual int DistClean(
const wxString& target) = 0;
317 virtual int Build(
const wxString& target) = 0;
331 virtual int Rebuild(
const wxString& target) = 0;
352 virtual int CompileFile(
const wxString& file) = 0;
355 virtual int KillProcess() = 0;
358 virtual bool IsRunning()
const = 0;
361 virtual int GetExitCode()
const = 0;
403 void OnAttach()
override;
404 void OnRelease(
bool appShutDown)
override;
406 void BuildMenu(
wxMenuBar* menuBar)
override;
408 bool BuildToolBar(
wxToolBar* toolBar)
override;
418 virtual void EditorLinesAddedOrRemoved(
cbEditor* editor,
int startline,
int lines);
420 virtual void OnAttachReal() = 0;
421 virtual void OnReleaseReal(
bool appShutDown) = 0;
423 virtual void SetupToolsMenu(
wxMenu &menu) = 0;
424 virtual bool ToolMenuEnabled()
const;
431 void SetActiveConfig(
int index);
432 int GetIndexOfActiveConfig()
const;
438 virtual bool Debug(
bool breakOnEntry) = 0;
441 virtual void Continue() = 0;
444 virtual bool RunToCursor(
const wxString& filename,
int line,
const wxString& line_text) = 0;
447 virtual void SetNextStatement(
const wxString& filename,
int line) = 0;
450 virtual void Next() = 0;
453 virtual void NextInstruction() = 0;
456 virtual void StepIntoInstruction() = 0;
459 virtual void Step() = 0;
462 virtual void StepOut() = 0;
465 virtual void Break() = 0;
468 virtual void Stop() = 0;
471 virtual bool IsRunning()
const = 0;
474 virtual bool IsStopped()
const = 0;
477 virtual bool IsBusy()
const = 0;
480 virtual int GetExitCode()
const = 0;
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;
494 virtual cb::shared_ptr<cbBreakpoint> AddBreakpoint(
const wxString& filename,
int line) = 0;
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;
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;
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;
533 AddDataBreak = 1 << 4,
534 ExamineMemory = 1 << 5
542 { wxUnusedVar(menu); wxUnusedVar(watch); wxUnusedVar(property); wxUnusedVar(disabledMenus); };
544 virtual void SendCommand(
const wxString& cmd,
bool debugLog) = 0;
546 virtual void AttachToProcess(
const wxString& pid) = 0;
547 virtual void DetachFromProcess() = 0;
548 virtual bool IsAttachedToProcess()
const = 0;
550 virtual void GetCurrentPosition(
wxString& filename,
int &line) = 0;
553 virtual void OnValueTooltip(
const wxString& token,
const wxRect &evalRect);
554 virtual bool ShowValueTooltip(
int style);
556 void RegisterValueTooltip();
563 StartTypeUnknown = 0,
568 virtual void ConvertDirectory(
wxString& str,
wxString base =
_T(
""),
bool relative =
true) = 0;
570 virtual void ResetProject() = 0;
571 virtual void CleanupWhenProjectClosed(
cbProject *project) = 0;
579 { wxUnusedVar(compilerFailed); wxUnusedVar(startType);
return false; }
595 void ClearActiveMarkFromAllEditors();
606 void BringCBToFront();
609 void ShowLog(
bool clear);
612 bool HasDebugLog()
const;
616 void SetupLog(
int normalIndex);
622 void SwitchToDebuggingLayout();
623 void SwitchToPreviousLayout();
626 bool EnsureBuildUpToDate(
StartType startType);
629 int RunNixConsole(
wxString& consoleTty);
630 void MarkAsStopped();
695 virtual bool CanHandleFile(
const wxString& filename)
const = 0;
702 virtual int OpenFile(
const wxString& filename) = 0;
714 virtual bool HandlesEverything()
const = 0;
724 class wxHtmlLinkEvent;
758 id(_id), category(categ), weight(5), displayName(dispNm), name(dispNm) {}
772 id(_id), category(categ), weight(_weight), displayName(dispNm), name(nm) {}
791 hlStart(-1), hlEnd(-1), tip(tp) {}
803 hlStart(highlightStart), hlEnd(highlightEnd), tip(tp) {}
866 virtual std::vector<CCToken> GetAutocompList(
bool isAuto,
cbEditor* ed,
int& tknStart,
int& tknEnd) = 0;
899 virtual std::vector<CCCallTip> GetCallTips(
int pos,
int style,
cbEditor* ed,
int& argsPos) = 0;
911 virtual std::vector<CCToken> GetTokenAt(
int pos,
cbEditor* ed,
bool& allowCallTip) = 0;
922 virtual wxString OnDocumentationLink(wxHtmlLinkEvent& event,
bool& dismissPopup) = 0;
973 virtual int GetCount()
const = 0;
981 virtual wxString GetTitle(
int index)
const = 0;
985 virtual wxString GetDescription(
int index)
const = 0;
989 virtual wxString GetCategory(
int index)
const = 0;
993 virtual const wxBitmap& GetBitmap(
int index)
const = 0;
997 virtual wxString GetScriptFilename(
int index)
const = 0;
1037 void OnAttach()
override;
1038 void OnRelease(
bool appShutDown)
override;
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;
1063 wxChar GetNextNonWhitespaceCharOnLine(
cbStyledTextCtrl* stc,
int position = -1,
int *pos =
nullptr)
const;
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;
1129 #endif // CBPLUGIN_H CCToken(int _id, const wxString &dispNm, const wxString &nm, int _weight, int categ=-1)
Construct a fully specified CCToken.
int Execute(const wxString &command)
static const int cgCorePlugin
One of the core plugins.
static cbPlugin * CreatePlugin()
wxString tip
The content of the calltip.
Base class for code-completion plugins.
PluginManager * GetPluginManager() const
void RegisterPlugin(const wxString &name, CreatePluginProc createProc, FreePluginProc freeProc, PluginSDKVersionProc versionProc)
void Delete(std::vector< T > &s)
CCProviderStatus
Level of functionality a CC plugin is able to provide.
Base class for debugger plugins.
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
wxString m_PreviousLayout
PluginRegistrant(const wxString &name)
Information about the plugin.
#define PLUGIN_SDK_VERSION_MINOR
Structure representing an individual calltip with an optional highlighted range.
static const int cgCompiler
Compiler related.
CC plugin provides no functionality.
#define PLUGIN_SDK_VERSION_MAJOR
virtual bool CanDetach() const
See whether this plugin can be detached (unloaded) or not.
static const int cgEditor
Editor related.
PluginType m_Type
Holds the plugin's type.
virtual PluginType GetType() const
The plugin must return its type on request.
Base class for mime plugins.
A generic Code::Blocks event.
int hlStart
The start index of the desired highlighted range.
void UpdateWatch(wxPropertyGrid *grid, wxPGProperty *property, cb::shared_ptr< cbWatch > watch, bool readonly)
Base class for compiler plugins.
bool WaitingCompilerToFinish() const
CCCallTip(const wxString &tp)
Convenience constructor.
wxUSE_UNICODE_dependent wxChar
PluginManager manages plugins.
PluginType
Known plugin types.
CC plugin provides specialized functionality.
int weight
Lower numbers are placed earlier in listing, 5 is default; try to keep 0-10.
Represents a Code::Blocks project.
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's stat...
wxString name
Minimal name of the token that CCManager may choose to display in restricted circumstances.
ModuleType
The type of module offering a context menu.
wxString GetSettingsName() const
bool m_IsAttached
Holds the "attached" state.
wxChar GetLastNonWhitespaceChar(cbStyledTextCtrl *control, int position)
for OnGotoFunction(), search backward
virtual void OnRelease(cb_optional bool appShutDown)
Any descendent plugin should override this virtual method and perform any necessary de-initialization...
virtual void OnConfigurationChange(bool isActive)
Called when the user clicks OK in Settings -> Debugger...
cbCompilerPlugin * m_pCompiler
Structure representing a generic token, passed between CC plugins and CCManager.
wxString displayName
Verbose string representing the token.
int category
The category corresponding to the index of the registered image (during autocomplete).
virtual int GetConfigurationPriority() const
Return the plugin's configuration priority.
A custom status bar which can contain controls, icons...
virtual void OnAttach()
Any descendent plugin should override this virtual method and perform any necessary initialization...
Base class for plugin configuration panels.
Plugin registration object.
TemplateOutputType
Template output types.
Abstract base class for compilers.
#define PLUGIN_SDK_VERSION_RELEASE
wxString GetGUIName() const
static void SDKVersion(int *major, int *minor, int *release)
virtual void OnCCDone(cb_unused cbEditor *ed)
This is called after a code completion operation finishes.
CCCallTip(const wxString &tp, int highlightStart, int highlightEnd)
Construct a calltip, specifying a highlighted range.
int hlEnd
The end index of the desired highlighted range.
static const int cgContribPlugin
One of the contrib plugins (or any third-party plugin for that matter).
bool m_WaitingCompilerToFinish
virtual cbConfigurationPanel * GetProjectConfigurationPanel(cb_optional wxWindow *parent, cb_optional cbProject *project)
Return plugin's configuration panel for projects.
Represents a Code::Blocks project build target.
virtual int GetConfigurationGroup() const
Return the configuration group for this plugin.
bool IsAttached() const
See whether this plugin is attached or not.
static const int cgUnknown
Unknown. This will be probably grouped with cgContribPlugin.
virtual bool CompilerFinished(bool compilerFailed, StartType startType)
Called when the compilation has finished.
Base class for wizard plugins.
CCToken(int _id, const wxString &dispNm, int categ=-1)
Convenience constructor.
int id
CCManager will pass this back unmodified. Use it as an internal identifier for the token...
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's configuration panel.
static void FreePlugin(cbPlugin *plugin)