You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-12-03 21:44:45 +02:00
Update to CEF 88.2.9
Added the SimpleBrowser demo for Linux. Added Linux support to TChromiumWindow. Removed unused code and added more code comments to the SimpleBrowser demos for Windows.
This commit is contained in:
48
demos/Lazarus_Linux/SimpleBrowser/interfaces.pas
Normal file
48
demos/Lazarus_Linux/SimpleBrowser/interfaces.pas
Normal file
@@ -0,0 +1,48 @@
|
||||
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.
|
||||
Reference in New Issue
Block a user