2010-05-10 21:47 UTC+0200 Xavi (jarabal/at/gmail.com)
* config/postinst.prg
% Corrected tipo.
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2010-05-10 21:47 UTC+0200 Xavi (jarabal/at/gmail.com)
|
||||
* config/postinst.prg
|
||||
% Corrected tipo.
|
||||
|
||||
2010-05-10 11:20 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* INSTALL
|
||||
+ Made it clear that Windows example section is for x86/32-bit.
|
||||
@@ -24,7 +28,7 @@
|
||||
2010-05-09 20:11 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
|
||||
* contrib/hbide/hbide.prg
|
||||
* contrib/hbide/ideplugins.prg
|
||||
% Changed: plugins are loaded on first call instead of
|
||||
% Changed: plugins are loaded on first call instead of
|
||||
loading all plugins at startup. Now the overhead is negligible.
|
||||
|
||||
2010-05-09 17:21 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
|
||||
@@ -40,7 +44,7 @@
|
||||
+ Image to be activated when "Line" selection mode is on.
|
||||
|
||||
* contrib/hbqt/hbqt_hbqplaintextedit.cpp
|
||||
|
||||
|
||||
* contrib/hbide/hbide.hbp
|
||||
+ Added ideplugin.prg
|
||||
|
||||
@@ -55,63 +59,63 @@
|
||||
+ Priliminary commit to handle plugins.
|
||||
|
||||
* contrib/hbide/ideshortcuts.prg
|
||||
|
||||
+ Implemented: a very simple yet powerful interface to hook plugins.
|
||||
|
||||
+ Implemented: a very simple yet powerful interface to hook plugins.
|
||||
The idea got polished with Francesco Perillo's description of the thought.
|
||||
|
||||
Creating a hbIDE plugin
|
||||
=======================
|
||||
A .hrb ( compiled with -gh as the minimum ), i.e., savebackup.prg,
|
||||
A .hrb ( compiled with -gh as the minimum ), i.e., savebackup.prg,
|
||||
having two mandatory functions:
|
||||
|
||||
|
||||
1. hrb_file_name_without_extension_plus_underscrore_plus_INIT()
|
||||
savebackup_INIT( ... ) -> TRUE/FALSE
|
||||
2. hrb_file_name_without_extension_plus_underscrore_plus_EXEC()
|
||||
savebackup_EXEC( oIde, ... ) -> xValue
|
||||
|
||||
savebackup_INIT() will be used to establish hand-shake and it must
|
||||
return a logical indicating success or failure. Currently it is
|
||||
called with "1.0" as version no but is scheduled to be enhanced
|
||||
savebackup_INIT() will be used to establish hand-shake and it must
|
||||
return a logical indicating success or failure. Currently it is
|
||||
called with "1.0" as version no but is scheduled to be enhanced
|
||||
in future.
|
||||
|
||||
If hand-shake is successful, means, savebackup_INIT( ... ) returns
|
||||
with TRUE, savebackup_EXEC( oIde, ... ) is called as per user
|
||||
If hand-shake is successful, means, savebackup_INIT( ... ) returns
|
||||
with TRUE, savebackup_EXEC( oIde, ... ) is called as per user
|
||||
request. oIDE is sent as the first argument followed by user supplied
|
||||
arguments. Within this function in .hrb, all action takes place.
|
||||
User can write n number of functions withing the same source but
|
||||
all other functions will always be STATIC ones.
|
||||
User can write n number of functions withing the same source but
|
||||
all other functions will always be STATIC ones.
|
||||
|
||||
The whole hbIDE object is passed with each execution and hence
|
||||
The whole hbIDE object is passed with each execution and hence
|
||||
user is having utmost control over what he wants to accomplish.
|
||||
|
||||
|
||||
Location of the Plugin
|
||||
======================
|
||||
All plugins ( .hrb ) must reside within "plugins" sub-folder from hbIDE.exe
|
||||
location. The location is determined with return value of
|
||||
All plugins ( .hrb ) must reside within "plugins" sub-folder from hbIDE.exe
|
||||
location. The location is determined with return value of
|
||||
hb_dirBase() + hb_osPathSeparator() + "plugins" + hb_osPathSeparator().
|
||||
|
||||
Loading Plugins
|
||||
===============
|
||||
At startup hbIDE looks into "plugins" folder for all .hrb files.
|
||||
It then tries to establish hand-shake with them. If successful, a
|
||||
handle is retained in static array. When an execution request is
|
||||
encountered, this static array is searched for and
|
||||
savebackup_EXEC( oIDE, ... ) is called and return value is passed
|
||||
handle is retained in static array. When an execution request is
|
||||
encountered, this static array is searched for and
|
||||
savebackup_EXEC( oIDE, ... ) is called and return value is passed
|
||||
back to the caller macro.
|
||||
|
||||
Executing Plugins in hbIDE
|
||||
==========================
|
||||
A public method ::execPlugin( cPlugin, ... ) is implemented under
|
||||
"Keyboard Mappings". ::execPlugin is called with plugin name, which
|
||||
essentially is the .hrb file name. So in demo example, it is
|
||||
"savebackup". Final expression would be like :
|
||||
A public method ::execPlugin( cPlugin, ... ) is implemented under
|
||||
"Keyboard Mappings". ::execPlugin is called with plugin name, which
|
||||
essentially is the .hrb file name. So in demo example, it is
|
||||
"savebackup". Final expression would be like :
|
||||
::execPlugin( "savebackup", "saveas" )
|
||||
Here "saveas" is the identifier which is used in this demo to invoke
|
||||
STATIC FUNCTION savebackup_saveAs( oIde )
|
||||
Author of plugin has to decide how and what he would like to pass
|
||||
what and in how many. So simply build a macro to call a plugin
|
||||
with parameters, that's it.
|
||||
|
||||
|
||||
I am hopeful that you, brilliant programmers, with help extending hbIDE
|
||||
to an amazing levels. Send your critics to the list to enrich this thought.
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ PROCEDURE Main()
|
||||
{ "HB_WITH_CAIRO" , "..\..\bin\libcairo-2.dll" , .T., "cairo" },;
|
||||
{ "HB_WITH_CURL" , "..\libcurl.dll" , .T., "" },;
|
||||
{ "HB_WITH_CURL" , "..\bin\libcurl.dll" , .T., "" },;
|
||||
{ "HB_WITH_FIREBIRD" , "..\bin\fbclient.dll" , .F., "" },; /* Doesn't work with mingw*/cygwin, because .lib has another name in another directory */
|
||||
{ "HB_WITH_FIREBIRD" , "..\bin\fbclient.dll" , .F., "" },; /* Doesn't work with mingw cygwin, because .lib has another name in another directory */
|
||||
{ "HB_WITH_FREEIMAGE" , "..\Dist\FreeImage.dll" , .F., "" },;
|
||||
{ "HB_WITH_GD" , "..\bin\bgd.dll" , .F., "" },;
|
||||
{ "HB_WITH_LIBHARU" , "..\libhpdf.dll" , .F., "" },;
|
||||
|
||||
Reference in New Issue
Block a user