mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2024-11-15 15:55:56 +01:00
7f3e3415ef
Converted the OSRExternalPumpBrowser demo to GTK3 Converted the TinyBrowser demo to GTK3 Converted the TinyBrowser2 demo to GTK3 Moved all Lazarus demos for Linux to the Lazarus_Linux_GTK2 directory Fixed the Copy.CEF.DLLs tool thanks to fraurino
49 lines
1005 B
ObjectPascal
49 lines
1005 B
ObjectPascal
unit Interfaces;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
interface
|
|
|
|
{$IFDEF UNIX}{$IFNDEF DisableCWString}uses cwstring;{$ENDIF}{$ENDIF}
|
|
|
|
procedure CustomWidgetSetInitialization;
|
|
procedure CustomWidgetSetFinalization;
|
|
|
|
implementation
|
|
|
|
uses
|
|
{$IFNDEF EnableLibOverlay}
|
|
gtk2DisableLibOverlay,
|
|
{$ENDIF}
|
|
Gtk2Int, Forms, xlib;
|
|
|
|
function CustomX11ErrorHandler(Display:PDisplay; ErrorEv:PXErrorEvent):longint;cdecl;
|
|
begin
|
|
{$IFDEF DEBUG}
|
|
XError := ErrorEv^.error_code;
|
|
WriteLn('Error: ' + IntToStr(XError));
|
|
{$ENDIF}
|
|
Result := 0;
|
|
end;
|
|
|
|
function CustomXIOErrorHandler(Display:PDisplay):longint;cdecl;
|
|
begin
|
|
Result := 0;
|
|
end;
|
|
|
|
procedure CustomWidgetSetInitialization;
|
|
begin
|
|
CreateWidgetset(TGtk2WidgetSet);
|
|
// Install xlib error handlers so that the application won't be terminated
|
|
// on non-fatal errors. Must be done after initializing GTK.
|
|
XSetErrorHandler(@CustomX11ErrorHandler);
|
|
XSetIOErrorHandler(@CustomXIOErrorHandler);
|
|
end;
|
|
|
|
procedure CustomWidgetSetFinalization;
|
|
begin
|
|
FreeWidgetSet;
|
|
end;
|
|
|
|
end.
|