2021-02-06 23:16:02 +01:00
|
|
|
program AppHelper;
|
2021-01-31 16:53:07 +01:00
|
|
|
|
|
|
|
(*
|
|
|
|
* The compiled exe should be copied into
|
|
|
|
* SimpleBrowser.app/Content/Frameworks/SimpleBrowser2 Helper.app/Content/MacOS/SimpleBrowser2 Helper
|
|
|
|
* including app bundle in SimpleBrowser2.app/Content/Frameworks/SimpleBrowser2 Helper.app
|
|
|
|
*)
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
2021-02-20 16:55:01 +01:00
|
|
|
{$I cef.inc}
|
|
|
|
|
2021-01-31 16:53:07 +01:00
|
|
|
uses
|
|
|
|
{$IFDEF UNIX}
|
|
|
|
cthreads,
|
|
|
|
{$ENDIF}
|
|
|
|
Interfaces, // this includes the LCL widgetset
|
|
|
|
uCEFApplicationCore, uCEFTypes, uCEFConstants, LazFileUtils, sysutils;
|
|
|
|
|
|
|
|
begin
|
|
|
|
GlobalCEFApp := TCefApplicationCore.Create;
|
|
|
|
|
|
|
|
// The main process and the subprocess *MUST* have the same GlobalCEFApp
|
|
|
|
// properties and events, specially FrameworkDirPath, ResourcesDirPath,
|
|
|
|
// LocalesDirPath, cache and UserDataPath paths.
|
2021-02-16 22:16:58 +01:00
|
|
|
{$IFDEF MACOSX}
|
2021-02-07 16:45:55 +01:00
|
|
|
GlobalCEFApp.InitLibLocationFromArgs;
|
2021-02-16 22:16:58 +01:00
|
|
|
{$ENDIF}
|
2021-01-31 16:53:07 +01:00
|
|
|
|
|
|
|
GlobalCEFApp.StartSubProcess;
|
|
|
|
GlobalCEFApp.Free;
|
|
|
|
GlobalCEFApp := nil;
|
|
|
|
end.
|
|
|
|
|