-
Notifications
You must be signed in to change notification settings - Fork 0
/
DigIt_Bridge_Intf.pas
213 lines (165 loc) · 7.33 KB
/
DigIt_Bridge_Intf.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
(*******************************************************************************
** DigIt **
** **
** (s) 2024 Massimo Magnano **
** **
********************************************************************************
** Bridge to the Engine **
*******************************************************************************)
unit Digit_Bridge_Intf;
{$mode objfpc}{$H+}
//{$interfaces corba}
interface
const
DigIt_Source_Kind = $0000000F;
DigIt_Source_TakeDataType = $00000FF0;
//
//DigIt_Sources_Kind constants
//
//Standard Source
DigIt_Source_Kind_STD = $00000000;
//
//DigIt_Source_TakeDataType constants
//
//Source return a Filename in Preview/Take/ReTake as a PChar
TakeData_FileName = $00000000;
//Source return a Filename in Preview/Take/ReTake as a PChar
TakeData_ARRAY = $00000001;
(* Maybe Tomorrow
//Source return a Pointer to a Bitmap in Preview/Take/ReTake as a Pointer (IDigIt_Settings.GetMaxBufferSize maximum size)
DigIt_Source_TakeData_BITMAP = $00000002;
*)
DigIt_PluginInfoProcName = 'DigIt_Plugin_Info';
DigIt_PluginInitProcName = 'DigIt_Plugin_Init';
DigIt_PluginReleaseProcName = 'DigIt_Plugin_Release';
type
//Interface Kind
TDigItInterfaceKind = (
diSourceStd, //Standard Source
diDestinationStd
);
//Data Type
TDigItDataType = (
diDataType_FileName, //Filename as a PChar
diDataType_Bitmap //Pointer to a Bitmap
);
IDigIt_Bridge =interface;
TDigIt_PluginInfo = packed record
BridgeMinVer: Byte;
Flags: DWord; { #note -oMaxM : Future use, like kind of Plugin, etc... }
Name: String[32];
Ver: String[5];
end;
// Library in plugins subdirectory must export this procedures:
// "DigIt_Plugin_Info" when get the plugin Info
TDigIt_PluginInfoProc = function (var PluginInfo: TDigIt_PluginInfo): Boolean; stdcall;
// "DigIt_Plugin_Init" when the plugin is initialized
// "DigIt_Plugin_Release" when the plugin is released
TDigIt_PluginInitProc = function (const digitBridge: IDigIt_Bridge): Boolean; stdcall;
// "GetDisplayName"
TDigIt_PluginNameProc = function :PChar; stdcall;
IDigIt_ROArray = Interface
['{D101CADE-C69C-4929-A8DF-1386A8BF4D21}']
function GetCount: DWord; stdcall;
function Get(const aIndex: DWord; out aData: Pointer): Boolean; stdcall;
end;
IDigIt_RWArray = Interface(IDigIt_ROArray)
['{D101CADE-C69C-4929-A8DF-1386A8BF4D22}']
function Put(const aIndex: DWord; var aData: Pointer): Boolean; stdcall;
end;
IDigIt_Params = Interface
['{D101CADE-C69C-4929-A8DF-4E30A587BCB3}']
function GetFromUser: Boolean; stdcall;
function Duplicate: IDigIt_Params; stdcall;
function Load(const xml_File: PChar; const xml_RootPath: PChar): Boolean; stdcall;
function Save(const xml_File: PChar; const xml_RootPath: PChar): Boolean; stdcall;
function Summary(const ASummary: PChar): Integer; stdcall;
function OnSet: Boolean; stdcall;
end;
IDigIt_Interface = Interface
function Flags: TDigItInterfaceKind; stdcall;
function Init: Boolean; stdcall;
function Release: Boolean; stdcall;
function Enabled: Boolean; stdcall;
function setEnabled(AEnabled: Boolean): Boolean; stdcall;
function Params: IDigIt_Params; stdcall;
function UI_Title(out AUI_Title: PChar): Integer; stdcall;
function UI_ImageIndex: Integer; stdcall;
end;
//
//DigIt_Source_TakeAction enum
//
DigIt_Source_TakeAction = (takeActPreview, takeActTake);
IDigIt_Source = Interface(IDigIt_Interface)
['{D101CADE-C69C-4929-A8DF-699AC76DEE00}']
//Take a Picture and returns it on aData according with aDataType
// (if Result is > 1 then aData is a IDigIt_ROArray interface)
function Take(takeAction: DigIt_Source_TakeAction; out aDataType: TDigItDataType; out aData: Pointer): DWord; stdcall;
//Clear internal Data, usually used when we finish processing files
procedure Clear; stdcall;
end;
IDigIt_Sources = Interface
['{D101CADE-C69C-4929-A8DF-8344B540E20F}']
function Register(const aName: PChar; const aClass: IDigIt_Source) :Boolean; stdcall;
//function UnRegister(const aClass : IDigIt_Source) :Boolean; stdcall; { #note 5 -oMaxM : Implementer unregist the Class}
end;
TDigit_CounterData = packed record
rValue,
rValue_Previous: Integer;
rValue_StringPost,
rValue_StringPre: PChar;
rValue_StringDigits: Byte;
end;
{ #note -oMaxM : Not enabled for now until I figure out how to pass the image data and make the thumbnails }
(*
IDigIt_Destination = Interface(IDigIt_Interface)
['{D101CADE-C69C-4929-A8DF-699AC76DEE10}']
//Put cropped image (stored in the temporary file AFileName) and
//return a preview File name in APreviewFileName (Result is the String size) ??
{ #todo 5 -oMaxM : should also return a value to refer to this cropped area in future operations such as rotate/etc }
function Put(counterValue: TDigit_CounterData;
MaxDataSize: DWord; const AFileName, APreviewFileName: PChar): DWord; stdcall;
end;
IDigIt_Destinations = Interface
['{D101CADE-C69C-4929-A8DF-8344B540E21F}']
function Register(const aName: PChar; const aClass: IDigIt_Destination) :Boolean; stdcall;
//function UnRegister(const aClass : IDigIt_Destination) :Boolean; stdcall; { #note 5 -oMaxM : Implementer unregist the Class}
end;
*)
IDigIt_Settings = Interface
['{D101CADE-C69C-4929-A8DF-6B103B8BCBDF}']
//Path consts
function Path_Temp: PChar; stdcall;
function Path_Config: PChar; stdcall;
function Path_Application: PChar; stdcall;
end;
IDigIt_ProgressCallback = Interface
['{D101CADE-C69C-4929-A8DF-2344BF2350B0}']
procedure ProgressCancelClick(ATotalValue, ACurrentValue: Integer); stdcall;
end;
IDigIt_Progress = Interface
['{D101CADE-C69C-4929-A8DF-2344BF2350B1}']
procedure SetTotalVisible(AVisible: Boolean); stdcall;
procedure SetTotalLabel(const ALabel: PChar); stdcall;
procedure SetTotal(AMin, AMax, AValue: Integer; isMarquee: Boolean); stdcall;
procedure SetTotalCaption(const ACaption: PChar); stdcall;
procedure SetTotalValue(AValue: Integer); stdcall;
procedure SetCurrentVisible(AVisible: Boolean); stdcall;
procedure SetCurrent(AMin, AMax, AValue: Integer; isMarquee: Boolean); stdcall;
procedure SetCurrentCaption(const ACaption: PChar); stdcall;
procedure SetCurrentValue(AValue: Integer); stdcall;
procedure SetEventCallBack(const AEventCallBack: IDigIt_ProgressCallback); stdcall;
procedure Show(const ACaption: PChar); stdcall;
procedure Hide; stdcall;
end;
IDigIt_Bridge = Interface
['{D101CADE-C69C-4929-A8DF-C779BE1D5762}']
function Sources: IDigIt_Sources; stdcall;
{ #note -oMaxM : Not enabled for now until I figure out how to pass the image data and make the thumbnails }
//function Destinations: IDigIt_Destinations; stdcall;
function Settings: IDigIt_Settings; stdcall;
function Progress: IDigIt_Progress; stdcall;
//ToolBar, Menù, Pre/PostProcessing Image, etc... { #todo -oMaxM : Maybe Tomorrow }
end;
implementation
end.