summaryrefslogtreecommitdiff
path: root/libgtk_kylix/GTKUtils.pas
diff options
context:
space:
mode:
Diffstat (limited to 'libgtk_kylix/GTKUtils.pas')
-rw-r--r--libgtk_kylix/GTKUtils.pas41
1 files changed, 36 insertions, 5 deletions
diff --git a/libgtk_kylix/GTKUtils.pas b/libgtk_kylix/GTKUtils.pas
index f893858..c1b662e 100644
--- a/libgtk_kylix/GTKUtils.pas
+++ b/libgtk_kylix/GTKUtils.pas
@@ -1,6 +1,5 @@
(*
GTK-Kylix Library: GTKUtils - Various utilities
- Version 0.6.17 (last updated 2003-10-07)
Copyright (C) 2003 Tomas Bzatek <tbzatek@users.sourceforge.net>
This library is free software; you can redistribute it and/or
@@ -24,13 +23,16 @@ unit GTKUtils;
interface
-uses gtk2, gdk2, lazglib2, SysUtils, GTKControls, GTKClasses;
+uses lazglib2, lazgdk3, lazgtk3, SysUtils, GTKControls, GTKClasses;
(********************************************************************************************************************************)
+(*
function AllocateColor(Widget: PGtkWidget; R, G, B: Word): PGdkColor; overload;
function AllocateColor(R, G, B: Word): TGDKColor; overload;
+*)
function KeyValToUnicode(const Key: word): guint32;
function UnicodeToKeyVal(const UnicodeVal: guint32): word;
+(*
function GetDefaultForegroundColor(State: integer): PGdkColor; overload;
function GetDefaultForegroundColor(Widget: TGTKControl; State: integer): PGdkColor; overload;
function GetDefaultBackgroundColor(State: integer): PGdkColor; overload;
@@ -39,15 +41,20 @@ function GetDefaultBaseColor(State: integer): PGdkColor; overload;
function GetDefaultBaseColor(Widget: TGTKControl; State: integer): PGdkColor; overload;
function GetDefaultTextColor(State: integer): PGdkColor; overload;
function GetDefaultTextColor(Widget: TGTKControl; State: integer): PGdkColor; overload;
-function GDKColorToPGdkColor(Color: TGDKColor): PGdkColor;
-function PGdkColorToGDKColor(Color: PGdkColor): TGDKColor;
+
+function GDKColorToPGdkRGBA(Color: TGDKColor): PGdkRGBA;
+function PGdkRGBAToGDKColor(Color: PGdkRGBA): TGDKColor;
function GDKColorToString(Color: TGDKColor): string;
function StringToGDKColor(Str: string; var Color: TGDKColor): boolean;
+*)
+function ValidateColorString(const Color: string): boolean;
+
(********************************************************************************************************************************)
implementation
(********************************************************************************************************************************)
+(*
function AllocateColor(Widget: PGtkWidget; R, G, B: Word): PGdkColor;
begin
New(Result);
@@ -66,6 +73,7 @@ begin
Result.green := G;
Result.blue := B;
end;
+*)
(********************************************************************************************************************************)
function KeyValToUnicode(const Key: word): guint32;
@@ -80,6 +88,7 @@ begin
end;
(********************************************************************************************************************************)
+(*
function GetDefaultForegroundColor(State: integer): PGdkColor;
var Widget: PGtkWidget;
Style: PGtkStyle;
@@ -96,8 +105,10 @@ begin
Style := gtk_rc_get_style(Widget.FWidget);
Result := @(Style^.fg[State]);
end;
+*)
(********************************************************************************************************************************)
+(*
function GetDefaultBackgroundColor(State: integer): PGdkColor;
var Widget: PGtkWidget;
Style: PGtkStyle;
@@ -114,8 +125,10 @@ begin
Style := gtk_rc_get_style(Widget.FWidget);
Result := @(Style^.bg[State]);
end;
+*)
(********************************************************************************************************************************)
+(*
function GetDefaultBaseColor(State: integer): PGdkColor;
var Widget: PGtkWidget;
Style: PGtkStyle;
@@ -132,8 +145,10 @@ begin
Style := gtk_rc_get_style(Widget.FWidget);
Result := @(Style^.base[State]);
end;
+*)
(********************************************************************************************************************************)
+(*
function GetDefaultTextColor(State: integer): PGdkColor;
var Widget: PGtkWidget;
Style: PGtkStyle;
@@ -150,9 +165,11 @@ begin
Style := gtk_rc_get_style(Widget.FWidget);
Result := @(Style^.text[State]);
end;
+*)
(********************************************************************************************************************************)
-function GDKColorToPGdkColor(Color: TGDKColor): PGdkColor;
+(*
+function GDKColorToPGdkRGBA(Color: TGDKColor): PGdkRGBA;
begin
New(Result);
Result^.pixel := Color.pixel;
@@ -160,8 +177,11 @@ begin
Result^.green := Color.green;
Result^.blue := Color.blue;
end;
+*)
(********************************************************************************************************************************)
+(*
+function PGdkRGBAToGDKColor(Color: PGdkRGBA): TGDKColor;
function PGdkColorToGDKColor(Color: PGdkColor): TGDKColor;
begin
Result.pixel := Color^.pixel;
@@ -169,14 +189,18 @@ begin
Result.green := Color^.green;
Result.blue := Color^.blue;
end;
+*)
(********************************************************************************************************************************)
+(*
function GDKColorToString(Color: TGDKColor): string;
begin
Result := Format('#%.2x%.2x%.2xFF', [Color.red div 256, Color.green div 256, Color.blue div 256]);
end;
+*)
(********************************************************************************************************************************)
+(*
function StringToGDKColor(Str: string; var Color: TGDKColor): boolean;
var AColor: PGdkColor;
begin
@@ -191,7 +215,14 @@ begin
Dispose(AColor);
except end;
end;
+*)
(********************************************************************************************************************************)
+function ValidateColorString(const Color: string): boolean;
+var rgba: TGdkRGBA;
+begin
+ Result := gdk_rgba_parse(@rgba, PChar(Color));
+end;
+
end.