mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 14:38:01 +02:00
Gtk3: cleanup.
This commit is contained in:
parent
1a7bfbe92c
commit
470c7fe34c
@ -21,68 +21,10 @@ end;
|
||||
|
||||
{hook into gtk3 main event loop, used for testing purposes only atm.}
|
||||
procedure Gtk3MainEventLoop(AEvent: PGdkEvent; {%H-}AData: gPointer); cdecl;
|
||||
var
|
||||
AList: PGList;
|
||||
APt: TPoint;
|
||||
AWindow: HWND;
|
||||
AComboBox: TGtk3ComboBox;
|
||||
AWidget: gpointer;
|
||||
AContext: Pcairo_t;
|
||||
x: Double;
|
||||
y: Double;
|
||||
x2: Double;
|
||||
y2: Double;
|
||||
ARegion: Pcairo_region_t;
|
||||
begin
|
||||
{$IFDEF GTK3DEBUGCORE}
|
||||
DebugLn('** TGtk3WidgetSet.Gtk3MainEventLoop **');
|
||||
{$ENDIF}
|
||||
|
||||
// even this does not work correct
|
||||
(*
|
||||
if (AEvent^.type_ = GDK_CONFIGURE) then
|
||||
begin
|
||||
AWidget := g_object_get_data(AEvent^.configure.window,'lclwidget');
|
||||
if AWidget <> nil then
|
||||
begin
|
||||
if wtWindow in TGtk3Widget(AWidget).WidgetType then
|
||||
begin
|
||||
TGtk3Window(AWidget).Gtk3ActivateWindow(AEvent);
|
||||
DebugLn('** WindowState event ',dbgsName(TGtk3Widget(AWidget).LCLObject),' windowState=',dbgs(TGtk3Window(AWidget).GetWindowState));
|
||||
end else
|
||||
DebugLn('** WindowState event not wtWindow ',dbgsName(TGtk3Widget(AWidget).LCLObject));
|
||||
end else
|
||||
DebugLn('** WindowState event UNKNOWN WINDOW !!!');
|
||||
end;
|
||||
*)
|
||||
|
||||
(*
|
||||
if (AEvent^.type_ = GDK_EXPOSE) then
|
||||
begin
|
||||
AWidget := g_object_get_data(AEvent^.expose.window,'lclwidget');
|
||||
if (AWidget <> nil) then
|
||||
begin
|
||||
ARegion := gdk_window_get_clip_region(AEvent^.expose.window);
|
||||
cairo_region_get_extents(ARegion, @ARect);
|
||||
DebugLn('Gtk3MainEventLoop*** EXPOSED ',dbgsName(TGtk3Widget(AWidget).LCLObject),
|
||||
' ownswindow ',dbgs(TGtk3Widget(AWidget).GetContainerWidget^.get_has_window),
|
||||
' window ',dbgHex(PtrUInt(AEvent^.expose.window)),
|
||||
' extents ',Format('x %d y %d x2 %d y2 %d',[ARect.x, ARect.y, ARect.width, ARect.height]));
|
||||
|
||||
{ do not use this otherwise painting is corrupted !!!! testing purposes only
|
||||
AContext := gdk_cairo_create(AEvent^.expose.window);
|
||||
cairo_clip_extents(AContext, @x, @y, @x2, @y2);
|
||||
DebugLn('Gtk3MainEventLoop*** EXPOSED ',dbgsName(TGtk3Widget(AWidget).LCLObject),
|
||||
' window ',dbgHex(PtrUInt(AEvent^.expose.window)),
|
||||
' extents ',Format('x %2.2n y %2.2n x2 %2.2n y2 %2.2n',[x, y, x2, y2]));
|
||||
cairo_surface_flush(cairo_get_target(AContext));
|
||||
cairo_surface_mark_dirty(cairo_get_target(AContext));
|
||||
cairo_destroy(AContext);
|
||||
}
|
||||
end;
|
||||
end;
|
||||
*)
|
||||
|
||||
gtk_main_do_event(AEvent);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user