1 {
2  *****************************************************************************
3   This file is part of the Lazarus Component Library (LCL)
4 
5   See the file COPYING.modifiedLGPL.txt, included in this distribution,
6   for details about the license.
7  *****************************************************************************
8 
9  Contains the non-GUI dependent parts of LCL Platform definition.
10 }
11 
12 unit LCLPlatformDef;
13 
14 {$mode objfpc}{$H+}
15 
16 interface
17 
18 uses
19   SysUtils;
20 
21 type
22   TLCLPlatform = (
23     lpGtk,
24     lpGtk2,
25     lpGtk3,
26     lpWin32,
27     lpWinCE,
28     lpCarbon,
29     lpQT,
30     lpQt5,
31     lpfpGUI,
32     lpNoGUI,
33     lpCocoa,
34     lpCustomDrawn,
35     lpMUI
36     );
37 
38   TLCLPlatforms = set of TLCLPlatform;
39 
DirNameToLCLPlatformnull40   function DirNameToLCLPlatform(const ADirName: string): TLCLPlatform;
GetBuildLCLWidgetTypenull41   function GetBuildLCLWidgetType: TLCLPlatform;
42 
43 const
44   LCLPlatformDirNames: array[TLCLPlatform] of string = (
45     'gtk',
46     'gtk2',
47     'gtk3',
48     'win32',
49     'wince',
50     'carbon',
51     'qt',
52     'qt5',
53     'fpgui',
54     'nogui',
55     'cocoa',
56     'customdrawn',
57     'mui'
58     );
59 
60   LCLPlatformDisplayNames: array[TLCLPlatform] of string = (
61     'gtk (deprecated)',
62     'gtk2',
63     'gtk3 (alpha)',
64     'win32/win64',
65     'wince',
66     'carbon',
67     'qt',
68     'qt5',
69     'fpGUI (alpha)',
70     'NoGUI',
71     'cocoa',
72     'customdrawn (alpha)',
73     'MUI'
74     );
75 
76 var
77   // set by lazbuild.lpr and used by GetDefaultLCLWidgetType
78   BuildLCLWidgetType: TLCLPlatform =
79     {$IFDEF MSWindows}{$DEFINE WidgetSetDefined}
80     lpWin32;
81     {$ENDIF}
82     {$IFDEF darwin}{$DEFINE WidgetSetDefined}
83     lpCarbon;
84     {$ENDIF}
85     {$IFDEF HASAMIGA}{$DEFINE WidgetSetDefined}
86     lpMUI;
87     {$ENDIF}
88     {$IFNDEF WidgetSetDefined}
89     lpGtk2;
90     {$ENDIF}
91 
92 
93 implementation
94 
DirNameToLCLPlatformnull95 function DirNameToLCLPlatform(const ADirName: string): TLCLPlatform;
96 begin
97   for Result:=Low(TLCLPlatform) to High(TLCLPlatform) do
98     if CompareText(ADirName,LCLPlatformDirNames[Result])=0 then exit;
99   Result:=lpGtk2;
100 end;
101 
GetBuildLCLWidgetTypenull102 function GetBuildLCLWidgetType: TLCLPlatform;
103 begin
104   Result:=BuildLCLWidgetType;
105 end;
106 
107 end.
108 
109