* Fixed compilation for gtk2

git-svn-id: trunk@5414 -
This commit is contained in:
marc 2004-04-19 09:30:04 +00:00
parent 05f9bbe917
commit 2d80402433
5 changed files with 30 additions and 13 deletions

View File

@ -267,7 +267,12 @@ const
type type
TGdkPixBufBuffer = {$IFDEF Gtk2}Pguchar{$ELSE}PChar{$ENDIF}; TGdkPixBufBuffer = {$IFDEF Gtk2}Pguchar{$ELSE}PChar{$ENDIF};
{$IFDEF GTK2}
const
GDK_VOIDSYMBOL = $FFFFFF;
{$ENDIF}
// MWE: All the IFDEFs for GTK2 annoyed me so I defined all (most) constants here // MWE: All the IFDEFs for GTK2 annoyed me so I defined all (most) constants here
{$IFNDEF GTK2} {$IFNDEF GTK2}
{$I gtkkeysyms.inc} {$I gtkkeysyms.inc}
@ -569,6 +574,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.59 2004/04/19 09:30:04 marc
* Fixed compilation for gtk2
Revision 1.58 2004/04/18 23:55:39 marc Revision 1.58 2004/04/18 23:55:39 marc
* Applied patch from Ladislav Michl * Applied patch from Ladislav Michl
* Changed the way TControl.Text is resolved * Changed the way TControl.Text is resolved

View File

@ -2067,7 +2067,7 @@ function TGtkWidgetSet.GetWindowRawImageDescription(GDKWindow: PGdkWindow;
var var
Visual: PGdkVisual; Visual: PGdkVisual;
Width, Height: integer; Width, Height: integer;
WindowType: TGdkWindowType; // WindowType: TGdkWindowType;
IsGdkBitmap: Boolean; IsGdkBitmap: Boolean;
begin begin
Result := false; Result := false;
@ -2084,15 +2084,15 @@ begin
If GDKWindow <> nil then begin If GDKWindow <> nil then begin
Visual:=gdk_window_get_visual(GDKWindow); Visual:=gdk_window_get_visual(GDKWindow);
GDK_Window_Get_Size(GDKWindow,@Width,@Height); GDK_Window_Get_Size(GDKWindow,@Width,@Height);
if Visual=nil then begin // if Visual=nil then begin
WindowType:=gdk_window_get_type(GDKWindow); // WindowType:=gdk_window_get_type(GDKWindow);
if WindowType=GDK_WINDOW_PIXMAP then begin // if WindowType=GDK_WINDOW_PIXMAP then begin
// a pixmap without visual // a pixmap without visual
//writeln('TGtkWidgetSet.GetWindowRawImageDescription GdkBitmap Type=',WindowType,' ',Width,',',Height,' ',GDK_WINDOW_PIXMAP); //writeln('TGtkWidgetSet.GetWindowRawImageDescription GdkBitmap Type=',WindowType,' ',Width,',',Height,' ',GDK_WINDOW_PIXMAP);
// ToDo: find a test: gdkpixmap or gdkbitmap // ToDo: find a test: gdkpixmap or gdkbitmap
//if IsBitmap then IsGdkBitmap:=true; //if IsBitmap then IsGdkBitmap:=true;
end; // end;
end; // end;
end; end;
if Visual=nil then begin if Visual=nil then begin
Visual := GDK_Visual_Get_System; Visual := GDK_Visual_Get_System;
@ -9404,6 +9404,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.496 2004/04/19 09:30:04 marc
* Fixed compilation for gtk2
Revision 1.495 2004/04/18 23:55:39 marc Revision 1.495 2004/04/18 23:55:39 marc
* Applied patch from Ladislav Michl * Applied patch from Ladislav Michl
* Changed the way TControl.Text is resolved * Changed the way TControl.Text is resolved

View File

@ -4023,11 +4023,6 @@ begin
Result := PAcceleratorKey(gtk_object_get_data(PGtkObject(Widget),'AccelKey')); Result := PAcceleratorKey(gtk_object_get_data(PGtkObject(Widget),'AccelKey'));
end; end;
{$Ifdef GTK2}
const
GDK_VOIDSYMBOL = $FFFFFF;
{$EndIf}
function SetAccelKey(const Widget: PGtkWidget; function SetAccelKey(const Widget: PGtkWidget;
Key: guint; Mods: TGdkModifierType; const Signal: string): PAcceleratorKey; Key: guint; Mods: TGdkModifierType; const Signal: string): PAcceleratorKey;
begin begin
@ -6747,6 +6742,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.276 2004/04/19 09:30:04 marc
* Fixed compilation for gtk2
Revision 1.275 2004/04/11 18:58:26 micha Revision 1.275 2004/04/11 18:58:26 micha
fix (lm_)setcursor changes for gtk target fix (lm_)setcursor changes for gtk target

View File

@ -28,7 +28,11 @@ interface
uses uses
// libs // libs
{$IFDEF GTK2}
GLib2, Gtk2,
{$ELSE}
GLib, Gtk, GLib, Gtk,
{$ENDIF}
// LCL // LCL
Buttons, Classes, LCLType, LMessages, Controls, Buttons, Classes, LCLType, LMessages, Controls,
// widgetset // widgetset
@ -139,7 +143,11 @@ begin
end; end;
BtnWidget := PGtkButton(AWinControl.Handle); BtnWidget := PGtkButton(AWinControl.Handle);
{$IFDEF GTK2}
LblWidget := PGtkLabel(PGtkBin(BtnWidget)^.Child);
{$ELSE}
LblWidget := PGtkLabel(BtnWidget^.Child); LblWidget := PGtkLabel(BtnWidget^.Child);
{$ENDIF}
if LblWidget = nil if LblWidget = nil
then begin then begin

View File

@ -27,7 +27,7 @@ unit GtkWSControls;
interface interface
uses uses
Gtk, {$IFDEF GTK2} Gtk2, {$ELSE} Gtk, {$ENDIF}
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
// I M P O R T A N T // I M P O R T A N T
//////////////////////////////////////////////////// ////////////////////////////////////////////////////