Added initial lcl binding for external languages.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@340 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
d43ab07cd5
commit
d2a6c32d49
30
lclbindings/clazhello/Makefile.win
Normal file
30
lclbindings/clazhello/Makefile.win
Normal file
@ -0,0 +1,30 @@
|
||||
# Project: clazhello
|
||||
# Makefile created by Dev-C++ 4.9.9.2
|
||||
|
||||
CPP = g++.exe
|
||||
CC = gcc.exe
|
||||
WINDRES = windres.exe
|
||||
RES =
|
||||
OBJ = clazhello.o $(RES)
|
||||
LINKOBJ = clazhello.o $(RES)
|
||||
LIBS = -L"C:/Programas/Dev-Cpp/lib" -mwindows liblclexports.a
|
||||
INCS = -I"C:/Programas/Dev-Cpp/include" -I"../lclincludes"
|
||||
CXXINCS = -I"C:/Programas/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Programas/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Programas/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Programas/Dev-Cpp/include/c++/3.4.2" -I"C:/Programas/Dev-Cpp/include" -I"../lclincludes"
|
||||
BIN = clazhello.exe
|
||||
CXXFLAGS = $(CXXINCS)
|
||||
CFLAGS = $(INCS)
|
||||
RM = rm -f
|
||||
|
||||
.PHONY: all all-before all-after clean clean-custom
|
||||
|
||||
all: all-before clazhello.exe all-after
|
||||
|
||||
|
||||
clean: clean-custom
|
||||
${RM} $(OBJ) $(BIN)
|
||||
|
||||
$(BIN): $(OBJ)
|
||||
$(CC) $(LINKOBJ) -o "clazhello.exe" $(LIBS)
|
||||
|
||||
clazhello.o: clazhello.c
|
||||
$(CC) -c clazhello.c -o clazhello.o $(CFLAGS)
|
49
lclbindings/clazhello/clazhello.c
Normal file
49
lclbindings/clazhello/clazhello.c
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
clazhello.c
|
||||
|
||||
Simple demonstration program that uses the LCL Exports library to build a GUI
|
||||
|
||||
LICENSE: Public domain
|
||||
|
||||
AUTHOR: Felipe Monteiro de Carvalho
|
||||
*/
|
||||
|
||||
#include "vcl.h"
|
||||
|
||||
TFormH MyForm;
|
||||
TButtonH MyButton;
|
||||
|
||||
/* Callback for the close button */
|
||||
FASTCALL_TNOTIFYEVENT_START(MyButton_OnClick) /* void* Self, TObjectH Sender */
|
||||
|
||||
TCustomForm_Close(MyForm);
|
||||
}
|
||||
|
||||
/* Application entry-point */
|
||||
APPBEGIN()
|
||||
{
|
||||
Application_Initialize();
|
||||
|
||||
Application_CreateForm(&MyForm);
|
||||
|
||||
TControl_SetTop(MyForm, 50);
|
||||
TControl_SetLeft(MyForm, 50);
|
||||
TControl_SetHeight(MyForm, 200);
|
||||
TControl_SetWidth(MyForm, 200);
|
||||
TControl_SetCaption(MyForm, "C Lazarus app");
|
||||
|
||||
MyButton = TButton_Create(MyForm);
|
||||
TWinControl_SetParent(MyButton, MyForm);
|
||||
|
||||
TControl_SetTop(MyButton, 150);
|
||||
TControl_SetLeft(MyButton, 50);
|
||||
TControl_SetWidth(MyButton, 100);
|
||||
|
||||
TControl_SetOnClick(MyButton, &MyButton_OnClick);
|
||||
TControl_SetCaption(MyButton, "Close Button");
|
||||
|
||||
/* Enter main loop */
|
||||
Application_Run();
|
||||
|
||||
return 0;
|
||||
}
|
119
lclbindings/clazhello/clazhello.dev
Normal file
119
lclbindings/clazhello/clazhello.dev
Normal file
@ -0,0 +1,119 @@
|
||||
[Project]
|
||||
FileName=clazhello.dev
|
||||
Name=clazhello
|
||||
UnitCount=7
|
||||
Type=0
|
||||
Ver=1
|
||||
ObjFiles=
|
||||
Includes=..\lclincludes
|
||||
Libs=
|
||||
PrivateResource=
|
||||
ResourceIncludes=
|
||||
MakeIncludes=
|
||||
Compiler=_@@_
|
||||
CppCompiler=
|
||||
Linker=liblclexports.a_@@_
|
||||
IsCpp=0
|
||||
Icon=
|
||||
ExeOutput=
|
||||
ObjectOutput=
|
||||
OverrideOutput=0
|
||||
OverrideOutputName=clazhello.exe
|
||||
HostApplication=
|
||||
Folders=
|
||||
CommandLine=
|
||||
UseCustomMakefile=0
|
||||
CustomMakefile=
|
||||
IncludeVersionInfo=0
|
||||
SupportXPThemes=0
|
||||
CompilerSet=0
|
||||
CompilerSettings=0000000000000000000000
|
||||
|
||||
[Unit1]
|
||||
FileName=clazhello.c
|
||||
CompileCpp=0
|
||||
Folder=
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=$(CC) -c clazhello.c -o clazhello.o $(CFLAGS)
|
||||
|
||||
[VersionInfo]
|
||||
Major=0
|
||||
Minor=1
|
||||
Release=1
|
||||
Build=1
|
||||
LanguageID=1033
|
||||
CharsetID=1252
|
||||
CompanyName=
|
||||
FileVersion=
|
||||
FileDescription=Developed using the Dev-C++ IDE
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=
|
||||
AutoIncBuildNr=0
|
||||
|
||||
[Unit2]
|
||||
FileName=..\lclincludes\classes.h
|
||||
CompileCpp=0
|
||||
Folder=clazhello
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit3]
|
||||
FileName=..\lclincludes\controls.h
|
||||
CompileCpp=0
|
||||
Folder=clazhello
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit4]
|
||||
FileName=..\lclincludes\forms.h
|
||||
CompileCpp=0
|
||||
Folder=clazhello
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit5]
|
||||
FileName=..\lclincludes\stdctrls.h
|
||||
CompileCpp=0
|
||||
Folder=clazhello
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit6]
|
||||
FileName=..\lclincludes\system.h
|
||||
CompileCpp=0
|
||||
Folder=clazhello
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit7]
|
||||
FileName=..\lclincludes\vcl.h
|
||||
CompileCpp=0
|
||||
Folder=clazhello
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
3
lclbindings/lclexports/builddef.bat
Normal file
3
lclbindings/lclexports/builddef.bat
Normal file
@ -0,0 +1,3 @@
|
||||
PATH=c:\Programas\Dev-Cpp\bin\
|
||||
pexports.exe lclexports.dll > liblclexports.def
|
||||
dlltool.exe --def liblclexports.def --dllname lclexports.dll --output-lib liblclexports.a
|
4
lclbindings/lclexports/clean.bat
Normal file
4
lclbindings/lclexports/clean.bat
Normal file
@ -0,0 +1,4 @@
|
||||
del *.o
|
||||
del *.ppu
|
||||
del *.compiled
|
||||
del *.bak
|
131
lclbindings/lclexports/controlsexports.pas
Normal file
131
lclbindings/lclexports/controlsexports.pas
Normal file
@ -0,0 +1,131 @@
|
||||
{
|
||||
controlsexports.pas
|
||||
|
||||
Exports the functionality from the Controls LCL unit
|
||||
|
||||
This file is part of the LCL Exports library.
|
||||
|
||||
LICENSE: The same modifyed LGPL as the Free Pascal Runtime Library
|
||||
and the Lazarus Component Library
|
||||
|
||||
Copyright (C) 2008 Felipe Monteiro de Carvalho
|
||||
}
|
||||
unit controlsexports;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils,
|
||||
Controls;
|
||||
|
||||
{ TControl }
|
||||
|
||||
{ Events }
|
||||
function TControl_GetOnClick(Self: TControl): TNotifyEvent; cdecl;
|
||||
procedure TControl_SetOnClick(Self: TControl; AValue: TNotifyEvent); cdecl;
|
||||
{ Properties }
|
||||
function TControl_GetCaption(Self: TControl): PChar; cdecl;
|
||||
procedure TControl_SetCaption(Self: TControl; AValue: PChar); cdecl;
|
||||
|
||||
function TControl_GetLeft(Self: TControl): Integer; cdecl;
|
||||
procedure TControl_SetLeft(Self: TControl; AValue: Integer); cdecl;
|
||||
function TControl_GetHeight(Self: TControl): Integer; cdecl;
|
||||
procedure TControl_SetHeight(Self: TControl; AValue: Integer); cdecl;
|
||||
function TControl_GetHint(Self: TControl): PChar; cdecl;
|
||||
procedure TControl_SetHint(Self: TControl; AValue: PChar); cdecl;
|
||||
function TControl_GetTop(Self: TControl): Integer; cdecl;
|
||||
procedure TControl_SetTop(Self: TControl; AValue: Integer); cdecl;
|
||||
function TControl_GetWidth(Self: TControl): Integer; cdecl;
|
||||
procedure TControl_SetWidth(Self: TControl; AValue: Integer); cdecl;
|
||||
|
||||
{ TWinControl }
|
||||
|
||||
function TWinControl_GetParent(Self: TWinControl): TWinControl; cdecl;
|
||||
procedure TWinControl_SetParent(Self: TWinControl; AValue: TWinControl); cdecl;
|
||||
|
||||
implementation
|
||||
|
||||
function TControl_GetOnClick(Self: TControl): TNotifyEvent; cdecl;
|
||||
begin
|
||||
Result := Self.OnClick;
|
||||
end;
|
||||
|
||||
procedure TControl_SetOnClick(Self: TControl; AValue: TNotifyEvent); cdecl;
|
||||
begin
|
||||
Self.OnClick := AValue;
|
||||
end;
|
||||
|
||||
function TControl_GetCaption(Self: TControl): PChar; cdecl;
|
||||
begin
|
||||
Result := PChar(Self.Caption);
|
||||
end;
|
||||
|
||||
procedure TControl_SetCaption(Self: TControl; AValue: PChar); cdecl;
|
||||
begin
|
||||
Self.Caption := string(AValue);
|
||||
end;
|
||||
|
||||
function TControl_GetLeft(Self: TControl): Integer; cdecl;
|
||||
begin
|
||||
Result := Self.Left;
|
||||
end;
|
||||
|
||||
procedure TControl_SetLeft(Self: TControl; AValue: Integer); cdecl;
|
||||
begin
|
||||
Self.Left := AValue;
|
||||
end;
|
||||
|
||||
function TControl_GetHeight(Self: TControl): Integer; cdecl;
|
||||
begin
|
||||
Result := Self.Height;
|
||||
end;
|
||||
|
||||
procedure TControl_SetHeight(Self: TControl; AValue: Integer); cdecl;
|
||||
begin
|
||||
Self.Height := AValue;
|
||||
end;
|
||||
|
||||
function TControl_GetHint(Self: TControl): PChar; cdecl;
|
||||
begin
|
||||
Result := PChar(Self.Hint);
|
||||
end;
|
||||
|
||||
procedure TControl_SetHint(Self: TControl; AValue: PChar); cdecl;
|
||||
begin
|
||||
Self.Hint := string(AValue);
|
||||
end;
|
||||
|
||||
function TControl_GetTop(Self: TControl): Integer; cdecl;
|
||||
begin
|
||||
Result := Self.Top;
|
||||
end;
|
||||
|
||||
procedure TControl_SetTop(Self: TControl; AValue: Integer); cdecl;
|
||||
begin
|
||||
Self.Top := AValue;
|
||||
end;
|
||||
|
||||
function TControl_GetWidth(Self: TControl): Integer; cdecl;
|
||||
begin
|
||||
Result := Self.Width;
|
||||
end;
|
||||
|
||||
procedure TControl_SetWidth(Self: TControl; AValue: Integer); cdecl;
|
||||
begin
|
||||
Self.Width := AValue;
|
||||
end;
|
||||
|
||||
function TWinControl_GetParent(Self: TWinControl): TWinControl; cdecl;
|
||||
begin
|
||||
Result := Self.Parent;
|
||||
end;
|
||||
|
||||
procedure TWinControl_SetParent(Self: TWinControl; AValue: TWinControl); cdecl;
|
||||
begin
|
||||
Self.Parent := AValue;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
76
lclbindings/lclexports/formsexports.pas
Normal file
76
lclbindings/lclexports/formsexports.pas
Normal file
@ -0,0 +1,76 @@
|
||||
{
|
||||
formsexports.pas
|
||||
|
||||
Exports the functionality from the Forms LCL unit
|
||||
|
||||
This file is part of the LCL Exports library.
|
||||
|
||||
LICENSE: The same modifyed LGPL as the Free Pascal Runtime Library
|
||||
and the Lazarus Component Library
|
||||
|
||||
Copyright (C) 2008 Felipe Monteiro de Carvalho
|
||||
}
|
||||
unit formsexports;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, Forms;
|
||||
|
||||
{ Application }
|
||||
|
||||
procedure Application_CreateForm(var Reference: Pointer); cdecl;
|
||||
procedure Application_Initialize; cdecl;
|
||||
procedure Application_Run; cdecl;
|
||||
|
||||
{ TCustomForm }
|
||||
|
||||
procedure TCustomForm_Close(Self: TCustomForm); cdecl;
|
||||
procedure TCustomForm_Show(Self: TCustomForm); cdecl;
|
||||
|
||||
{ TForm }
|
||||
|
||||
function TForm_Create(TheOwner: TComponent): TForm; cdecl;
|
||||
|
||||
implementation
|
||||
|
||||
{ Application }
|
||||
|
||||
procedure Application_CreateForm(var Reference: Pointer); cdecl;
|
||||
begin
|
||||
Application.CreateForm(TForm, Reference);
|
||||
end;
|
||||
|
||||
procedure Application_Initialize; cdecl;
|
||||
begin
|
||||
Application.Initialize;
|
||||
end;
|
||||
|
||||
procedure Application_Run; cdecl;
|
||||
begin
|
||||
Application.Run;
|
||||
end;
|
||||
|
||||
{ TCustomForm }
|
||||
|
||||
procedure TCustomForm_Close(Self: TCustomForm); cdecl;
|
||||
begin
|
||||
Self.Close;
|
||||
end;
|
||||
|
||||
procedure TCustomForm_Show(Self: TCustomForm); cdecl;
|
||||
begin
|
||||
Self.Show;
|
||||
end;
|
||||
|
||||
{ TForm }
|
||||
|
||||
function TForm_Create(TheOwner: TComponent): TForm; cdecl;
|
||||
begin
|
||||
Result := TForm.Create(TheOwner);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
56
lclbindings/lclexports/lclexports.dpr
Normal file
56
lclbindings/lclexports/lclexports.dpr
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
lclexports.dpr
|
||||
|
||||
Export library to use LCL functions in other languages
|
||||
|
||||
This file is part of the LCL Exports library.
|
||||
|
||||
LICENSE: The same modifyed LGPL as the Free Pascal Runtime Library
|
||||
and the Lazarus Component Library
|
||||
|
||||
Copyright (C) 2008 Felipe Monteiro de Carvalho
|
||||
}
|
||||
library lclexports;
|
||||
|
||||
{$ifndef fpc}
|
||||
{$mode objfpc}{$H+}
|
||||
{$endif}
|
||||
|
||||
uses
|
||||
Interfaces, // Necessary to create the widgetset object
|
||||
Classes,
|
||||
formsexports,
|
||||
controlsexports,
|
||||
stdctrlsexports;
|
||||
|
||||
exports
|
||||
{ ControlsExports }
|
||||
TControl_GetOnClick,
|
||||
TControl_SetOnClick,
|
||||
TControl_GetCaption,
|
||||
TControl_SetCaption,
|
||||
TControl_GetLeft,
|
||||
TControl_SetLeft,
|
||||
TControl_GetHeight,
|
||||
TControl_SetHeight,
|
||||
TControl_GetHint,
|
||||
TControl_SetHint,
|
||||
TControl_GetTop,
|
||||
TControl_SetTop,
|
||||
TControl_GetWidth,
|
||||
TControl_SetWidth,
|
||||
TWinControl_GetParent,
|
||||
TWinControl_SetParent,
|
||||
{ FormsExports }
|
||||
Application_CreateForm,
|
||||
Application_Initialize,
|
||||
Application_Run,
|
||||
TCustomForm_Close,
|
||||
TCustomForm_Show,
|
||||
TForm_Create,
|
||||
{ StdCtrlsExports }
|
||||
TButton_Create;
|
||||
|
||||
begin
|
||||
end.
|
||||
|
70
lclbindings/lclexports/lclexports.lpi
Normal file
70
lclbindings/lclexports/lclexports.lpi
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="6"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<IconPath Value="./"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
<ProjectVersion Value=""/>
|
||||
</VersionInfo>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IgnoreBinaries Value="False"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="1">
|
||||
<Item1>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="4">
|
||||
<Unit0>
|
||||
<Filename Value="lclexports.dpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="lclexports"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="formsexports.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="formsexports"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="controlsexports.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="controlsexports"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="stdctrlsexports.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="stdctrlsexports"/>
|
||||
</Unit3>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="5"/>
|
||||
<PathDelim Value="\"/>
|
||||
<CodeGeneration>
|
||||
<Generate Value="Faster"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Options>
|
||||
<ExecutableType Value="Library"/>
|
||||
</Options>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
</CONFIG>
|
33
lclbindings/lclexports/stdctrlsexports.pas
Normal file
33
lclbindings/lclexports/stdctrlsexports.pas
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
stdctrlsexports.pas
|
||||
|
||||
Exports the functionality from the StdCtrls LCL unit
|
||||
|
||||
This file is part of the LCL Exports library.
|
||||
|
||||
LICENSE: The same modifyed LGPL as the Free Pascal Runtime Library
|
||||
and the Lazarus Component Library
|
||||
|
||||
Copyright (C) 2008 Felipe Monteiro de Carvalho
|
||||
}
|
||||
unit stdctrlsexports;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils,
|
||||
StdCtrls;
|
||||
|
||||
function TButton_Create(TheOwner: TComponent): TButton; cdecl;
|
||||
|
||||
implementation
|
||||
|
||||
function TButton_Create(TheOwner: TComponent): TButton; cdecl;
|
||||
begin
|
||||
Result := TButton.Create(TheOwner);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
29
lclbindings/lclincludes/classes.h
Normal file
29
lclbindings/lclincludes/classes.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
classes.h
|
||||
|
||||
C/C++ header for the LCL Exports library
|
||||
|
||||
LICENSE: The same modifyed LGPL as the Free Pascal Runtime Library
|
||||
and the Lazarus Component Library
|
||||
|
||||
Copyright (C) 2008 Felipe Monteiro de Carvalho
|
||||
*/
|
||||
|
||||
#ifndef LAZARUS_CLASSES_H
|
||||
#define LAZARUS_CLASSES_H
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* TComponent */
|
||||
|
||||
typedef void* TComponentH;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !LAZARUS_CLASSES_H */
|
88
lclbindings/lclincludes/controls.h
Normal file
88
lclbindings/lclincludes/controls.h
Normal file
@ -0,0 +1,88 @@
|
||||
/*
|
||||
controls.h
|
||||
|
||||
C/C++ header for the LCL Exports library
|
||||
|
||||
LICENSE: The same modifyed LGPL as the Free Pascal Runtime Library
|
||||
and the Lazarus Component Library
|
||||
|
||||
Copyright (C) 2008 Felipe Monteiro de Carvalho
|
||||
*/
|
||||
|
||||
#ifndef LAZARUS_CONTROLS_H
|
||||
#define LAZARUS_CONTROLS_H
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* TControl */
|
||||
|
||||
typedef void* TControlH;
|
||||
|
||||
/* Helper macros to access the parameters of an event */
|
||||
#ifdef __BORLANDC__
|
||||
|
||||
typedef __fastcall void (*TNotifyEvent) (void* Self, TObjectH Sender);
|
||||
|
||||
#define FASTCALL_TNOTIFYEVENT_START(EventName) \
|
||||
__fastcall void EventName(void* Self, TObjectH Sender){
|
||||
|
||||
#elif __GNUC__
|
||||
|
||||
#ifdef __i386__
|
||||
|
||||
typedef void (*TNotifyEvent) (void);
|
||||
|
||||
#define FASTCALL_TNOTIFYEVENT_START(EventName) \
|
||||
void EventName(){ \
|
||||
void* Self; \
|
||||
TObjectH Sender; \
|
||||
__asm__ __volatile__ ("nop" \
|
||||
: "=a" (Self), "=d" (Sender) \
|
||||
: "a" (Self), "d" (Sender) \
|
||||
);
|
||||
|
||||
|
||||
#else
|
||||
|
||||
typedef void (*TNotifyEvent) (void* Self, TObjectH Sender);
|
||||
|
||||
#define FASTCALL_TNOTIFYEVENT_START(EventName) \
|
||||
void EventName(void* Self, TObjectH Sender){
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
__cdecl TNotifyEvent TControl_GetOnClick(TControlH Self);
|
||||
__cdecl TControl_SetOnClick(TControlH Self, TNotifyEvent AValue);
|
||||
|
||||
__cdecl char* TControl_GetCaption(TControlH Self);
|
||||
__cdecl TControl_SetCaption(TControlH Self, char* AValue);
|
||||
|
||||
__cdecl Integer TControl_GetLeft(TControlH Self);
|
||||
__cdecl TControl_SetLeft(TControlH Self, Integer AValue);
|
||||
__cdecl Integer TControl_GetHeight(TControlH Self);
|
||||
__cdecl TControl_SetHeight(TControlH Self, Integer AValue);
|
||||
__cdecl char* TControl_GetHint(TControlH Self);
|
||||
__cdecl TControl_SetHint(TControlH Self, char* AValue);
|
||||
__cdecl Integer TControl_GetTop(TControlH Self);
|
||||
__cdecl TControl_SetTop(TControlH Self, Integer AValue);
|
||||
__cdecl Integer TControl_GetWidth(TControlH Self);
|
||||
__cdecl TControl_SetWidth(TControlH Self, Integer AValue);
|
||||
|
||||
/* TWinControl */
|
||||
|
||||
typedef void* TWinControlH;
|
||||
|
||||
__cdecl TWinControlH TWinControl_GetParent(TWinControlH Self);
|
||||
__cdecl TWinControl_SetParent(TWinControlH Self, TWinControlH AValue);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !LAZARUS_CONTROLS_H */
|
46
lclbindings/lclincludes/forms.h
Normal file
46
lclbindings/lclincludes/forms.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
forms.h
|
||||
|
||||
C/C++ header for the LCL Exports library
|
||||
|
||||
LICENSE: The same modifyed LGPL as the Free Pascal Runtime Library
|
||||
and the Lazarus Component Library
|
||||
|
||||
Copyright (C) 2008 Felipe Monteiro de Carvalho
|
||||
*/
|
||||
|
||||
#ifndef LAZARUS_FORMS_H
|
||||
#define LAZARUS_FORMS_H
|
||||
|
||||
#include "system.h"
|
||||
#include "classes.h"
|
||||
#include "controls.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Application */
|
||||
|
||||
__cdecl void Application_CreateForm(void** Reference);
|
||||
__cdecl void Application_Initialize();
|
||||
__cdecl void Application_Run();
|
||||
|
||||
/* TCustomForm */
|
||||
|
||||
typedef void* TCustomFormH;
|
||||
|
||||
__cdecl void TCustomForm_Close(TCustomFormH Self);
|
||||
__cdecl void TCustomForm_Show(TCustomFormH Self);
|
||||
|
||||
/* TForm */
|
||||
|
||||
typedef void* TFormH;
|
||||
|
||||
__cdecl TFormH TForm_Create(TComponentH Owner);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !LAZARUS_FORMS_H */
|
33
lclbindings/lclincludes/stdctrls.h
Normal file
33
lclbindings/lclincludes/stdctrls.h
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
stdctrls.h
|
||||
|
||||
C/C++ header for the LCL Exports library
|
||||
|
||||
LICENSE: The same modifyed LGPL as the Free Pascal Runtime Library
|
||||
and the Lazarus Component Library
|
||||
|
||||
Copyright (C) 2008 Felipe Monteiro de Carvalho
|
||||
*/
|
||||
|
||||
#ifndef LAZARUS_STDCTRLS_H
|
||||
#define LAZARUS_STDCTRLS_H
|
||||
|
||||
#include "system.h"
|
||||
#include "classes.h"
|
||||
#include "controls.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* TButton */
|
||||
|
||||
typedef void* TButtonH;
|
||||
|
||||
__cdecl TButtonH TButton_Create(TComponentH TheOwner);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !LAZARUS_STDCTRLS_H */
|
54
lclbindings/lclincludes/system.h
Normal file
54
lclbindings/lclincludes/system.h
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
system.h
|
||||
|
||||
C/C++ header for the LCL Exports library
|
||||
|
||||
LICENSE: The same modifyed LGPL as the Free Pascal Runtime Library
|
||||
and the Lazarus Component Library
|
||||
|
||||
Copyright (C) 2008 Felipe Monteiro de Carvalho
|
||||
*/
|
||||
|
||||
/* Basic Pascal declarations */
|
||||
|
||||
#ifndef LAZARUS_SYSTEM_H
|
||||
#define LAZARUS_SYSTEM_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Cross-platform entry-point */
|
||||
|
||||
#ifdef __Win32__
|
||||
|
||||
#define APPBEGIN() \
|
||||
int WINAPI WinMain (HINSTANCE hThisInstance, \
|
||||
HINSTANCE hPrevInstance, \
|
||||
LPSTR lpszArgument, \
|
||||
int nFunsterStil)
|
||||
|
||||
#else
|
||||
|
||||
#define APPBEGIN() \
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
#endif
|
||||
|
||||
typedef void* TObjectH;
|
||||
|
||||
/* 32-bit types */
|
||||
|
||||
typedef int Integer;
|
||||
typedef unsigned int Cardinal;
|
||||
|
||||
/* Variable width types */
|
||||
|
||||
typedef int PtrInt;
|
||||
typedef unsigned int PtrUInt;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !LAZARUS_SYSTEM_H */
|
21
lclbindings/lclincludes/vcl.h
Normal file
21
lclbindings/lclincludes/vcl.h
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
vcl.h
|
||||
|
||||
C/C++ header for the LCL Exports library
|
||||
|
||||
LICENSE: The same modifyed LGPL as the Free Pascal Runtime Library
|
||||
and the Lazarus Component Library
|
||||
|
||||
Copyright (C) 2008 Felipe Monteiro de Carvalho
|
||||
*/
|
||||
|
||||
#ifndef LAZARUS_VCL_H
|
||||
#define LAZARUS_VCL_H
|
||||
|
||||
#include "classes.h"
|
||||
#include "controls.h"
|
||||
#include "forms.h"
|
||||
#include "stdctrls.h"
|
||||
#include "system.h"
|
||||
|
||||
#endif /* !LAZARUS_VCL_H */
|
Loading…
Reference in New Issue
Block a user