diff options
| author | Tomas Bzatek <tbzatek@redhat.com> | 2024-12-23 23:59:45 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@redhat.com> | 2025-11-27 19:36:10 +0100 |
| commit | b9703b29819b619037cc282d719c187e51bacd30 (patch) | |
| tree | bd6d73e5fb6bcb6eb307844103b3dff185f2ac9a /libgtk_kylix/GTKUtils.pas | |
| parent | a9634b933f71a9045e61d29c486f2d51d39fd1e2 (diff) | |
| download | tuxcmd-b9703b29819b619037cc282d719c187e51bacd30.tar.xz | |
Port to g-i generated glib2 bindings
Includes switch to FPC -Mobjfpc and related pointer style fixes.
Diffstat (limited to 'libgtk_kylix/GTKUtils.pas')
| -rw-r--r-- | libgtk_kylix/GTKUtils.pas | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/libgtk_kylix/GTKUtils.pas b/libgtk_kylix/GTKUtils.pas index acc30ca..f893858 100644 --- a/libgtk_kylix/GTKUtils.pas +++ b/libgtk_kylix/GTKUtils.pas @@ -24,11 +24,9 @@ unit GTKUtils; interface -uses gtk2, gdk2, glib2, SysUtils, GTKControls, GTKClasses; +uses gtk2, gdk2, lazglib2, SysUtils, GTKControls, GTKClasses; (********************************************************************************************************************************) -function PgcharToString(const S: Pgchar): string; -function StringToPgchar(const S: string): Pgchar; function AllocateColor(Widget: PGtkWidget; R, G, B: Word): PGdkColor; overload; function AllocateColor(R, G, B: Word): TGDKColor; overload; function KeyValToUnicode(const Key: word): guint32; @@ -50,18 +48,6 @@ function StringToGDKColor(Str: string; var Color: TGDKColor): boolean; implementation (********************************************************************************************************************************) -function PgcharToString(const S: Pgchar): string; -begin - Result := string(S); -end; - -(********************************************************************************************************************************) -function StringToPgchar(const S: string): Pgchar; -begin - Result := PChar(S); -end; - -(********************************************************************************************************************************) function AllocateColor(Widget: PGtkWidget; R, G, B: Word): PGdkColor; begin New(Result); @@ -178,10 +164,10 @@ end; (********************************************************************************************************************************) function PGdkColorToGDKColor(Color: PGdkColor): TGDKColor; begin - Result.pixel := Color.pixel; - Result.red := Color.red; - Result.green := Color.green; - Result.blue := Color.blue; + Result.pixel := Color^.pixel; + Result.red := Color^.red; + Result.green := Color^.green; + Result.blue := Color^.blue; end; (********************************************************************************************************************************) |
