From 03134fa5f6f25d92724ce4c183f9bbe12a9e37dc Mon Sep 17 00:00:00 2001 From: "Roberto C. Sanchez" Date: Sat, 29 Mar 2014 10:53:59 -0400 Subject: Imported Upstream version 1.5.11 --- bindings/bcppmake/MainCLXTest.cpp | 16 ++++++ bindings/bcppmake/MainCLXTest.dfm | 16 ++++++ bindings/bcppmake/MainCLXTest.h | 21 ++++++++ bindings/bcppmake/MainTest.cpp | 37 +++++++++++++ bindings/bcppmake/MainTest.dfm | 36 +++++++++++++ bindings/bcppmake/MainTest.h | 25 +++++++++ bindings/bcppmake/Makefile.am | 16 ++++++ bindings/bcppmake/clxtest.bpr | 93 ++++++++++++++++++++++++++++++++ bindings/bcppmake/clxtest.cpp | 24 +++++++++ bindings/bcppmake/sword.bpf | 11 ++++ bindings/bcppmake/sword.bpr | 111 ++++++++++++++++++++++++++++++++++++++ bindings/bcppmake/sword.c | 31 +++++++++++ bindings/bcppmake/sworddll.bpg | 33 ++++++++++++ bindings/bcppmake/test.cpp | 23 ++++++++ 14 files changed, 493 insertions(+) create mode 100644 bindings/bcppmake/MainCLXTest.cpp create mode 100644 bindings/bcppmake/MainCLXTest.dfm create mode 100644 bindings/bcppmake/MainCLXTest.h create mode 100644 bindings/bcppmake/MainTest.cpp create mode 100644 bindings/bcppmake/MainTest.dfm create mode 100644 bindings/bcppmake/MainTest.h create mode 100644 bindings/bcppmake/Makefile.am create mode 100644 bindings/bcppmake/clxtest.bpr create mode 100644 bindings/bcppmake/clxtest.cpp create mode 100644 bindings/bcppmake/sword.bpf create mode 100644 bindings/bcppmake/sword.bpr create mode 100644 bindings/bcppmake/sword.c create mode 100644 bindings/bcppmake/sworddll.bpg create mode 100644 bindings/bcppmake/test.cpp (limited to 'bindings/bcppmake') diff --git a/bindings/bcppmake/MainCLXTest.cpp b/bindings/bcppmake/MainCLXTest.cpp new file mode 100644 index 0000000..b82658a --- /dev/null +++ b/bindings/bcppmake/MainCLXTest.cpp @@ -0,0 +1,16 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop + +#include "MainCLXTest.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TForm2 *Form2; +//--------------------------------------------------------------------------- +__fastcall TForm2::TForm2(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- diff --git a/bindings/bcppmake/MainCLXTest.dfm b/bindings/bcppmake/MainCLXTest.dfm new file mode 100644 index 0000000..3d5e63c --- /dev/null +++ b/bindings/bcppmake/MainCLXTest.dfm @@ -0,0 +1,16 @@ +object Form2: TForm2 + Left = 346 + Top = 107 + Width = 870 + Height = 600 + Caption = 'Form2' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/bindings/bcppmake/MainCLXTest.h b/bindings/bcppmake/MainCLXTest.h new file mode 100644 index 0000000..fbb0f72 --- /dev/null +++ b/bindings/bcppmake/MainCLXTest.h @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- + +#ifndef MainCLXTestH +#define MainCLXTestH +//--------------------------------------------------------------------------- +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TForm2 : public TForm +{ +__published: // IDE-managed Components +private: // User declarations +public: // User declarations + __fastcall TForm2(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TForm2 *Form2; +//--------------------------------------------------------------------------- +#endif diff --git a/bindings/bcppmake/MainTest.cpp b/bindings/bcppmake/MainTest.cpp new file mode 100644 index 0000000..46c0b65 --- /dev/null +++ b/bindings/bcppmake/MainTest.cpp @@ -0,0 +1,37 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop + +#include "MainTest.h" +extern "C" { +#include +} +//using namespace sword; +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TForm1 *Form1; +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormShow(TObject *Sender) +{ + SWHANDLE mgr = SWMgr_new(); + SWHANDLE it = SWMgr_getModulesIterator(mgr); + SWHANDLE module = 0; + String modlist; + do { + module = ModList_iterator_val(it); + if (module) { + modlist += SWModule_getName(module) + (String)"\r\n"; + ModList_iterator_next(it); + } + } while (module); + Memo1->Text = modlist; + SWMgr_delete(mgr); +} +//--------------------------------------------------------------------------- diff --git a/bindings/bcppmake/MainTest.dfm b/bindings/bcppmake/MainTest.dfm new file mode 100644 index 0000000..ffb3c5a --- /dev/null +++ b/bindings/bcppmake/MainTest.dfm @@ -0,0 +1,36 @@ +object Form1: TForm1 + Left = 346 + Top = 234 + Width = 446 + Height = 265 + Caption = 'Form1' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Memo1: TMemo + Left = 0 + Top = 0 + Width = 438 + Height = 197 + Align = alClient + Lines.Strings = ( + 'Memo1') + TabOrder = 0 + end + object Panel1: TPanel + Left = 0 + Top = 197 + Width = 438 + Height = 41 + Align = alBottom + Caption = 'Panel1' + TabOrder = 1 + end +end diff --git a/bindings/bcppmake/MainTest.h b/bindings/bcppmake/MainTest.h new file mode 100644 index 0000000..99802c8 --- /dev/null +++ b/bindings/bcppmake/MainTest.h @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- + +#ifndef MainTestH +#define MainTestH +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + TMemo *Memo1; + TPanel *Panel1; + void __fastcall FormShow(TObject *Sender); +private: // User declarations +public: // User declarations + __fastcall TForm1(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif diff --git a/bindings/bcppmake/Makefile.am b/bindings/bcppmake/Makefile.am new file mode 100644 index 0000000..0e34fea --- /dev/null +++ b/bindings/bcppmake/Makefile.am @@ -0,0 +1,16 @@ +swbcppmakedir = $(top_srcdir)/bindings/bcppmake + +EXTRA_DIST += $(swbcppmakedir)/MainCLXTest.dfm +EXTRA_DIST += $(swbcppmakedir)/MainTest.cpp +EXTRA_DIST += $(swbcppmakedir)/MainTest.h +EXTRA_DIST += $(swbcppmakedir)/clxtest.bpr +EXTRA_DIST += $(swbcppmakedir)/sword.bpf +EXTRA_DIST += $(swbcppmakedir)/sword.c +EXTRA_DIST += $(swbcppmakedir)/test.cpp +EXTRA_DIST += $(swbcppmakedir)/MainCLXTest.cpp +EXTRA_DIST += $(swbcppmakedir)/MainCLXTest.h +EXTRA_DIST += $(swbcppmakedir)/MainTest.dfm +EXTRA_DIST += $(swbcppmakedir)/Makefile.am +EXTRA_DIST += $(swbcppmakedir)/clxtest.cpp +EXTRA_DIST += $(swbcppmakedir)/sword.bpr +EXTRA_DIST += $(swbcppmakedir)/sworddll.bpg diff --git a/bindings/bcppmake/clxtest.bpr b/bindings/bcppmake/clxtest.bpr new file mode 100644 index 0000000..0231ee9 --- /dev/null +++ b/bindings/bcppmake/clxtest.bpr @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + + \ No newline at end of file diff --git a/bindings/bcppmake/clxtest.cpp b/bindings/bcppmake/clxtest.cpp new file mode 100644 index 0000000..9c481eb --- /dev/null +++ b/bindings/bcppmake/clxtest.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("clxtest.res"); +USEFORM("MainCLXTest.cpp", Form2); +USEUNIT("..\clx\Sword.pas"); +USELIB("sword.lib"); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TForm2), &Form2); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/bindings/bcppmake/sword.bpf b/bindings/bcppmake/sword.bpf new file mode 100644 index 0000000..b3caae1 --- /dev/null +++ b/bindings/bcppmake/sword.bpf @@ -0,0 +1,11 @@ +USEUNIT("sword.c"); +USEUNIT("..\flatapi.cpp"); +USELIB("..\..\lib\libsword.lib"); +USELIB("..\..\..\icu-sword\as_is\borland\icui18n.lib"); +USELIB("..\..\..\icu-sword\as_is\borland\icudatab.lib"); +USELIB("..\..\..\icu-sword\as_is\borland\icucommon.lib"); +//--------------------------------------------------------------------------- +This file is used by the project manager only and should be treated like the project file + + +DllEntryPoint \ No newline at end of file diff --git a/bindings/bcppmake/sword.bpr b/bindings/bcppmake/sword.bpr new file mode 100644 index 0000000..092cb6f --- /dev/null +++ b/bindings/bcppmake/sword.bpr @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[HistoryLists\hlIncludePath] +Count=4 +Item0=..\;..;..\..\include;$(BCB)\include;$(BCB)\include\vcl +Item1=..\;..\..\include;$(BCB)\include;$(BCB)\include\vcl +Item2=..\..\include;$(BCB)\include;$(BCB)\include\vcl +Item3=..\;$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=2 +Item0=..\;..;$(BCB)\lib\obj;$(BCB)\lib +Item1=..\;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=2 +Item0=_DEBUG;SWMAKINGDLL +Item1=_DEBUG + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + + \ No newline at end of file diff --git a/bindings/bcppmake/sword.c b/bindings/bcppmake/sword.c new file mode 100644 index 0000000..4c1c100 --- /dev/null +++ b/bindings/bcppmake/sword.c @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- + +#include +//--------------------------------------------------------------------------- +// Important note about DLL memory management when your DLL uses the +// static version of the RunTime Library: +// +// If your DLL exports any functions that pass String objects (or structs/ +// classes containing nested Strings) as parameter or function results, +// you will need to add the library MEMMGR.LIB to both the DLL project and +// any other projects that use the DLL. You will also need to use MEMMGR.LIB +// if any other projects which use the DLL will be performing new or delete +// operations on any non-TObject-derived classes which are exported from the +// DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling +// EXE's to use the BORLNDMM.DLL as their memory manager. In these cases, +// the file BORLNDMM.DLL should be deployed along with your DLL. +// +// To avoid using BORLNDMM.DLL, pass string information using "char *" or +// ShortString parameters. +// +// If your DLL uses the dynamic version of the RTL, you do not need to +// explicitly add MEMMGR.LIB as this will be done implicitly for you +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved) +{ + return 1; +} +//--------------------------------------------------------------------------- + \ No newline at end of file diff --git a/bindings/bcppmake/sworddll.bpg b/bindings/bcppmake/sworddll.bpg new file mode 100644 index 0000000..7f3c269 --- /dev/null +++ b/bindings/bcppmake/sworddll.bpg @@ -0,0 +1,33 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = libsword.lib sword.dll test.exe clxtest.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +libsword.lib: ..\..\lib\bcppmake\libsword.bpr + $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $** + $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak + +sword.dll: sword.bpr + $(ROOT)\bin\bpr2mak $** + $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak + +test.exe: test.bpr + $(ROOT)\bin\bpr2mak $** + $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak + +clxtest.exe: clxtest.bpr + $(ROOT)\bin\bpr2mak $** + $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak + + diff --git a/bindings/bcppmake/test.cpp b/bindings/bcppmake/test.cpp new file mode 100644 index 0000000..1d02c50 --- /dev/null +++ b/bindings/bcppmake/test.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("test.res"); +USEFORM("MainTest.cpp", Form1); +USELIB("sword.lib"); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TForm1), &Form1); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + return 0; +} +//--------------------------------------------------------------------------- -- cgit v1.2.3