From 71657931daa89050b35844c30bd864659ce142f0 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 29 May 2007 16:46:50 +0000 Subject: [PATCH] =?UTF-8?q?Importaci=C3=B3n=20inicial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Componentes.Internos.PluginSDK/trunk@2 e72b1707-40e4-cb4a-951e-f3997140195a --- Build/Build.proj | 13 + Build/Build.properties | 9 + Build/PluginSDK_D.proj | 42 +++ Build/PluginSDK_R.proj | 41 +++ Packages/PluginSDK.inc | 114 ++++++ Packages/PluginSDK_D10D.bdsproj | 505 ++++++++++++++++++++++++++ Packages/PluginSDK_D10D.dpk | 40 ++ Packages/PluginSDK_D10D.drc | 14 + Packages/PluginSDK_D10D.res | Bin 0 -> 5056 bytes Packages/PluginSDK_D10R.bdsproj | 187 ++++++++++ Packages/PluginSDK_D10R.dpk | 39 ++ Packages/PluginSDK_D10R.drc | 14 + Packages/PluginSDK_D10R.res | Bin 0 -> 5056 bytes Packages/PluginSDK_D2007D.dpk | 40 ++ Packages/PluginSDK_D2007D.res | Bin 0 -> 5056 bytes Packages/PluginSDK_D2007R.dpk | 39 ++ Packages/PluginSDK_D2007R.dproj | 84 +++++ Packages/PluginSDK_D2007R.res | Bin 0 -> 5056 bytes Packages/PluginSDK_D7D.dof | 489 +++++++++++++++++++++++++ Packages/PluginSDK_D7D.dpk | 40 ++ Packages/PluginSDK_D7D.drc | 14 + Packages/PluginSDK_D7D.res | Bin 0 -> 1536 bytes Packages/PluginSDK_D7R.dof | 489 +++++++++++++++++++++++++ Packages/PluginSDK_D7R.dpk | 38 ++ Packages/PluginSDK_D7R.drc | 14 + Packages/PluginSDK_D7R.res | Bin 0 -> 1536 bytes Packages/PluginSDK_GroupD10.bdsgroup | 20 + Packages/PluginSDK_GroupD10.groupproj | 40 ++ Source/uHostManager.pas | 301 +++++++++++++++ Source/uInterfaces.pas | 54 +++ Source/uModuleController.dfm | 7 + Source/uModuleController.pas | 96 +++++ Source/uModuleMenu.pas | 90 +++++ Source/uReg.pas | 27 ++ Templates/uSamplePluginController.dfm | 11 + Templates/uSamplePluginController.pas | 35 ++ 36 files changed, 2946 insertions(+) create mode 100644 Build/Build.proj create mode 100644 Build/Build.properties create mode 100644 Build/PluginSDK_D.proj create mode 100644 Build/PluginSDK_R.proj create mode 100644 Packages/PluginSDK.inc create mode 100644 Packages/PluginSDK_D10D.bdsproj create mode 100644 Packages/PluginSDK_D10D.dpk create mode 100644 Packages/PluginSDK_D10D.drc create mode 100644 Packages/PluginSDK_D10D.res create mode 100644 Packages/PluginSDK_D10R.bdsproj create mode 100644 Packages/PluginSDK_D10R.dpk create mode 100644 Packages/PluginSDK_D10R.drc create mode 100644 Packages/PluginSDK_D10R.res create mode 100644 Packages/PluginSDK_D2007D.dpk create mode 100644 Packages/PluginSDK_D2007D.res create mode 100644 Packages/PluginSDK_D2007R.dpk create mode 100644 Packages/PluginSDK_D2007R.dproj create mode 100644 Packages/PluginSDK_D2007R.res create mode 100644 Packages/PluginSDK_D7D.dof create mode 100644 Packages/PluginSDK_D7D.dpk create mode 100644 Packages/PluginSDK_D7D.drc create mode 100644 Packages/PluginSDK_D7D.res create mode 100644 Packages/PluginSDK_D7R.dof create mode 100644 Packages/PluginSDK_D7R.dpk create mode 100644 Packages/PluginSDK_D7R.drc create mode 100644 Packages/PluginSDK_D7R.res create mode 100644 Packages/PluginSDK_GroupD10.bdsgroup create mode 100644 Packages/PluginSDK_GroupD10.groupproj create mode 100644 Source/uHostManager.pas create mode 100644 Source/uInterfaces.pas create mode 100644 Source/uModuleController.dfm create mode 100644 Source/uModuleController.pas create mode 100644 Source/uModuleMenu.pas create mode 100644 Source/uReg.pas create mode 100644 Templates/uSamplePluginController.dfm create mode 100644 Templates/uSamplePluginController.pas diff --git a/Build/Build.proj b/Build/Build.proj new file mode 100644 index 0000000..e29fb01 --- /dev/null +++ b/Build/Build.proj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Build/Build.properties b/Build/Build.properties new file mode 100644 index 0000000..cd11811 --- /dev/null +++ b/Build/Build.properties @@ -0,0 +1,9 @@ + + + + $(MSBuildProjectDirectory)\.. + $(BaseFolder)\Source + $(BaseFolder)\Packages + $(BaseFolder)\Lib\$(DelphiVersion) + + diff --git a/Build/PluginSDK_D.proj b/Build/PluginSDK_D.proj new file mode 100644 index 0000000..5d263f8 --- /dev/null +++ b/Build/PluginSDK_D.proj @@ -0,0 +1,42 @@ + + + + + + + + Release + AnyCPU + $(OutputFolder)\PluginSDK_$(DelphiVersion)D.bpl + + + + + + + + + False + False + 0 + 0 + $(OutputFolder) + $(OutputFolder) + $(OutputFolder) + $(OutputFolder) + $(OutputFolder);$(SourceFolder) + $(OutputFolder) + $(OutputFolder) + $(OutputFolder) + False + RELEASE + + + + + + + + + + \ No newline at end of file diff --git a/Build/PluginSDK_R.proj b/Build/PluginSDK_R.proj new file mode 100644 index 0000000..c09649e --- /dev/null +++ b/Build/PluginSDK_R.proj @@ -0,0 +1,41 @@ + + + + + + + + Release + AnyCPU + $(OutputFolder)\PluginSDK_$(DelphiVersion)R.bpl + + + + + + + + + False + False + 0 + 0 + $(OutputFolder) + $(OutputFolder) + $(OutputFolder) + $(OutputFolder) + $(OutputFolder);$(SourceFolder) + $(OutputFolder) + $(OutputFolder) + $(OutputFolder) + False + RELEASE + + + + + + + + + \ No newline at end of file diff --git a/Packages/PluginSDK.inc b/Packages/PluginSDK.inc new file mode 100644 index 0000000..9cc223d --- /dev/null +++ b/Packages/PluginSDK.inc @@ -0,0 +1,114 @@ + { defines for Delphi 1.0 } + {$IFDEF VER80} + {$DEFINE DELPHI} + {$DEFINE DELPHI1} + {$DEFINE DELPHI1UP} + {$ENDIF} + + { defines for Delphi 2.0 } + {$IFDEF VER90} + {$DEFINE DELPHI} + {$DEFINE DELPHI2} + {$DEFINE DELPHI1UP} + {$DEFINE DELPHI2UP} + {$ENDIF} + + { defines for Delphi 3.0 } + {$IFDEF VER100} + {$DEFINE DELPHI} + {$DEFINE DELPHI3} + {$DEFINE DELPHI1UP} + {$DEFINE DELPHI2UP} + {$DEFINE DELPHI3UP} + {$ENDIF} + + { defines for Delphi 4.0 } + {$IFDEF VER120} + {$DEFINE DELPHI} + {$DEFINE DELPHI4} + {$DEFINE DELPHI1UP} + {$DEFINE DELPHI2UP} + {$DEFINE DELPHI3UP} + {$DEFINE DELPHI4UP} + {$ENDIF} + + { defines for Delphi 5.0 } + {$IFDEF VER130} + {$DEFINE DELPHI} + {$DEFINE DELPHI5} + {$DEFINE DELPHI1UP} + {$DEFINE DELPHI2UP} + {$DEFINE DELPHI3UP} + {$DEFINE DELPHI4UP} + {$DEFINE DELPHI5UP} + {$ENDIF} + + { defines for Delphi 6.0 } + {$IFDEF VER140} + {$DEFINE VER140UP} + {$DEFINE DELPHI} + {$DEFINE DELPHI6} + {$DEFINE DELPHI1UP} + {$DEFINE DELPHI2UP} + {$DEFINE DELPHI3UP} + {$DEFINE DELPHI4UP} + {$DEFINE DELPHI5UP} + {$DEFINE DELPHI6UP} + {$ENDIF} + + { defines for Delphi 7.0 } + {$IFDEF VER150} + {$DEFINE VER140UP} + {$DEFINE DELPHI} + {$DEFINE DELPHI7} + {$DEFINE DELPHI1UP} + {$DEFINE DELPHI2UP} + {$DEFINE DELPHI3UP} + {$DEFINE DELPHI4UP} + {$DEFINE DELPHI5UP} + {$DEFINE DELPHI6UP} + {$DEFINE DELPHI7UP} + {$ENDIF} + + { defines for Delphi 2005 } + {$IFDEF VER170} + {$DEFINE VER140UP} + {$DEFINE DELPHI} + {$DEFINE DELPHI9} + {$DEFINE DELPHI2005} + {$DEFINE DELPHI1UP} + {$DEFINE DELPHI2UP} + {$DEFINE DELPHI3UP} + {$DEFINE DELPHI4UP} + {$DEFINE DELPHI5UP} + {$DEFINE DELPHI6UP} + {$DEFINE DELPHI7UP} + {$DEFINE DELPHI9UP} + {$DEFINE DELPHI2005} + {$DEFINE BDS} + {$DEFINE BDS3} + {$DEFINE BDS3UP} + {$ENDIF} + + { defines for Delphi 2006 } + {$IFDEF VER180} + {$DEFINE VER140UP} + {$DEFINE DELPHI} + {$DEFINE DELPHI9} + {$DEFINE DELPHI2005} + {$DEFINE DELPHI1UP} + {$DEFINE DELPHI2UP} + {$DEFINE DELPHI3UP} + {$DEFINE DELPHI4UP} + {$DEFINE DELPHI5UP} + {$DEFINE DELPHI6UP} + {$DEFINE DELPHI7UP} + {$DEFINE DELPHI9UP} + {$DEFINE DELPHI2005UP} + {$DEFINE DELPHI2006} + {$DEFINE BDS} + {$DEFINE BDS3} + {$DEFINE BDS4} + {$DEFINE BDS3UP} + {$ENDIF} + diff --git a/Packages/PluginSDK_D10D.bdsproj b/Packages/PluginSDK_D10D.bdsproj new file mode 100644 index 0000000..2566836 --- /dev/null +++ b/Packages/PluginSDK_D10D.bdsproj @@ -0,0 +1,505 @@ + + + + + + + + + + + + PluginSDK_D10D.dpk + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 3 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + PluginSDK for Delphi 10 (Designtime) + + + + ..\Lib\D10 + + + ..\Lib\D10 + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 3082 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ExpressBars by Developer Express Inc. + ExpressCommonLibrary by Developer Express Inc. + ExpressBars DBNavigator by Developer Express Inc. + ExpressBars extended DB items by Developer Express Inc. + ExpressBars extended items by Developer Express Inc. + ExpressDocking Library by Developer Express Inc. + ExpressLayout Control by Developer Express Inc. + ExpressNavBar by Developer Express Inc. + ExpressGDI+ Library by Developer Express Inc. + ExpressPrinting System by Developer Express Inc. + ExpressSideBar by Developer Express Inc. + + + + diff --git a/Packages/PluginSDK_D10D.dpk b/Packages/PluginSDK_D10D.dpk new file mode 100644 index 0000000..80e2fd1 --- /dev/null +++ b/Packages/PluginSDK_D10D.dpk @@ -0,0 +1,40 @@ +package PluginSDK_D10D; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'PluginSDK for Delphi 10 (Designtime)'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vclactnband, + vclx, + vcl, + PluginSDK_D10R; + +contains + uReg in '..\Source\uReg.pas'; + +end. diff --git a/Packages/PluginSDK_D10D.drc b/Packages/PluginSDK_D10D.drc new file mode 100644 index 0000000..7642ac9 --- /dev/null +++ b/Packages/PluginSDK_D10D.drc @@ -0,0 +1,14 @@ +/* VER180 + Generated by the Borland Delphi Pascal Compiler + because -GD or --drc was supplied to the compiler. + + This file contains compiler-generated resources that + were bound to the executable. + If this file is empty, then no compiler-generated + resources were bound to the produced executable. +*/ + +STRINGTABLE +BEGIN +END + diff --git a/Packages/PluginSDK_D10D.res b/Packages/PluginSDK_D10D.res new file mode 100644 index 0000000000000000000000000000000000000000..86c94e6ada7b3c85f6761b1ee234a9f34ef3c861 GIT binary patch literal 5056 zcmbW5&x;&Y5XWnifD(f4!IPI+L`3!=E9BmaF%VEA#@TDLXpF&R6XJUC)cc=I4kFSA z{{!hg%bp}hVRP_qjvmDJ`>A@>-7}euyEfF+`%$mH-*3IwZ-y~5+miKtn3_w^Pn$V^ zQ861nx4C)wN(Q~H#+K|o*@m~&(3=1I%Llk7>S*pvE7;Yjz^+ljNYba;|&8!P>=GYp<9J^QiRC`-*du(Wb zBJI+RemE@Tm2dSSKL$269_p-ia&WJ{$B|EYy#Bt1`fm?B(CB-l8nlXqgY!6fUOzP@ zr|Te|e4cZxgJWuLF8<`}dughP69?9a%ha4}r`jtX-7UCl^he&nV;_S<)Ya!2FlEJu zrr{t12%dXkNqpywX{@?Eb_MKs@29XRNI;2D%DxW zo|xv^jnf#kFIDZr^e=W==PW{#^6Ao{deqzuxId;ujOZ~3;otiwSzBXu3^t3 z&$C~D3=Umz@OQRR9+}nP>x>=u115dAI{rd2#Mbgv81-@e%IA6)a8SDwHm3Di`~F1x z)jhG~04Fd5o4f^Iah!WFIS0|E#)aohzS6onIG_;>-~Ytz3J0A}=DenTZ*cIo-Ves9 zp>qHmo5lV+rntk2He9_1!t%2yZsF;l)>iGc4jkU$0bBWEPmBKKP>uSjxhXIDsSodT z@EG|gFZa>|hHF!PaN};FzIxxlpPKT;87{i(!eu7T%H?}r^yeP=K2c}If`cyKd-3DW z_4ib`jDt-MZ?C~;z1O=EKN(!YbpFJR_c`u>(C=ph9O_Y*Jz5Z>`Zs7T9Mn$y@ay$^ z{gulxYxXwGq@TIGbG$~Hi*qk8?9|WMkNweF@MU18F;AQKZ>jcWAL86`f59r^Yh;+XfGU10gV*5=*FT)q#qz2B_Ik28(#vUlW{{>1m(1wXK3zHQ3+RoHfz^$cuqg(^F;eqz6WUMUE^m$ z9R1u2H_t9ue%}<_JcD5KB$svgjBysd-ql#|toxF$&>h1Qc)Vw6j~u{SeHg>my$i{SJtD^MnJV!{AK!ZgN9Q4bN2bs7?m1Qo zsLwc-c&GZ4_%7jWppm+9C(?(bpCye?f6Mv)ml~{r9)<=EoH5SYSxm8xsWZv%2MjL$ zd)R%{gxqI&lEaJ6!*jggJMcIz?<5?~hn@VA1Kzcrp$;C`m0CzQdy{!G?|FT$$5W3N zaydTsdE#>2dGSt*&wOX~r{!54?~lxS4gM|rOZH6mRCZMCP#!z)bEv-^up_gJ*i*BY zl>1d-%!E}5v+s{C_OF@Qj;!xrv5)P2yJ4TmKCqke`Aq-U;NJ}WpRu*&|7!3r$c7zU zF#m_6?>Cia!E%D)b;IaF{ zzPG~QEyw>z^LKm}whzS>Dx3Ct`1w98?Y5 + + + + + + + + + + + PluginSDK_D10R.dpk + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 3 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + PluginSDK for Delphi 10 (Runtime) + + + + ..\Lib\D10 + + + ..\Lib\D10 + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 3082 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + ExpressBars by Developer Express Inc. + ExpressCommonLibrary by Developer Express Inc. + ExpressBars DBNavigator by Developer Express Inc. + ExpressBars extended DB items by Developer Express Inc. + ExpressBars extended items by Developer Express Inc. + ExpressDocking Library by Developer Express Inc. + ExpressLayout Control by Developer Express Inc. + ExpressNavBar by Developer Express Inc. + ExpressGDI+ Library by Developer Express Inc. + ExpressPrinting System by Developer Express Inc. + ExpressSideBar by Developer Express Inc. + + + diff --git a/Packages/PluginSDK_D10R.dpk b/Packages/PluginSDK_D10R.dpk new file mode 100644 index 0000000..7b47a32 --- /dev/null +++ b/Packages/PluginSDK_D10R.dpk @@ -0,0 +1,39 @@ +package PluginSDK_D10R; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'PluginSDK for Delphi 10 (Runtime)'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + uHostManager in '..\Source\uHostManager.pas', + uInterfaces in '..\Source\uInterfaces.pas', + uModuleMenu in '..\Source\uModuleMenu.pas', + uModuleController in '..\Source\uModuleController.pas' {ModuleController: TDataModule}; + +end. diff --git a/Packages/PluginSDK_D10R.drc b/Packages/PluginSDK_D10R.drc new file mode 100644 index 0000000..7642ac9 --- /dev/null +++ b/Packages/PluginSDK_D10R.drc @@ -0,0 +1,14 @@ +/* VER180 + Generated by the Borland Delphi Pascal Compiler + because -GD or --drc was supplied to the compiler. + + This file contains compiler-generated resources that + were bound to the executable. + If this file is empty, then no compiler-generated + resources were bound to the produced executable. +*/ + +STRINGTABLE +BEGIN +END + diff --git a/Packages/PluginSDK_D10R.res b/Packages/PluginSDK_D10R.res new file mode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9O_Y*Jz5Z>`Zs7T9Mn$y@ay$^ z{gulxYxXwGq@TIGbG$~Hi*qk8?9|WMkNweF@MU18F;AQKZ>jcWAL86`f59r^Yh;+XfGU10gV*5=*FT)q#qz2B_Ik28(#vUlW{{>1m(1wXK3zHQ3+RoHfz^$cuqg(^F;eqz6WUMUE^m$ z9R1u2H_t9ue%}<_JcD5KB$svgjBysd-ql#|toxF$&>h1Qc)Vw6j~u{SeHg>my$i{SJtD^MnJV!{AK!ZgN9Q4bN2bs7?m1Qo zsLwc-c&GZ4_%7jWppm+9C(?(bpCye?f6Mv)ml~{r9)<=EoH5SYSxm8xsWZv%2MjL$ zd)R%{gxqI&lEaJ6!*jggJMcIz?<5?~hn@VA1Kzcrp$;C`m0CzQdy{!G?|FT$$5W3N zaydTsdE#>2dGSt*&wOX~r{!54?~lxS4gM|rOZH6mRCZMCP#!z)bEv-^up_gJ*i*BY zl>1d-%!E}5v+s{C_OF@Qj;!xrv5)P2yJ4TmKCqke`Aq-U;NJ}WpRu*&|7!3r$c7zU zF#m_6?>Cia!E%D)b;IaF{ zzPG~QEyw>z^LKm}whzS>Dx3Ct`1w98?Y5 + + {545345d0-d90f-4976-a800-ff87ad6947d2} + PluginSDK_D2007R.dpk + Debug + AnyCPU + DCC32 + C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\PluginSDK_D2007R.bpl + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + 0 + DEBUG + + + Delphi.Personality + Package + + + False + True + False + + + PluginSDK for Delphi 2007 (Runtime) + False + False + True + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 3082 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + PluginSDK_D2007R.dpk + + + + + + + MainSource + + + + +
ModuleController
+
+ + + +
+ + \ No newline at end of file diff --git a/Packages/PluginSDK_D2007R.res b/Packages/PluginSDK_D2007R.res new file mode 100644 index 0000000000000000000000000000000000000000..86c94e6ada7b3c85f6761b1ee234a9f34ef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_M@Tsd(p*RT`&t_hS-lG6uB>> z#x>NMcF!UmvR8 + + + + + + + + + + + + PluginSDK_D10R.bdsproj + PluginSDK_D10D.bdsproj + PluginSDK_D10R.bpl PluginSDK_D10D.bpl + + + + diff --git a/Packages/PluginSDK_GroupD10.groupproj b/Packages/PluginSDK_GroupD10.groupproj new file mode 100644 index 0000000..fde6b12 --- /dev/null +++ b/Packages/PluginSDK_GroupD10.groupproj @@ -0,0 +1,40 @@ + + + {5ab3c3c7-1637-4d7c-bd71-3f098e7d8a0e} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/uHostManager.pas b/Source/uHostManager.pas new file mode 100644 index 0000000..44cf8de --- /dev/null +++ b/Source/uHostManager.pas @@ -0,0 +1,301 @@ + +unit uHostManager; + +interface + +uses + Windows, Classes, Forms, Menus, Contnrs, + uInterfaces, uModuleController; + +type + { TModuleInfo } + TModuleInfo = class(TObject) + private + FPackageHandle: HModule; + FFileName : String; + FName: string; + FVersion : string; + FModule: TModuleController; + FModuleClass: TModuleControllerClass; + public + constructor Create(AModuleClass: TModuleControllerClass; + const FileName : String); + destructor Destroy; override; + property Module: TModuleController read FModule; + property Name: string read FName; + property FileName : string read FFileName; + property PackageHandle: HModule read FPackageHandle; + property Version: String read FVersion; + end; + + { Events } + TBeforeLoadEvent = procedure(Sender: TObject; FileName: string; var Allow: Boolean) of object; + TAfterLoadEvent = procedure(Sender: TObject; AModuleInfo : TModuleInfo) of object; + TBeforeUnloadEvent = procedure(Sender: TObject; AModuleInfo : TModuleInfo) of object; + TAfterUnloadEvent = procedure(Sender: TObject; FileName: string) of object; + + { THostManager } + THostManager = class(TComponent) + private + FMainForm : TForm; + FMainMenu : TMainMenu; + FBPLPath : String; + FInstancesList : TList; + FModules : TObjectList; + FOnBeforeLoad : TBeforeLoadEvent; + FOnAfterLoad : TAfterLoadEvent; + FOnBeforeUnload : TBeforeUnloadEvent; + FOnAfterUnload : TAfterUnloadEvent; + protected + function GetInstanceCount: integer; + function GetInstances(Index: integer): TModuleController; + function GetModules(Index: Integer): TModuleInfo; + function GetModulesCount: Integer; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property Instances[Index : integer] : TModuleController read GetInstances; + property InstanceCount : integer read GetInstanceCount; + procedure LoadModules; + function LoadModule(const AFileName : String) : Boolean; + procedure UnloadModules; + function UnloadModule(const AIndex : Integer): Boolean; + property ModulesCount: Integer read GetModulesCount; + property Modules[Index: Integer]: TModuleInfo read GetModules; + published + property BPLPath: string read FBPLPath write FBPLPath; + property MainMenu: TMainMenu read FMainMenu write FMainMenu; + property MainForm: TForm read FMainForm write FMainForm; + property OnBeforeLoad: TBeforeLoadEvent read FOnBeforeLoad write FOnBeforeLoad; + property OnAfterLoad: TAfterLoadEvent read FOnAfterLoad write FOnAfterLoad; + property OnBeforeUnload : TBeforeUnloadEvent read FOnBeforeUnload write FOnBeforeUnload; + property OnAfterUnload: TAfterUnloadEvent read FOnAfterUnload write FOnAfterUnload; + end; + +procedure RegisterModuleClass(AModuleClass : TModuleControllerClass); +procedure UnRegisterModuleClass(AModuleClass : TModuleControllerClass); +function GetModuleClass(AHandle: HMODULE): TModuleControllerClass; + +implementation + +uses + SysUtils, Dialogs; + +const + MODULES_FILES = '*.bpl'; + DEFAULT_DIR = 'Modules'; + +var + FModuleClassList: TClassList; + FModuleHandleList: TStringList; + + +{ TModuleInfo } +constructor TModuleInfo.Create(AModuleClass: TModuleControllerClass; + const FileName : String); +var + GetModulefunc : TGetModuleFunc; +begin + FName := AModuleClass.ClassName; + FPackageHandle := HMODULE(FindClassHInstance(AModuleClass)); + FModuleClass := TModuleControllerClass(FindClass(FName)); + FFileName := FileName; + + @GetModulefunc := GetProcAddress(FPackageHandle, PChar(GET_MODULE_FUNC)); + if (@GetModulefunc = NIL) then + raise Exception.Create('No se ha podido registrar el módulo') + else begin + FModule := GetModulefunc; + end; +end; + +destructor TModuleInfo.Destroy; +begin + FreeAndNIL(FModule); + inherited; +end; + +{ THostManager } +constructor THostManager.Create(AOwner : TComponent); +begin + inherited Create(AOwner); + FMainForm := nil; + FMainMenu := nil; + FBPLPath := ''; + + FInstancesList := TList.Create; + FModules := TObjectList.Create; +end; + +destructor THostManager.Destroy; +begin + UnloadModules; + FreeAndNil(FInstancesList); + FreeAndNil(FModules); + inherited; +end; + +function THostManager.GetInstanceCount: integer; +begin + Result := FInstancesList.Count; +end; + +function THostManager.GetInstances(Index: integer): TModuleController; +begin + Result := TModuleController(FInstancesList.Items[Index]); +end; + +function THostManager.GetModules(Index: Integer): TModuleInfo; +begin + Result := TModuleInfo(FModules[Index]); +end; + +function THostManager.GetModulesCount: Integer; +begin + Result := 0; + if Assigned(FModules) then + Result := FModules.Count; +end; + +function THostManager.LoadModule(const AFileName: String): Boolean; +var + AHandle : HMODULE; + AModuleClass : TModuleControllerClass; + AModuleInfo: TModuleInfo; + CanContinue : Boolean; + AFile : String; +begin + Result := False; + CanContinue := True; + AFile := ExtractFileName(AFileName); + if Assigned(FOnBeforeLoad) then + FOnBeforeLoad(Self, AFile, CanContinue); + + if CanContinue then + begin + AHandle := LoadPackage(AFileName); + AModuleClass := GetModuleClass(AHandle); + if Assigned(AModuleClass) then + begin + AModuleInfo := TModuleInfo.Create(AModuleClass, AFile); + FModules.Add(AModuleInfo); + if Assigned(FOnAfterLoad) then + FOnAfterLoad(Self, AModuleInfo); + end; + Result := True; + end; +end; + +procedure THostManager.LoadModules; +var + SRec : TSearchRec; + AFileName : String; +begin + if FBPLPath = '' then + FBPLPath := ExtractFilePath(Application.ExeName) + + PathDelim + DEFAULT_DIR + PathDelim; + + if Copy(FBPLPath, Length(FBPLPath), 1) <> PathDelim then + FBPLPath := FBPLPath + PathDelim; + + if FindFirst(FBPLPath + MODULES_FILES, faAnyFile, SRec) = 0 then + begin + repeat + AFileName := FBPLPath + SRec.Name; + LoadModule(AFileName); + until FindNext(SRec) <> 0; + end; +end; + +procedure THostManager.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + case Operation of + opRemove: + begin + if (FMainMenu <> nil) and (AComponent is TMainMenu) and + (AComponent = FMainMenu) then + FMainMenu := NIL; + + if (FMainForm <> nil) and (AComponent is TForm) + and (FMainForm = AComponent)then + FMainForm := NIL; + end; + end; +end; + +function THostManager.UnloadModule(const AIndex: Integer): Boolean; +var + AFileName : String; + AHandle : HModule; +begin + if Assigned(FOnBeforeUnload) then + FOnBeforeUnload(Self, Modules[AIndex]); + + AFileName := Modules[AIndex].FileName; + AHandle := Modules[AIndex].PackageHandle; + FModules.Delete(AIndex); + UnloadPackage(AHandle); + + if Assigned(FOnAfterUnload) then + FOnAfterUnload(Self, AFileName); + Result := True; +end; + +procedure THostManager.UnloadModules; +var + i : integer; +begin + for i := (FModules.Count - 1) downto 0 do + UnloadModule(i); +end; + +procedure RegisterModuleClass(AModuleClass : TModuleControllerClass); +var + x : Integer; +begin + x := FModuleClassList.IndexOf(AModuleClass); + if x < 0 then + begin + Classes.RegisterClass(AModuleClass); + FModuleClassList.Add(AModuleClass); + FModuleHandleList.Add(IntToStr(HMODULE(FindClassHInstance(AModuleClass)))); + end; +end; + +procedure UnRegisterModuleClass(AModuleClass : TModuleControllerClass); +var + x : Integer; +begin + x := FModuleClassList.IndexOf(AModuleClass); + if x >= 0 then + begin + FModuleClassList.Delete(x); + FModuleHandleList.Delete(x); + Classes.UnRegisterClass(AModuleClass); + end; +end; + +function GetModuleClass(AHandle: HMODULE): TModuleControllerClass; +var + x : Integer; +begin + Result := Nil; + + x := FModuleHandleList.IndexOf(IntToStr(AHandle)); + if x <> -1 then + Result := TModuleControllerClass(FModuleClassList.Items[x]); +end; + + +initialization + FModuleClassList := TClassList.Create; + FModuleHandleList := TStringList.Create; + +finalization + FreeAndNIL(FModuleClassList); + FreeAndNIL(FModuleHandleList); +end. diff --git a/Source/uInterfaces.pas b/Source/uInterfaces.pas new file mode 100644 index 0000000..9524fe1 --- /dev/null +++ b/Source/uInterfaces.pas @@ -0,0 +1,54 @@ +unit uInterfaces; + +interface + +uses + Windows, Classes, Forms, Menus, ActnList, Controls, uModuleController; + +const + GET_MODULE_FUNC = 'GetModule'; + +type + TGetModuleFunc = function : TModuleController; stdcall; + + { IModule } +{ IModule = interface(IHostAware) + function GetDefaultAction: TAction; + property DefaultAction: TAction read GetDefaultAction; + + function GetDescription: string; + property Description: string read GetDescription; + + procedure SetHModule(const Value: HModule); + function GetHModule: HModule; + property ModuleHandle: HModule read GetHModule write SetHModule; + + function GetMenu: IModuleMenu; + property Menu: IModuleMenu read GetMenu; + + function GetModuleName: string; + property ModuleName: string read GetModuleName; + + function GetSmallImages: TImageList; + function GetLargeImages: TImageList; + function GetLargeImagesDisabled: TImageList; + function GetLargeImagesHot: TImageList; + function GetSmallImagesDisabled: TImageList; + function GetSmallImagesHot: TImageList; + property SmallImages: TImageList read GetSmallImages; + property LargeImages: TImageList read GetLargeImages; + property SmallImagesDisabled: TImageList read GetSmallImagesDisabled; + property LargeImagesDisabled: TImageList read GetLargeImagesDisabled; + property SmallImagesHot: TImageList read GetSmallImagesHot; + property LargeImagesHot: TImageList read GetLargeImagesHot; + end;} + +implementation + +uses + SysUtils, Dialogs, + uHostManager; + +{ TModuleInfo } + +end. diff --git a/Source/uModuleController.dfm b/Source/uModuleController.dfm new file mode 100644 index 0000000..1892417 --- /dev/null +++ b/Source/uModuleController.dfm @@ -0,0 +1,7 @@ +object ModuleController: TModuleController + OldCreateOrder = False + Left = 594 + Top = 308 + Height = 150 + Width = 215 +end diff --git a/Source/uModuleController.pas b/Source/uModuleController.pas new file mode 100644 index 0000000..41298d9 --- /dev/null +++ b/Source/uModuleController.pas @@ -0,0 +1,96 @@ +unit uModuleController; + +interface + +uses + SysUtils, Classes, + uModuleMenu, ImgList, Controls, ActnList, Menus; + +type + TModuleController = class(TDataModule) + private + FDescription : String; + FModuleName : String; + FModuleHandle : HModule; + FModuleMenu : TMainMenu; + FHModule: HModule; + FAuthor: String; + FVersion: String; + FDefaultAction : TAction; + FSmallImages : TImageList; + FLargeImages : TImageList; + FSmallImagesDisabled : TImageList; + FLargeImagesDisabled : TImageList; + FSmallImagesHot : TImageList; + FLargeImagesHot : TImageList; + public + constructor Create(AOwner : TComponent); override; + destructor Destroy; override; + property ModuleHandle: HModule read FHModule write FHModule; + protected + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + published + property DefaultAction: TAction read FDefaultAction write FDefaultAction; + property Description: string read FDescription write FDescription; + property ModuleMenu: TMainMenu read FModuleMenu write FModuleMenu; + property ModuleName: string read FModuleName write FModuleName; + property SmallImages: TImageList read FSmallImages write FSmallImages; + property LargeImages: TImageList read FLargeImages write FLargeImages; + property SmallImagesDisabled: TImageList read FSmallImagesDisabled write FSmallImagesDisabled; + property LargeImagesDisabled: TImageList read FLargeImagesDisabled write FLargeImagesDisabled; + property SmallImagesHot: TImageList read FSmallImagesHot write FSmallImagesHot; + property LargeImagesHot: TImageList read FLargeImagesHot write FLargeImagesHot; + property Author: string read FAuthor write FAuthor; + property Version: string read FVersion write FVersion; + end; + + TModuleControllerClass = class of TModuleController; + +implementation + +{$R *.dfm} + +uses + Dialogs; + + +{ TModuleController } + +constructor TModuleController.Create(AOwner: TComponent); +begin + inherited; + FModuleHandle := 0; +end; + +destructor TModuleController.Destroy; +begin + inherited; +end; + +procedure TModuleController.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + begin + if ModuleMenu = AComponent then + ModuleMenu := NIL; + if DefaultAction = AComponent then + DefaultAction := NIL; + if SmallImages = AComponent then + SmallImages := nil; + if SmallImagesDisabled = AComponent then + SmallImagesDisabled := nil; + if SmallImagesHot = AComponent then + SmallImagesHot := nil; + if LargeImages = AComponent then + LargeImages := nil; + if LargeImagesDisabled = AComponent then + LargeImagesDisabled := nil; + if LargeImagesHot = AComponent then + LargeImagesHot := nil; + end; +end; + +end. diff --git a/Source/uModuleMenu.pas b/Source/uModuleMenu.pas new file mode 100644 index 0000000..c72efb8 --- /dev/null +++ b/Source/uModuleMenu.pas @@ -0,0 +1,90 @@ +unit uModuleMenu; + +interface + +uses + Menus; + +type + + { IModuleMenu } + IModuleMenu = interface(IInterface) + ['{8C844424-13F3-44D6-8B50-F723F964E816}'] + function GetName: string; + procedure SetName(const Value: string); + property Name: string read GetName write SetName; + + function GetItems(Index: Integer): TMenuItem; + property Items[Index: Integer]: TMenuItem read GetItems; + + function GetItemsCount: Integer; + property ItemsCount: Integer read GetItemsCount; + + function AddItem: TMenuItem; + end; + + { TModuleMenu } + TModuleMenu = class(TInterfacedObject, IModuleMenu) + private + FMenu: TMenu; + function GetName: string; + function GetItems(Index: Integer): TMenuItem; + function GetItemsCount: Integer; + procedure SetName(const Value: string); + public + constructor Create(const AMenuCaption: String); + destructor Destroy; override; + function AddItem: TMenuItem; + property Name: string read GetName write SetName; + property Items[Index: Integer]: TMenuItem read GetItems; + property ItemsCount: Integer read GetItemsCount; + end; + +implementation + +uses + SysUtils; + +constructor TModuleMenu.Create(const AMenuCaption: String); +begin + FMenu := TMenu.Create(nil); + if AMenuCaption <> '' then + FMenu.Items.Caption := AMenuCaption; + inherited Create; +end; + +destructor TModuleMenu.Destroy; +begin + FMenu.Free; + inherited; +end; + +function TModuleMenu.AddItem: TMenuItem; +begin + Result := TMenuItem.Create(FMenu); + FMenu.Items.Add(Result); +end; + +function TModuleMenu.GetName: string; +begin + Result := FMenu.Items.Caption; +end; + +function TModuleMenu.GetItems(Index: Integer): TMenuItem; +begin + Result := FMenu.Items.Items[Index]; +end; + +function TModuleMenu.GetItemsCount: Integer; +begin + Result := FMenu.Items.Count; +end; + +procedure TModuleMenu.SetName(const Value: string); +begin + if FMenu.Items.Caption <> Value then + FMenu.Items.Caption := Value; +end; + +end. + diff --git a/Source/uReg.pas b/Source/uReg.pas new file mode 100644 index 0000000..818c181 --- /dev/null +++ b/Source/uReg.pas @@ -0,0 +1,27 @@ +unit uReg; + +{$I PluginSDK.inc} + +interface + +procedure Register; + +implementation + +uses + Classes, + {$IFDEF DELPHI6UP} + DesignEditors, DesignIntf, VCLEditors, + {$ELSE} + DsgnIntf, + {$ENDIF DELPHI6UP} + ToolsAPI, + uHostManager, uModuleController; + +procedure Register; +begin + RegisterComponents('Rodax Plugin', [THostManager]); + RegisterCustomModule(TModuleController, TCustomModule); +end; + +end. diff --git a/Templates/uSamplePluginController.dfm b/Templates/uSamplePluginController.dfm new file mode 100644 index 0000000..aab133e --- /dev/null +++ b/Templates/uSamplePluginController.dfm @@ -0,0 +1,11 @@ +object ModuleController1: TModuleController1 + OldCreateOrder = True + Description = 'Ventas' + ModuleName = 'Ventas' + Author = 'David' + Version = '1.0.0' + Left = 605 + Top = 361 + Height = 258 + Width = 407 +end diff --git a/Templates/uSamplePluginController.pas b/Templates/uSamplePluginController.pas new file mode 100644 index 0000000..2963f39 --- /dev/null +++ b/Templates/uSamplePluginController.pas @@ -0,0 +1,35 @@ +unit uSamplePluginController; + +interface + +uses + uModuleController, uInterfaces, uHostManager; + +type + TModuleController1 = class(TModuleController) + private + { Private declarations } + public + { Public declarations } + end; + +implementation + +{$R *.dfm} + +function GetModule : TModuleController; +begin + Result := TModuleController1.Create(nil); +end; + +exports + GetModule name GET_MODULE_FUNC; + +initialization + RegisterModuleClass(TModuleController1); + +finalization + UnRegisterModuleClass(TModuleController1); + + +end.