From b9703b29819b619037cc282d719c187e51bacd30 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 23 Dec 2024 23:59:45 +0100 Subject: Port to g-i generated glib2 bindings Includes switch to FPC -Mobjfpc and related pointer style fixes. --- libgtk_kylix/GTKUtils.pas | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'libgtk_kylix/GTKUtils.pas') 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; @@ -49,18 +47,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 @@ -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; (********************************************************************************************************************************) -- cgit v1.2.3