Some ideas.

binary format: .hrb, should be platform indipendent and it may be
closed-source...

hbide at startup checks the content of "plugin" directory where there
will be all the .hrb files. Imagine the file ext.hrb

ext.hrb must contain some mandatory routines, name after the filename,
for example:
ext_init()

hbide loads every hrb file and calls the ext_init(). you must decide
if this function can access hbide internals directly or via a well
defined API (the latter is better).
It must check hbide version, API version, etc...
the plugin can add items in the menu system, add toolbars, menu items
in the right-click menu in the editor, eventuallly register in the
keystroke controller

When invoked, a plugin funcion must be able to access various elements:
a - active source code window
b - a list of source code window
c - source code from a window
d - retrieve the selected lines/block/stream of a window and able to
replace the text
e - retrieve any text of any full row or single char of any source code window
f - able to stuff characters in any position


Imagine some plugins:
- code beautifer ( works on the active window if no text selected, or
on the selection active )
- code converter to apply some conversion (not a search/replace) on
some code, imagine like running sorce code thrpough the pre-processor
to translate COMMIT  to dbCommit(). I once wrote a preprocessor to
import a @ SAY / GET based code to hwgui compatible objects
- some refactoring functions, imagine a function rename from pippo to
pippo2... it must convert the
function pippo
but also all pippo( in all files included in the project... and it
can't be a simple strtran().... well, using regexp probably you can...
- refactoring: selecting a DATA pippo line, right-click -> refactoring
-> create getter/setter: it is necessary to go up in the source code
and get the class name, then go down until the end of class and just
before the closing line adding the
function setPippo( var )
::pippo = var
return ::pippo
function getPippo()
return ::pippo


Just some ideas to give you something to think about, what to expose
to plugins... how it can be done, I don't know....

Francesco
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to