From 4d80d8258884f32ac3cfc9d4a0839e9821f90665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvador=20D=C3=ADaz=20Fau?= Date: Fri, 26 Apr 2024 15:54:09 +0200 Subject: [PATCH] Fixed build issue in Android projects although it's not supported --- source/uCEFApplicationCore.pas | 5 +++++ source/uCEFFMXWindowParent.pas | 5 +++-- source/uCEFMiscFunctions.pas | 23 +++++++++++++++++++++++ source/uCEFTypes.pas | 28 ++++++++++++++++++++++++++-- update_CEF4Delphi.json | 2 +- 5 files changed, 58 insertions(+), 5 deletions(-) diff --git a/source/uCEFApplicationCore.pas b/source/uCEFApplicationCore.pas index 1484ac1f..5c7f81d2 100644 --- a/source/uCEFApplicationCore.pas +++ b/source/uCEFApplicationCore.pas @@ -48,6 +48,11 @@ const CHROMEELF_DLL = ''; {$ENDIF} + {$IFDEF ANDROID} + LIBCEF_DLL = ''; + CHROMEELF_DLL = ''; + {$ENDIF} + // for InitLibLocationFromArgs LIBCEF_PAK = 'cef.pak'; LIBCEF_LOCALE_DIR = 'locales'; diff --git a/source/uCEFFMXWindowParent.pas b/source/uCEFFMXWindowParent.pas index 23fea2ba..54fdfc29 100644 --- a/source/uCEFFMXWindowParent.pas +++ b/source/uCEFFMXWindowParent.pas @@ -70,7 +70,7 @@ implementation // It's also necessary to call "Reparent" to add this component as a child component to your form. uses - System.SysUtils, FMX.Platform, FMX.Platform.Win, + System.SysUtils, FMX.Platform, {$IFDEF MSWINDOWS}FMX.Platform.Win,{$ENDIF} uCEFApplicationCore; {$IFDEF DELPHI17_UP} @@ -159,8 +159,9 @@ end; procedure TFMXWindowParent.Notification(AComponent: TComponent; Operation: TOperation); begin inherited Notification(AComponent, Operation); - + {$IFDEF MSWINDOWS} if (Operation = opRemove) and (AComponent = FChromium) then FChromium := nil; + {$ENDIF} end; diff --git a/source/uCEFMiscFunctions.pas b/source/uCEFMiscFunctions.pas index 1ced4bc2..0b480cc6 100644 --- a/source/uCEFMiscFunctions.pas +++ b/source/uCEFMiscFunctions.pas @@ -311,6 +311,12 @@ procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : TCefWind procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring = ''); {$ENDIF} +{$IFDEF ANDROID} +procedure WindowInfoAsChild(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; aRect : TRect; const aWindowName : ustring = ''; aExStyle : DWORD = 0); +procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring = ''; aExStyle : DWORD = 0); +procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring = ''; aExStyle : DWORD = 0); +{$ENDIF} + {$IFDEF MSWINDOWS} function ProcessUnderWow64(hProcess: THandle; Wow64Process: PBOOL): BOOL; stdcall; external Kernel32DLL name 'IsWow64Process'; function PathIsRelativeAnsi(pszPath: LPCSTR): BOOL; stdcall; external SHLWAPIDLL name 'PathIsRelativeA'; @@ -1465,6 +1471,23 @@ begin end; {$ENDIF} +{$IFDEF ANDROID} +procedure WindowInfoAsChild(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; aRect : TRect; const aWindowName : ustring; aExStyle : DWORD); +begin + // +end; + +procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring; aExStyle : DWORD); +begin + // +end; + +procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring; aExStyle : DWORD); +begin + // +end; +{$ENDIF} + function CefIsCertStatusError(Status : TCefCertStatus) : boolean; begin Result := (GlobalCEFApp <> nil) and diff --git a/source/uCEFTypes.pas b/source/uCEFTypes.pas index 21e0a517..4805fbf1 100644 --- a/source/uCEFTypes.pas +++ b/source/uCEFTypes.pas @@ -325,13 +325,37 @@ type /// TCefCursorHandle = type LongWord; {$ENDIF} + /// + /// Native event handle. + /// + /// + /// CEF source file: /include/internal/cef_types_linux.h (cef_event_handle_t) + /// + TCefEventHandle = type PXEvent; + {$ENDIF} + + {$IFDEF ANDROID} + /// + /// Native Window handle. + /// + /// + /// CEF source file: /include/internal/cef_types_win.h (cef_window_handle_t) + /// + TCefWindowHandle = type UIntPtr; + /// + /// Native Cursor handle. + /// + /// + /// CEF source file: /include/internal/cef_types_win.h (cef_cursor_handle_t) + /// + TCefCursorHandle = type UIntPtr; /// /// Native event handle. /// /// - /// CEF source file: /include/internal/cef_types_linux.h (cef_event_handle_t) + /// CEF source file: /include/internal/cef_types_win.h (cef_event_handle_t) /// - TCefEventHandle = type PXEvent; + TCefEventHandle = type UIntPtr; {$ENDIF} /// diff --git a/update_CEF4Delphi.json b/update_CEF4Delphi.json index d7b0f524..423e8e43 100644 --- a/update_CEF4Delphi.json +++ b/update_CEF4Delphi.json @@ -2,7 +2,7 @@ "UpdateLazPackages" : [ { "ForceNotify" : true, - "InternalVersion" : 585, + "InternalVersion" : 586, "Name" : "cef4delphi_lazarus.lpk", "Version" : "123.0.13" }