salvadordf / CEF4Delphi

CEF4Delphi is an open source project to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC for Windows, Linux and MacOS.
https://www.briskbard.com/forum/
Other
1.2k stars 365 forks source link

Could not install CEF4Delphi on Lazarus Linux QT #440

Open khongten001 opened 1 year ago

khongten001 commented 1 year ago

Hi @salvadordf

Thank you for developing this awesome components!

I'm facing an error when installing CEF4Delphi on Lazarus Linux QT widget. The error in uCEFLinuxFunctions.pas because QT does not use GDK units! Could you please take a look?

unit uCEFLinuxFunctions;

{$IFDEF FPC}
  {$MODE OBJFPC}{$H+}
{$ENDIF}

{$I cef.inc}

{$IFNDEF TARGET_64BITS}{$ALIGN ON}{$ENDIF}
{$MINENUMSIZE 4}

interface

uses
  {$IFDEF LINUX}
    {$IFDEF FPC}
      ctypes, keysym, xf86keysym, x, xlib,

      //// NO IFDEF FOR LCLQT5!!!!!

      {$IFDEF LCLGTK2}gtk2, glib2, gdk2, gtk2proc, gtk2int, Gtk2Def, gdk2x, Gtk2Extra,{$ENDIF}         
      {$IFDEF LCLGTK3}LazGdk3, LazGtk3, LazGObject2, LazGLib2, gtk3objects, gtk3procs,{$ENDIF}
    {$ENDIF}
  {$ENDIF}
  uCEFLinuxTypes, uCEFTypes;

{$IFDEF LINUX}
// Error here because PGdkEventKey is not defined
procedure GdkEventKeyToCEFKeyEvent(GdkEvent: PGdkEventKey; var aCEFKeyEvent : TCEFKeyEvent);

function  KeyboardCodeFromXKeysym(keysym : uint32) : integer;
function  GetCefStateModifiers(state : uint32) : integer;

// Error here because PGdkEventKey is not defined
function  GdkEventToWindowsKeyCode(Event: PGdkEventKey) : integer;
function  GetWindowsKeyCodeWithoutLocation(key_code : integer) : integer;
function  GetControlCharacter(windows_key_code : integer; shift : boolean) : integer;   

Thank you very much!

salvadordf commented 1 year ago

At this moment, CEF4Delphi only supports GTK.

I would have to learn about QT5 development and then see how it's implemented in the official CEF sample application in order to add QT5 support to CEF4Delphi.

khongten001 commented 11 months ago

The QT back-end for Chromium was merged at https://bugs.chromium.org/p/chromium/issues/detail?id=1317782

Hope CEF will support QT soon :)