mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 11:19:26 +02:00
gtk: implement DrawDefaultDockImage (as blue rectangle)
git-svn-id: trunk@13666 -
This commit is contained in:
parent
bdb8aa451e
commit
3a02d78daa
@ -80,6 +80,7 @@
|
||||
{$fatal X is required for GTK1}
|
||||
{$endif}
|
||||
{$define GTK_2_8}
|
||||
{$define GTK_2_10}
|
||||
{$endif}
|
||||
|
||||
|
||||
|
@ -125,6 +125,7 @@ type
|
||||
FGlobalCursor: HCursor;
|
||||
|
||||
FDCManager: TDeviceContextMemManager;
|
||||
FDockImage: PGtkWidget;
|
||||
|
||||
function CreateThemeServices: TThemeServices; override;
|
||||
function GetDeviceContextClass: TGtkDeviceContextClass; virtual; abstract;
|
||||
@ -143,7 +144,7 @@ type
|
||||
|
||||
// styles
|
||||
procedure FreeAllStyles; virtual;
|
||||
Function GetCompStyle(Sender : TObject) : Longint; Virtual;
|
||||
function GetCompStyle(Sender : TObject) : Longint; virtual;
|
||||
|
||||
// create and destroy
|
||||
function CreateAPIWidget(AWinControl: TWinControl): PGtkWidget;
|
||||
|
@ -30,6 +30,41 @@
|
||||
|
||||
//##apiwiz##sps## // Do not remove
|
||||
|
||||
procedure TGTKWidgetSet.DrawDefaultDockImage(AOldRect, ANewRect: TRect;
|
||||
AOperation: TDockImageOperation);
|
||||
{$ifdef GTK_2_10}
|
||||
var
|
||||
Colormap: PGdkColormap;
|
||||
Screen: PGdkScreen;
|
||||
{$endif}
|
||||
begin
|
||||
if FDockImage = nil then
|
||||
begin
|
||||
// dock image is just a blue window without title
|
||||
FDockImage := gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_default_size(PGtkWindow(FDockImage),
|
||||
ANewRect.Right - ANewRect.Left, ANewRect.Bottom - ANewRect.Top);
|
||||
gtk_widget_realize(FDockImage);
|
||||
gdk_window_set_decorations(FDockImage^.window, 0);
|
||||
gdk_window_set_functions(FDockImage^.window, GDK_FUNC_RESIZE or GDK_FUNC_CLOSE);
|
||||
SetWidgetColor(FDockImage, clNone, clBlue, [GTK_STATE_NORMAL]);
|
||||
{$ifdef GTK_2_10}
|
||||
// attemp to make window semi-transparent
|
||||
Screen := gtk_widget_get_screen(FDockImage);
|
||||
Colormap := gdk_screen_get_rgba_colormap(Screen);
|
||||
if (Colormap <> nil) and gdk_screen_is_composited(Screen) then
|
||||
gtk_widget_set_colormap(FDockImage, Colormap);
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
gdk_window_move_resize(FDockImage^.window, ANewRect.Left, ANewRect.Top,
|
||||
ANewRect.Right - ANewRect.Left, ANewRect.Bottom - ANewRect.Top);
|
||||
case AOperation of
|
||||
disShow: gtk_widget_show(FDockImage);
|
||||
disHide: gtk_widget_hide(FDockImage);
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function TGtkWidgetSet.ExtUTF8Out(DC: HDC; X, Y: Integer; Options: Longint;
|
||||
Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean;
|
||||
|
@ -37,6 +37,7 @@ function AddProcessEventHandler(AHandle: THandle;
|
||||
AEventHandler: TChildExitEvent; AData: PtrInt): PProcessEventHandler; override;
|
||||
|
||||
function CreateStandardCursor(ACursor: SmallInt): hCursor; override;
|
||||
procedure DrawDefaultDockImage(AOldRect, ANewRect: TRect; AOperation: TDockImageOperation); override;
|
||||
|
||||
function ExtUTF8Out(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect;
|
||||
Str: PChar; Count: Longint; Dx: PInteger): Boolean; override;
|
||||
|
@ -362,6 +362,9 @@ var
|
||||
QueueItem : TGtkMessageQueueItem;
|
||||
NextQueueItem : TGtkMessageQueueItem;
|
||||
begin
|
||||
if FDockImage <> nil then
|
||||
gtk_widget_destroy(FDockImage);
|
||||
|
||||
ReAllocMem(FExtUTF8OutCache,0);
|
||||
FExtUTF8OutCacheSize:=0;
|
||||
|
||||
|
@ -83,6 +83,9 @@ procedure gdk_display_get_maximal_cursor_size(display: PGdkDisplay; w, h: pguint
|
||||
procedure gdk_display_warp_pointer(display: PGdkDisplay; screen: PGdkScreen; x, y: gint); cdecl; external gdklib;
|
||||
function gdk_screen_get_rgba_colormap(screen: PGdkScreen): PGdkColormap; cdecl; external gdklib;
|
||||
{$endif}
|
||||
{$ifdef GTK_2_10}
|
||||
function gdk_screen_is_composited(screen: PGdkScreen): gboolean; cdecl; external gdklib;
|
||||
{$endif}
|
||||
{ for future use
|
||||
function gdk_display_supports_cursor_alpha(display: PGdkDisplay): gBoolean; cdecl; external gdklib;
|
||||
function gdk_display_supports_cursor_color(display: PGdkDisplay): gBoolean; cdecl; external gdklib;
|
||||
|
Loading…
Reference in New Issue
Block a user