gtk intf: made some gtk1-X functions available to gtk2-X (e.g. XGetWorkArea) from Felipe

git-svn-id: trunk@10099 -
This commit is contained in:
mattias 2006-10-23 10:18:30 +00:00
parent ffdfdaa611
commit b38f796623
6 changed files with 15 additions and 7 deletions

View File

@ -49,7 +49,7 @@ begin
TSQLTransaction,
TIBConnection,
{$IFDEF HASODBCCONNECTION}
TODBCConnection,
TODBCConnection,
{$ENDIF}
{$IFDEF HASMYSQL50CONNECTION}
TMySQL40Connection,

View File

@ -6,7 +6,7 @@
<CompilerOptions>
<Version Value="5"/>
<SearchPaths>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)/"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>

View File

@ -64,6 +64,13 @@ interface
{$EndIF}
{$EndIF}
{$IFDEF Unix}
{$DEFINE HasX}
{$IFDEF Gtk1}
{$DEFINE HasGtkX}
{$ENDIF}
{$ENDIF}
uses
{$IFDEF WIN32}
// use windows unit first,

View File

@ -8603,7 +8603,7 @@ end;
{$ENDIF UseXinerama}
{$ENDIF Gtk1}
{$IFDEF HasGtkX}
{$IFDEF HasX}
function XGetWorkarea(var ax,ay,awidth,aheight:gint): gint;
var

View File

@ -798,7 +798,7 @@ Procedure GetTextExtentIgnoringAmpersands(FontDesc: PGDKFont; Str: PChar;
function GetDefaultFontName: string;
Procedure FillScreenFonts(ScreenFonts: TStrings);
function GetTextHeight(DCTextMetric: TDevContextTextMetric): integer;
{$IFDEF GtkHasX}
{$IFDEF HasX}
function XGetWorkarea(var ax,ay,awidth,aheight:gint): gint;
{$ENDIF}

View File

@ -5299,7 +5299,7 @@ begin
{$IFDEF Gtk1}
exit;
{$ELSE}
{$IFDEF GtkHasX}
{$IFDEF HasX}
GDKWindow:=gdk_screen_get_root_window(gdk_screen_get_default);
{$ELSE}
exit;
@ -5651,6 +5651,7 @@ end;
function TGtkWidgetSet.GetSystemMetrics(nIndex: Integer): Integer;
var
P : Pointer;
ax,ay,ah,aw : gint;
begin
Assert(False, Format('Trace:> [TGtkWidgetSet.GetSystemMetrics] %d', [nIndex]));
case nIndex of
@ -5754,14 +5755,14 @@ begin
end;
SM_CXMAXIMIZED:
begin
{$IFDEF GtkHasX}
{$IFDEF HasX}
if XGetWorkarea(ax,ay,aw,ah)>=0 then result:=aw
else getSystemMetrics(SM_CXSCREEN);
{$ENDIF}
end;
SM_CYMAXIMIZED:
begin
{$IFDEF GtkHasX}
{$IFDEF HasX}
if XGetWorkarea(ax,ay,aw,ah)>=0 then result:=ah
else getSystemMetrics(SM_CYSCREEN);
{$ENDIF}