mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 02:53:42 +02:00
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:
parent
ffdfdaa611
commit
b38f796623
@ -49,7 +49,7 @@ begin
|
||||
TSQLTransaction,
|
||||
TIBConnection,
|
||||
{$IFDEF HASODBCCONNECTION}
|
||||
TODBCConnection,
|
||||
TODBCConnection,
|
||||
{$ENDIF}
|
||||
{$IFDEF HASMYSQL50CONNECTION}
|
||||
TMySQL40Connection,
|
||||
|
@ -6,7 +6,7 @@
|
||||
<CompilerOptions>
|
||||
<Version Value="5"/>
|
||||
<SearchPaths>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)/"/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<Generate Value="Faster"/>
|
||||
|
@ -64,6 +64,13 @@ interface
|
||||
{$EndIF}
|
||||
{$EndIF}
|
||||
|
||||
{$IFDEF Unix}
|
||||
{$DEFINE HasX}
|
||||
{$IFDEF Gtk1}
|
||||
{$DEFINE HasGtkX}
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
|
||||
uses
|
||||
{$IFDEF WIN32}
|
||||
// use windows unit first,
|
||||
|
@ -8603,7 +8603,7 @@ end;
|
||||
{$ENDIF UseXinerama}
|
||||
{$ENDIF Gtk1}
|
||||
|
||||
{$IFDEF HasGtkX}
|
||||
{$IFDEF HasX}
|
||||
function XGetWorkarea(var ax,ay,awidth,aheight:gint): gint;
|
||||
|
||||
var
|
||||
|
@ -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}
|
||||
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user