wxsPluginBase - abstract base class for all wxStudio plugins. Declares methods for querying type of plugin, initialization, cloning it's instance and invoking text-encoded commands. Currently there are five most general plugin-categories:

 enum WXS_PLUGIN_TYPE
 {
     WXS_UNKNOWN_PLUGIN = 0,
     WXS_EDITOR_PLUGIN,
     WXS_CLASSBROWSER_PLUGIN,
     WXS_FILEBROWSER_PLUGIN,
     WXS_CLASSINFO_PLUGIN
 };

To ensure binary compatibility among dynamicly loadable plugins, their generic interfaces should not change. Extensions to these interface can be made only by introducing new text-encoded commands, which are invoked through

"virtual string Command( const string& name, const string& args )"

method. If the requested command is not supported by particular plugin, it returns NOT_SUPPORTED" value. The recommended form of of encoding argument-list into "args" string is following:

args  = [args,][name=value]
value = literal | quoted_string
name  = literal

example:

  string result =
      plugin->Command( "find_text", "from_line=5,till_line=10,text=\"foo\"" );

After instantiation, "InitPlugin()" method is called for each plugin to perform plugin-specific initialization, such as subscribing for notifications from other components, setting up event-handlers to intercept window-related events, etc.

Note: plugins currently undergo very intial developement, thefore their interfaces are not finalised yet.

wxsComponent - derivative of wxsPluginBase, serves as a base class for all "visual" plugins - which have a window associated with them. Additionally they should implement:

virtual void Create( wxWindow* parent, wxWindowID id ) = 0;
virtual wxWindow* GetWindow() = 0;

methods.

wxsSourceInfoPlugin - defines abstract interface for a plugin, which is "willing" to serve as central source-information repository. Term "source-information" refers to data about class, method, etc contexts found in the source code. There can be only one such plugin active within wxStudio, and it's reference obtained by calling "GetSourceInfoPlugin()" of wxsWorkpalce class.

Plugin has two responsibilities:

  • sends notifications to subscribed "wxsSourceInfoListener"s
  • satisfies info-requests about the given project, such as
    LoadClasses(..)
    LoadClassMembers(..)
    FindDefinition(..)
    FindClassByName(..)
    (and others)

Interface provides method "SetSourceParser()" for setting a parser for custom language (all general interfaces for parsers and context-structures common to object-oriented languages are
defined in srcparser.h)

wxsSourceEditorPlugin - derivative of wxsComponent, defines generic interface for source code editors. Interfaces includes user-level commands such as "cut", "paste", "undo", "redo", "find", etc as well as lower-level commands for querying on-screen cursor position, obtaining, inserting, removing text blocks, setting/clearing check-point for state of modification,   positioning cursor and others. Some of these commands may not be supported by particular plugin implementations, in such case editor should return predefined-values indicating that command is not supported, e.g. GetCharacterSize() would return wxSize(-1,-1).

(TODO: introduce wxsEditorBasePlugin interface, derive wxsSourceEditorPlugin from it)

Document prepared by Aleksandras Gluchovas


SourceForge Logo