From fdb75fa47dd72522b705e94be5a201c4e1a731cb Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 3 Oct 2007 12:43:01 +0000 Subject: New plugin SDK added Some more debug information for windows builds (Does this work in lazarus?) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@466 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/SDK/UPluginDefs.pas | 107 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 Modis/SDK/UPluginDefs.pas (limited to 'Modis/SDK/UPluginDefs.pas') diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas new file mode 100644 index 00000000..7428ae2e --- /dev/null +++ b/Modis/SDK/UPluginDefs.pas @@ -0,0 +1,107 @@ +unit uPluginDefs; +{********************* + uPluginDefs + Some Basic Structures and Functions used to communicate with Plugins + Usable as Delphi Plugin SDK +*********************} + +interface + +type + DWORD = LongWord; + + //---------------- + // TUS_PluginInfo - Some Infos from Plugin to Core. + // Send when Plugininfo procedure is Called + //---------------- + PUS_PluginInfo = ^TUS_PluginInfo; + TUS_PluginInfo = record + cbSize: Integer; //Size of this record (usefull if record will be extended in the future) + + Name: PChar; //Name of the Plugin + Version: DWord; //Version of the Plugin + Description: PChar; //Description, what does this Plugin do + Author: PChar; //Author of this Plugin + AuthorEmail: PChar; //Authors Email + Homepage: PChar; //Homepage of Plugin/Author + end; + + //---------------- + // TUS_Hook - Structure of the Hook Function + // Return 0 if the Hook should be continue, + // or a non zero Value, if the Hook should be Interuped + // In this Case the Caller of the Notivier gets the Return Value + // Return Value Should not be -1 + //---------------- + TUS_Hook = Function (wParam, lParam: DWord): integer; stdcall; + TUS_Hook_of_Object = Function (wParam, lParam: DWord): integer of Object; + + //---------------- + // TUS_Service - Structure of the Service Function + // This Function is called if the Registered Service is Called + // Return Value Should not be SERVICE_NOT_FOUND + //---------------- + TUS_Service = Function (wParam, lParam: DWord): integer; stdcall; + TUS_Service_of_Object = Function (wParam, lParam: DWord): integer of Object; + + //---------------- + // TUS_PluginInterface - Structure that Includes all Methods callable + // from the Plugins + //---------------- + PUS_PluginInterface = ^TUS_PluginInterface; + TUS_PluginInterface = record + {******** Hook specific Methods ********} + {Function Creates a new Hookable Event and Returns the Handle + or 0 on Failure. (Name already exists)} + CreateHookableEvent: Function (EventName: PChar): THandle; stdcall; + + {Function Destroys an Event and Unhooks all Hooks to this Event. + 0 on success, not 0 on Failure} + DestroyHookableEvent: Function (hEvent: THandle): integer; stdcall; + + {Function start calling the Hook Chain + 0 if Chain is called until the End, -1 if Event Handle is not valid + otherwise Return Value of the Hook that breaks the Chain} + NotivyEventHooks: Function (hEvent: THandle; wParam, lParam: dWord): integer; stdcall; + + {Function Hooks an Event by Name. + Returns Hook Handle on Success, otherwise 0} + HookEvent: Function (EventName: PChar; HookProc: TUS_Hook): THandle; stdcall; + + {Function Removes the Hook from the Chain + Returns 0 on Success} + UnHookEvent: Function (hHook: THandle): Integer; stdcall; + + {Function Returns Non Zero if a Event with the given Name Exists, + otherwise 0} + EventExists: Function (EventName: PChar): Integer; stdcall; + + {******** Service specific Methods ********} + {Function Creates a new Service and Returns the Services Handle + or 0 on Failure. (Name already exists)} + CreateService: Function (ServiceName: PChar; ServiceProc: TUS_Service): THandle; stdcall; + + {Function Destroys a Service. + 0 on success, not 0 on Failure} + DestroyService: Function (hService: THandle): integer; stdcall; + + {Function Calls a Services Proc + Returns Services Return Value or SERVICE_NOT_FOUND on Failure} + CallService: Function (ServiceName: PChar; wParam, lParam: dWord): integer; stdcall; + + {Function Returns Non Zero if a Service with the given Name Exists, + otherwise 0} + ServiceExists: Function (ServiceName: PChar): Integer; stdcall; + end; + +//---------------- +// Some Default Constants +//---------------- +const + {Returned if Service is not Found from CallService} + SERVICE_NOT_FOUND=$80000000; + + +implementation + +end. -- cgit v1.2.3 From 621bfb05407a169f6511f5b115d0622e5ec8bdd5 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 10 Oct 2007 17:50:05 +0000 Subject: Added Hook and Service Class for new Plugin System to Trunc Added Core and CoreModule. That maybe will be used for new Core management. Core needs many code to write Some Info to Plugin SDK added git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@497 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/SDK/UPluginDefs.pas | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) (limited to 'Modis/SDK/UPluginDefs.pas') diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas index 7428ae2e..42f888e4 100644 --- a/Modis/SDK/UPluginDefs.pas +++ b/Modis/SDK/UPluginDefs.pas @@ -13,6 +13,12 @@ type //---------------- // TUS_PluginInfo - Some Infos from Plugin to Core. // Send when Plugininfo procedure is Called + // --- + // Version Structure: + // First Byte: Head Revison + // Second Byte: Sub Revison + // Third Byte: Sub Revision 2 + // Fourth Byte: Letter (For Bug Fix releases. 0 or 'a' .. 'z') //---------------- PUS_PluginInfo = ^TUS_PluginInfo; TUS_PluginInfo = record @@ -30,7 +36,7 @@ type // TUS_Hook - Structure of the Hook Function // Return 0 if the Hook should be continue, // or a non zero Value, if the Hook should be Interuped - // In this Case the Caller of the Notivier gets the Return Value + // In this Case the Caller of the Notifier gets the Return Value // Return Value Should not be -1 //---------------- TUS_Hook = Function (wParam, lParam: DWord): integer; stdcall; @@ -54,7 +60,7 @@ type {Function Creates a new Hookable Event and Returns the Handle or 0 on Failure. (Name already exists)} CreateHookableEvent: Function (EventName: PChar): THandle; stdcall; - + {Function Destroys an Event and Unhooks all Hooks to this Event. 0 on success, not 0 on Failure} DestroyHookableEvent: Function (hEvent: THandle): integer; stdcall; @@ -80,7 +86,7 @@ type {Function Creates a new Service and Returns the Services Handle or 0 on Failure. (Name already exists)} CreateService: Function (ServiceName: PChar; ServiceProc: TUS_Service): THandle; stdcall; - + {Function Destroys a Service. 0 on success, not 0 on Failure} DestroyService: Function (hService: THandle): integer; stdcall; @@ -98,10 +104,41 @@ type // Some Default Constants //---------------- const - {Returned if Service is not Found from CallService} + {Returned if Service is not found from CallService} SERVICE_NOT_FOUND=$80000000; + CORE_SM_NOSYMBOL= 0; + CORE_SM_ERROR = 1; + CORE_SM_WARNING = 2; + CORE_SM_INFO = 3; + +//---------------- +// Some Functions to Handle Version DWords +//---------------- +Function MakeVersion(const HeadRevision, SubVersion, SubVersion2: Byte; Letter: Char): DWord; +Function VersiontoSting(const Version: DWord): String; + implementation +//-------------- +// MakeVersion - Converts 4 Values to a valid Version DWord +//-------------- +Function MakeVersion(const HeadRevision, SubVersion, SubVersion2: Byte; Letter: Char): DWord; +begin + If (letter < 'a') or (Letter > 'z') then + letter := chr(0); + + Result := (HeadRevision shl 24) or (SubVersion shl 16) or (SubVersion2 shl 8) or Ord(Letter); +end; + +//-------------- +// VersiontoString - Returns some beauty '1.0.2a' like String +//-------------- +Function VersiontoSting(const Version: DWord): String; +begin // to-do : Write VersiontoString without SysUtils depencies + //Result := InttoStr((ver and $FF000000) shr 24); + Result := '1.0.1 +end; + end. -- cgit v1.2.3 From 2f80e3be339f528bd0c7ef54db8ff7cc641883e3 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 10 Oct 2007 18:07:01 +0000 Subject: Fixed some Bugs from Previous Commit git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@498 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/SDK/UPluginDefs.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Modis/SDK/UPluginDefs.pas') diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas index 42f888e4..5a16d807 100644 --- a/Modis/SDK/UPluginDefs.pas +++ b/Modis/SDK/UPluginDefs.pas @@ -138,7 +138,7 @@ end; Function VersiontoSting(const Version: DWord): String; begin // to-do : Write VersiontoString without SysUtils depencies //Result := InttoStr((ver and $FF000000) shr 24); - Result := '1.0.1 + Result := '1.0.1' end; end. -- cgit v1.2.3 From 4231c33ad7c7765fd3851c5c7168f8c7d367deef Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 16 Oct 2007 23:19:11 +0000 Subject: nearly finished Cores loading procs Add PluginLoader Unit to implent new PluginLoader Reordered Delphi .dpr uses clausel git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@519 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/SDK/UPluginDefs.pas | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Modis/SDK/UPluginDefs.pas') diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas index 5a16d807..8b964cc2 100644 --- a/Modis/SDK/UPluginDefs.pas +++ b/Modis/SDK/UPluginDefs.pas @@ -100,6 +100,15 @@ type ServiceExists: Function (ServiceName: PChar): Integer; stdcall; end; + //TModuleInfo: Info about Modules + PModuleInfo = ^TModuleInfo; + TModuleInfo = record + Name: String; + Version: LongWord; + Description: String; + end; + AModuleInfo = array of TModuleInfo; + //---------------- // Some Default Constants //---------------- -- cgit v1.2.3 From 9af5260cd9905f8d7e5600110cdb0667c0bb5188 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sat, 27 Oct 2007 09:28:42 +0000 Subject: Update forgotten UPluginDefs from last commit git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@536 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/SDK/UPluginDefs.pas | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to 'Modis/SDK/UPluginDefs.pas') diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas index 8b964cc2..69c258fb 100644 --- a/Modis/SDK/UPluginDefs.pas +++ b/Modis/SDK/UPluginDefs.pas @@ -24,13 +24,15 @@ type TUS_PluginInfo = record cbSize: Integer; //Size of this record (usefull if record will be extended in the future) - Name: PChar; //Name of the Plugin - Version: DWord; //Version of the Plugin - Description: PChar; //Description, what does this Plugin do - Author: PChar; //Author of this Plugin - AuthorEmail: PChar; //Authors Email - Homepage: PChar; //Homepage of Plugin/Author + Name: Array [0..31] of Char; //Name of the Plugin + Version: DWord; //Version of the Plugin + Description: Array [0..127] of Char; //Description, what does this Plugin do + Author: Array [0..31] of Char; //Author of this Plugin + AuthorEmail: Array [0..63] of Char; //Authors Email + Homepage: Array [0..63] of Char; //Homepage of Plugin/Author end; + AUS_PluginInfo = Array of TUS_PluginInfo; + PAUS_PluginInfo = ^AUS_PluginInfo; //---------------- // TUS_Hook - Structure of the Hook Function @@ -100,7 +102,9 @@ type ServiceExists: Function (ServiceName: PChar): Integer; stdcall; end; - //TModuleInfo: Info about Modules + //---------------- + //TModuleInfo: Info about Modules. Result of Core/GetModuleInfo + //---------------- PModuleInfo = ^TModuleInfo; TModuleInfo = record Name: String; @@ -109,6 +113,25 @@ type end; AModuleInfo = array of TModuleInfo; + //---------------- + // Procs that should be exported by Plugin Dlls + //---------------- + //Procedure is called to check if this is USDx Plugin + //Info is Pointer to this Plugins Info. Size is already set. Don't write over this limit + Proc_PluginInfo = procedure (Info: PUS_PluginInfo); stdcall; + + //Called on Plugins Load. If Non Zero is Returned => abort Loading + //PInterface is Pointer to PluginInterface + Func_Load = function (const PInterface: PUS_PluginInterface): Integer; stdcall; + + //Called on Plugins Init. If Non Zero is Returned => abort Loading + //PInterface is Pointer to PluginInterface + Func_Init = function (const PInterface: PUS_PluginInterface): Integer; stdcall; + + //Called on Plugins Deinit. + //PInterface is Pointer to PluginInterface + Proc_DeInit = procedure (const PInterface: PUS_PluginInterface); stdcall; + //---------------- // Some Default Constants //---------------- @@ -116,6 +139,7 @@ const {Returned if Service is not found from CallService} SERVICE_NOT_FOUND=$80000000; + //for use in Service 'Core/ShowMessage' lParam(Symbol) CORE_SM_NOSYMBOL= 0; CORE_SM_ERROR = 1; CORE_SM_WARNING = 2; @@ -127,7 +151,6 @@ const Function MakeVersion(const HeadRevision, SubVersion, SubVersion2: Byte; Letter: Char): DWord; Function VersiontoSting(const Version: DWord): String; - implementation //-------------- -- cgit v1.2.3 From 391d30716d48dc709f6444b19c008e82311623b9 Mon Sep 17 00:00:00 2001 From: eddie-0815 Date: Thu, 1 Nov 2007 19:34:40 +0000 Subject: Mac OS X version compiles and links. I hope I didn't break too many files on windows/linux. Added switches.inc to all files. Changed many IFDEFs. For Windows-only code please use MSWINDOWS instead of WIN32 now. WIN32 is also used by the Mac port. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@546 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/SDK/UPluginDefs.pas | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Modis/SDK/UPluginDefs.pas') diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas index 69c258fb..4e1ea36b 100644 --- a/Modis/SDK/UPluginDefs.pas +++ b/Modis/SDK/UPluginDefs.pas @@ -7,6 +7,8 @@ unit uPluginDefs; interface +{$I switches.inc} + type DWORD = LongWord; -- cgit v1.2.3 From 8c9c787a1326b90490543bd50b56fce9b89d9807 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Sat, 3 Nov 2007 02:31:06 +0000 Subject: Windows Lazarus Build working again... Lazarus Project file includes the DPR, so that we have a unified Uses Clause ( keep this in mind please ) added "Delphi" to switches git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@560 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/SDK/UPluginDefs.pas | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Modis/SDK/UPluginDefs.pas') diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas index 4e1ea36b..f0a68fa9 100644 --- a/Modis/SDK/UPluginDefs.pas +++ b/Modis/SDK/UPluginDefs.pas @@ -7,6 +7,10 @@ unit uPluginDefs; interface +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + {$I switches.inc} type -- cgit v1.2.3 From a1a9c43dcd6f61610eb3afea542aec5de5dabf30 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 6 Nov 2007 19:40:06 +0000 Subject: Some changes to PluginInterface to fit with 64 Bit Systems. lParam is maily for use as Pointer, therefore standardtype: Pointer. wParam should mainly be used for ordinals. (Integer or Int64 on 64Bit Systems). Don't return addresses. Result is not assured to be Int64 on 64 Bit Systems. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@592 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/SDK/UPluginDefs.pas | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'Modis/SDK/UPluginDefs.pas') diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas index f0a68fa9..68b35446 100644 --- a/Modis/SDK/UPluginDefs.pas +++ b/Modis/SDK/UPluginDefs.pas @@ -16,6 +16,17 @@ interface type DWORD = LongWord; + //Compatibility with 64 Bit Systems + {$IFDEF CPU32} + TwParam = Integer; + TlParam = Pointer; //lParam is Used for 32 Bit addresses DWord is large enough + {$ELSE} + TwParam = Int64; + TlParam = Pointer; //lParam used for 64Bit addresses in 64 Bit Systems(FreePascal) + {$ENDIF} + //wParam is mainly used for Ordninals + //lParam is mainly used for Pointers + //---------------- // TUS_PluginInfo - Some Infos from Plugin to Core. // Send when Plugininfo procedure is Called @@ -47,16 +58,16 @@ type // In this Case the Caller of the Notifier gets the Return Value // Return Value Should not be -1 //---------------- - TUS_Hook = Function (wParam, lParam: DWord): integer; stdcall; - TUS_Hook_of_Object = Function (wParam, lParam: DWord): integer of Object; + TUS_Hook = Function (wParam: TwParam; lParam: TlParam): integer; stdcall; + TUS_Hook_of_Object = Function (wParam: TwParam; lParam: TlParam): integer of Object; //---------------- // TUS_Service - Structure of the Service Function // This Function is called if the Registered Service is Called // Return Value Should not be SERVICE_NOT_FOUND //---------------- - TUS_Service = Function (wParam, lParam: DWord): integer; stdcall; - TUS_Service_of_Object = Function (wParam, lParam: DWord): integer of Object; + TUS_Service = Function (wParam: TwParam; lParam: TlParam): integer; stdcall; + TUS_Service_of_Object = Function (wParam: TwParam; lParam: TlParam): integer of Object; //---------------- // TUS_PluginInterface - Structure that Includes all Methods callable @@ -76,7 +87,7 @@ type {Function start calling the Hook Chain 0 if Chain is called until the End, -1 if Event Handle is not valid otherwise Return Value of the Hook that breaks the Chain} - NotivyEventHooks: Function (hEvent: THandle; wParam, lParam: dWord): integer; stdcall; + NotivyEventHooks: Function (hEvent: THandle; wParam: TwParam; lParam: TlParam): integer; stdcall; {Function Hooks an Event by Name. Returns Hook Handle on Success, otherwise 0} @@ -101,7 +112,7 @@ type {Function Calls a Services Proc Returns Services Return Value or SERVICE_NOT_FOUND on Failure} - CallService: Function (ServiceName: PChar; wParam, lParam: dWord): integer; stdcall; + CallService: Function (ServiceName: PChar; wParam: TwParam; lParam: TlParam): integer; stdcall; {Function Returns Non Zero if a Service with the given Name Exists, otherwise 0} @@ -151,12 +162,14 @@ const CORE_SM_WARNING = 2; CORE_SM_INFO = 3; + //---------------- // Some Functions to Handle Version DWords //---------------- Function MakeVersion(const HeadRevision, SubVersion, SubVersion2: Byte; Letter: Char): DWord; Function VersiontoSting(const Version: DWord): String; + implementation //-------------- -- cgit v1.2.3