Contains routines and types used in LCL Platform definitions.

lclplatformdef.pas contains types, constants, variables and routines used in LCL platform definitions.

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

Represents the supported platforms for the LCL. GIMP ToolKit. GTK version 2. GTK version 3. Windows API (née Win32 API). Windows CE. macOS Carbon API. QT version 4. QT version 5. FreePascal GUI. No GUI. macOS Cocoa API. Custom-drawn. Magic User Interface (MUI) for AmigaOS, AROS. Set type used to store TLCLPlatform enumeration value(s). Gets the platform enumeration value for the specified directory name.

DirNameToLCLPlatform is a TLCLPlatform function used to get the platform identifier for the source directory specified in the ADirName argument. It is assumed that ADirName contains only the directory name relative to ($LazarusDir)/lcl/interfaces without path delimiters. In other words, a value like: 'win32', 'qt5', or 'gtk3'.

DirNameToLCLPlatform performs a case-insensitive comparison between ADirName and each of the values in the LCLPlatformDirNames constant. The return value is the enumeration value which identifies the platform and widgetset for the specified directory.

If a matching value in LCLPlatformDirNames is not found, the return value is set to lpGtk2.

DirNameToLCLPlatform is called from the lazbuild utility when a widgetset override has been provided on the command line.

TLCLPlatform enumeration value for the given directory name. Directory name to convert to a TLCLPlatform enumeration value. Gets the value in the BuildLCLWidgetType variable.

Used in the lazbuild utility to get the target widgetset used for the various platform defines.

TLCLPlatform enumeration value for the platform. Array constant with the directory names for supported LCL platforms.

LCLPlatformDirNames is a array of Strings with directory names for the platforms supported for the LCL. The directory names are relative to the ($LazarusDir)/lcl/interfaces base path and should not include path delimiters. Values in the array are indexed by TLCLPlatform enumeration values.

For example:

// var SDir, SName: String; // SDir contains 'win32' SDir := LCLPlatformDirNames[lpWin32]; // SName contains 'win32/win64' SName := LCLPlatformDisplayNames[lpWin32];

Use LCLPlatformDisplayNames to get the display name for a given TLCLPlatform enumeration value.

Array constant with the display names for supported LCL platforms.

LCLPlatformDisplayNames is a array of Strings with display names for the supported LCL platforms. Values in the array are indexed by TLCLPlatform enumeration values. For example:

// var SDir, SName: String; // SDir contains 'win32' SDir := LCLPlatformDirNames[lpWin32]; // SName contains 'win32/win64' SName := LCLPlatformDisplayNames[lpWin32];

Use LCLPlatformDirNames to get the directory name for a given TLCLPlatform enumeration value.

Gets the TLCLPlatform enumeration value for the current platform.

BuildLCLWidgetType is a TLCLPlatform variable with an enumeration value which identifies the widgetset for the current platform. Its value is determined by the compiler define active when the LCL was built. For example:

MSWindows
Sets the variable to lpWin32.
darwin
Sets the variable to lpCarbon for systems using the PowerPC processor. Otherwise, the variable is set to lpCocoa.
HASAMIGA
Sets the variable to lpMUI.

For other platforms where a specific compiler define was not set, the variable is set to lpGtk2.

The value in BuildLCLWidgetType is used in the lazbuild utility to get the target widgetset used for the various platform defines, and when GetDefaultLCLWidgetType is called from the LCL interface.

For LCL version 2.2 and higher, the default widgetset for the macOS (Darwin) platform uses the Cocoa (lpCocoa) API. For versions prior to 2.2, the default widgetset used was the Carbon (lpCarbon) API. For Macs using the PowerPC processor, the widgetset continues to use the Carbon (lpCarbon) API. GetDefaultLCLWidgetType