File: lclintf.inc

package info (click to toggle)
lazarus 4.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 275,760 kB
  • sloc: pascal: 2,341,904; xml: 509,420; makefile: 348,726; cpp: 93,608; sh: 3,387; java: 609; perl: 297; sql: 222; ansic: 137
file content (538 lines) | stat: -rw-r--r-- 18,421 bytes parent folder | download
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
{%MainUnit ../lclintf.pas}
{ $Id$
******************************************************************************
  All interface communication related stuff goes here.
  This file is used by LCLIntf.pas
  If a procedure is platform dependent then it should call:
    WidgetSet.MyDependentProc

  If a procedure insn't platform dependent, it is no part of InterfaseBase has
  to be implementerd here

  !! Keep this alphabetical !!

 *****************************************************************************
  This file is part of the Lazarus Component Library (LCL)

  See the file COPYING.modifiedLGPL.txt, included in this distribution,
  for details about the license.
 *****************************************************************************

******************************************************************************
  These functions redirect to the platform specific interface object.

  Note:
    the section for not referring WidgetSet is at the end
 ******************************************************************************}
//##apiwiz##sps##   // Do not remove

function AddEventHandler(AHandle: TLCLHandle; AFlags: dword;
  AEventHandler: TWaitHandleEvent; AData: PtrInt): PEventHandler;
begin
  Result := WidgetSet.AddEventHandler(AHandle, AFlags, AEventHandler, AData);
end;

function AddPipeEventHandler(AHandle: TLCLHandle; AEventHandler: TPipeEvent;
  AData: PtrInt): PPipeEventHandler;
begin
  Result:=WidgetSet.AddPipeEventHandler(AHandle, AEventHandler, AData);
end;

function AddProcessEventHandler(AHandle: TLCLHandle; AEventHandler: TChildExitEvent;
  AData: PtrInt): PProcessEventHandler;
begin
  Result:=WidgetSet.AddProcessEventHandler(AHandle, AEventHandler, AData);
end;

function AllocateHWnd(Method: TLCLWndMethod): HWND;
begin
  Result := WidgetSet.AllocateHWnd(Method);
end;

function AskUser(const DialogCaption, DialogMessage: string; DialogType: LongInt; Buttons: TDialogButtons; HelpCtx: Longint): LongInt;
begin
  Result := WidgetSet.AskUser(DialogCaption, DialogMessage, DialogType, Buttons, HelpCtx);
end;

procedure CallDefaultWndHandler(Sender: TObject; var Message);
begin
  WidgetSet.CallDefaultWndHandler(Sender,Message);
end;

// the clipboard functions are internally used by TClipboard
function ClipboardFormatToMimeType(FormatID: TClipboardFormat): string;
begin
  Result := WidgetSet.ClipboardFormatToMimeType(FormatID);
end;

function ClipboardGetData(ClipboardType: TClipboardType;
  FormatID: TClipboardFormat; Stream: TStream): boolean;
begin
  Result := WidgetSet.ClipboardGetData(ClipboardType, FormatID, Stream);
end;

// ! List will be created. You must free it yourself with FreeMem(List) !
function ClipboardGetFormats(ClipboardType: TClipboardType;
  var Count: integer; var List: PClipboardFormat): boolean;
begin
  Result := WidgetSet.ClipboardGetFormats(ClipboardType,Count,List);
end;

function ClipboardGetOwnerShip(ClipboardType: TClipboardType;
  OnRequestProc: TClipboardRequestEvent;  FormatCount: integer;
  Formats: PClipboardFormat): boolean;
begin
  Result := WidgetSet.ClipboardGetOwnerShip(ClipboardType, OnRequestProc,
                   FormatCount, Formats);
end;

function ClipboardRegisterFormat(const AMimeType: string): TClipboardFormat;
begin
  Result := WidgetSet.ClipboardRegisterFormat(AMimeType);
end;

function ClipboardFormatNeedsNullByte(const AFormat: TPredefinedClipboardFormat): Boolean;
begin
  Result := WidgetSet.ClipboardFormatNeedsNullByte(AFormat);
end;

function CreateEmptyRegion: hRGN;
begin
  Result := WidgetSet.CreateEmptyRegion;
end;

function CreatePixmapIndirect(const Data: Pointer; const TransColor: Longint): HBITMAP;
begin
  Result := WidgetSet.CreatePixmapIndirect(Data, TransColor);
end;

function CreateRegionCopy(SrcRGN: hRGN): hRGN;
begin
  Result := WidgetSet.CreateRegionCopy(SrcRGN);
end;

function CreateStandardCursor(ACursor: SmallInt): hCursor;
begin
  Result := WidgetSet.CreateStandardCursor(ACursor);
end;

function DCClipRegionValid(DC: HDC): boolean;
begin
  Result := WidgetSet.DCClipRegionValid(DC);
end;

function CreateRubberBand(const ARect: TRect; const ABrush: HBrush = 0): HWND;
begin
  Result := WidgetSet.CreateRubberBand(ARect, ABrush);
end;

procedure DeallocateHWnd(Wnd: HWND);
begin
  WidgetSet.DeallocateHWnd(Wnd);
end;

procedure DestroyRubberBand(ARubberBand: HWND);
begin
  WidgetSet.DestroyRubberBand(ARubberBand);
end;

procedure DrawDefaultDockImage(AOldRect, ANewRect: TRect; AOperation: TDockImageOperation);
begin
  WidgetSet.DrawDefaultDockImage(AOldRect, ANewRect, AOperation);
end;

procedure DrawGrid(DC: HDC; const R: TRect; DX, DY: Integer);
begin
  WidgetSet.DrawGrid(DC, R, DX, DY);
end;

function ExtUTF8Out(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect;
  Str: PChar; Count: Longint; Dx: PInteger): Boolean;
begin
  Result := WidgetSet.ExtUTF8Out(DC,X,Y,Options,Rect,Str,Count,Dx);
end;

function RawImage_CreateBitmaps(const ARawImage: TRawImage; out ABitmap, AMask: HBitmap; ASkipMask: Boolean): Boolean;
begin
  Result := WidgetSet.RawImage_CreateBitmaps(ARawImage, ABitmap, AMask, ASkipMask);
end;

function RawImage_DescriptionFromBitmap(ABitmap: HBITMAP; out ADesc: TRawImageDescription): Boolean;
begin
  Result := WidgetSet.RawImage_DescriptionFromBitmap(ABitmap, ADesc);
end;

function RawImage_DescriptionFromDevice(ADC: HDC; out ADesc: TRawImageDescription): Boolean;
begin
  Result := WidgetSet.RawImage_DescriptionFromDevice(ADC, ADesc);
end;

function RawImage_FromBitmap(out ARawImage: TRawImage; ABitmap, AMask: HBITMAP; ARect: PRect): Boolean;
begin
  Result := WidgetSet.RawImage_FromBitmap(ARawImage, ABitmap, AMask, ARect);
end;

function RawImage_FromDevice(out ARawImage: TRawImage; ADC: HDC; const ARect: TRect): Boolean;
begin
  Result := WidgetSet.RawImage_FromDevice(ARawImage, ADC, ARect);
end;

function RawImage_QueryDescription(AFlags: TRawImageQueryFlags; var ADesc: TRawImageDescription): Boolean;
begin
  Result := WidgetSet.RawImage_QueryDescription(AFlags, ADesc);
end;


function TextUTF8Out(DC: HDC; X, Y: Integer;  Str: PChar; Count: Longint): Boolean;
begin
  Result := WidgetSet.TextUTF8Out(DC,X,Y,Str,Count);
end;

function FontIsMonoSpace(Font: HFont): boolean;
begin
  Result := WidgetSet.FontIsMonoSpace(Font);
end;

function Frame3d(DC: HDC; var ARect: TRect; const FrameWidth: integer;
  const Style: TGraphicsBevelCut): boolean;
begin
  Result := WidgetSet.Frame3d(DC, ARect, FrameWidth, Style);
end;

function GetAvailableNativeCanvasTypes(DC: HDC; AAllowFallbackToParent: Boolean): TNativeCanvasTypes;
begin
  Result := Widgetset.GetAvailableNativeCanvasTypes(DC, AAllowFallbackToParent);
end;

function GetAvailableNativeHandleTypes(Handle: HWND; AAllowFallbackToParent: Boolean): TNativeHandleTypes;
begin
  Result := Widgetset.GetAvailableNativeHandleTypes(Handle, AAllowFallbackToParent);
end;

function GetCaretRespondToFocus(handle: HWND; var ShowHideOnFocus: boolean): Boolean;
begin
  Result := WidgetSet.GetCaretRespondToFocus(handle,ShowHideOnFocus);
end;

{------------------------------------------------------------------------------
  Function: GetClientBounds
  Params: handle:
          ARect:
          Result:
  Returns: true on success

  Returns the client bounds of a control. The client bounds is the rectangle of
  the inner area of a control, where the child controls are visible. The
  coordinates are relative to the control's left and top.
 ------------------------------------------------------------------------------}
function GetClientBounds(Handle: HWND; var ARect: TRect): Boolean;
begin
  Result := WidgetSet.GetClientBounds(Handle, ARect);
end;

{------------------------------------------------------------------------------
  Function: GetCmdLineParamDescForInterface
  Params: none
  Returns: ansistring

  Returns a description of the command line parameters, that are understood by
  the interface.
 ------------------------------------------------------------------------------}
function GetCmdLineParamDescForInterface: TStringList;
begin
  Result := WidgetSet.GetCmdLineParamDescForInterface;
end;

{------------------------------------------------------------------------------
  Function: GetControlConstraints
  Params: Constraints: TObject
  Returns: true on success

  Updates the constraints object (e.g. TSizeConstraints) with interface specific
  bounds. For instance, vertical scrollbars under gtk are fixed in width. So,
  it sets MinInterfaceWidth and MaxInterfaceWidth. This is used by the auto
  aligning/sizing algorithms of the LCL.
 ------------------------------------------------------------------------------}
function GetControlConstraints(Constraints: TObject): boolean;
begin
  Result := WidgetSet.GetControlConstraints(Constraints);
end;

function GetDCOriginRelativeToWindow(PaintDC: HDC; WindowHandle: HWND;
  var OriginDiff: TPoint): boolean;
begin
  Result := WidgetSet.GetDCOriginRelativeToWindow(PaintDC,WindowHandle,
                                                        OriginDiff);
end;

function GetDesignerDC(WindowHandle: HWND): HDC;
begin
  Result := WidgetSet.GetDesignerDC(WindowHandle);
end;

function GetDeviceSize(DC: HDC; var p: TPoint): boolean;
begin
  Result := WidgetSet.GetDeviceSize(DC,p);
end;

function GetLCLOwnerObject(Handle: HWnd): TObject;
begin
  Result := WidgetSet.GetLCLOwnerObject(Handle);
end;

function GetScrollBarSize(Handle: HWND; SBStyle: Integer): integer;
begin
  Result := WidgetSet.GetScrollBarSize(Handle, SBStyle);
end;

function GetScrollbarVisible(Handle: HWND; SBStyle: Integer): boolean;
begin
  Result := WidgetSet.GetScrollbarVisible(Handle, SBStyle);
end;

function GetAcceleratorString(const AVKey: Byte; const AShiftState: TShiftState): String;
begin
  Result := WidgetSet.GetAcceleratorString(AVKey, AShiftState);
end;

function GetNativeCanvas(DC: HDC; AHandleType: TNativeCanvasType; AAllowFallbackToParent: Boolean): PtrInt;
begin
  Result := Widgetset.GetNativeCanvas(DC, AHandleType, AAllowFallbackToParent);
end;

function GetNativeHandle(Handle: HWND; AHandleType: TNativeHandleType; AAllowFallbackToParent: Boolean): PtrInt;
begin
  Result := Widgetset.GetNativeHandle(Handle, AHandleType, AAllowFallbackToParent);
end;

{------------------------------------------------------------------------------
  function GetWindowRelativePosition(Handle: hwnd;
    var Left, Top: integer): boolean;

  Returns the Left, Top, relative to the client origin of its parent.
------------------------------------------------------------------------------}
function GetWindowRelativePosition(Handle: hwnd;
  var Left, Top: integer): boolean;
begin
  Result := WidgetSet.GetWindowRelativePosition(Handle,Left,Top);
end;

{------------------------------------------------------------------------------
  function InvalidateFrame(aHandle: HWND; ARect: pRect; bErase: Boolean;
    BorderWidth: integer): Boolean;

  Calls InvalidateRect for the borderframe.
------------------------------------------------------------------------------}
function InvalidateFrame(aHandle: HWND; ARect: pRect; bErase: Boolean; BorderWidth: integer): Boolean;
begin
  Result := WidgetSet.InvalidateFrame(aHandle,ARect,bErase,BorderWidth);
end;

function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean;
begin
  Result := WidgetSet.IsDesignerDC(WindowHandle, DC);
end;

// Indicates of we have fullscreen-only forms like in a mobile platform
function IsMobilePlatform: Boolean;
begin
  Result := WidgetSet.IsMobilePlatform();
end;

function IsCDIntfControl(AWinControl: TObject): Boolean;
begin
  Result := WidgetSet.IsCDIntfControl(AWinControl);
end;

function MoveWindowOrgEx(dc: hdc; dX,dY: Integer): boolean;
begin
  Result := WidgetSet.MoveWindowOrgEx(DC, dX, dY);
end;

function PromptUser(const DialogMessage: String; DialogType: longint; Buttons: PLongint;
  ButtonCount, DefaultIndex, EscapeResult: Longint): Longint;
begin
  Result := WidgetSet.PromptUser('', DialogMessage, DialogType, Buttons, ButtonCount, DefaultIndex, EscapeResult);
end;

function PromptUser(const DialogCaption, DialogMessage: String; DialogType: longint; Buttons: PLongint;
  ButtonCount, DefaultIndex, EscapeResult: Longint): Longint;
begin
  Result := WidgetSet.PromptUser(DialogCaption, DialogMessage, DialogType, Buttons, ButtonCount, DefaultIndex, EscapeResult);
end;

function PromptUserAtXY(const DialogMessage: String; DialogType: longint; Buttons: PLongint;
  ButtonCount, DefaultIndex, EscapeResult: Longint; X, Y: Longint): Longint;
begin
  Result := WidgetSet.PromptUserAtXY('', DialogMessage, DialogType, Buttons, ButtonCount, DefaultIndex, EscapeResult, X, Y);
end;

function PromptUserAtXY(const DialogCaption, DialogMessage: String; DialogType: longint; Buttons: PLongint;
  ButtonCount, DefaultIndex, EscapeResult: Longint; X, Y: Longint): Longint;
begin
  Result := WidgetSet.PromptUserAtXY(DialogCaption, DialogMessage, DialogType, Buttons, ButtonCount, DefaultIndex, EscapeResult, X, Y);
end;

function RadialChord(DC: HDC; x1, y1, x2, y2, sx, sy, ex, ey: Integer): Boolean;
begin
  Result := WidgetSet.RadialChord(DC, x1, y1, x2, y2, sx, sy, ex, ey);
end;

function RadialArc(DC: HDC; left, top, right, bottom, sx, sy, ex, ey: Integer): Boolean;
begin
  Result := WidgetSet.RadialArc(DC, left, top, right, bottom, sx, sy, ex, ey);
end;

function RadialPie(DC: HDC; x1, y1, x2, y2,
  Angle1,Angle2: Integer): Boolean;
begin
  Result := WidgetSet.RadialPie(DC, x1, y1, x2, y2, Angle1, Angle2);
end;

function RegroupMenuItem(hndMenu: HMENU; GroupIndex: integer): Boolean;
begin
  Result := WidgetSet.RegroupMenuItem(hndMenu,GroupIndex);
end;

function ReleaseDesignerDC(hWnd: HWND; DC: HDC): Integer;
begin
  Result := WidgetSet.ReleaseDesignerDC(hWnd, DC);
end;

procedure RemoveEventHandler(var AHandler: PEventHandler);
begin
  WidgetSet.RemoveEventHandler(AHandler);
end;

procedure RemoveProcessEventHandler(var AHandler: PProcessEventHandler);
begin
  WidgetSet.RemoveProcessEventHandler(AHandler);
end;

procedure RemovePipeEventHandler(var AHandler: PPipeEventHandler);
begin
  WidgetSet.RemovePipeEventHandler(AHandler);
end;

function RequestInput(const InputCaption, InputPrompt: String; MaskInput: Boolean; var Value: String): Boolean;
begin
  Result := WidgetSet.RequestInput(InputCaption, InputPrompt, MaskInput, Value);
end;

procedure SendCachedLCLMessages;
begin
end;

function SetCaretRespondToFocus(Handle: hWnd; ShowHideOnFocus: boolean):Boolean;
begin
  Result := WidgetSet.SetCaretRespondToFocus(Handle,ShowHideOnFocus);
end;

function SetComboMinDropDownSize(Handle: HWND;
  MinItemsWidth, MinItemsHeight, MinItemCount: integer): boolean;
begin
  Result := WidgetSet.SetComboMinDropDownSize(Handle,
                                   MinItemsWidth, MinItemsHeight, MinItemCount);
end;

procedure SetEventHandlerFlags(AHandler: PEventHandler; NewFlags: dword);
begin
  WidgetSet.SetEventHandlerFlags(AHandler, NewFlags);
end;

procedure SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect);
begin
  WidgetSet.SetRubberBandRect(ARubberBand, ARect);
end;

function ShowSelectItemDialog(const AItems: TStrings; APos: TPoint): Boolean;
begin
  Result := Widgetset.ShowSelectItemDialog(AItems, APos);
end;

function StretchMaskBlt(DestDC: HDC; X, Y, Width, Height: Integer;
  SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer;
  Mask: HBITMAP; XMask, YMask: Integer; Rop: DWORD): Boolean;
begin
  Result := WidgetSet.StretchMaskBlt(DestDC, X, Y, Width, Height,
               SrcDC, XSrc, YSrc, SrcWidth, SrcHeight, Mask, XMask, YMask, Rop);
end;

//##apiwiz##eps##   // Do not remove

{******************************************************************************
  Platform independent stuff
 ******************************************************************************}

//##apiwiz##spi##   // Do not remove


{------------------------------------------------------------------------------
  Function: ExcludeClipRgn
  Params:  dc, RGN
  Returns: integer

  Subtracts all intersecting points of the passed Region from the Current
  clipping region in the device context (dc).

  The result can be one of the following constants
      Error
      NullRegion
      SimpleRegion
      ComplexRegion

 ------------------------------------------------------------------------------}
function ExcludeClipRgn(dc: hdc; rgn: hrgn): Integer;
begin
  Result := ExtSelectClipRGN(DC, RGN, RGN_DIFF);
end;

procedure NotifyUser(const DialogMessage: String; DialogType: longint);
begin
  PromptUser(DialogMessage, DialogType, [idButtonOK], 0, -1);
end;

procedure NotifyUser(const DialogCaption, DialogMessage: String; DialogType: longint);
begin
  PromptUser(DialogCaption, DialogMessage, DialogType, [idButtonOK], 0, -1);
end;

procedure NotifyUserAtXY(const DialogMessage: String; DialogType: longint; X, Y: Longint);
begin
  PromptUserAtXY(DialogMessage, DialogType, [idButtonOK], 0, -1, X, Y);
end;

procedure NotifyUserAtXY(const DialogCaption, DialogMessage: String; DialogType: longint; X, Y: Longint);
begin
  PromptUserAtXY(DialogCaption, DialogMessage, DialogType, [idButtonOK], 0, -1, X, Y);
end;

function PromptUser(const DialogMessage: String; DialogType: longint; Buttons: Array of Longint;
  DefaultIndex, EscapeResult: Longint): Longint;
begin
  Result := PromptUser(DialogMessage, DialogType, @Buttons[Low(Buttons)],
    High(Buttons) - Low(Buttons) + 1, DefaultIndex, EscapeResult);
end;

function PromptUser(const DialogCaption, DialogMessage: String; DialogType: longint; Buttons: Array of Longint;
  DefaultIndex, EscapeResult: Longint): Longint;
begin
  Result := PromptUser(DialogCaption, DialogMessage, DialogType, @Buttons[Low(Buttons)],
    High(Buttons) - Low(Buttons) + 1, DefaultIndex, EscapeResult);
end;

function PromptUserAtXY(const DialogMessage: String; DialogType: longint; Buttons: Array of Longint;
  DefaultIndex, EscapeResult: Longint; X, Y: Longint): Longint;
begin
  Result := PromptUserAtXY(DialogMessage, DialogType, @Buttons[Low(Buttons)],
    High(Buttons) - Low(Buttons) + 1, DefaultIndex, EscapeResult, X, Y);
end;

function PromptUserAtXY(const DialogCaption, DialogMessage: String; DialogType: longint; Buttons: Array of Longint;
  DefaultIndex, EscapeResult: Longint; X, Y: Longint): Longint;
begin
  Result := PromptUserAtXY(DialogCaption, DialogMessage, DialogType, @Buttons[Low(Buttons)],
    High(Buttons) - Low(Buttons) + 1, DefaultIndex, EscapeResult, X, Y);
end;

//##apiwiz##epi##   // Do not remove