File: noguiint.pp

package info (click to toggle)
lazarus 2.2.6%2Bdfsg2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 219,980 kB
  • sloc: pascal: 1,944,919; xml: 357,634; makefile: 270,608; cpp: 57,115; sh: 3,249; java: 609; perl: 297; sql: 222; ansic: 137
file content (166 lines) | stat: -rw-r--r-- 3,542 bytes parent folder | download | duplicates (3)
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
{
 *****************************************************************************
  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.
 *****************************************************************************
 }

unit NoGUIInt;

{$mode objfpc}{$H+}

interface

{$ifdef Trace}
{$ASSERTIONS ON}
{$endif}

uses
  {$IFDEF TraceGdiCalls}
  LineInfo,
  {$ENDIF}
  // rtl+fcl
  Types, Classes, SysUtils,
  // interfacebase
  InterfaceBase,
  // LCL
  Dialogs, Controls, Forms,
  LCLProc, LCLIntf, LCLType, LCLPlatformDef, Graphics, Menus, Themes,
  // LazUtils
  GraphType,
  // widgetset
  WSLCLClasses;

type

  { TNoGUIWidgetSet }

  TNoGUIWidgetSet = class(TWidgetSet)
    procedure NoGUIWidgetSetWakeMainThread(Sender: TObject);
  protected
  public
    procedure PassCmdLineOptions; override;
  public
    function LCLPlatform: TLCLPlatform; override;
    // Application
    procedure AppInit(var {%H-}ScreenInfo: TScreenInfo); override;
    procedure AppProcessMessages; override;
    procedure AppWaitMessage; override;
    procedure AppTerminate; override;
    procedure AppMinimize; override;
    procedure AppRestore; override;
    procedure AppBringToFront; override;
    procedure AppSetTitle(const {%H-}ATitle: string); override;
    function EnumFontFamiliesEx({%H-}DC: HDC; {%H-}lpLogFont: PLogFont; {%H-}Callback: FontEnumExProc; {%H-}Lparam: LParam; {%H-}Flags: dword): longint; override;
  public
    constructor Create; override;
    destructor Destroy; override;

    // create and destroy
    function CreateTimer({%H-}Interval: integer; {%H-}TimerFunc: TWSTimerProc) : THandle; override;
    function DestroyTimer({%H-}TimerHandle: THandle) : boolean; override;
    procedure DestroyLCLComponent(Sender: TObject);virtual;
  public
  end;

var
  NoGUIWidgetSet: TNoGUIWidgetSet;

implementation

{ TNoGUIWidgetSet }

procedure TNoGUIWidgetSet.NoGUIWidgetSetWakeMainThread(Sender: TObject);
// Called by thread to wake up the main thread
begin
  // Nothing to be done. The application must call
  // Application.ProcessMessages or CheckSynchronize regularly
end;

procedure TNoGUIWidgetSet.PassCmdLineOptions;
begin
  inherited PassCmdLineOptions;
end;

function TNoGUIWidgetSet.LCLPlatform: TLCLPlatform;
begin
  Result:=lpNoGUI;
end;

procedure TNoGUIWidgetSet.AppInit(var ScreenInfo: TScreenInfo);
begin

end;

procedure TNoGUIWidgetSet.AppProcessMessages;
begin
  if IsMultiThread then
    CheckSynchronize;
end;

procedure TNoGUIWidgetSet.AppWaitMessage;
begin

end;

procedure TNoGUIWidgetSet.AppTerminate;
begin

end;

procedure TNoGUIWidgetSet.AppMinimize;
begin

end;

procedure TNoGUIWidgetSet.AppRestore;
begin

end;

procedure TNoGUIWidgetSet.AppBringToFront;
begin

end;

procedure TNoGUIWidgetSet.AppSetTitle(const ATitle: string);
begin

end;

function TNoGUIWidgetSet.EnumFontFamiliesEx(DC: HDC; lpLogFont: PLogFont;
  Callback: FontEnumExProc; Lparam: LParam; Flags: dword): longint;
begin
  Result:=0;
end;

constructor TNoGUIWidgetSet.Create;
begin
  inherited Create;
  WakeMainThread:=@NoGUIWidgetSetWakeMainThread;
end;

destructor TNoGUIWidgetSet.Destroy;
begin
  inherited Destroy;
end;

function TNoGUIWidgetSet.CreateTimer(Interval: integer; TimerFunc: TWSTimerProc
  ): THandle;
begin
  Result:=0;
end;

function TNoGUIWidgetSet.DestroyTimer(TimerHandle: THandle): boolean;
begin
  Result:=false;
end;

procedure TNoGUIWidgetSet.DestroyLCLComponent(Sender: TObject);
begin

end;

end.