Skip to content

Commit

Permalink
Fixed build issue in Android projects although it's not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
salvadordf committed Apr 26, 2024
1 parent 82f6d8e commit 4d80d82
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 5 deletions.
5 changes: 5 additions & 0 deletions source/uCEFApplicationCore.pas
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ interface
CHROMEELF_DLL = '';
{$ENDIF}

{$IFDEF ANDROID}
LIBCEF_DLL = '';
CHROMEELF_DLL = '';
{$ENDIF}

// for InitLibLocationFromArgs
LIBCEF_PAK = 'cef.pak';
LIBCEF_LOCALE_DIR = 'locales';
Expand Down
5 changes: 3 additions & 2 deletions source/uCEFFMXWindowParent.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -159,8 +159,9 @@ procedure TFMXWindowParent.Reparent(const aNewParentHandle : {$IFDEF DELPHI18_UP
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;


Expand Down
23 changes: 23 additions & 0 deletions source/uCEFMiscFunctions.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -1465,6 +1471,23 @@ procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : TCe
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
Expand Down
28 changes: 26 additions & 2 deletions source/uCEFTypes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,37 @@ interface
/// </remarks>
TCefCursorHandle = type LongWord;
{$ENDIF}
/// <summary>
/// Native event handle.
/// </summary>
/// <remarks>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_linux.h">CEF source file: /include/internal/cef_types_linux.h (cef_event_handle_t)</see></para>
/// </remarks>
TCefEventHandle = type PXEvent;
{$ENDIF}

{$IFDEF ANDROID}
/// <summary>
/// Native Window handle.
/// </summary>
/// <remarks>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_win.h">CEF source file: /include/internal/cef_types_win.h (cef_window_handle_t)</see></para>
/// </remarks>
TCefWindowHandle = type UIntPtr;
/// <summary>
/// Native Cursor handle.
/// </summary>
/// <remarks>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_win.h">CEF source file: /include/internal/cef_types_win.h (cef_cursor_handle_t)</see></para>
/// </remarks>
TCefCursorHandle = type UIntPtr;
/// <summary>
/// Native event handle.
/// </summary>
/// <remarks>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_linux.h">CEF source file: /include/internal/cef_types_linux.h (cef_event_handle_t)</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_win.h">CEF source file: /include/internal/cef_types_win.h (cef_event_handle_t)</see></para>
/// </remarks>
TCefEventHandle = type PXEvent;
TCefEventHandle = type UIntPtr;
{$ENDIF}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion update_CEF4Delphi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 585,
"InternalVersion" : 586,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "123.0.13"
}
Expand Down

0 comments on commit 4d80d82

Please sign in to comment.