Skip to content

Commit

Permalink
Added VirtualUI demos for Delphi and Lazarus
Browse files Browse the repository at this point in the history
Added Delphi_VCL/VirtualUIBrowser
Added Delphi_FMX_Windows/FMXVirtualUIBrowser
Added Lazarus_Windows/VirtualUIBrowser
  • Loading branch information
salvadordf committed Oct 15, 2022
1 parent be3015f commit 031eb58
Show file tree
Hide file tree
Showing 34 changed files with 10,882 additions and 1 deletion.
18 changes: 18 additions & 0 deletions demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/00-DeleteDCUs.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
del /s /q *.dcu
del /s /q *.exe
del /s /q *.res
del /s /q *.rsm
del /s /q *.log
del /s /q *.dsk
del /s /q *.identcache
del /s /q *.stat
del /s /q *.local
del /s /q *.~*
rmdir Win32\Debug
rmdir Win32\Release
rmdir Win32
rmdir Win64\Debug
rmdir Win64\Release
rmdir Win64
rmdir __history
rmdir __recovery
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// ************************************************************************
// ***************************** CEF4Delphi *******************************
// ************************************************************************
//
// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based
// browser in Delphi applications.
//
// The original license of DCEF3 still applies to CEF4Delphi.
//
// For more information about CEF4Delphi visit :
// https://www.briskbard.com/index.php?lang=en&pageid=cef
//
// Copyright © 2018 Salvador Díaz Fau. All rights reserved.
//
// ************************************************************************
// ************ vvvv Original license and comments below vvvv *************
// ************************************************************************
(*
* Delphi Chromium Embedded 3
*
* Usage allowed under the restrictions of the Lesser GNU General Public License
* or alternatively the restrictions of the Mozilla Public License 1.1
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
*
* Unit owner : Henri Gourvest <[email protected]>
* Web site : http://www.progdigy.com
* Repository : http://code.google.com/p/delphichromiumembedded/
* Group : http://groups.google.com/group/delphichromiumembedded
*
* Embarcadero Technologies, Inc is not permitted to use or redistribute
* this source code without explicit permission.
*
*)

program FMXVirtualUIBrowser;

uses
{$IFDEF DELPHI17_UP}
System.StartUpCopy,
{$ENDIF }
FMX.Forms,
{$IFDEF MSWINDOWS}
WinApi.Windows,
{$ENDIF }
uCEFApplication,
uCEFFMXWorkScheduler,
uFMXVirtualUIBrowser in 'uFMXVirtualUIBrowser.pas' {MainForm},
uFMXApplicationService in 'uFMXApplicationService.pas';

{$R *.res}

{$IFDEF MSWINDOWS}
// CEF3 needs to set the LARGEADDRESSAWARE flag which allows 32-bit processes to use up to 3GB of RAM.
{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
{$ENDIF}

begin
// GlobalCEFApp creation and initialization moved to a different unit to fix the memory leak described in the bug #89
// https://github.com/salvadordf/CEF4Delphi/issues/89
CreateGlobalCEFApp;

if GlobalCEFApp.StartMainProcess then
begin
Application.Initialize;
Application.CreateForm(TMainForm, MainForm);
Application.Run;

// The form needs to be destroyed *BEFORE* stopping the scheduler.
MainForm.Free;

GlobalFMXWorkScheduler.StopScheduler;
end;

DestroyGlobalCEFApp;
DestroyGlobalFMXWorkScheduler;
end.
1,167 changes: 1,167 additions & 0 deletions demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser.dproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{ACA5C793-B5BE-494D-995D-E5AA20ACA9AE}</ProjectGuid>
</PropertyGroup>
<ItemGroup>
<Projects Include="FMXVirtualUIBrowser.dproj">
<Dependencies/>
</Projects>
<Projects Include="FMXVirtualUIBrowser_sp.dproj">
<Dependencies/>
</Projects>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Default.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Default.Personality/>
</BorlandProject>
</ProjectExtensions>
<Target Name="FMXVirtualUIBrowser">
<MSBuild Projects="FMXVirtualUIBrowser.dproj"/>
</Target>
<Target Name="FMXVirtualUIBrowser:Clean">
<MSBuild Projects="FMXVirtualUIBrowser.dproj" Targets="Clean"/>
</Target>
<Target Name="FMXVirtualUIBrowser:Make">
<MSBuild Projects="FMXVirtualUIBrowser.dproj" Targets="Make"/>
</Target>
<Target Name="FMXVirtualUIBrowser_sp">
<MSBuild Projects="FMXVirtualUIBrowser_sp.dproj"/>
</Target>
<Target Name="FMXVirtualUIBrowser_sp:Clean">
<MSBuild Projects="FMXVirtualUIBrowser_sp.dproj" Targets="Clean"/>
</Target>
<Target Name="FMXVirtualUIBrowser_sp:Make">
<MSBuild Projects="FMXVirtualUIBrowser_sp.dproj" Targets="Make"/>
</Target>
<Target Name="Build">
<CallTarget Targets="FMXVirtualUIBrowser;FMXVirtualUIBrowser_sp"/>
</Target>
<Target Name="Clean">
<CallTarget Targets="FMXVirtualUIBrowser:Clean;FMXVirtualUIBrowser_sp:Clean"/>
</Target>
<Target Name="Make">
<CallTarget Targets="FMXVirtualUIBrowser:Make;FMXVirtualUIBrowser_sp:Make"/>
</Target>
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
program FMXVirtualUIBrowser_sp;

uses
uFMXVirtualUIBrowser_sp in 'uFMXVirtualUIBrowser_sp.pas';

{$R *.res}

begin
CreateGlobalCEFApp;
end.
Loading

0 comments on commit 031eb58

Please sign in to comment.