diff --git a/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/00-DeleteDCUs.bat b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/00-DeleteDCUs.bat new file mode 100644 index 00000000..a9a84095 --- /dev/null +++ b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/00-DeleteDCUs.bat @@ -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 diff --git a/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser.dpr b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser.dpr new file mode 100644 index 00000000..6d1d7027 --- /dev/null +++ b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser.dpr @@ -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 + * 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. diff --git a/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser.dproj b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser.dproj new file mode 100644 index 00000000..eeb2c9e7 --- /dev/null +++ b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser.dproj @@ -0,0 +1,1167 @@ + + + {BE24D13B-2634-4064-8746-AB331419C5FA} + 19.5 + FMX + FMXVirtualUIBrowser.dpr + True + Debug + Win32 + 3 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + .\$(Platform)\$(Config) + ..\..\..\bin + false + false + false + false + false + RESTComponents;emsclientfiredac;FireDAC;FireDACSqliteDriver;soaprtl;FireDACIBDriver;soapmidas;FireDACCommon;emsclient;RESTBackendComponents;soapserver;FireDACCommonDriver;CloudService;inet;$(DCC_UsePackage) + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + $(BDS)\bin\delphi_PROJECTICON.ico + $(BDS)\bin\delphi_PROJECTICNS.icns + FMXVirtualUIBrowser + 3082 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(FrameworkType);$(DCC_Define) + true + true + true + true + true + true + true + true + ..\..\..\source;C:\Program Files\Thinfinity\VirtualUI\dev\Delphi;$(DCC_UnitSearchPath) + + + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png + annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar + + + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png + annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar + + + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + iPhoneAndiPad + true + Debug + $(MSBuildProjectName) + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_87x87.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_60x60.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPad\FM_NotificationIcon_40x40.png + + + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + iPhoneAndiPad + true + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_87x87.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_60x60.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPad\FM_NotificationIcon_40x40.png + + + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSCameraUsageDescription=The reason for accessing the camera;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSMotionUsageDescription=The reason for accessing the accelerometer;NSDesktopFolderUsageDescription=The reason for accessing the Desktop folder;NSDocumentsFolderUsageDescription=The reason for accessing the Documents folder;NSDownloadsFolderUsageDescription=The reason for accessing the Downloads folder;NSNetworkVolumesUsageDescription=The reason for accessing files on a network volume;NSRemovableVolumesUsageDescription=The reason for accessing files on a removable volume;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + Debug + true + + + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSCameraUsageDescription=The reason for accessing the camera;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSMotionUsageDescription=The reason for accessing the accelerometer;NSDesktopFolderUsageDescription=The reason for accessing the Desktop folder;NSDocumentsFolderUsageDescription=The reason for accessing the Documents folder;NSDownloadsFolderUsageDescription=The reason for accessing the Downloads folder;NSNetworkVolumesUsageDescription=The reason for accessing files on a network volume;NSRemovableVolumesUsageDescription=The reason for accessing files on a removable volume;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + Debug + true + + + DBXSqliteDriver;bindcompdbx;fmxase;DBXDb2Driver;DBXInterBaseDriver;vcl;DBXSybaseASEDriver;vclactnband;vclFireDAC;FireDACDb2Driver;DataSnapFireDAC;svnui;tethering;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;DBXMSSQLDriver;vclimg;FireDACInfxDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;Componentes_UI;vcldb;bindcompfmx;svn;FireDACPgDriver;DBXOracleDriver;inetdb;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;CEF4Delphi;DbxCommonDriver;IndyProtocols240;IndySystem240;fmx;DataSnapServer;xmlrtl;DataSnapNativeClient;fmxobj;fmxdae;vclwinx;rtl;FireDACDSDriver;DbxClientDriver;IndyCore240;DBXSybaseASADriver;CustomIPTransport;vcldsnap;dbexpress;FireDACDBXDriver;vclx;bindcomp;appanalytics;dsnap;DataSnapCommon;DBXInformixDriver;bindcompvcl;DataSnapConnectors;VCLRESTComponents;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;dsnapxml;FireDACMySQLDriver;dbrtl;inetdbxpress;DBXFirebirdDriver;DataSnapProviderClient;FireDACMongoDBDriver;FireDACCommonODBC;DataSnapClient;DataSnapServerMidas;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + 1033 + $(BDS)\bin\default_app.manifest + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DBXSqliteDriver;bindcompdbx;fmxase;DBXDb2Driver;DBXInterBaseDriver;vcl;DBXSybaseASEDriver;vclactnband;vclFireDAC;FireDACDb2Driver;DataSnapFireDAC;tethering;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;DBXMSSQLDriver;vclimg;FireDACInfxDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;FireDACPgDriver;DBXOracleDriver;inetdb;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;DbxCommonDriver;IndyProtocols240;IndySystem240;fmx;DataSnapServer;xmlrtl;DataSnapNativeClient;fmxobj;fmxdae;vclwinx;rtl;FireDACDSDriver;DbxClientDriver;IndyCore240;DBXSybaseASADriver;CustomIPTransport;vcldsnap;dbexpress;FireDACDBXDriver;vclx;bindcomp;appanalytics;dsnap;DataSnapCommon;DBXInformixDriver;bindcompvcl;DataSnapConnectors;VCLRESTComponents;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;dsnapxml;FireDACMySQLDriver;dbrtl;inetdbxpress;DBXFirebirdDriver;DataSnapProviderClient;FireDACMongoDBDriver;FireDACCommonODBC;DataSnapClient;DataSnapServerMidas;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + 1033 + $(BDS)\bin\default_app.manifest + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + false + 1033 + PerMonitorV2 + true + + + true + PerMonitorV2 + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + PerMonitor + true + 1033 + + + true + PerMonitorV2 + + + + MainSource + + +
MainForm
+
+ + + Base + + + Cfg_1 + Base + + + Cfg_2 + Base + +
+ + Delphi.Personality.12 + Application + + + + FMXVirtualUIBrowser.dpr + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + true + + + + + true + + + + + + + true + + + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 64 + + + classes + 64 + + + + + res\xml + 1 + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + library\lib\armeabi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\mips + 1 + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-v21 + 1 + + + res\values-v21 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-small + 1 + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + res\drawable-xlarge + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).launchscreen + 64 + + + ..\$(PROJECTNAME).launchscreen + 64 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + + + + False + False + False + False + False + False + True + True + + + 12 + + + + +
diff --git a/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowserGrp.groupproj b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowserGrp.groupproj new file mode 100644 index 00000000..9d526a93 --- /dev/null +++ b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowserGrp.groupproj @@ -0,0 +1,48 @@ + + + {ACA5C793-B5BE-494D-995D-E5AA20ACA9AE} + + + + + + + + + + + Default.Personality.12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser_sp.dpr b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser_sp.dpr new file mode 100644 index 00000000..3880f158 --- /dev/null +++ b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser_sp.dpr @@ -0,0 +1,10 @@ +program FMXVirtualUIBrowser_sp; + +uses + uFMXVirtualUIBrowser_sp in 'uFMXVirtualUIBrowser_sp.pas'; + +{$R *.res} + +begin + CreateGlobalCEFApp; +end. diff --git a/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser_sp.dproj b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser_sp.dproj new file mode 100644 index 00000000..7a359d21 --- /dev/null +++ b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/FMXVirtualUIBrowser_sp.dproj @@ -0,0 +1,1169 @@ + + + {63D58342-E301-4D91-A57F-9C9DF302F6BF} + 19.5 + FMX + True + Debug + Win32 + 693267 + Application + FMXVirtualUIBrowser_sp.dpr + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + .\$(Platform)\$(Config) + ..\..\..\bin + false + false + false + false + false + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + true + true + true + true + true + true + true + true + $(BDS)\bin\delphi_PROJECTICON.ico + $(BDS)\bin\delphi_PROJECTICNS.icns + FMXVirtualUIBrowser_sp + $(FrameworkType);$(DCC_Define) + ..\..\..\source;$(DCC_UnitSearchPath) + + + soapserver;IndySystem;FMXTMSFNCCorePkgDXE15;fmx;DbxCommonDriver;bindengine;IndyIPCommon;FireDACCommonDriver;IndyProtocols;Skia.Package.RTL;IndyIPClient;dbxcds;bindcomp;FireDACCommon;FmxTeeUI;IndyCore;RESTBackendComponents;bindcompfmx;bindcompdbx;rtl;FireDACSqliteDriver;DbxClientDriver;RESTComponents;soapmidas;DBXSqliteDriver;IndyIPServer;dsnapxml;fmxFireDAC;dbexpress;inet;FireDAC;xmlrtl;tethering;dbrtl;dsnap;Skia.Package.FMX;CloudService;CustomIPTransport;FMXTee;soaprtl;FMXTMSFNCUIPackPkgDXE15;DBXInterBaseDriver;FireDACIBDriver;$(DCC_UsePackage) + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png + annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar + + + soapserver;IndySystem;FMXTMSFNCCorePkgDXE15;fmx;DbxCommonDriver;bindengine;IndyIPCommon;FireDACCommonDriver;IndyProtocols;Skia.Package.RTL;IndyIPClient;dbxcds;bindcomp;FireDACCommon;FmxTeeUI;IndyCore;RESTBackendComponents;bindcompfmx;bindcompdbx;rtl;FireDACSqliteDriver;DbxClientDriver;RESTComponents;soapmidas;DBXSqliteDriver;IndyIPServer;dsnapxml;fmxFireDAC;dbexpress;inet;FireDAC;xmlrtl;tethering;dbrtl;dsnap;Skia.Package.FMX;CloudService;CustomIPTransport;FMXTee;soaprtl;FMXTMSFNCUIPackPkgDXE15;DBXInterBaseDriver;FireDACIBDriver;$(DCC_UsePackage) + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png + annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar + + + soapserver;IndySystem;FMXTMSFNCCorePkgDXE15;fmx;DbxCommonDriver;bindengine;IndyIPCommon;FireDACCommonDriver;IndyProtocols;Skia.Package.RTL;IndyIPClient;dbxcds;bindcomp;FireDACCommon;FmxTeeUI;IndyCore;RESTBackendComponents;bindcompfmx;bindcompdbx;rtl;FireDACSqliteDriver;DbxClientDriver;RESTComponents;soapmidas;DBXSqliteDriver;IndyIPServer;dsnapxml;fmxFireDAC;dbexpress;inet;FireDAC;fmxase;xmlrtl;tethering;dbrtl;dsnap;Skia.Package.FMX;CloudService;CustomIPTransport;FMXTee;soaprtl;FMXTMSFNCUIPackPkgDXE15;DBXInterBaseDriver;FireDACIBDriver;$(DCC_UsePackage) + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + iPhoneAndiPad + true + Debug + $(MSBuildProjectName) + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_87x87.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_60x60.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPad\FM_NotificationIcon_40x40.png + + + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + iPhoneAndiPad + true + soapserver;IndySystem;FMXTMSFNCCorePkgDXE15;fmx;DbxCommonDriver;bindengine;IndyIPCommon;FireDACCommonDriver;IndyProtocols;Skia.Package.RTL;IndyIPClient;dbxcds;bindcomp;FireDACCommon;FmxTeeUI;IndyCore;RESTBackendComponents;bindcompfmx;bindcompdbx;rtl;FireDACSqliteDriver;DbxClientDriver;RESTComponents;soapmidas;DBXSqliteDriver;IndyIPServer;dsnapxml;fmxFireDAC;dbexpress;inet;FireDAC;fmxase;xmlrtl;tethering;dbrtl;dsnap;Skia.Package.FMX;CloudService;CustomIPTransport;FMXTee;soaprtl;FMXTMSFNCUIPackPkgDXE15;DBXInterBaseDriver;FireDACIBDriver;$(DCC_UsePackage);$(DCC_UsePackage) + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_87x87.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_60x60.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPad\FM_NotificationIcon_40x40.png + + + soapserver;IndySystem;FMXTMSFNCCorePkgDXE15;fmx;DbxCommonDriver;bindengine;IndyIPCommon;FireDACCommonODBC;FireDACCommonDriver;IndyProtocols;Skia.Package.RTL;IndyIPClient;dbxcds;bindcomp;FireDACCommon;FmxTeeUI;IndyCore;RESTBackendComponents;bindcompfmx;bindcompdbx;inetdb;rtl;FireDACMySQLDriver;FireDACSqliteDriver;DbxClientDriver;RESTComponents;soapmidas;DBXSqliteDriver;IndyIPServer;dsnapxml;fmxFireDAC;dbexpress;DBXMySQLDriver;inet;FireDACPgDriver;FireDAC;fmxase;inetdbxpress;xmlrtl;tethering;dbrtl;dsnap;fmxdae;Skia.Package.FMX;CloudService;CustomIPTransport;fmxobj;FMXTee;soaprtl;FMXTMSFNCUIPackPkgDXE15;DBXInterBaseDriver;FireDACIBDriver;$(DCC_UsePackage) + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSCameraUsageDescription=The reason for accessing the camera;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSMotionUsageDescription=The reason for accessing the accelerometer;NSDesktopFolderUsageDescription=The reason for accessing the Desktop folder;NSDocumentsFolderUsageDescription=The reason for accessing the Documents folder;NSDownloadsFolderUsageDescription=The reason for accessing the Downloads folder;NSNetworkVolumesUsageDescription=The reason for accessing files on a network volume;NSRemovableVolumesUsageDescription=The reason for accessing files on a removable volume;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + Debug + true + + + soapserver;IndySystem;fmx;DbxCommonDriver;bindengine;IndyIPCommon;FireDACCommonODBC;FireDACCommonDriver;IndyProtocols;IndyIPClient;dbxcds;bindcomp;FireDACCommon;FmxTeeUI;IndyCore;RESTBackendComponents;bindcompfmx;bindcompdbx;inetdb;rtl;FireDACMySQLDriver;FireDACSqliteDriver;DbxClientDriver;RESTComponents;soapmidas;DBXSqliteDriver;IndyIPServer;dsnapxml;fmxFireDAC;dbexpress;DBXMySQLDriver;inet;FireDACPgDriver;FireDAC;fmxase;inetdbxpress;xmlrtl;tethering;dbrtl;dsnap;fmxdae;CloudService;CustomIPTransport;fmxobj;FMXTee;soaprtl;DBXInterBaseDriver;FireDACIBDriver;$(DCC_UsePackage) + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSCameraUsageDescription=The reason for accessing the camera;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSMotionUsageDescription=The reason for accessing the accelerometer;NSDesktopFolderUsageDescription=The reason for accessing the Desktop folder;NSDocumentsFolderUsageDescription=The reason for accessing the Documents folder;NSDownloadsFolderUsageDescription=The reason for accessing the Downloads folder;NSNetworkVolumesUsageDescription=The reason for accessing files on a network volume;NSRemovableVolumesUsageDescription=The reason for accessing files on a removable volume;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + Debug + true + + + soapserver;IndySystem;vclwinx;FMXTMSFNCCorePkgDXE15;fmx;Skia.Package.VCL;vclie;DbxCommonDriver;bindengine;vcldb;IndyIPCommon;VCLRESTComponents;FireDACCommonODBC;FireDACCommonDriver;appanalytics;IndyProtocols;vclx;Skia.Package.RTL;IndyIPClient;dbxcds;vcledge;vclFireDAC;bindcompvclwinx;bindcomp;FireDACCommon;FmxTeeUI;IndyCore;RESTBackendComponents;bindcompfmx;bindcompdbx;inetdb;rtl;FireDACMySQLDriver;FireDACSqliteDriver;DbxClientDriver;FireDACADSDriver;WebView4DelphiVCLRTL;RESTComponents;soapmidas;DBXSqliteDriver;vcl;vclactnband;IndyIPServer;dsnapxml;fmxFireDAC;dbexpress;dsnapcon;adortl;TeeUI;Tee;CEF4DelphiVCLRTL;DBXMySQLDriver;WebView4DelphiFMXRTL;VclSmp;inet;vclimg;vcltouch;FireDACPgDriver;FireDAC;fmxase;inetdbxpress;xmlrtl;tethering;dbrtl;bindcompvcl;dsnap;fmxdae;TeeDB;Skia.Package.FMX;CloudService;FireDACMSAccDriver;CustomIPTransport;fmxobj;bindcompvclsmp;FMXTee;CEF4DelphiFMXRTL;soaprtl;FMXTMSFNCUIPackPkgDXE15;vcldsnap;DBXInterBaseDriver;FireDACIBDriver;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + $(BDS)\bin\default_app.manifest + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + soapserver;IndySystem;vclwinx;FMXTMSFNCCorePkgDXE15;fmx;Skia.Package.VCL;vclie;DbxCommonDriver;bindengine;vcldb;IndyIPCommon;VCLRESTComponents;FireDACCommonODBC;FireDACCommonDriver;appanalytics;IndyProtocols;vclx;Skia.Package.RTL;IndyIPClient;dbxcds;vcledge;vclFireDAC;bindcompvclwinx;bindcomp;FireDACCommon;FmxTeeUI;IndyCore;RESTBackendComponents;bindcompfmx;bindcompdbx;inetdb;rtl;FireDACMySQLDriver;FireDACSqliteDriver;DbxClientDriver;FireDACADSDriver;WebView4DelphiVCLRTL;RESTComponents;soapmidas;DBXSqliteDriver;vcl;vclactnband;IndyIPServer;dsnapxml;fmxFireDAC;dbexpress;dsnapcon;adortl;TeeUI;Tee;CEF4DelphiVCLRTL;DBXMySQLDriver;WebView4DelphiFMXRTL;VclSmp;inet;vclimg;vcltouch;FireDACPgDriver;FireDAC;fmxase;inetdbxpress;xmlrtl;tethering;dbrtl;bindcompvcl;dsnap;fmxdae;TeeDB;Skia.Package.FMX;CloudService;FireDACMSAccDriver;CustomIPTransport;fmxobj;bindcompvclsmp;FMXTee;CEF4DelphiFMXRTL;soaprtl;FMXTMSFNCUIPackPkgDXE15;vcldsnap;DBXInterBaseDriver;FireDACIBDriver;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + $(BDS)\bin\default_app.manifest + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DEBUG;$(DCC_Define) + true + false + true + true + true + true + true + + + false + true + PerMonitorV2 + true + 1033 + + + true + PerMonitorV2 + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + PerMonitorV2 + + + true + PerMonitorV2 + + + + MainSource + + + + Base + + + Cfg_1 + Base + + + Cfg_2 + Base + + + + Delphi.Personality.12 + Application + + + + FMXVirtualUIBrowser_sp.dpr + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + true + + + + + true + + + + + true + + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 64 + + + classes + 64 + + + + + res\xml + 1 + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + library\lib\armeabi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\mips + 1 + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-v21 + 1 + + + res\values-v21 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-small + 1 + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + res\drawable-xlarge + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).launchscreen + 64 + + + ..\$(PROJECTNAME).launchscreen + 64 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + + + + True + True + True + True + True + True + True + True + + + 12 + + + + + diff --git a/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/cef.inc b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/cef.inc new file mode 100644 index 00000000..76ec7fb3 --- /dev/null +++ b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/cef.inc @@ -0,0 +1,507 @@ +// ************************************************************************ +// ***************************** 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 © 2017 Salvador Diaz 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 + * 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. + * + *) + + // The complete list of compiler versions is here : + // http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Compiler_Versions + +{$DEFINE DELPHI_VERSION_UNKNOW} + +// Delphi 5 +{$IFDEF VER130} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} +{$ENDIF} + +// Delphi 6 +{$IFDEF VER140} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} +{$ENDIF} + +// Delphi 7 +{$IFDEF VER150} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} +{$ENDIF} + +// Delphi 8 +{$IFDEF VER160} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} +{$ENDIF} + +// Delphi 2005 +{$IFDEF VER170} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} +{$ENDIF} + +{$IFDEF VER180} + {$UNDEF DELPHI_VERSION_UNKNOW} + // Delphi 2007 + {$IFDEF VER185} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + // Delphi 2006 + {$ELSE} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$ENDIF} +{$ENDIF} + +// Delphi 2009 +{$IFDEF VER200} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} +{$ENDIF} + +//Delphi 2010 +{$IFDEF VER210} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} +{$ENDIF} + +// Delphi XE +{$IFDEF VER220} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} +{$ENDIF} + +// Delphi XE2 (First FireMonkey and 64bit compiler) +{$IFDEF VER230} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} +{$ENDIF} + +// Delphi XE3 +{$IFDEF VER240} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} +{$ENDIF} + +// Delphi XE4 +{$IFDEF VER250} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} +{$ENDIF} + +// Delphi XE5 +{$IFDEF VER260} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} +{$ENDIF} + +// Delphi XE6 +{$IFDEF VER270} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} +{$ENDIF} + +// Delphi XE7 +{$IFDEF VER280} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} +{$ENDIF} + +// Delphi XE8 +{$IFDEF VER290} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} +{$ENDIF VER290} + +// Rad Studio 10 - Delphi Seattle +{$IFDEF VER300} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} +{$ENDIF} + +// Rad Studio 10.1 - Delphi Berlin +{$IFDEF VER310} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} +{$ENDIF} + +// Rad Studio 10.2 - Delphi Tokyo +{$IFDEF VER320} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} +{$ENDIF} + +// Rad Studio 10.3 - Delphi Rio +{$IFDEF VER330} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} + {$DEFINE DELPHI26_UP} +{$ENDIF} + +// Rad Studio 10.4 - Delphi Sydney +{$IFDEF VER340} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} + {$DEFINE DELPHI26_UP} + {$DEFINE DELPHI27_UP} +{$ENDIF} + +// Rad Studio 11.0 - Delphi Alexandria +{$IFDEF VER350} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} + {$DEFINE DELPHI26_UP} + {$DEFINE DELPHI27_UP} + {$DEFINE DELPHI28_UP} +{$ENDIF} + +{$IFDEF FPC} + {$DEFINE SUPPORTS_INLINE} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30200)} + {$DEFINE FPC_VER_320} + {$IFEND} +{$ELSE} + {$IFDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} + {$DEFINE DELPHI26_UP} + {$DEFINE DELPHI27_UP} + {$DEFINE DELPHI28_UP} + {$ENDIF} +{$ENDIF} + +{$IFDEF DELPHI9_UP} + {$DEFINE SUPPORTS_INLINE} +{$ENDIF} + +{$IF DEFINED(CPUX32) OR + DEFINED(CPU32) OR + DEFINED(CPU32BITS) OR + DEFINED(CPUARM32) OR + DEFINED(WIN32) OR + DEFINED(IOS32) OR + DEFINED(MACOS32) OR + DEFINED(LINUX32) OR + DEFINED(POSIX32) OR + DEFINED(ANDROID32)} + {$DEFINE TARGET_32BITS} +{$ELSE} + {$IF DEFINED(CPUX64) OR + DEFINED(CPU64) OR + DEFINED(CPU64BITS) OR + DEFINED(CPUARM64) OR + DEFINED(WIN64) OR + DEFINED(IOS64) OR + DEFINED(MACOS64) OR + DEFINED(LINUX64) OR + DEFINED(POSIX64) OR + DEFINED(ANDROID64)} + {$DEFINE TARGET_64BITS} + {$IFEND} +{$IFEND} + +// Delphi uses MACOS for the new MacOSX and DARWIN is not defined +// FPC uses DARWIN for the new MacOSX and MACOS is defined for the classic Macintosh OS (System 7) +// We define MACOSX to avoid conflicts in both situations +{$IFDEF FPC} + {$IFDEF DARWIN} + {$DEFINE MACOSX} + {$ENDIF} +{$ELSE} + {$IFDEF MACOS} + {$DEFINE MACOSX} + {$ENDIF} +{$ENDIF} diff --git a/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/uFMXApplicationService.pas b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/uFMXApplicationService.pas new file mode 100644 index 00000000..8cae0fff --- /dev/null +++ b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/uFMXApplicationService.pas @@ -0,0 +1,227 @@ +// ************************************************************************ +// ***************************** CEF4Delphi ******************************* +// ************************************************************************ +// +// CEF4Delphi is based on DCEF3 which uses CEF 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 © 2022 Salvador Diaz 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 + * 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. + * + *) + +unit uFMXApplicationService; + +{$I cef.inc} + +// This unit is based in the TFMXApplicationService class created by Takashi Yamamoto +// https://www.gesource.jp/weblog/?p=7367 + +interface + +uses + FMX.Platform; + +type + TFMXApplicationService = class(TInterfacedObject, IFMXApplicationService) + protected + class var OldFMXApplicationService: IFMXApplicationService; + class var NewFMXApplicationService: IFMXApplicationService; + + public + procedure Run; + function HandleMessage: Boolean; + procedure WaitMessage; + function GetDefaultTitle: string; + function GetTitle: string; + procedure SetTitle(const Value: string); + function GetVersionString: string; + procedure Terminate; + function Terminating: Boolean; + function Running: Boolean; + + class procedure AddPlatformService; + + property DefaultTitle : string read GetDefaultTitle; + property Title : string read GetTitle write SetTitle; + property AppVersion : string read GetVersionString; + end; + +implementation + +uses + FMX.Forms, {$IFDEF MSWINDOWS}Winapi.Messages, Winapi.Windows,{$ENDIF} + uFMXVirtualUIBrowser, uCEFFMXWorkScheduler, uCEFApplication, uCEFConstants; + +class procedure TFMXApplicationService.AddPlatformService; +begin + if TPlatformServices.Current.SupportsPlatformService(IFMXApplicationService, IInterface(OldFMXApplicationService)) then + begin + TPlatformServices.Current.RemovePlatformService(IFMXApplicationService); + + NewFMXApplicationService := TFMXApplicationService.Create; + TPlatformServices.Current.AddPlatformService(IFMXApplicationService, NewFMXApplicationService); + end; +end; + +function TFMXApplicationService.GetDefaultTitle: string; +begin + Result := OldFMXApplicationService.GetDefaultTitle; +end; + +function TFMXApplicationService.GetTitle: string; +begin + Result := OldFMXApplicationService.GetTitle; +end; + +function TFMXApplicationService.GetVersionString: string; +begin + {$IFDEF DELPHI22_UP} + Result := OldFMXApplicationService.GetVersionString; + {$ELSE DELPHI22_UP} + Result := 'unsupported yet'; + {$ENDIF DELPHI22_UP} +end; + +procedure TFMXApplicationService.Run; +begin + OldFMXApplicationService.Run; +end; + +procedure TFMXApplicationService.SetTitle(const Value: string); +begin + OldFMXApplicationService.SetTitle(Value); +end; + +procedure TFMXApplicationService.Terminate; +begin + OldFMXApplicationService.Terminate; +end; + +function TFMXApplicationService.Terminating: Boolean; +begin + Result := OldFMXApplicationService.Terminating; +end; + +procedure TFMXApplicationService.WaitMessage; +begin + OldFMXApplicationService.WaitMessage; +end; + +function TFMXApplicationService.Running: Boolean; +begin + {$IFDEF DELPHI24_UP} + Result := OldFMXApplicationService.Running; + {$ELSE} + Result := True; + {$ENDIF} +end; + +function TFMXApplicationService.HandleMessage: Boolean; +{$IFDEF MSWINDOWS} +var + TempMsg : TMsg; +{$ENDIF} +begin + {$IFDEF MSWINDOWS} + if PeekMessage(TempMsg, 0, 0, 0, PM_NOREMOVE) then + case TempMsg.Message of + WM_MOVE, + WM_MOVING : + if not(Application.Terminated) and + (Application.MainForm <> nil) and + (Application.MainForm is TMainForm) then + TMainForm(Application.MainForm).NotifyMoveOrResizeStarted; + + WM_ENTERMENULOOP : + if (TempMsg.wParam = 0) and + (GlobalCEFApp <> nil) then + GlobalCEFApp.OsmodalLoop := True; + + WM_EXITMENULOOP : + if (TempMsg.wParam = 0) and + (GlobalCEFApp <> nil) then + GlobalCEFApp.OsmodalLoop := False; + + WM_CAPTURECHANGED, + WM_CANCELMODE : + if not(Application.Terminated) and + (Application.MainForm <> nil) and + (Application.MainForm is TMainForm) then + TMainForm(Application.MainForm).SendCaptureLostEvent; + + WM_SYSCHAR : + if not(Application.Terminated) and + (Application.MainForm <> nil) and + (Application.MainForm is TMainForm) then + TMainForm(Application.MainForm).HandleSYSCHAR(TempMsg); + + WM_SYSKEYDOWN : + if not(Application.Terminated) and + (Application.MainForm <> nil) and + (Application.MainForm is TMainForm) then + TMainForm(Application.MainForm).HandleSYSKEYDOWN(TempMsg); + + WM_SYSKEYUP : + if not(Application.Terminated) and + (Application.MainForm <> nil) and + (Application.MainForm is TMainForm) then + TMainForm(Application.MainForm).HandleSYSKEYUP(TempMsg); + + WM_KEYDOWN : + if not(Application.Terminated) and + (Application.MainForm <> nil) and + (Application.MainForm is TMainForm) then + TMainForm(Application.MainForm).HandleKEYDOWN(TempMsg); + + WM_KEYUP : + if not(Application.Terminated) and + (Application.MainForm <> nil) and + (Application.MainForm is TMainForm) then + TMainForm(Application.MainForm).HandleKEYUP(TempMsg); + + WM_POINTERDOWN, + WM_POINTERUPDATE, + WM_POINTERUP : + if not(Application.Terminated) and + (Application.MainForm <> nil) and + (Application.MainForm is TMainForm) then + TMainForm(Application.MainForm).HandlePOINTER(TempMsg); + + CEF_PENDINGRESIZE : + if not(Application.Terminated) and + (Application.MainForm <> nil) and + (Application.MainForm is TMainForm) then + TMainForm(Application.MainForm).DoResize; + end; + {$ENDIF} + + Result := OldFMXApplicationService.HandleMessage; +end; + +end. diff --git a/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/uFMXVirtualUIBrowser.fmx b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/uFMXVirtualUIBrowser.fmx new file mode 100644 index 00000000..86f0d8a3 --- /dev/null +++ b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/uFMXVirtualUIBrowser.fmx @@ -0,0 +1,135 @@ +object MainForm: TMainForm + Left = 0 + Top = 0 + Caption = 'Initializing browser. Please wait...' + ClientHeight = 633 + ClientWidth = 800 + Position = ScreenCenter + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + OnCreate = FormCreate + OnCloseQuery = FormCloseQuery + OnDestroy = FormDestroy + OnShow = FormShow + OnHide = FormHide + DesignerMasterStyle = 0 + object AddressPnl: TPanel + Align = Top + Padding.Left = 5.000000000000000000 + Padding.Top = 5.000000000000000000 + Padding.Right = 5.000000000000000000 + Padding.Bottom = 5.000000000000000000 + Size.Width = 800.000000000000000000 + Size.Height = 33.000000000000000000 + Size.PlatformDefault = False + TabOrder = 0 + TabStop = False + object Layout1: TLayout + Align = Right + Padding.Left = 5.000000000000000000 + Position.X = 714.000000000000000000 + Position.Y = 5.000000000000000000 + Size.Width = 81.000000000000000000 + Size.Height = 23.000000000000000000 + Size.PlatformDefault = False + TabOrder = 1 + object GoBtn: TButton + Align = Left + Position.X = 5.000000000000000000 + Size.Width = 36.000000000000000000 + Size.Height = 23.000000000000000000 + Size.PlatformDefault = False + TabOrder = 0 + Text = 'Go' + OnClick = GoBtnClick + OnEnter = GoBtnEnter + end + object SnapshotBtn: TButton + Align = Right + StyledSettings = [Style, FontColor] + Position.X = 45.000000000000000000 + Size.Width = 36.000000000000000000 + Size.Height = 23.000000000000000000 + Size.PlatformDefault = False + TabOrder = 1 + Text = #181 + TextSettings.Font.Family = 'Webdings' + TextSettings.Font.Size = 32.000000000000000000 + OnClick = SnapshotBtnClick + OnEnter = SnapshotBtnEnter + end + end + object AddressCb: TComboEdit + Touch.InteractiveGestures = [LongTap, DoubleTap] + Align = Client + TabOrder = 0 + ItemHeight = 19.000000000000000000 + Items.Strings = ( + 'https://www.google.com' + + 'https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onco' + + 'ntextmenu' + + 'https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input' + + '_type_file' + 'https://www.w3schools.com/js/tryit.asp?filename=tryjs_alert' + 'https://www.w3schools.com/js/tryit.asp?filename=tryjs_confirm' + 'https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select') + ItemIndex = 0 + Text = 'https://www.google.com' + Size.Width = 709.000000000000000000 + Size.Height = 23.000000000000000000 + Size.PlatformDefault = False + end + end + object Timer1: TTimer + Enabled = False + Interval = 300 + OnTimer = Timer1Timer + Left = 40 + Top = 137 + end + object SaveDialog1: TSaveDialog + DefaultExt = 'bmp' + Filter = 'Bitmap files (*.bmp)|*.BMP' + Title = 'Save snapshot' + Left = 40 + Top = 201 + end + object Panel1: TFMXBufferPanel + Align = Client + TabOrder = 1 + CanFocus = True + Size.Width = 800.000000000000000000 + Size.Height = 600.000000000000000000 + Size.PlatformDefault = False + OnEnter = Panel1Enter + OnExit = Panel1Exit + OnResize = Panel1Resize + OnClick = Panel1Click + OnMouseDown = Panel1MouseDown + OnMouseMove = Panel1MouseMove + OnMouseUp = Panel1MouseUp + OnMouseLeave = Panel1MouseLeave + OnMouseWheel = Panel1MouseWheel + OnKeyDown = Panel1KeyDown + OnDialogKey = Panel1DialogKey + end + object chrmosr: TFMXChromium + OnAddressChange = chrmosrAddressChange + OnTooltip = chrmosrTooltip + OnCursorChange = chrmosrCursorChange + OnBeforePopup = chrmosrBeforePopup + OnAfterCreated = chrmosrAfterCreated + OnBeforeClose = chrmosrBeforeClose + OnGetViewRect = chrmosrGetViewRect + OnGetScreenPoint = chrmosrGetScreenPoint + OnGetScreenInfo = chrmosrGetScreenInfo + OnPopupShow = chrmosrPopupShow + OnPopupSize = chrmosrPopupSize + OnPaint = chrmosrPaint + Left = 40 + Top = 73 + end +end diff --git a/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/uFMXVirtualUIBrowser.pas b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/uFMXVirtualUIBrowser.pas new file mode 100644 index 00000000..f8c61fc5 --- /dev/null +++ b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/uFMXVirtualUIBrowser.pas @@ -0,0 +1,1190 @@ +// ************************************************************************ +// ***************************** CEF4Delphi ******************************* +// ************************************************************************ +// +// CEF4Delphi is based on DCEF3 which uses CEF 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 © 2022 Salvador Diaz 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 + * 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. + * + *) + +unit uFMXVirtualUIBrowser; + +{$I cef.inc} + +interface + +uses + {$IFDEF MSWINDOWS} + Winapi.Messages, Winapi.Windows, + {$ENDIF} + System.Types, System.UITypes, System.Classes, System.SyncObjs, + FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, + FMX.Edit, FMX.StdCtrls, FMX.Controls.Presentation, + {$IFDEF DELPHI17_UP} + FMX.Graphics, + {$ENDIF} + uCEFFMXChromium, uCEFFMXBufferPanel, uCEFFMXWorkScheduler, + uCEFInterfaces, uCEFTypes, uCEFConstants, uCEFChromiumCore, FMX.Layouts, + FMX.ComboEdit; + +type + TMainForm = class(TForm) + AddressPnl: TPanel; + chrmosr: TFMXChromium; + Timer1: TTimer; + SaveDialog1: TSaveDialog; + Panel1: TFMXBufferPanel; + Layout1: TLayout; + GoBtn: TButton; + SnapshotBtn: TButton; + AddressCb: TComboEdit; + + procedure GoBtnClick(Sender: TObject); + procedure GoBtnEnter(Sender: TObject); + + procedure Panel1Enter(Sender: TObject); + procedure Panel1Exit(Sender: TObject); + procedure Panel1Resize(Sender: TObject); + procedure Panel1Click(Sender: TObject); + procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); + procedure Panel1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); + procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single); + procedure Panel1MouseLeave(Sender: TObject); + procedure Panel1MouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean); + procedure Panel1KeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); + procedure Panel1DialogKey(Sender: TObject; var Key: Word; Shift: TShiftState); + + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormHide(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + + procedure chrmosrPaint(Sender: TObject; const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer); + procedure chrmosrGetViewRect(Sender: TObject; const browser: ICefBrowser; var rect: TCefRect); + procedure chrmosrGetScreenPoint(Sender: TObject; const browser: ICefBrowser; viewX, viewY: Integer; var screenX, screenY: Integer; out Result: Boolean); + procedure chrmosrGetScreenInfo(Sender: TObject; const browser: ICefBrowser; var screenInfo: TCefScreenInfo; out Result: Boolean); + procedure chrmosrPopupShow(Sender: TObject; const browser: ICefBrowser; show: Boolean); + procedure chrmosrPopupSize(Sender: TObject; const browser: ICefBrowser; const rect: PCefRect); + procedure chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser); + procedure chrmosrTooltip(Sender: TObject; const browser: ICefBrowser; var text: ustring; out Result: Boolean); + procedure chrmosrBeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean); + procedure chrmosrAfterCreated(Sender: TObject; const browser: ICefBrowser); + procedure chrmosrCursorChange(Sender: TObject; const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult: Boolean); + + procedure Timer1Timer(Sender: TObject); + procedure AddressEdtEnter(Sender: TObject); + + procedure SnapshotBtnClick(Sender: TObject); + procedure SnapshotBtnEnter(Sender: TObject); + procedure chrmosrAddressChange(Sender: TObject; const browser: ICefBrowser; + const frame: ICefFrame; const url: ustring); + + + protected + FPopUpBitmap : TBitmap; + FPopUpRect : TRect; + FShowPopUp : boolean; + FResizing : boolean; + FPendingResize : boolean; + FCanClose : boolean; + FClosing : boolean; + FResizeCS : TCriticalSection; + FAtLeastWin8 : boolean; + {$IFDEF DELPHI17_UP} + FMouseWheelService : IFMXMouseService; + {$ENDIF} + + FLastClickCount : integer; + FLastClickTime : integer; + FLastClickPoint : TPointF; + FLastClickButton : TMouseButton; + + procedure LoadURL; + function getModifiers(Shift: TShiftState): TCefEventFlags; + function GetButton(Button: TMouseButton): TCefMouseButtonType; + function GetMousePosition(var aPoint : TPointF) : boolean; + procedure InitializeLastClick; + function CancelPreviousClick(const x, y : single; var aCurrentTime : integer) : boolean; + {$IFDEF MSWINDOWS} + function SendCompMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean; + function ArePointerEventsSupported : boolean; + function HandlePenEvent(const aID : uint32; aMsg : cardinal) : boolean; + function HandleTouchEvent(const aID : uint32; aMsg : cardinal) : boolean; overload; + function HandlePointerEvent(const aMessage : TMsg) : boolean; + {$ENDIF} + + public + procedure DoResize; + procedure NotifyMoveOrResizeStarted; + procedure SendCaptureLostEvent; + procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer); override; + {$IFDEF MSWINDOWS} + procedure HandleSYSCHAR(const aMessage : TMsg); + procedure HandleSYSKEYDOWN(const aMessage : TMsg); + procedure HandleSYSKEYUP(const aMessage : TMsg); + procedure HandleKEYDOWN(const aMessage : TMsg); + procedure HandleKEYUP(const aMessage : TMsg); + function HandlePOINTER(const aMessage : TMsg) : boolean; + {$ENDIF} + end; + +var + MainForm : TMainForm; + +// This is a simple browser using FireMonkey components in OSR mode (off-screen rendering) +// and a external message pump. + +// It's recomemded to understand the code in the SimpleOSRBrowser and OSRExternalPumpBrowser demos before +// reading the code in this demo. + +// Due to the Firemonkey code structure, this demo uses a IFMXApplicationService interface implemented in +// uFMXApplicationService.pas to intercept some windows messages needed to make a CEF browser work. + +// The TFMXApplicationService.HandleMessages function receives many of the messages that the +// OSRExternalPumpBrowser demo hadled in the main form or in the GlobalFMXWorkScheduler. + +// It was necessary to destroy the browser following the destruction sequence described in +// the MDIBrowser demo but in OSR mode there are some modifications. + +// All FMX applications using CEF4Delphi should add the $(FrameworkType) conditional define +// in the project options to avoid duplicated resources. +// This demo has that define in the menu option : +// Project -> Options -> Building -> Delphi compiler -> Conditional defines (All configurations) + +// This is the destruction sequence in OSR mode : +// 1- FormCloseQuery sets CanClose to the initial FCanClose value (False) and +// calls chrmosr.CloseBrowser(True). +// 2- chrmosr.CloseBrowser(True) will trigger chrmosr.OnClose and the default +// implementation will destroy the internal browser immediately, which will +// trigger the chrmosr.OnBeforeClose event. +// 3- chrmosr.OnBeforeClose sets FCanClose to True and closes the form. + +procedure CreateGlobalCEFApp; + +implementation + +{$R *.fmx} + +uses + VirtualUI_SDK, + System.SysUtils, System.Math, FMX.Platform, FMX.Platform.Win, + uCEFMiscFunctions, uCEFApplication, uFMXApplicationService; + +procedure GlobalCEFApp_OnScheduleMessagePumpWork(const aDelayMS : int64); +begin + if (GlobalFMXWorkScheduler <> nil) then + GlobalFMXWorkScheduler.ScheduleMessagePumpWork(aDelayMS); +end; + +procedure CreateGlobalCEFApp; +begin + // Start VirtualUI and allow the execution of CEF subprocesses with FMXVirtualUIBrowser_sp.exe + VirtualUI.Start; + VirtualUI.AllowExecute('FMXVirtualUIBrowser_sp.exe'); + + GlobalCEFApp := TCefApplication.Create; + GlobalCEFApp.WindowlessRenderingEnabled := True; + GlobalCEFApp.EnableHighDPISupport := True; + GlobalCEFApp.ExternalMessagePump := True; + GlobalCEFApp.MultiThreadedMessageLoop := False; + GlobalCEFApp.BrowserSubprocessPath := 'FMXVirtualUIBrowser_sp.exe'; + GlobalCEFApp.OnScheduleMessagePumpWork := GlobalCEFApp_OnScheduleMessagePumpWork; + {$IFDEF DEBUG} + //GlobalCEFApp.LogFile := 'debug.log'; + //GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO; + {$ENDIF} + + // TFMXWorkScheduler will call cef_do_message_loop_work when + // it's told in the GlobalCEFApp.OnScheduleMessagePumpWork event. + // GlobalFMXWorkScheduler needs to be created before the + // GlobalCEFApp.StartMainProcess call. + GlobalFMXWorkScheduler := TFMXWorkScheduler.Create(nil); +end; + +procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean); +begin + CanClose := FCanClose; + + if not(FClosing) then + begin + FClosing := True; + Visible := False; + AddressPnl.Enabled := False; + chrmosr.CloseBrowser(True); + end; +end; + +procedure TMainForm.FormCreate(Sender: TObject); +var + TempMajorVer, TempMinorVer : DWORD; +begin + TFMXApplicationService.AddPlatformService; + + FPopUpBitmap := nil; + FPopUpRect := rect(0, 0, 0, 0); + FShowPopUp := False; + FResizing := False; + FPendingResize := False; + FCanClose := False; + FClosing := False; + FResizeCS := TCriticalSection.Create; + + {$IFDEF MSWINDOWS} + FAtLeastWin8 := GetWindowsMajorMinorVersion(TempMajorVer, TempMinorVer) and + ((TempMajorVer > 6) or + ((TempMajorVer = 6) and (TempMinorVer >= 2))); + {$ELSE} + FAtLeastWin8 := False; + {$ENDIF} + + chrmosr.DefaultURL := AddressCb.Text; + + InitializeLastClick; + + {$IFDEF DELPHI17_UP} + if TPlatformServices.Current.SupportsPlatformService(IFMXMouseService) then + FMouseWheelService := TPlatformServices.Current.GetPlatformService(IFMXMouseService) as IFMXMouseService; + {$ENDIF} +end; + +procedure TMainForm.FormDestroy(Sender: TObject); +begin + FResizeCS.Free; + if (FPopUpBitmap <> nil) then FreeAndNil(FPopUpBitmap); +end; + +procedure TMainForm.FormHide(Sender: TObject); +begin + chrmosr.SetFocus(False); + chrmosr.WasHidden(True); +end; + +procedure TMainForm.FormShow(Sender: TObject); +begin + if chrmosr.Initialized then + begin + chrmosr.WasHidden(False); + chrmosr.SetFocus(True); + end + else + begin + // opaque white background color + chrmosr.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF); + + if not(chrmosr.CreateBrowser) then Timer1.Enabled := True; + end; +end; + +procedure TMainForm.GoBtnClick(Sender: TObject); +begin + LoadURL; +end; + +procedure TMainForm.LoadURL; +begin + FResizeCS.Acquire; + FResizing := False; + FPendingResize := False; + FResizeCS.Release; + + chrmosr.LoadURL(AddressCb.Text); +end; + +procedure TMainForm.GoBtnEnter(Sender: TObject); +begin + chrmosr.SetFocus(False); +end; + +procedure TMainForm.Panel1Click(Sender: TObject); +begin + Panel1.SetFocus; +end; + +procedure TMainForm.Panel1DialogKey(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if (Key = vkTab) then Key := 0; +end; + +procedure TMainForm.Panel1Enter(Sender: TObject); +begin + chrmosr.SetFocus(True); +end; + +procedure TMainForm.Panel1Exit(Sender: TObject); +begin + chrmosr.SetFocus(False); +end; + +procedure TMainForm.Panel1KeyDown( Sender : TObject; + var Key : Word; + var KeyChar : Char; + Shift : TShiftState); +var + TempKeyEvent : TCefKeyEvent; +begin + if not(Panel1.IsFocused) then exit; + + if (Key = 0) and (KeyChar <> #0) then + begin + TempKeyEvent.kind := KEYEVENT_CHAR; + TempKeyEvent.modifiers := getModifiers(Shift); + TempKeyEvent.windows_key_code := ord(KeyChar); + TempKeyEvent.native_key_code := 0; + TempKeyEvent.is_system_key := ord(False); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end + else + if (Key <> 0) and (KeyChar = #0) and + (Key in [vkLeft, vkRight, vkUp, vkDown]) then + Key := 0; +end; + +procedure TMainForm.Panel1MouseDown(Sender : TObject; + Button : TMouseButton; + Shift : TShiftState; + X, Y : Single); +var + TempEvent : TCefMouseEvent; + TempTime : integer; +begin + if not(ssTouch in Shift) then + begin + Panel1.SetFocus; + + if not(CancelPreviousClick(x, y, TempTime)) and (Button = FLastClickButton) then + inc(FLastClickCount) + else + begin + FLastClickPoint.x := x; + FLastClickPoint.y := y; + FLastClickCount := 1; + end; + + FLastClickTime := TempTime; + FLastClickButton := Button; + + TempEvent.x := round(X); + TempEvent.y := round(Y); + TempEvent.modifiers := getModifiers(Shift); + chrmosr.SendMouseClickEvent(@TempEvent, GetButton(Button), False, FLastClickCount); + end; +end; + +function TMainForm.GetMousePosition(var aPoint : TPointF) : boolean; +begin + {$IFDEF DELPHI17_UP} + if (FMouseWheelService <> nil) then + begin + aPoint := FMouseWheelService.GetMousePos; + Result := True; + end + else + begin + aPoint.x := 0; + aPoint.y := 0; + Result := False; + end; + {$ELSE} + TempPointF := Platform.GetMousePos; + Result := True; + {$ENDIF} +end; + +procedure TMainForm.Panel1MouseLeave(Sender: TObject); +var + TempEvent : TCefMouseEvent; + TempPoint : TPointF; + TempTime : integer; +begin + if GetMousePosition(TempPoint) then + begin + TempPoint := Panel1.ScreenToClient(TempPoint); + + if CancelPreviousClick(TempPoint.x, TempPoint.y, TempTime) then InitializeLastClick; + + TempEvent.x := round(TempPoint.x); + TempEvent.y := round(TempPoint.y); + TempEvent.modifiers := GetCefMouseModifiers; + chrmosr.SendMouseMoveEvent(@TempEvent, True); + end; +end; + +procedure TMainForm.Panel1MouseMove(Sender : TObject; + Shift : TShiftState; + X, Y : Single); +var + TempEvent : TCefMouseEvent; + TempTime : integer; +begin + if not(ssTouch in Shift) then + begin + if CancelPreviousClick(x, y, TempTime) then InitializeLastClick; + + TempEvent.x := round(x); + TempEvent.y := round(y); + TempEvent.modifiers := getModifiers(Shift); + chrmosr.SendMouseMoveEvent(@TempEvent, False); + end; +end; + +procedure TMainForm.Panel1MouseUp(Sender : TObject; + Button : TMouseButton; + Shift : TShiftState; + X, Y : Single); +var + TempEvent : TCefMouseEvent; +begin + if not(ssTouch in Shift) then + begin + TempEvent.x := round(X); + TempEvent.y := round(Y); + TempEvent.modifiers := getModifiers(Shift); + chrmosr.SendMouseClickEvent(@TempEvent, GetButton(Button), True, FLastClickCount); + end; +end; + +procedure TMainForm.Panel1MouseWheel( Sender : TObject; + Shift : TShiftState; + WheelDelta : Integer; + var Handled : Boolean); +var + TempEvent : TCefMouseEvent; + TempPoint : TPointF; +begin + if Panel1.IsFocused and GetMousePosition(TempPoint) then + begin + TempPoint := Panel1.ScreenToClient(TempPoint); + TempEvent.x := round(TempPoint.x); + TempEvent.y := round(TempPoint.y); + TempEvent.modifiers := getModifiers(Shift); + chrmosr.SendMouseWheelEvent(@TempEvent, 0, WheelDelta); + end; +end; + +procedure TMainForm.Panel1Resize(Sender: TObject); +begin + DoResize; +end; + +procedure TMainForm.Timer1Timer(Sender: TObject); +begin + Timer1.Enabled := False; + + if not(chrmosr.CreateBrowser) and not(chrmosr.Initialized) then + Timer1.Enabled := True; +end; + +procedure TMainForm.AddressEdtEnter(Sender: TObject); +begin + chrmosr.SetFocus(False); +end; + +procedure TMainForm.chrmosrAddressChange(Sender: TObject; + const browser: ICefBrowser; const frame: ICefFrame; const url: ustring); +begin + AddressCb.Text := url; +end; + +procedure TMainForm.chrmosrAfterCreated(Sender: TObject; const browser: ICefBrowser); +begin + // Now the browser is fully initialized we can enable the UI. + Caption := 'FMX VirtualUI Browser'; + AddressPnl.Enabled := True; + Panel1.SetFocus; +end; + +procedure TMainForm.chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser); +begin + FCanClose := True; + + {$IFDEF MSWINDOWS} + SendCompMessage(WM_CLOSE); + {$ELSE} + TThread.Queue(nil, procedure + begin + close + end); + {$ENDIF} +end; + +procedure TMainForm.chrmosrBeforePopup( Sender : TObject; + const browser : ICefBrowser; + const frame : ICefFrame; + const targetUrl : ustring; + const targetFrameName : ustring; + targetDisposition : TCefWindowOpenDisposition; + userGesture : Boolean; + const popupFeatures : TCefPopupFeatures; + var windowInfo : TCefWindowInfo; + var client : ICefClient; + var settings : TCefBrowserSettings; + var extra_info : ICefDictionaryValue; + var noJavascriptAccess : Boolean; + var Result : Boolean); +begin + // For simplicity, this demo blocks all popup windows and new tabs + Result := (targetDisposition in [WOD_NEW_FOREGROUND_TAB, WOD_NEW_BACKGROUND_TAB, WOD_NEW_POPUP, WOD_NEW_WINDOW]); +end; + +procedure TMainForm.chrmosrCursorChange( Sender : TObject; + const browser : ICefBrowser; + cursor_ : TCefCursorHandle; + cursorType : TCefCursorType; + const customCursorInfo : PCefCursorInfo; + var aResult : Boolean); +begin + Panel1.Cursor := CefCursorToWindowsCursor(cursorType); + aResult := True; +end; + +procedure TMainForm.chrmosrGetScreenInfo( Sender : TObject; + const browser : ICefBrowser; + var screenInfo : TCefScreenInfo; + out Result : Boolean); +var + TempRect : TCEFRect; +begin + TempRect.x := 0; + TempRect.y := 0; + TempRect.width := round(Panel1.Width); + TempRect.height := round(Panel1.Height); + + screenInfo.device_scale_factor := Panel1.ScreenScale; + screenInfo.depth := 0; + screenInfo.depth_per_component := 0; + screenInfo.is_monochrome := Ord(False); + screenInfo.rect := TempRect; + screenInfo.available_rect := TempRect; + + Result := True; +end; + +procedure TMainForm.chrmosrGetScreenPoint( Sender : TObject; + const browser : ICefBrowser; + viewX : Integer; + viewY : Integer; + var screenX : Integer; + var screenY : Integer; + out Result : Boolean); +var + TempScreenPt, TempViewPt : TPoint; + TempScale : single; +begin + TempScale := Panel1.ScreenScale; + TempViewPt.x := viewX; + TempViewPt.y := viewY; + TempScreenPt := Panel1.ClientToScreen(TempViewPt); + screenX := LogicalToDevice(TempScreenPt.x, TempScale); + screenY := LogicalToDevice(TempScreenPt.y, TempScale); + Result := True; +end; + +procedure TMainForm.chrmosrGetViewRect( Sender : TObject; + const browser : ICefBrowser; + var rect : TCefRect); +begin + rect.x := 0; + rect.y := 0; + rect.width := round(Panel1.Width); + rect.height := round(Panel1.Height); +end; + +procedure TMainForm.chrmosrPaint( Sender : TObject; + const browser : ICefBrowser; + type_ : TCefPaintElementType; + dirtyRectsCount : NativeUInt; + const dirtyRects : PCefRectArray; + const buffer : Pointer; + width : Integer; + height : Integer); +var + src, dst: PByte; + i, j, TempLineSize, TempSrcOffset, TempDstOffset, SrcStride, TempWidth, TempHeight : Integer; + n : NativeUInt; + {$IFNDEF DELPHI17_UP} + TempScanlineSize, DstStride : integer; + {$ENDIF} + TempBufferBits : Pointer; + TempForcedResize : boolean; + TempBitmapData : TBitmapData; + TempBitmap : TBitmap; + TempSrcRect, TempDstRect : TRectF; +begin + try + FResizeCS.Acquire; + TempForcedResize := False; + + if Panel1.BeginBufferDraw then + try + if (type_ = PET_POPUP) then + begin + if (FPopUpBitmap = nil) or + (width <> FPopUpBitmap.Width) or + (height <> FPopUpBitmap.Height) then + begin + if (FPopUpBitmap <> nil) then FPopUpBitmap.Free; + + FPopUpBitmap := TBitmap.Create(width, height); + {$IFDEF DELPHI17_UP} + FPopUpBitmap.BitmapScale := Panel1.ScreenScale; + {$ENDIF} + end; + + TempWidth := FPopUpBitmap.Width; + TempHeight := FPopUpBitmap.Height; + {$IFNDEF DELPHI17_UP} + TempScanlineSize := FPopUpBitmap.BytesPerLine; + {$ENDIF} + TempBitmap := FPopUpBitmap; + end + else + begin + TempForcedResize := Panel1.UpdateBufferDimensions(Width, Height) or not(Panel1.BufferIsResized(False)); + TempWidth := Panel1.BufferWidth; + TempHeight := Panel1.BufferHeight; + {$IFNDEF DELPHI17_UP} + TempScanlineSize := Panel1.ScanlineSize; + {$ENDIF} + TempBitmap := Panel1.Buffer; + end; + + + if (TempBitmap <> nil) {$IFDEF DELPHI17_UP}and TempBitmap.Map(TMapAccess.ReadWrite, TempBitmapData){$ENDIF} then + begin + try + {$IFNDEF DELPHI17_UP} + TempBufferBits := TempBitmapData.StartLine; + DstStride := TempScanlineSize; + {$ENDIF} + SrcStride := Width * SizeOf(TRGBQuad); + + n := 0; + + while (n < dirtyRectsCount) do + begin + if (dirtyRects[n].x >= 0) and (dirtyRects[n].y >= 0) then + begin + TempLineSize := min(dirtyRects[n].width, TempWidth - dirtyRects[n].x) * SizeOf(TRGBQuad); + + if (TempLineSize > 0) then + begin + TempSrcOffset := ((dirtyRects[n].y * Width) + dirtyRects[n].x) * SizeOf(TRGBQuad); + + {$IFDEF DELPHI17_UP} + TempDstOffset := (dirtyRects[n].x * SizeOf(TRGBQuad)); + {$ELSE} + TempDstOffset := (dirtyRects[n].y * TempScanlineSize) + (dirtyRects[n].x * SizeOf(TRGBQuad)); + {$ENDIF} + + src := @PByte(buffer)[TempSrcOffset]; + {$IFNDEF DELPHI17_UP} + dst := @PByte(TempBufferBits)[TempDstOffset]; + {$ENDIF} + + i := 0; + j := min(dirtyRects[n].height, TempHeight - dirtyRects[n].y); + + while (i < j) do + begin + {$IFDEF DELPHI17_UP} + TempBufferBits := TempBitmapData.GetScanline(dirtyRects[n].y + i); + dst := @PByte(TempBufferBits)[TempDstOffset]; + {$ENDIF} + + Move(src^, dst^, TempLineSize); + + {$IFNDEF DELPHI17_UP} + inc(dst, DstStride); + {$ENDIF} + inc(src, SrcStride); + inc(i); + end; + end; + end; + + inc(n); + end; + + Panel1.InvalidatePanel; + finally + {$IFDEF DELPHI17_UP} + TempBitmap.Unmap(TempBitmapData); + {$ENDIF} + end; + + if FShowPopup and (FPopUpBitmap <> nil) then + begin + TempSrcRect := RectF(0, 0, + min(FPopUpRect.Width, FPopUpBitmap.Width), + min(FPopUpRect.Height, FPopUpBitmap.Height)); + + TempDstRect.Left := FPopUpRect.Left / GlobalCEFApp.DeviceScaleFactor; + TempDstRect.Top := FPopUpRect.Top / GlobalCEFApp.DeviceScaleFactor; + TempDstRect.Right := TempDstRect.Left + (TempSrcRect.Width / GlobalCEFApp.DeviceScaleFactor); + TempDstRect.Bottom := TempDstRect.Top + (TempSrcRect.Height / GlobalCEFApp.DeviceScaleFactor); + + Panel1.BufferDraw(FPopUpBitmap, TempSrcRect, TempDstRect); + end; + end; + + if (type_ = PET_VIEW) then + begin + if TempForcedResize or FPendingResize then + begin + {$IFDEF MSWINDOWS} + SendCompMessage(CEF_PENDINGRESIZE); + {$ELSE} + TThread.Queue(nil, DoResize); + {$ENDIF} + end; + + FResizing := False; + FPendingResize := False; + end; + finally + Panel1.EndBufferDraw; + end; + finally + FResizeCS.Release; + end; +end; + +procedure TMainForm.chrmosrPopupShow( Sender : TObject; + const browser : ICefBrowser; + show : Boolean); +begin + if show then + FShowPopUp := True + else + begin + FShowPopUp := False; + FPopUpRect := rect(0, 0, 0, 0); + + chrmosr.Invalidate(PET_VIEW); + end; +end; + +procedure TMainForm.chrmosrPopupSize( Sender : TObject; + const browser : ICefBrowser; + const rect : PCefRect); +begin + if (GlobalCEFApp <> nil) then + begin + LogicalToDevice(rect^, GlobalCEFApp.DeviceScaleFactor); + + FPopUpRect.Left := rect.x; + FPopUpRect.Top := rect.y; + FPopUpRect.Right := rect.x + rect.width - 1; + FPopUpRect.Bottom := rect.y + rect.height - 1; + end; +end; + +procedure TMainForm.chrmosrTooltip( Sender : TObject; + const browser : ICefBrowser; + var text : ustring; + out Result : Boolean); +begin + Panel1.Hint := text; + Panel1.ShowHint := (length(text) > 0); + Result := True; +end; + +procedure TMainForm.DoResize; +begin + if (FResizeCS <> nil) then + try + FResizeCS.Acquire; + + if FResizing then + FPendingResize := True + else + if Panel1.BufferIsResized then + chrmosr.Invalidate(PET_VIEW) + else + begin + FResizing := True; + chrmosr.WasResized; + end; + finally + FResizeCS.Release; + end; +end; + +procedure TMainForm.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +var + PositionChanged: Boolean; +begin + PositionChanged := (ALeft <> Left) or (ATop <> Top); + + inherited SetBounds(ALeft, ATop, AWidth, AHeight); + + if PositionChanged then NotifyMoveOrResizeStarted; +end; + +procedure TMainForm.NotifyMoveOrResizeStarted; +begin + if (chrmosr <> nil) then chrmosr.NotifyMoveOrResizeStarted; +end; + +procedure TMainForm.SendCaptureLostEvent; +begin + if (chrmosr <> nil) then chrmosr.SendCaptureLostEvent; +end; + +function TMainForm.getModifiers(Shift: TShiftState): TCefEventFlags; +begin + Result := EVENTFLAG_NONE; + + if (ssShift in Shift) then Result := Result or EVENTFLAG_SHIFT_DOWN; + if (ssAlt in Shift) then Result := Result or EVENTFLAG_ALT_DOWN; + if (ssCtrl in Shift) then Result := Result or EVENTFLAG_CONTROL_DOWN; + if (ssLeft in Shift) then Result := Result or EVENTFLAG_LEFT_MOUSE_BUTTON; + if (ssRight in Shift) then Result := Result or EVENTFLAG_RIGHT_MOUSE_BUTTON; + if (ssMiddle in Shift) then Result := Result or EVENTFLAG_MIDDLE_MOUSE_BUTTON; +end; + +function TMainForm.GetButton(Button: TMouseButton): TCefMouseButtonType; +begin + case Button of + TMouseButton.mbRight : Result := MBT_RIGHT; + TMouseButton.mbMiddle : Result := MBT_MIDDLE; + else Result := MBT_LEFT; + end; +end; + +procedure TMainForm.InitializeLastClick; +begin + FLastClickCount := 1; + FLastClickTime := 0; + FLastClickPoint.x := 0; + FLastClickPoint.y := 0; + FLastClickButton := TMouseButton.mbLeft; +end; + +function TMainForm.CancelPreviousClick(const x, y : single; var aCurrentTime : integer) : boolean; +begin + {$IFDEF MSWINDOWS} + aCurrentTime := GetMessageTime; + + Result := (abs(FLastClickPoint.x - x) > (GetSystemMetrics(SM_CXDOUBLECLK) div 2)) or + (abs(FLastClickPoint.y - y) > (GetSystemMetrics(SM_CYDOUBLECLK) div 2)) or + (cardinal(aCurrentTime - FLastClickTime) > GetDoubleClickTime); + {$ELSE} + aCurrentTime := 0; + Result := False; + {$ENDIF} +end; + +procedure TMainForm.SnapshotBtnClick(Sender: TObject); +begin + if SaveDialog1.Execute then Panel1.SaveToFile(SaveDialog1.FileName); +end; + +procedure TMainForm.SnapshotBtnEnter(Sender: TObject); +begin + chrmosr.SetFocus(False); +end; + +{$IFDEF MSWINDOWS} +procedure TMainForm.HandleSYSCHAR(const aMessage : TMsg); +var + TempKeyEvent : TCefKeyEvent; +begin + if Panel1.IsFocused and (aMessage.wParam in [VK_BACK..VK_HELP]) then + begin + TempKeyEvent.kind := KEYEVENT_CHAR; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam); + TempKeyEvent.windows_key_code := integer(aMessage.wParam); + TempKeyEvent.native_key_code := integer(aMessage.lParam); + TempKeyEvent.is_system_key := ord(True); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; +end; + +procedure TMainForm.HandleSYSKEYDOWN(const aMessage : TMsg); +var + TempKeyEvent : TCefKeyEvent; +begin + if Panel1.IsFocused and (aMessage.wParam in [VK_BACK..VK_HELP]) then + begin + TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam); + TempKeyEvent.windows_key_code := integer(aMessage.wParam); + TempKeyEvent.native_key_code := integer(aMessage.lParam); + TempKeyEvent.is_system_key := ord(True); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; +end; + +procedure TMainForm.HandleSYSKEYUP(const aMessage : TMsg); +var + TempKeyEvent : TCefKeyEvent; +begin + if Panel1.IsFocused and (aMessage.wParam in [VK_BACK..VK_HELP]) then + begin + TempKeyEvent.kind := KEYEVENT_KEYUP; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam); + TempKeyEvent.windows_key_code := integer(aMessage.wParam); + TempKeyEvent.native_key_code := integer(aMessage.lParam); + TempKeyEvent.is_system_key := ord(True); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; +end; + +procedure TMainForm.HandleKEYDOWN(const aMessage : TMsg); +var + TempKeyEvent : TCefKeyEvent; +begin + if Panel1.IsFocused then + begin + TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam); + TempKeyEvent.windows_key_code := integer(aMessage.wParam); + TempKeyEvent.native_key_code := integer(aMessage.lParam); + TempKeyEvent.is_system_key := ord(False); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; +end; + +procedure TMainForm.HandleKEYUP(const aMessage : TMsg); +var + TempKeyEvent : TCefKeyEvent; +begin + if Panel1.IsFocused then + begin + if (aMessage.wParam = vkReturn) then + begin + TempKeyEvent.kind := KEYEVENT_CHAR; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam); + TempKeyEvent.windows_key_code := integer(aMessage.wParam); + TempKeyEvent.native_key_code := integer(aMessage.lParam); + TempKeyEvent.is_system_key := ord(False); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; + + TempKeyEvent.kind := KEYEVENT_KEYUP; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam); + TempKeyEvent.windows_key_code := integer(aMessage.wParam); + TempKeyEvent.native_key_code := integer(aMessage.lParam); + TempKeyEvent.is_system_key := ord(False); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; +end; + +function TMainForm.HandlePOINTER(const aMessage : TMsg) : boolean; +begin + Result := Panel1.IsFocused and + (GlobalCEFApp <> nil) and + ArePointerEventsSupported and + HandlePointerEvent(aMessage); +end; + +function TMainForm.SendCompMessage(aMsg : cardinal; aWParam : WPARAM; aLParam : LPARAM) : boolean; +var + TempHandle : TWinWindowHandle; +begin + TempHandle := WindowHandleToPlatform(Handle); + Result := WinApi.Windows.PostMessage(TempHandle.Wnd, aMsg, aWParam, aLParam); +end; + +function TMainForm.ArePointerEventsSupported : boolean; +begin + Result := FAtLeastWin8 and + (@GetPointerType <> nil) and + (@GetPointerTouchInfo <> nil) and + (@GetPointerPenInfo <> nil); +end; + +function TMainForm.HandlePointerEvent(const aMessage : TMsg) : boolean; +const + PT_TOUCH = 2; + PT_PEN = 3; +var + TempID : uint32; + TempType : POINTER_INPUT_TYPE; +begin + Result := False; + TempID := LoWord(aMessage.wParam); + + if GetPointerType(TempID, @TempType) then + case TempType of + PT_PEN : Result := HandlePenEvent(TempID, aMessage.message); + PT_TOUCH : Result := HandleTouchEvent(TempID, aMessage.message); + end; +end; + +function TMainForm.HandlePenEvent(const aID : uint32; aMsg : cardinal) : boolean; +var + TempPenInfo : POINTER_PEN_INFO; + TempTouchEvent : TCefTouchEvent; + TempPoint : TPoint; + TempScale : single; +begin + Result := False; + if not(GetPointerPenInfo(aID, @TempPenInfo)) then exit; + + TempTouchEvent.id := aID; + TempTouchEvent.x := 0; + TempTouchEvent.y := 0; + TempTouchEvent.radius_x := 0; + TempTouchEvent.radius_y := 0; + TempTouchEvent.type_ := CEF_TET_RELEASED; + TempTouchEvent.modifiers := EVENTFLAG_NONE; + + if ((TempPenInfo.penFlags and PEN_FLAG_ERASER) <> 0) then + TempTouchEvent.pointer_type := CEF_POINTER_TYPE_ERASER + else + TempTouchEvent.pointer_type := CEF_POINTER_TYPE_PEN; + + if ((TempPenInfo.penMask and PEN_MASK_PRESSURE) <> 0) then + TempTouchEvent.pressure := TempPenInfo.pressure / 1024 + else + TempTouchEvent.pressure := 0; + + if ((TempPenInfo.penMask and PEN_MASK_ROTATION) <> 0) then + TempTouchEvent.rotation_angle := TempPenInfo.rotation / 180 * Pi + else + TempTouchEvent.rotation_angle := 0; + + Result := True; + + case aMsg of + WM_POINTERDOWN : + TempTouchEvent.type_ := CEF_TET_PRESSED; + + WM_POINTERUPDATE : + if ((TempPenInfo.pointerInfo.pointerFlags and POINTER_FLAG_INCONTACT) <> 0) then + TempTouchEvent.type_ := CEF_TET_MOVED + else + exit; // Ignore hover events. + + WM_POINTERUP : + TempTouchEvent.type_ := CEF_TET_RELEASED; + end; + + if ((TempPenInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then + TempTouchEvent.type_ := CEF_TET_CANCELLED; + + TempScale := Panel1.ScreenScale; + TempPoint.x := DeviceToLogical(TempPenInfo.pointerInfo.ptPixelLocation.x, TempScale); + TempPoint.y := DeviceToLogical(TempPenInfo.pointerInfo.ptPixelLocation.y, TempScale); + + TempPoint := Panel1.ScreenToClient(TempPoint); + TempTouchEvent.x := TempPoint.x; + TempTouchEvent.y := TempPoint.y; + + chrmosr.SendTouchEvent(@TempTouchEvent); +end; + +function TMainForm.HandleTouchEvent(const aID : uint32; aMsg : cardinal) : boolean; +var + TempTouchInfo : POINTER_TOUCH_INFO; + TempTouchEvent : TCefTouchEvent; + TempPoint : TPoint; + TempScale : single; +begin + Result := False; + if not(GetPointerTouchInfo(aID, @TempTouchInfo)) then exit; + + TempTouchEvent.id := aID; + TempTouchEvent.x := 0; + TempTouchEvent.y := 0; + TempTouchEvent.radius_x := 0; + TempTouchEvent.radius_y := 0; + TempTouchEvent.rotation_angle := 0; + TempTouchEvent.pressure := 0; + TempTouchEvent.type_ := CEF_TET_RELEASED; + TempTouchEvent.modifiers := EVENTFLAG_NONE; + TempTouchEvent.pointer_type := CEF_POINTER_TYPE_TOUCH; + + Result := True; + + case aMsg of + WM_POINTERDOWN : + TempTouchEvent.type_ := CEF_TET_PRESSED; + + WM_POINTERUPDATE : + if ((TempTouchInfo.pointerInfo.pointerFlags and POINTER_FLAG_INCONTACT) <> 0) then + TempTouchEvent.type_ := CEF_TET_MOVED + else + exit; // Ignore hover events. + + WM_POINTERUP : + TempTouchEvent.type_ := CEF_TET_RELEASED; + end; + + if ((TempTouchInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then + TempTouchEvent.type_ := CEF_TET_CANCELLED; + + TempScale := Panel1.ScreenScale; + TempPoint.x := DeviceToLogical(TempTouchInfo.pointerInfo.ptPixelLocation.x, TempScale); + TempPoint.y := DeviceToLogical(TempTouchInfo.pointerInfo.ptPixelLocation.y, TempScale); + + TempPoint := Panel1.ScreenToClient(TempPoint); + //TempPoint := Panel1.ScreenToClient(TempTouchInfo.pointerInfo.ptPixelLocation); + TempTouchEvent.x := TempPoint.x; + TempTouchEvent.y := TempPoint.y; + + chrmosr.SendTouchEvent(@TempTouchEvent); +end; +{$ENDIF} + +end. diff --git a/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/uFMXVirtualUIBrowser_sp.pas b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/uFMXVirtualUIBrowser_sp.pas new file mode 100644 index 00000000..88b51c1d --- /dev/null +++ b/demos/Delphi_FMX_Windows/FMXVirtualUIBrowser/uFMXVirtualUIBrowser_sp.pas @@ -0,0 +1,27 @@ +unit uFMXVirtualUIBrowser_sp; + +interface + +uses + uCEFApplicationCore, uCEFInterfaces, uCEFTypes, uCEFConstants; + +procedure CreateGlobalCEFApp; + +implementation + +procedure CreateGlobalCEFApp; +begin + GlobalCEFApp := TCefApplicationCore.Create; + GlobalCEFApp.WindowlessRenderingEnabled := True; + GlobalCEFApp.EnableHighDPISupport := True; + GlobalCEFApp.ExternalMessagePump := True; + GlobalCEFApp.MultiThreadedMessageLoop := False; + GlobalCEFApp.EnableGPU := True; + {$IFDEF DEBUG} + //GlobalCEFApp.LogFile := 'debug.log'; + //GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO; + {$ENDIF} + GlobalCEFApp.StartSubProcess; +end; + +end. diff --git a/demos/Delphi_VCL/VirtualUIBrowser/00-DeleteDCUs.bat b/demos/Delphi_VCL/VirtualUIBrowser/00-DeleteDCUs.bat new file mode 100644 index 00000000..a9a84095 --- /dev/null +++ b/demos/Delphi_VCL/VirtualUIBrowser/00-DeleteDCUs.bat @@ -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 diff --git a/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowser.dpr b/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowser.dpr new file mode 100644 index 00000000..8d937c58 --- /dev/null +++ b/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowser.dpr @@ -0,0 +1,67 @@ +// ************************************************************************ +// ***************************** 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 + * 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 VirtualUIBrowser; + +{$I cef.inc} + +uses + {$IFDEF DELPHI16_UP} + Vcl.Forms, + {$ELSE} + Forms, + {$ENDIF } + uCEFLoader in 'uCEFLoader.pas', + uVirtualUIBrowser in 'uVirtualUIBrowser.pas' {Form1}, + uVirtualUIBrowserConstants in 'uVirtualUIBrowserConstants.pas'; + +{$R *.res} + +{$IFDEF WIN32} + // CEF needs to set the LARGEADDRESSAWARE flag which allows 32-bit processes to use up to 3GB of RAM. + // If you don't add this flag the rederer process will crash when you try to load large images. + {$SetPEFlags $20} +{$ENDIF} + +begin + Application.Initialize; + {$IFDEF DELPHI11_UP} + Application.MainFormOnTaskbar := True; + {$ENDIF} + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowser.dproj b/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowser.dproj new file mode 100644 index 00000000..6f2a2634 --- /dev/null +++ b/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowser.dproj @@ -0,0 +1,1007 @@ + + + {7DC52040-59FF-4430-BF65-3A852AB5A6C0} + 19.5 + VCL + VirtualUIBrowser.dpr + True + Debug + Win32 + 3 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + 3082 + System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\delphi_PROJECTICON.ico + VirtualUIBrowser + .\$(Platform)\$(Config) + false + false + false + false + false + ..\..\..\bin + ..\..\..\source;C:\Program Files\Thinfinity\VirtualUI\dev\Delphi;$(DCC_UnitSearchPath) + + + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + true + 1033 + CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName) + $(BDS)\bin\default_app.manifest + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;frxe23;vclFireDAC;emsclientfiredac;DataSnapFireDAC;svnui;tethering;Componentes;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;Intraweb;DBXOracleDriver;inetdb;Componentes_Int;CEF4Delphi;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyProtocols230;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;frxTee23;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;vcl;DBXSybaseASEDriver;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;Componentes_UI;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;Componentes_Misc;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;Componentes_RTF;DBXInformixDriver;bindcompvcl;frxDB23;Componentes_vCard;TeeUI;IndyCore230;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;IndySystem230;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;frx23;fmxase;$(DCC_UsePackage) + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyProtocols230;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;vcl;DBXSybaseASEDriver;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;bindcompvcl;TeeUI;IndyCore230;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;IndySystem230;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;fmxase;$(DCC_UsePackage) + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + $(BDS)\bin\default_app.manifest + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + true + 1033 + true + false + Debug + CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName) + PerMonitorV2 + + + true + PerMonitorV2 + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + PerMonitor + Debug + true + 1033 + CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName) + + + true + PerMonitorV2 + + + + MainSource + + + +
Form1
+
+ + + Base + + + Cfg_1 + Base + + + Cfg_2 + Base + +
+ + Delphi.Personality.12 + Application + + + + VirtualUIBrowser.dpr + + + IP Abstraction Indy Implementation Design Time + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 64 + + + classes + 64 + + + + + res\xml + 1 + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + library\lib\armeabi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\mips + 1 + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-v21 + 1 + + + res\values-v21 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-small + 1 + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + res\drawable-xlarge + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).launchscreen + 64 + + + ..\$(PROJECTNAME).launchscreen + 64 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + + + + True + True + + + 12 + + + + +
diff --git a/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowserGrp.groupproj b/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowserGrp.groupproj new file mode 100644 index 00000000..ff258bd5 --- /dev/null +++ b/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowserGrp.groupproj @@ -0,0 +1,48 @@ + + + {5EA9176C-16E9-421D-9A7B-9D5925539FDB} + + + + + + + + + + + Default.Personality.12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowser_sp.dpr b/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowser_sp.dpr new file mode 100644 index 00000000..0fb9a57e --- /dev/null +++ b/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowser_sp.dpr @@ -0,0 +1,53 @@ +// ************************************************************************ +// ***************************** 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 © 2021 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 + * 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 VirtualUIBrowser_sp; + +{$I cef.inc} + +uses + uCEFLoader_sp in 'uCEFLoader_sp.pas', + uVirtualUIBrowserConstants in 'uVirtualUIBrowserConstants.pas'; + +{$IFDEF WIN32} + // CEF needs to set the LARGEADDRESSAWARE flag which allows 32-bit processes to use up to 3GB of RAM. + // If you don't add this flag the rederer process will crash when you try to load large images. + {$SetPEFlags $20} +{$ENDIF} + +begin + // This SubProcess project is only used for the CEF subprocesses. +end. diff --git a/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowser_sp.dproj b/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowser_sp.dproj new file mode 100644 index 00000000..042f2d36 --- /dev/null +++ b/demos/Delphi_VCL/VirtualUIBrowser/VirtualUIBrowser_sp.dproj @@ -0,0 +1,983 @@ + + + {6ABCF641-08D0-4F35-9D13-2FBD18E5152A} + 19.5 + VCL + VirtualUIBrowser_sp.dpr + True + Debug + Win32 + 3 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + 3082 + System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\delphi_PROJECTICON.ico + VirtualUIBrowser_sp + .\$(Platform)\$(Config) + false + false + false + false + false + ..\..\..\bin + ..\..\..\source;$(DCC_UnitSearchPath) + + + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + true + 1033 + CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName) + $(BDS)\bin\default_app.manifest + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;frxe23;vclFireDAC;emsclientfiredac;DataSnapFireDAC;svnui;tethering;Componentes;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;Intraweb;DBXOracleDriver;inetdb;Componentes_Int;CEF4Delphi;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyProtocols230;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;frxTee23;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;vcl;DBXSybaseASEDriver;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;Componentes_UI;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;Componentes_Misc;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;Componentes_RTF;DBXInformixDriver;bindcompvcl;frxDB23;Componentes_vCard;TeeUI;IndyCore230;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;IndySystem230;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;frx23;fmxase;$(DCC_UsePackage) + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyProtocols230;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;vcl;DBXSybaseASEDriver;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;bindcompvcl;TeeUI;IndyCore230;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;IndySystem230;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;fmxase;$(DCC_UsePackage) + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + true + 1033 + true + false + PerMonitor + CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName) + Debug + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + Debug + true + 1033 + CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName) + PerMonitor + + + + MainSource + + + + + Base + + + Cfg_1 + Base + + + Cfg_2 + Base + + + + Delphi.Personality.12 + Application + + + + VirtualUIBrowser_sp.dpr + + + IP Abstraction Indy Implementation Design Time + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 64 + + + classes + 64 + + + + + res\xml + 1 + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + library\lib\armeabi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\mips + 1 + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-v21 + 1 + + + res\values-v21 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-small + 1 + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + res\drawable-xlarge + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).launchscreen + 64 + + + ..\$(PROJECTNAME).launchscreen + 64 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + + + + True + True + + + 12 + + + + + diff --git a/demos/Delphi_VCL/VirtualUIBrowser/cef.inc b/demos/Delphi_VCL/VirtualUIBrowser/cef.inc new file mode 100644 index 00000000..76ec7fb3 --- /dev/null +++ b/demos/Delphi_VCL/VirtualUIBrowser/cef.inc @@ -0,0 +1,507 @@ +// ************************************************************************ +// ***************************** 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 © 2017 Salvador Diaz 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 + * 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. + * + *) + + // The complete list of compiler versions is here : + // http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Compiler_Versions + +{$DEFINE DELPHI_VERSION_UNKNOW} + +// Delphi 5 +{$IFDEF VER130} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} +{$ENDIF} + +// Delphi 6 +{$IFDEF VER140} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} +{$ENDIF} + +// Delphi 7 +{$IFDEF VER150} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} +{$ENDIF} + +// Delphi 8 +{$IFDEF VER160} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} +{$ENDIF} + +// Delphi 2005 +{$IFDEF VER170} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} +{$ENDIF} + +{$IFDEF VER180} + {$UNDEF DELPHI_VERSION_UNKNOW} + // Delphi 2007 + {$IFDEF VER185} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + // Delphi 2006 + {$ELSE} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$ENDIF} +{$ENDIF} + +// Delphi 2009 +{$IFDEF VER200} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} +{$ENDIF} + +//Delphi 2010 +{$IFDEF VER210} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} +{$ENDIF} + +// Delphi XE +{$IFDEF VER220} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} +{$ENDIF} + +// Delphi XE2 (First FireMonkey and 64bit compiler) +{$IFDEF VER230} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} +{$ENDIF} + +// Delphi XE3 +{$IFDEF VER240} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} +{$ENDIF} + +// Delphi XE4 +{$IFDEF VER250} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} +{$ENDIF} + +// Delphi XE5 +{$IFDEF VER260} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} +{$ENDIF} + +// Delphi XE6 +{$IFDEF VER270} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} +{$ENDIF} + +// Delphi XE7 +{$IFDEF VER280} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} +{$ENDIF} + +// Delphi XE8 +{$IFDEF VER290} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} +{$ENDIF VER290} + +// Rad Studio 10 - Delphi Seattle +{$IFDEF VER300} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} +{$ENDIF} + +// Rad Studio 10.1 - Delphi Berlin +{$IFDEF VER310} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} +{$ENDIF} + +// Rad Studio 10.2 - Delphi Tokyo +{$IFDEF VER320} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} +{$ENDIF} + +// Rad Studio 10.3 - Delphi Rio +{$IFDEF VER330} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} + {$DEFINE DELPHI26_UP} +{$ENDIF} + +// Rad Studio 10.4 - Delphi Sydney +{$IFDEF VER340} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} + {$DEFINE DELPHI26_UP} + {$DEFINE DELPHI27_UP} +{$ENDIF} + +// Rad Studio 11.0 - Delphi Alexandria +{$IFDEF VER350} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} + {$DEFINE DELPHI26_UP} + {$DEFINE DELPHI27_UP} + {$DEFINE DELPHI28_UP} +{$ENDIF} + +{$IFDEF FPC} + {$DEFINE SUPPORTS_INLINE} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30200)} + {$DEFINE FPC_VER_320} + {$IFEND} +{$ELSE} + {$IFDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} + {$DEFINE DELPHI26_UP} + {$DEFINE DELPHI27_UP} + {$DEFINE DELPHI28_UP} + {$ENDIF} +{$ENDIF} + +{$IFDEF DELPHI9_UP} + {$DEFINE SUPPORTS_INLINE} +{$ENDIF} + +{$IF DEFINED(CPUX32) OR + DEFINED(CPU32) OR + DEFINED(CPU32BITS) OR + DEFINED(CPUARM32) OR + DEFINED(WIN32) OR + DEFINED(IOS32) OR + DEFINED(MACOS32) OR + DEFINED(LINUX32) OR + DEFINED(POSIX32) OR + DEFINED(ANDROID32)} + {$DEFINE TARGET_32BITS} +{$ELSE} + {$IF DEFINED(CPUX64) OR + DEFINED(CPU64) OR + DEFINED(CPU64BITS) OR + DEFINED(CPUARM64) OR + DEFINED(WIN64) OR + DEFINED(IOS64) OR + DEFINED(MACOS64) OR + DEFINED(LINUX64) OR + DEFINED(POSIX64) OR + DEFINED(ANDROID64)} + {$DEFINE TARGET_64BITS} + {$IFEND} +{$IFEND} + +// Delphi uses MACOS for the new MacOSX and DARWIN is not defined +// FPC uses DARWIN for the new MacOSX and MACOS is defined for the classic Macintosh OS (System 7) +// We define MACOSX to avoid conflicts in both situations +{$IFDEF FPC} + {$IFDEF DARWIN} + {$DEFINE MACOSX} + {$ENDIF} +{$ELSE} + {$IFDEF MACOS} + {$DEFINE MACOSX} + {$ENDIF} +{$ENDIF} diff --git a/demos/Delphi_VCL/VirtualUIBrowser/uCEFLoader.pas b/demos/Delphi_VCL/VirtualUIBrowser/uCEFLoader.pas new file mode 100644 index 00000000..c28cd871 --- /dev/null +++ b/demos/Delphi_VCL/VirtualUIBrowser/uCEFLoader.pas @@ -0,0 +1,83 @@ +// ************************************************************************ +// ***************************** CEF4Delphi ******************************* +// ************************************************************************ +// +// CEF4Delphi is based on DCEF3 which uses CEF 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 © 2022 Salvador Diaz 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 + * 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. + * + *) + +unit uCEFLoader; + +interface + +implementation + +uses + VirtualUI_SDK, + uCEFApplication, uCEFTypes, uCEFInterfaces, uCEFConstants, uCEFMiscFunctions, + uVirtualUIBrowserConstants; + +procedure CreateGlobalCEFApp; +begin + // Start VirtualUI and allow the execution of CEF subprocesses with VirtualUIBrowser_sp.exe + VirtualUI.Start; + VirtualUI.AllowExecute('VirtualUIBrowser_sp.exe'); + + GlobalCEFApp := TCefApplication.Create; + GlobalCEFApp.BrowserSubprocessPath := 'VirtualUIBrowser_sp.exe'; + GlobalCEFApp.WindowlessRenderingEnabled := True; + GlobalCEFApp.EnableHighDPISupport := True; + GlobalCEFApp.TouchEvents := STATE_ENABLED; + GlobalCEFApp.EnableGPU := True; + //GlobalCEFApp.LogFile := 'debug.log'; + //GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE; + + // If you need transparency leave the GlobalCEFApp.BackgroundColor property + // with the default value or set the alpha channel to 0 + if TRANSPARENT_BROWSER then + GlobalCEFApp.BackgroundColor := CefColorSetARGB($00, $00, $00, $00) + else + GlobalCEFApp.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF); + + // This demo uses a different EXE for the subprocesses. + // With this configuration it's not necessary to have the + // GlobalCEFApp.StartMainProcess call in a if..then clause. + GlobalCEFApp.StartMainProcess; +end; + +initialization + CreateGlobalCEFApp; + +finalization + DestroyGlobalCEFApp; + +end. diff --git a/demos/Delphi_VCL/VirtualUIBrowser/uCEFLoader_sp.pas b/demos/Delphi_VCL/VirtualUIBrowser/uCEFLoader_sp.pas new file mode 100644 index 00000000..4fe83e01 --- /dev/null +++ b/demos/Delphi_VCL/VirtualUIBrowser/uCEFLoader_sp.pas @@ -0,0 +1,77 @@ +// ************************************************************************ +// ***************************** CEF4Delphi ******************************* +// ************************************************************************ +// +// CEF4Delphi is based on DCEF3 which uses CEF 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 © 2022 Salvador Diaz 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 + * 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. + * + *) + +unit uCEFLoader_sp; + +interface + +implementation + +uses + uCEFApplicationCore, uCEFTypes, uCEFInterfaces, uCEFConstants, uCEFMiscFunctions, + uVirtualUIBrowserConstants; + +procedure CreateGlobalCEFApp; +begin + GlobalCEFApp := TCefApplicationCore.Create; + GlobalCEFApp.WindowlessRenderingEnabled := True; + GlobalCEFApp.EnableHighDPISupport := True; + GlobalCEFApp.TouchEvents := STATE_ENABLED; + GlobalCEFApp.EnableGPU := True; + //GlobalCEFApp.LogFile := 'debug.log'; + //GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE; + + // If you need transparency leave the GlobalCEFApp.BackgroundColor property + // with the default value or set the alpha channel to 0 + if TRANSPARENT_BROWSER then + GlobalCEFApp.BackgroundColor := CefColorSetARGB($00, $00, $00, $00) + else + GlobalCEFApp.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF); + + // This demo uses a different EXE for the subprocesses. + // With this configuration it's not necessary to have the + // GlobalCEFApp.StartMainProcess call in a if..then clause. + GlobalCEFApp.StartSubProcess; +end; + +initialization + CreateGlobalCEFApp; + +finalization + DestroyGlobalCEFApp; + +end. diff --git a/demos/Delphi_VCL/VirtualUIBrowser/uVirtualUIBrowser.dfm b/demos/Delphi_VCL/VirtualUIBrowser/uVirtualUIBrowser.dfm new file mode 100644 index 00000000..0fef25b5 --- /dev/null +++ b/demos/Delphi_VCL/VirtualUIBrowser/uVirtualUIBrowser.dfm @@ -0,0 +1,171 @@ +object Form1: TForm1 + Left = 0 + Top = 0 + Caption = 'VirtualUI Browser - Initializing browser. Please wait...' + ClientHeight = 684 + ClientWidth = 1050 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Position = poScreenCenter + OnAfterMonitorDpiChanged = FormAfterMonitorDpiChanged + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + OnDestroy = FormDestroy + OnHide = FormHide + OnShow = FormShow + TextHeight = 13 + object NavControlPnl: TPanel + Left = 0 + Top = 0 + Width = 1050 + Height = 30 + Align = alTop + BevelOuter = bvNone + Enabled = False + Padding.Left = 5 + Padding.Top = 5 + Padding.Right = 5 + Padding.Bottom = 5 + TabOrder = 0 + ExplicitWidth = 1046 + object AddressCb: TComboBox + Left = 5 + Top = 5 + Width = 969 + Height = 21 + Align = alClient + ItemIndex = 0 + TabOrder = 0 + Text = 'https://www.google.com' + OnEnter = AddressCbEnter + Items.Strings = ( + 'https://www.google.com' + 'https://html5demos.com/drag' + + 'https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_selec' + + 't_form' + 'https://www.briskbard.com' + 'https://frames-per-second.appspot.com/' + 'file:///transparency.html') + ExplicitWidth = 965 + end + object Panel2: TPanel + Left = 974 + Top = 5 + Width = 71 + Height = 20 + Margins.Left = 2 + Margins.Top = 2 + Margins.Right = 2 + Margins.Bottom = 2 + Align = alRight + BevelOuter = bvNone + Padding.Left = 4 + TabOrder = 1 + ExplicitLeft = 970 + object GoBtn: TButton + Left = 4 + Top = 0 + Width = 31 + Height = 20 + Margins.Left = 5 + Align = alLeft + Caption = 'Go' + TabOrder = 0 + OnClick = GoBtnClick + OnEnter = GoBtnEnter + end + object SnapshotBtn: TButton + Left = 40 + Top = 0 + Width = 31 + Height = 20 + Hint = 'Take snapshot' + Margins.Left = 5 + Align = alRight + Caption = #181 + Font.Charset = SYMBOL_CHARSET + Font.Color = clWindowText + Font.Height = -24 + Font.Name = 'Webdings' + Font.Style = [] + ParentFont = False + ParentShowHint = False + ShowHint = True + TabOrder = 1 + OnClick = SnapshotBtnClick + OnEnter = SnapshotBtnEnter + end + end + end + object Panel1: TBufferPanel + Left = 0 + Top = 30 + Width = 1050 + Height = 654 + OnIMECancelComposition = Panel1IMECancelComposition + OnIMECommitText = Panel1IMECommitText + OnIMESetComposition = Panel1IMESetComposition + OnCustomTouch = Panel1CustomTouch + OnPointerDown = Panel1PointerDown + OnPointerUp = Panel1PointerUp + OnPointerUpdate = Panel1PointerUpdate + OnPaintParentBkg = Panel1PaintParentBkg + Align = alClient + Ctl3D = False + ParentCtl3D = False + BevelOuter = bvNone + TabOrder = 1 + TabStop = True + OnClick = Panel1Click + OnEnter = Panel1Enter + OnExit = Panel1Exit + OnMouseDown = Panel1MouseDown + OnMouseMove = Panel1MouseMove + OnMouseUp = Panel1MouseUp + OnResize = Panel1Resize + OnMouseLeave = Panel1MouseLeave + ExplicitWidth = 1046 + ExplicitHeight = 653 + end + object chrmosr: TChromium + OnAddressChange = chrmosrAddressChange + OnTooltip = chrmosrTooltip + OnCursorChange = chrmosrCursorChange + OnBeforePopup = chrmosrBeforePopup + OnAfterCreated = chrmosrAfterCreated + OnBeforeClose = chrmosrBeforeClose + OnGetViewRect = chrmosrGetViewRect + OnGetScreenPoint = chrmosrGetScreenPoint + OnGetScreenInfo = chrmosrGetScreenInfo + OnPopupShow = chrmosrPopupShow + OnPopupSize = chrmosrPopupSize + OnPaint = chrmosrPaint + OnIMECompositionRangeChanged = chrmosrIMECompositionRangeChanged + Left = 24 + Top = 56 + end + object AppEvents: TApplicationEvents + OnMessage = AppEventsMessage + Left = 24 + Top = 128 + end + object SaveDialog1: TSaveDialog + DefaultExt = 'bmp' + Filter = 'Bitmap files (*.bmp)|*.BMP' + Title = 'Save snapshot' + Left = 24 + Top = 278 + end + object Timer1: TTimer + Enabled = False + Interval = 300 + OnTimer = Timer1Timer + Left = 24 + Top = 206 + end +end diff --git a/demos/Delphi_VCL/VirtualUIBrowser/uVirtualUIBrowser.pas b/demos/Delphi_VCL/VirtualUIBrowser/uVirtualUIBrowser.pas new file mode 100644 index 00000000..1054e0eb --- /dev/null +++ b/demos/Delphi_VCL/VirtualUIBrowser/uVirtualUIBrowser.pas @@ -0,0 +1,1289 @@ +// ************************************************************************ +// ***************************** CEF4Delphi ******************************* +// ************************************************************************ +// +// CEF4Delphi is based on DCEF3 which uses CEF 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 © 2022 Salvador Diaz 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 + * 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. + * + *) + +unit uVirtualUIBrowser; + +{$I cef.inc} + +interface + +uses + {$IFDEF DELPHI16_UP} + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, + System.SyncObjs, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, + Vcl.ExtCtrls, Vcl.AppEvnts, WinApi.imm, Vcl.ComCtrls, + {$ELSE} + Windows, Messages, SysUtils, Variants, Classes, SyncObjs, + Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, AppEvnts, ComCtrls, + {$ENDIF} + uCEFChromium, uCEFTypes, uCEFInterfaces, uCEFConstants, uCEFBufferPanel, + uCEFChromiumCore; + +type + TForm1 = class(TForm) + NavControlPnl: TPanel; + chrmosr: TChromium; + AppEvents: TApplicationEvents; + AddressCb: TComboBox; + Panel2: TPanel; + GoBtn: TButton; + SnapshotBtn: TButton; + SaveDialog1: TSaveDialog; + Timer1: TTimer; + Panel1: TBufferPanel; + + procedure AppEventsMessage(var Msg: tagMSG; var Handled: Boolean); + + procedure GoBtnClick(Sender: TObject); + procedure GoBtnEnter(Sender: TObject); + + procedure Panel1Enter(Sender: TObject); + procedure Panel1Exit(Sender: TObject); + procedure Panel1Resize(Sender: TObject); + procedure Panel1Click(Sender: TObject); + procedure Panel1PaintParentBkg(Sender: TObject); + procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Panel1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); + procedure Panel1MouseLeave(Sender: TObject); + procedure Panel1IMECancelComposition(Sender: TObject); + procedure Panel1IMECommitText(Sender: TObject; const aText: ustring; const replacement_range: PCefRange; relative_cursor_pos: Integer); + procedure Panel1IMESetComposition(Sender: TObject; const aText: ustring; const underlines: TCefCompositionUnderlineDynArray; const replacement_range, selection_range: TCefRange); + procedure Panel1CustomTouch(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean); + procedure Panel1PointerDown(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean); + procedure Panel1PointerUp(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean); + procedure Panel1PointerUpdate(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean); + + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormHide(Sender: TObject); + procedure FormAfterMonitorDpiChanged(Sender: TObject; OldDPI, NewDPI: Integer); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + + procedure chrmosrPaint(Sender: TObject; const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer); + procedure chrmosrCursorChange(Sender: TObject; const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult : boolean); + procedure chrmosrGetViewRect(Sender: TObject; const browser: ICefBrowser; var rect: TCefRect); + procedure chrmosrGetScreenPoint(Sender: TObject; const browser: ICefBrowser; viewX, viewY: Integer; var screenX, screenY: Integer; out Result: Boolean); + procedure chrmosrGetScreenInfo(Sender: TObject; const browser: ICefBrowser; var screenInfo: TCefScreenInfo; out Result: Boolean); + procedure chrmosrPopupShow(Sender: TObject; const browser: ICefBrowser; show: Boolean); + procedure chrmosrPopupSize(Sender: TObject; const browser: ICefBrowser; const rect: PCefRect); + procedure chrmosrAfterCreated(Sender: TObject; const browser: ICefBrowser); + procedure chrmosrTooltip(Sender: TObject; const browser: ICefBrowser; var text: ustring; out Result: Boolean); + procedure chrmosrBeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean); + procedure chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser); + procedure chrmosrIMECompositionRangeChanged(Sender: TObject; const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect); + + procedure SnapshotBtnClick(Sender: TObject); + procedure SnapshotBtnEnter(Sender: TObject); + + procedure Timer1Timer(Sender: TObject); + procedure AddressCbEnter(Sender: TObject); + procedure chrmosrAddressChange(Sender: TObject; const browser: ICefBrowser; + const frame: ICefFrame; const url: ustring); + + protected + FPopUpBitmap : TBitmap; + FPopUpRect : TRect; + FShowPopUp : boolean; + FResizing : boolean; + FPendingResize : boolean; + FCanClose : boolean; + FClosing : boolean; + FResizeCS : TCriticalSection; + FIMECS : TCriticalSection; + FDeviceBounds : TCefRectDynArray; + FSelectedRange : TCefRange; + FAtLeastWin8 : boolean; + + FLastClickCount : integer; + FLastClickTime : integer; + FLastClickPoint : TPoint; + FLastClickButton : TMouseButton; + + function getModifiers(Shift: TShiftState): TCefEventFlags; + function GetButton(Button: TMouseButton): TCefMouseButtonType; + procedure DoResize; + procedure InitializeLastClick; + function CancelPreviousClick(x, y : integer; var aCurrentTime : integer) : boolean; + function ArePointerEventsSupported : boolean; + {$IFDEF DELPHI14_UP} + function HandlePenEvent(const aID : uint32; aMsg : cardinal) : boolean; + function HandleTouchEvent(const aID : uint32; aMsg : cardinal) : boolean; + function HandlePointerEvent(var aMessage : TMessage) : boolean; + {$ENDIF} + + procedure WMMove(var aMessage : TWMMove); message WM_MOVE; + procedure WMMoving(var aMessage : TMessage); message WM_MOVING; + procedure WMCaptureChanged(var aMessage : TMessage); message WM_CAPTURECHANGED; + procedure WMCancelMode(var aMessage : TMessage); message WM_CANCELMODE; + procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP; + procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP; + procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED; + procedure PendingResizeMsg(var aMessage : TMessage); message CEF_PENDINGRESIZE; + procedure RangeChangedMsg(var aMessage : TMessage); message CEF_IMERANGECHANGED; + + public + { Public declarations } + end; + +var + Form1: TForm1; + +implementation + +{$R *.dfm} + +uses + {$IFDEF DELPHI16_UP} + System.Math, + {$ELSE} + Math, + {$ENDIF} + uCEFMiscFunctions, uCEFApplication, uVirtualUIBrowserConstants; + +// This demo is based on the SimpleOSRBrowser demo but it uses a different +// executable for the CEF subprocesses and it's configured to run inside VirtualUI + +// We have to use the OSR mode to avoid refresh issues in VirtualUI. +// Chromium requires running several subprocesses and that can be problematic +// with VirtualUI. That's why we use a different executable for the subprocesses +// and call VirtualUI.AllowExecute before initializing CEF in uCEFLoader.pas. + +// Read the code comments in the SimpleOSRBrowser demo for more information. + +// This is the destruction sequence in OSR mode : +// 1- FormCloseQuery sets CanClose to the initial FCanClose value (False) and +// calls chrmosr.CloseBrowser(True). +// 2- chrmosr.CloseBrowser(True) will trigger chrmosr.OnClose and we have to +// set "aAction" to cbaClose and CEF will destroy the internal browser immediately. +// cbaClose is the default aAction value so this demo doesn't implement the OnClose event. +// 3- chrmosr.OnBeforeClose is triggered because the internal browser was destroyed. +// Sets FCanClose := True and sends WM_CLOSE to the form to close the demo. + +procedure TForm1.AppEventsMessage(var Msg: tagMSG; var Handled: Boolean); +var + TempKeyEvent : TCefKeyEvent; + TempMouseEvent : TCefMouseEvent; + TempPoint : TPoint; +begin + case Msg.message of + WM_SYSCHAR : + if Panel1.Focused then + begin + TempKeyEvent.kind := KEYEVENT_CHAR; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam); + TempKeyEvent.windows_key_code := Msg.wParam; + TempKeyEvent.native_key_code := Msg.lParam; + TempKeyEvent.is_system_key := ord(True); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + CefCheckAltGrPressed(Msg.wParam, TempKeyEvent); + chrmosr.SendKeyEvent(@TempKeyEvent); + end; + + WM_SYSKEYDOWN : + if Panel1.Focused then + begin + TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam); + TempKeyEvent.windows_key_code := Msg.wParam; + TempKeyEvent.native_key_code := Msg.lParam; + TempKeyEvent.is_system_key := ord(True); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; + + WM_SYSKEYUP : + if Panel1.Focused then + begin + TempKeyEvent.kind := KEYEVENT_KEYUP; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam); + TempKeyEvent.windows_key_code := Msg.wParam; + TempKeyEvent.native_key_code := Msg.lParam; + TempKeyEvent.is_system_key := ord(True); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; + + WM_KEYDOWN : + if Panel1.Focused then + begin + TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam); + TempKeyEvent.windows_key_code := Msg.wParam; + TempKeyEvent.native_key_code := Msg.lParam; + TempKeyEvent.is_system_key := ord(False); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + Handled := (Msg.wParam in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]); + end; + + WM_KEYUP : + if Panel1.Focused then + begin + TempKeyEvent.kind := KEYEVENT_KEYUP; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam); + TempKeyEvent.windows_key_code := Msg.wParam; + TempKeyEvent.native_key_code := Msg.lParam; + TempKeyEvent.is_system_key := ord(False); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; + + WM_CHAR : + if Panel1.Focused then + begin + TempKeyEvent.kind := KEYEVENT_CHAR; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam); + TempKeyEvent.windows_key_code := Msg.wParam; + TempKeyEvent.native_key_code := Msg.lParam; + TempKeyEvent.is_system_key := ord(False); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + CefCheckAltGrPressed(Msg.wParam, TempKeyEvent); + chrmosr.SendKeyEvent(@TempKeyEvent); + end; + + WM_MOUSEWHEEL : + if Panel1.Focused then + begin + GetCursorPos(TempPoint); + TempPoint := Panel1.ScreenToclient(TempPoint); + TempMouseEvent.x := TempPoint.x; + TempMouseEvent.y := TempPoint.y; + TempMouseEvent.modifiers := GetCefMouseModifiers(Msg.wParam); + + DeviceToLogical(TempMouseEvent, Panel1.ScreenScale); + + if CefIsKeyDown(VK_SHIFT) then + chrmosr.SendMouseWheelEvent(@TempMouseEvent, smallint(Msg.wParam shr 16), 0) + else + chrmosr.SendMouseWheelEvent(@TempMouseEvent, 0, smallint(Msg.wParam shr 16)); + end; + end; +end; + +procedure TForm1.GoBtnClick(Sender: TObject); +begin + FResizeCS.Acquire; + FResizing := False; + FPendingResize := False; + FResizeCS.Release; + + chrmosr.LoadURL(AddressCb.Text); +end; + +procedure TForm1.GoBtnEnter(Sender: TObject); +begin + chrmosr.SetFocus(False); +end; + +procedure TForm1.chrmosrAddressChange(Sender: TObject; + const browser: ICefBrowser; const frame: ICefFrame; const url: ustring); +begin + AddressCb.Text := url; +end; + +procedure TForm1.chrmosrAfterCreated(Sender: TObject; const browser: ICefBrowser); +begin + PostMessage(Handle, CEF_AFTERCREATED, 0, 0); +end; + +procedure TForm1.chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser); +begin + FCanClose := True; + PostMessage(Handle, WM_CLOSE, 0, 0); +end; + +procedure TForm1.chrmosrBeforePopup( Sender : TObject; + const browser : ICefBrowser; + const frame : ICefFrame; + const targetUrl : ustring; + const targetFrameName : ustring; + targetDisposition : TCefWindowOpenDisposition; + userGesture : Boolean; + const popupFeatures : TCefPopupFeatures; + var windowInfo : TCefWindowInfo; + var client : ICefClient; + var settings : TCefBrowserSettings; + var extra_info : ICefDictionaryValue; + var noJavascriptAccess : Boolean; + var Result : Boolean); +begin + // For simplicity, this demo blocks all popup windows and new tabs + Result := (targetDisposition in [WOD_NEW_FOREGROUND_TAB, WOD_NEW_BACKGROUND_TAB, WOD_NEW_POPUP, WOD_NEW_WINDOW]); +end; + +procedure TForm1.chrmosrCursorChange( Sender : TObject; + const browser : ICefBrowser; + cursor_ : TCefCursorHandle; + cursorType : TCefCursorType; + const customCursorInfo : PCefCursorInfo; + var aResult : boolean); +begin + Panel1.Cursor := CefCursorToWindowsCursor(cursorType); + aResult := True; +end; + +procedure TForm1.chrmosrGetScreenInfo( Sender : TObject; + const browser : ICefBrowser; + var screenInfo : TCefScreenInfo; + out Result : Boolean); +var + TempRect : TCEFRect; + TempScale : single; +begin + TempScale := Panel1.ScreenScale; + TempRect.x := 0; + TempRect.y := 0; + TempRect.width := DeviceToLogical(Panel1.Width, TempScale); + TempRect.height := DeviceToLogical(Panel1.Height, TempScale); + + screenInfo.device_scale_factor := TempScale; + screenInfo.depth := 0; + screenInfo.depth_per_component := 0; + screenInfo.is_monochrome := Ord(False); + screenInfo.rect := TempRect; + screenInfo.available_rect := TempRect; + + Result := True; +end; + +procedure TForm1.chrmosrGetScreenPoint( Sender : TObject; + const browser : ICefBrowser; + viewX : Integer; + viewY : Integer; + var screenX : Integer; + var screenY : Integer; + out Result : Boolean); +var + TempScreenPt, TempViewPt : TPoint; + TempScale : single; +begin + TempScale := Panel1.ScreenScale; + TempViewPt.x := LogicalToDevice(viewX, TempScale); + TempViewPt.y := LogicalToDevice(viewY, TempScale); + TempScreenPt := Panel1.ClientToScreen(TempViewPt); + screenX := TempScreenPt.x; + screenY := TempScreenPt.y; + Result := True; +end; + +procedure TForm1.chrmosrGetViewRect( Sender : TObject; + const browser : ICefBrowser; + var rect : TCefRect); +var + TempScale : single; +begin + TempScale := Panel1.ScreenScale; + rect.x := 0; + rect.y := 0; + rect.width := DeviceToLogical(Panel1.Width, TempScale); + rect.height := DeviceToLogical(Panel1.Height, TempScale); +end; + +procedure TForm1.chrmosrPaint( Sender : TObject; + const browser : ICefBrowser; + kind : TCefPaintElementType; + dirtyRectsCount : NativeUInt; + const dirtyRects : PCefRectArray; + const buffer : Pointer; + width : Integer; + height : Integer); +var + src, dst: PByte; + i, j, TempLineSize, TempSrcOffset, TempDstOffset, SrcStride, DstStride : Integer; + n : NativeUInt; + TempWidth, TempHeight, TempScanlineSize : integer; + TempBufferBits : Pointer; + TempForcedResize : boolean; + TempSrcRect : TRect; +begin + try + FResizeCS.Acquire; + TempForcedResize := False; + + if Panel1.BeginBufferDraw then + begin + if (kind = PET_POPUP) then + begin + if (FPopUpBitmap = nil) or + (width <> FPopUpBitmap.Width) or + (height <> FPopUpBitmap.Height) then + begin + if (FPopUpBitmap <> nil) then FPopUpBitmap.Free; + + FPopUpBitmap := TBitmap.Create; + FPopUpBitmap.PixelFormat := pf32bit; + FPopUpBitmap.HandleType := bmDIB; + FPopUpBitmap.Width := width; + FPopUpBitmap.Height := height; + end; + + TempWidth := FPopUpBitmap.Width; + TempHeight := FPopUpBitmap.Height; + TempScanlineSize := FPopUpBitmap.Width * SizeOf(TRGBQuad); + TempBufferBits := FPopUpBitmap.Scanline[pred(FPopUpBitmap.Height)]; + end + else + begin + TempForcedResize := Panel1.UpdateBufferDimensions(Width, Height) or not(Panel1.BufferIsResized(False)); + TempWidth := Panel1.BufferWidth; + TempHeight := Panel1.BufferHeight; + TempScanlineSize := Panel1.ScanlineSize; + TempBufferBits := Panel1.BufferBits; + end; + + if (TempBufferBits <> nil) then + begin + SrcStride := Width * SizeOf(TRGBQuad); + DstStride := - TempScanlineSize; + + n := 0; + + while (n < dirtyRectsCount) do + begin + if (dirtyRects[n].x >= 0) and (dirtyRects[n].y >= 0) then + begin + TempLineSize := min(dirtyRects[n].width, TempWidth - dirtyRects[n].x) * SizeOf(TRGBQuad); + + if (TempLineSize > 0) then + begin + TempSrcOffset := ((dirtyRects[n].y * Width) + dirtyRects[n].x) * SizeOf(TRGBQuad); + TempDstOffset := ((TempScanlineSize * pred(TempHeight)) - (dirtyRects[n].y * TempScanlineSize)) + + (dirtyRects[n].x * SizeOf(TRGBQuad)); + + src := @PByte(buffer)[TempSrcOffset]; + dst := @PByte(TempBufferBits)[TempDstOffset]; + + i := 0; + j := min(dirtyRects[n].height, TempHeight - dirtyRects[n].y); + + while (i < j) do + begin + Move(src^, dst^, TempLineSize); + + Inc(dst, DstStride); + Inc(src, SrcStride); + inc(i); + end; + end; + end; + + inc(n); + end; + + if FShowPopup and (FPopUpBitmap <> nil) then + begin + TempSrcRect := Rect(0, 0, + min(FPopUpRect.Right - FPopUpRect.Left, FPopUpBitmap.Width), + min(FPopUpRect.Bottom - FPopUpRect.Top, FPopUpBitmap.Height)); + + Panel1.BufferDraw(FPopUpBitmap, TempSrcRect, FPopUpRect); + end; + end; + + Panel1.EndBufferDraw; + Panel1.InvalidatePanel; + + if (kind = PET_VIEW) then + begin + if TempForcedResize or FPendingResize then PostMessage(Handle, CEF_PENDINGRESIZE, 0, 0); + + FResizing := False; + FPendingResize := False; + end; + end; + finally + FResizeCS.Release; + end; +end; + +procedure TForm1.chrmosrPopupShow( Sender : TObject; + const browser : ICefBrowser; + show : Boolean); +begin + if show then + FShowPopUp := True + else + begin + FShowPopUp := False; + FPopUpRect := rect(0, 0, 0, 0); + + if (chrmosr <> nil) then chrmosr.Invalidate(PET_VIEW); + end; +end; + +procedure TForm1.chrmosrPopupSize( Sender : TObject; + const browser : ICefBrowser; + const rect : PCefRect); +begin + LogicalToDevice(rect^, Panel1.ScreenScale); + + FPopUpRect.Left := rect.x; + FPopUpRect.Top := rect.y; + FPopUpRect.Right := rect.x + rect.width - 1; + FPopUpRect.Bottom := rect.y + rect.height - 1; +end; + +procedure TForm1.chrmosrTooltip(Sender: TObject; const browser: ICefBrowser; var text: ustring; out Result: Boolean); +begin + Panel1.hint := text; + Panel1.ShowHint := (length(text) > 0); + Result := True; +end; + +procedure TForm1.AddressCbEnter(Sender: TObject); +begin + chrmosr.SetFocus(False); +end; + +function TForm1.getModifiers(Shift: TShiftState): TCefEventFlags; +begin + Result := EVENTFLAG_NONE; + + if (ssShift in Shift) then Result := Result or EVENTFLAG_SHIFT_DOWN; + if (ssAlt in Shift) then Result := Result or EVENTFLAG_ALT_DOWN; + if (ssCtrl in Shift) then Result := Result or EVENTFLAG_CONTROL_DOWN; + if (ssLeft in Shift) then Result := Result or EVENTFLAG_LEFT_MOUSE_BUTTON; + if (ssRight in Shift) then Result := Result or EVENTFLAG_RIGHT_MOUSE_BUTTON; + if (ssMiddle in Shift) then Result := Result or EVENTFLAG_MIDDLE_MOUSE_BUTTON; +end; + +function TForm1.GetButton(Button: TMouseButton): TCefMouseButtonType; +begin + case Button of + mbRight : Result := MBT_RIGHT; + mbMiddle : Result := MBT_MIDDLE; + else Result := MBT_LEFT; + end; +end; + +procedure TForm1.WMMove(var aMessage : TWMMove); +begin + inherited; + + if (chrmosr <> nil) then chrmosr.NotifyMoveOrResizeStarted; +end; + +procedure TForm1.WMMoving(var aMessage : TMessage); +begin + inherited; + + if (chrmosr <> nil) then chrmosr.NotifyMoveOrResizeStarted; +end; + +procedure TForm1.WMCaptureChanged(var aMessage : TMessage); +begin + inherited; + + if (chrmosr <> nil) then chrmosr.SendCaptureLostEvent; +end; + +procedure TForm1.WMCancelMode(var aMessage : TMessage); +begin + inherited; + + if (chrmosr <> nil) then chrmosr.SendCaptureLostEvent; +end; + +procedure TForm1.WMEnterMenuLoop(var aMessage: TMessage); +begin + inherited; + + if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then GlobalCEFApp.OsmodalLoop := True; +end; + +procedure TForm1.WMExitMenuLoop(var aMessage: TMessage); +begin + inherited; + + if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then GlobalCEFApp.OsmodalLoop := False; +end; + +procedure TForm1.BrowserCreatedMsg(var aMessage : TMessage); +begin + Caption := 'VirtualUI Browser'; + NavControlPnl.Enabled := True; +end; + +procedure TForm1.FormAfterMonitorDpiChanged(Sender: TObject; OldDPI, NewDPI: Integer); +begin + if (GlobalCEFApp <> nil) then + GlobalCEFApp.UpdateDeviceScaleFactor; + + if (chrmosr <> nil) then + begin + chrmosr.NotifyScreenInfoChanged; + chrmosr.WasResized; + end; +end; + +procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); +begin + CanClose := FCanClose; + + if not(FClosing) then + begin + FClosing := True; + Visible := False; + chrmosr.CloseBrowser(True); + end; +end; + +procedure TForm1.FormCreate(Sender: TObject); +var + TempMajorVer, TempMinorVer : DWORD; +begin + FPopUpBitmap := nil; + FPopUpRect := rect(0, 0, 0, 0); + FShowPopUp := False; + FResizing := False; + FPendingResize := False; + FCanClose := False; + FClosing := False; + FDeviceBounds := nil; + + FAtLeastWin8 := GetWindowsMajorMinorVersion(TempMajorVer, TempMinorVer) and + ((TempMajorVer > 6) or + ((TempMajorVer = 6) and (TempMinorVer >= 2))); + + FSelectedRange.from := 0; + FSelectedRange.to_ := 0; + + FResizeCS := TCriticalSection.Create; + FIMECS := TCriticalSection.Create; + + Panel1.Transparent := TRANSPARENT_BROWSER; + + InitializeLastClick; + + chrmosr.DefaultURL := trim(AddressCb.Text); +end; + +procedure TForm1.FormDestroy(Sender: TObject); +begin + chrmosr.ShutdownDragAndDrop; + + if (FPopUpBitmap <> nil) then FreeAndNil(FPopUpBitmap); + if (FResizeCS <> nil) then FreeAndNil(FResizeCS); + if (FIMECS <> nil) then FreeAndNil(FIMECS); + + if (FDeviceBounds <> nil) then + begin + Finalize(FDeviceBounds); + FDeviceBounds := nil; + end; +end; + +procedure TForm1.FormHide(Sender: TObject); +begin + chrmosr.SetFocus(False); + chrmosr.WasHidden(True); +end; + +procedure TForm1.FormShow(Sender: TObject); +begin + if chrmosr.Initialized then + begin + chrmosr.WasHidden(False); + chrmosr.SetFocus(True); + end + else + begin + // If you need transparency leave the chrmosr.Options.BackgroundColor property + // with the default value or set the alpha channel to 0 + if TRANSPARENT_BROWSER then + chrmosr.Options.BackgroundColor := CefColorSetARGB($00, $00, $00, $00) + else + chrmosr.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF); + + // The IME handler needs to be created when Panel1 has a valid handle + // and before the browser creation. + // You can skip this if the user doesn't need an "Input Method Editor". + Panel1.CreateIMEHandler; + + {$IFDEF DELPHI14_UP} + if not(ArePointerEventsSupported) then + RegisterTouchWindow(Panel1.Handle, 0); + {$ENDIF} + + if chrmosr.CreateBrowser(nil, '') then + chrmosr.InitializeDragAndDrop(Panel1) + else + Timer1.Enabled := True; + end; +end; + +procedure TForm1.Panel1Click(Sender: TObject); +begin + Panel1.SetFocus; +end; + +procedure TForm1.Panel1CustomTouch(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean); +{$IFDEF DELPHI14_UP} +var + TempScale : single; + TempTouchEvent : TCefTouchEvent; + TempHTOUCHINPUT : HTOUCHINPUT; + TempNumPoints : integer; + i : integer; + TempTouchInputs : array of TTouchInput; + TempPoint : TPoint; + TempLParam : LPARAM; + TempResult : LRESULT; +{$ENDIF} +begin +{$IFDEF DELPHI14_UP} + if not(Panel1.Focused) or (GlobalCEFApp = nil) then exit; + + TempNumPoints := LOWORD(aMessage.wParam); + + // Chromium only supports upto 16 touch points. + if (TempNumPoints < 1) or (TempNumPoints > 16) then exit; + + SetLength(TempTouchInputs, TempNumPoints); + TempHTOUCHINPUT := HTOUCHINPUT(aMessage.lParam); + TempScale := Panel1.ScreenScale; + + if GetTouchInputInfo(TempHTOUCHINPUT, TempNumPoints, @TempTouchInputs[0], SizeOf(TTouchInput)) then + begin + i := 0; + while (i < TempNumPoints) do + begin + TempPoint := TouchPointToPoint(Panel1.Handle, TempTouchInputs[i]); + + if not(FAtLeastWin8) then + begin + // Windows 7 sends touch events for touches in the non-client area, + // whereas Windows 8 does not. In order to unify the behaviour, always + // ignore touch events in the non-client area. + + TempLParam := MakeLParam(TempPoint.x, TempPoint.y); + TempResult := SendMessage(Panel1.Handle, WM_NCHITTEST, 0, TempLParam); + + if (TempResult <> HTCLIENT) then + begin + SetLength(TempTouchInputs, 0); + exit; + end; + end; + + TempPoint := Panel1.ScreenToClient(TempPoint); + TempTouchEvent.x := DeviceToLogical(TempPoint.x, TempScale); + TempTouchEvent.y := DeviceToLogical(TempPoint.y, TempScale); + + // Touch point identifier stays consistent in a touch contact sequence + TempTouchEvent.id := TempTouchInputs[i].dwID; + + if ((TempTouchInputs[i].dwFlags and TOUCHEVENTF_DOWN) <> 0) then TempTouchEvent.type_ := CEF_TET_PRESSED + else if ((TempTouchInputs[i].dwFlags and TOUCHEVENTF_MOVE) <> 0) then TempTouchEvent.type_ := CEF_TET_MOVED + else if ((TempTouchInputs[i].dwFlags and TOUCHEVENTF_UP) <> 0) then TempTouchEvent.type_ := CEF_TET_RELEASED; + + TempTouchEvent.radius_x := 0; + TempTouchEvent.radius_y := 0; + TempTouchEvent.rotation_angle := 0; + TempTouchEvent.pressure := 0; + TempTouchEvent.modifiers := EVENTFLAG_NONE; + TempTouchEvent.pointer_type := CEF_POINTER_TYPE_TOUCH; + + chrmosr.SendTouchEvent(@TempTouchEvent); + + inc(i); + end; + + CloseTouchInputHandle(TempHTOUCHINPUT); + aHandled := True; + end; + + SetLength(TempTouchInputs, 0); +{$ENDIF} +end; + +procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + TempEvent : TCefMouseEvent; + TempTime : integer; +begin + {$IFDEF DELPHI14_UP} + if (ssTouch in Shift) then exit; + {$ENDIF} + + Panel1.SetFocus; + + if not(CancelPreviousClick(x, y, TempTime)) and (Button = FLastClickButton) then + inc(FLastClickCount) + else + begin + FLastClickPoint.x := x; + FLastClickPoint.y := y; + FLastClickCount := 1; + end; + + FLastClickTime := TempTime; + FLastClickButton := Button; + + TempEvent.x := X; + TempEvent.y := Y; + TempEvent.modifiers := getModifiers(Shift); + DeviceToLogical(TempEvent, Panel1.ScreenScale); + chrmosr.SendMouseClickEvent(@TempEvent, GetButton(Button), False, FLastClickCount); +end; + +procedure TForm1.Panel1MouseLeave(Sender: TObject); +var + TempEvent : TCefMouseEvent; + TempPoint : TPoint; + TempTime : integer; +begin + GetCursorPos(TempPoint); + TempPoint := Panel1.ScreenToclient(TempPoint); + + if CancelPreviousClick(TempPoint.x, TempPoint.y, TempTime) then InitializeLastClick; + + TempEvent.x := TempPoint.x; + TempEvent.y := TempPoint.y; + TempEvent.modifiers := GetCefMouseModifiers; + DeviceToLogical(TempEvent, Panel1.ScreenScale); + chrmosr.SendMouseMoveEvent(@TempEvent, True); +end; + +procedure TForm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); +var + TempEvent : TCefMouseEvent; + TempTime : integer; +begin + {$IFDEF DELPHI14_UP} + if (ssTouch in Shift) then exit; + {$ENDIF} + + if CancelPreviousClick(x, y, TempTime) then InitializeLastClick; + + TempEvent.x := x; + TempEvent.y := y; + TempEvent.modifiers := getModifiers(Shift); + DeviceToLogical(TempEvent, Panel1.ScreenScale); + chrmosr.SendMouseMoveEvent(@TempEvent, False); +end; + +procedure TForm1.Panel1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + TempEvent : TCefMouseEvent; +begin + {$IFDEF DELPHI14_UP} + if (ssTouch in Shift) then exit; + {$ENDIF} + + TempEvent.x := X; + TempEvent.y := Y; + TempEvent.modifiers := getModifiers(Shift); + DeviceToLogical(TempEvent, Panel1.ScreenScale); + chrmosr.SendMouseClickEvent(@TempEvent, GetButton(Button), True, FLastClickCount); +end; + +procedure TForm1.Panel1PaintParentBkg(Sender: TObject); +begin + // This event should only be used if you enabled transparency in the browser + if TRANSPARENT_BROWSER then + begin + // This event should copy the background image into Panel1.Canvas + // The TBufferPanel uses "AlphaBlend" to draw the browser contents over + // this background image. + // For simplicity, we just paint it green. + Panel1.Canvas.Brush.Color := clGreen; + Panel1.Canvas.Brush.Style := bsSolid; + Panel1.Canvas.FillRect(Rect(0, 0, Panel1.Width, Panel1.Height)); + end; +end; + +procedure TForm1.Panel1PointerDown(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean); +begin + {$IFDEF DELPHI14_UP} + aHandled := Panel1.Focused and + (GlobalCEFApp <> nil) and + ArePointerEventsSupported and + HandlePointerEvent(aMessage); + {$ELSE} + aHandled := False; + {$ENDIF} +end; + +procedure TForm1.Panel1PointerUp(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean); +begin + {$IFDEF DELPHI14_UP} + aHandled := Panel1.Focused and + (GlobalCEFApp <> nil) and + ArePointerEventsSupported and + HandlePointerEvent(aMessage); + {$ELSE} + aHandled := False; + {$ENDIF} +end; + +procedure TForm1.Panel1PointerUpdate(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean); +begin + {$IFDEF DELPHI14_UP} + aHandled := Panel1.Focused and + (GlobalCEFApp <> nil) and + ArePointerEventsSupported and + HandlePointerEvent(aMessage); + {$ELSE} + aHandled := False; + {$ENDIF} +end; + +{$IFDEF DELPHI14_UP} +function TForm1.HandlePointerEvent(var aMessage : TMessage) : boolean; +const + PT_TOUCH = 2; + PT_PEN = 3; +var + TempID : uint32; + TempType : POINTER_INPUT_TYPE; +begin + Result := False; + TempID := LoWord(aMessage.wParam); + + if GetPointerType(TempID, @TempType) then + case TempType of + PT_PEN : Result := HandlePenEvent(TempID, aMessage.Msg); + PT_TOUCH : Result := HandleTouchEvent(TempID, aMessage.Msg); + end; +end; + +function TForm1.HandlePenEvent(const aID : uint32; aMsg : cardinal) : boolean; +var + TempPenInfo : POINTER_PEN_INFO; + TempTouchEvent : TCefTouchEvent; + TempPoint : TPoint; + TempScale : single; +begin + Result := False; + + if not(GetPointerPenInfo(aID, @TempPenInfo)) then exit; + + TempTouchEvent.id := aID; + TempTouchEvent.x := 0; + TempTouchEvent.y := 0; + TempTouchEvent.radius_x := 0; + TempTouchEvent.radius_y := 0; + TempTouchEvent.type_ := CEF_TET_RELEASED; + TempTouchEvent.modifiers := EVENTFLAG_NONE; + + if ((TempPenInfo.penFlags and PEN_FLAG_ERASER) <> 0) then + TempTouchEvent.pointer_type := CEF_POINTER_TYPE_ERASER + else + TempTouchEvent.pointer_type := CEF_POINTER_TYPE_PEN; + + if ((TempPenInfo.penMask and PEN_MASK_PRESSURE) <> 0) then + TempTouchEvent.pressure := TempPenInfo.pressure / 1024 + else + TempTouchEvent.pressure := 0; + + if ((TempPenInfo.penMask and PEN_MASK_ROTATION) <> 0) then + TempTouchEvent.rotation_angle := TempPenInfo.rotation / 180 * Pi + else + TempTouchEvent.rotation_angle := 0; + + Result := True; + + case aMsg of + WM_POINTERDOWN : + TempTouchEvent.type_ := CEF_TET_PRESSED; + + WM_POINTERUPDATE : + if ((TempPenInfo.pointerInfo.pointerFlags and POINTER_FLAG_INCONTACT) <> 0) then + TempTouchEvent.type_ := CEF_TET_MOVED + else + exit; // Ignore hover events. + + WM_POINTERUP : + TempTouchEvent.type_ := CEF_TET_RELEASED; + end; + + if ((TempPenInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then + TempTouchEvent.type_ := CEF_TET_CANCELLED; + + TempScale := Panel1.ScreenScale; + TempPoint := Panel1.ScreenToClient(TempPenInfo.pointerInfo.ptPixelLocation); + TempTouchEvent.x := DeviceToLogical(TempPoint.x, TempScale); + TempTouchEvent.y := DeviceToLogical(TempPoint.y, TempScale); + + chrmosr.SendTouchEvent(@TempTouchEvent); +end; + +function TForm1.HandleTouchEvent(const aID : uint32; aMsg : cardinal) : boolean; +var + TempTouchInfo : POINTER_TOUCH_INFO; + TempTouchEvent : TCefTouchEvent; + TempPoint : TPoint; + TempScale : single; +begin + Result := False; + + if not(GetPointerTouchInfo(aID, @TempTouchInfo)) then exit; + + TempTouchEvent.id := aID; + TempTouchEvent.x := 0; + TempTouchEvent.y := 0; + TempTouchEvent.radius_x := 0; + TempTouchEvent.radius_y := 0; + TempTouchEvent.rotation_angle := 0; + TempTouchEvent.pressure := 0; + TempTouchEvent.type_ := CEF_TET_RELEASED; + TempTouchEvent.modifiers := EVENTFLAG_NONE; + TempTouchEvent.pointer_type := CEF_POINTER_TYPE_TOUCH; + + Result := True; + + case aMsg of + WM_POINTERDOWN : + TempTouchEvent.type_ := CEF_TET_PRESSED; + + WM_POINTERUPDATE : + if ((TempTouchInfo.pointerInfo.pointerFlags and POINTER_FLAG_INCONTACT) <> 0) then + TempTouchEvent.type_ := CEF_TET_MOVED + else + exit; // Ignore hover events. + + WM_POINTERUP : + TempTouchEvent.type_ := CEF_TET_RELEASED; + end; + + if ((TempTouchInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then + TempTouchEvent.type_ := CEF_TET_CANCELLED; + + TempScale := Panel1.ScreenScale; + TempPoint := Panel1.ScreenToClient(TempTouchInfo.pointerInfo.ptPixelLocation); + TempTouchEvent.x := DeviceToLogical(TempPoint.x, TempScale); + TempTouchEvent.y := DeviceToLogical(TempPoint.y, TempScale); + + chrmosr.SendTouchEvent(@TempTouchEvent); +end; +{$ENDIF} + +procedure TForm1.Panel1Resize(Sender: TObject); +begin + DoResize; +end; + +procedure TForm1.PendingResizeMsg(var aMessage : TMessage); +begin + DoResize; +end; + +procedure TForm1.RangeChangedMsg(var aMessage : TMessage); +begin + try + FIMECS.Acquire; + Panel1.ChangeCompositionRange(FSelectedRange, FDeviceBounds); + finally + FIMECS.Release; + end; +end; + +procedure TForm1.DoResize; +begin + try + FResizeCS.Acquire; + + if FResizing then + FPendingResize := True + else + if Panel1.BufferIsResized then + chrmosr.Invalidate(PET_VIEW) + else + begin + FResizing := True; + chrmosr.WasResized; + end; + finally + FResizeCS.Release; + end; +end; + +procedure TForm1.InitializeLastClick; +begin + FLastClickCount := 1; + FLastClickTime := 0; + FLastClickPoint.x := 0; + FLastClickPoint.y := 0; + FLastClickButton := mbLeft; +end; + +function TForm1.CancelPreviousClick(x, y : integer; var aCurrentTime : integer) : boolean; +begin + aCurrentTime := GetMessageTime; + + Result := (abs(FLastClickPoint.x - x) > (GetSystemMetrics(SM_CXDOUBLECLK) div 2)) or + (abs(FLastClickPoint.y - y) > (GetSystemMetrics(SM_CYDOUBLECLK) div 2)) or + (cardinal(aCurrentTime - FLastClickTime) > GetDoubleClickTime); +end; + +function TForm1.ArePointerEventsSupported : boolean; +begin + {$IFDEF DELPHI14_UP} + Result := FAtLeastWin8 and + (@GetPointerType <> nil) and + (@GetPointerTouchInfo <> nil) and + (@GetPointerPenInfo <> nil); + {$ELSE} + Result := False; + {$ENDIF} +end; + +procedure TForm1.Panel1Enter(Sender: TObject); +begin + chrmosr.SetFocus(True); +end; + +procedure TForm1.Panel1Exit(Sender: TObject); +begin + chrmosr.SetFocus(False); +end; + +procedure TForm1.SnapshotBtnClick(Sender: TObject); +begin + if SaveDialog1.Execute then Panel1.SaveToFile(SaveDialog1.FileName); +end; + +procedure TForm1.SnapshotBtnEnter(Sender: TObject); +begin + chrmosr.SetFocus(False); +end; + +procedure TForm1.Timer1Timer(Sender: TObject); +begin + Timer1.Enabled := False; + + if chrmosr.CreateBrowser(nil, '') then + chrmosr.InitializeDragAndDrop(Panel1) + else + if not(chrmosr.Initialized) then Timer1.Enabled := True; +end; + +procedure TForm1.chrmosrIMECompositionRangeChanged( Sender : TObject; + const browser : ICefBrowser; + const selected_range : PCefRange; + character_boundsCount : NativeUInt; + const character_bounds : PCefRect); +var + TempPRect : PCefRect; + i : NativeUInt; + TempScale : single; +begin + try + FIMECS.Acquire; + + // TChromium.OnIMECompositionRangeChanged is triggered in a different thread + // and all functions using a IMM context need to be executed in the same + // thread, in this case the main thread. We need to save the parameters and + // send a message to the form to execute Panel1.ChangeCompositionRange in + // the main thread. + + if (FDeviceBounds <> nil) then + begin + Finalize(FDeviceBounds); + FDeviceBounds := nil; + end; + + FSelectedRange := selected_range^; + + if (character_boundsCount > 0) then + begin + SetLength(FDeviceBounds, character_boundsCount); + + i := 0; + TempPRect := character_bounds; + TempScale := Panel1.ScreenScale; + + while (i < character_boundsCount) do + begin + FDeviceBounds[i] := TempPRect^; + LogicalToDevice(FDeviceBounds[i], TempScale); + + inc(TempPRect); + inc(i); + end; + end; + + PostMessage(Handle, CEF_IMERANGECHANGED, 0, 0); + finally + FIMECS.Release; + end; +end; + +procedure TForm1.Panel1IMECancelComposition(Sender: TObject); +begin + chrmosr.IMECancelComposition; +end; + +procedure TForm1.Panel1IMECommitText( Sender : TObject; + const aText : ustring; + const replacement_range : PCefRange; + relative_cursor_pos : Integer); +begin + chrmosr.IMECommitText(aText, replacement_range, relative_cursor_pos); +end; + +procedure TForm1.Panel1IMESetComposition( Sender : TObject; + const aText : ustring; + const underlines : TCefCompositionUnderlineDynArray; + const replacement_range : TCefRange; + const selection_range : TCefRange); +begin + chrmosr.IMESetComposition(aText, underlines, @replacement_range, @selection_range); +end; + +end. diff --git a/demos/Delphi_VCL/VirtualUIBrowser/uVirtualUIBrowserConstants.pas b/demos/Delphi_VCL/VirtualUIBrowser/uVirtualUIBrowserConstants.pas new file mode 100644 index 00000000..a8f62f94 --- /dev/null +++ b/demos/Delphi_VCL/VirtualUIBrowser/uVirtualUIBrowserConstants.pas @@ -0,0 +1,12 @@ +unit uVirtualUIBrowserConstants; + +interface + +const + // Set this constant to True and load "file://transparency.html" to test a + // transparent browser. + TRANSPARENT_BROWSER = False; + +implementation + +end. diff --git a/demos/Lazarus_Windows/VirtualUIBrowser/00-Delete.bat b/demos/Lazarus_Windows/VirtualUIBrowser/00-Delete.bat new file mode 100644 index 00000000..0b5ba5c8 --- /dev/null +++ b/demos/Lazarus_Windows/VirtualUIBrowser/00-Delete.bat @@ -0,0 +1,2 @@ +rmdir /S /Q lib +rmdir /S /Q backup diff --git a/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser.ico b/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser.ico new file mode 100644 index 00000000..0341321b Binary files /dev/null and b/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser.ico differ diff --git a/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser.lpi b/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser.lpi new file mode 100644 index 00000000..3cc7b6ad --- /dev/null +++ b/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser.lpi @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + <Icon Value="0"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + <Modes Count="1"> + <Mode0 Name="default"/> + </Modes> + </RunParams> + <RequiredPackages Count="2"> + <Item1> + <PackageName Value="CEF4Delphi_Lazarus"/> + </Item1> + <Item2> + <PackageName Value="LCL"/> + </Item2> + </RequiredPackages> + <Units Count="3"> + <Unit0> + <Filename Value="VirtualUIBrowser.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="uVirtualUIBrowser.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="Form1"/> + <HasResources Value="True"/> + <ResourceBaseClass Value="Form"/> + </Unit1> + <Unit2> + <Filename Value="C:\Program Files\Thinfinity\VirtualUI\dev\Delphi\VirtualUI_SDK.pas"/> + <IsPartOfProject Value="True"/> + </Unit2> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="..\..\..\bin\VirtualUIBrowser"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="C:\Program Files\Thinfinity\VirtualUI\dev\Delphi\"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <SyntaxMode Value="Delphi"/> + </SyntaxOptions> + </Parsing> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf2Set"/> + </Debugging> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + <Other> + <CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser.lpr b/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser.lpr new file mode 100644 index 00000000..1420bcd4 --- /dev/null +++ b/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser.lpr @@ -0,0 +1,66 @@ +// ************************************************************************ +// ***************************** 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 © 2022 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 <hgourvest@gmail.com> + * 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 VirtualUIBrowser; + +{$MODE OBJFPC}{$H+} + +uses + Forms, + LCLIntf, LCLType, LMessages, Interfaces, + uCEFApplication, + uVirtualUIBrowser in 'uVirtualUIBrowser.pas' {Form1}; + +{$IFDEF MSWINDOWS} + // CEF needs to set the LARGEADDRESSAWARE flag which allows 32-bit processes to use up to 3GB of RAM. + {$SetPEFlags $20} +{$ENDIF} + +{$R *.res} + +begin + CreateGlobalCEFApp; + + if GlobalCEFApp.StartMainProcess then + begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; + end; + + DestroyGlobalCEFApp; +end. diff --git a/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser.res b/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser.res new file mode 100644 index 00000000..d36929a1 Binary files /dev/null and b/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser.res differ diff --git a/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser_sp.lpi b/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser_sp.lpi new file mode 100644 index 00000000..45debf68 --- /dev/null +++ b/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser_sp.lpi @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasUsesSectionForAllUnits Value="False"/> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <Title Value="VirtualUIBrowser_sp"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + <Modes Count="0"/> + </RunParams> + <RequiredPackages Count="2"> + <Item1> + <PackageName Value="CEF4Delphi_Lazarus"/> + </Item1> + <Item2> + <PackageName Value="LCL"/> + </Item2> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="VirtualUIBrowser_sp.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="uCEFLoader.pas"/> + <IsPartOfProject Value="True"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="..\..\..\bin\VirtualUIBrowser_sp"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <SyntaxMode Value="Delphi"/> + </SyntaxOptions> + </Parsing> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + <Other> + <CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser_sp.lpr b/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser_sp.lpr new file mode 100644 index 00000000..4bcbb711 --- /dev/null +++ b/demos/Lazarus_Windows/VirtualUIBrowser/VirtualUIBrowser_sp.lpr @@ -0,0 +1,64 @@ +// ************************************************************************ +// ***************************** 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 © 2022 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 <hgourvest@gmail.com> + * 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 VirtualUIBrowser_sp; + +{$MODE Delphi} + +{$I cef.inc} + +uses + LCLIntf, LCLType, LMessages, Forms, Interfaces, + uCEFApplicationCore; + +{$IFDEF MSWINDOWS} + // CEF needs to set the LARGEADDRESSAWARE flag which allows 32-bit processes to use up to 3GB of RAM. + {$SetPEFlags $20} +{$ENDIF} + +begin + GlobalCEFApp := TCefApplicationCore.Create; + GlobalCEFApp.WindowlessRenderingEnabled := True; + GlobalCEFApp.EnableHighDPISupport := True; + GlobalCEFApp.EnableGPU := True; + //GlobalCEFApp.LogFile := 'debug.log'; + //GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE; + + GlobalCEFApp.StartSubProcess; + DestroyGlobalCEFApp; +end. + diff --git a/demos/Lazarus_Windows/VirtualUIBrowser/cef.inc b/demos/Lazarus_Windows/VirtualUIBrowser/cef.inc new file mode 100644 index 00000000..76ec7fb3 --- /dev/null +++ b/demos/Lazarus_Windows/VirtualUIBrowser/cef.inc @@ -0,0 +1,507 @@ +// ************************************************************************ +// ***************************** 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 © 2017 Salvador Diaz 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 <hgourvest@gmail.com> + * 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. + * + *) + + // The complete list of compiler versions is here : + // http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Compiler_Versions + +{$DEFINE DELPHI_VERSION_UNKNOW} + +// Delphi 5 +{$IFDEF VER130} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} +{$ENDIF} + +// Delphi 6 +{$IFDEF VER140} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} +{$ENDIF} + +// Delphi 7 +{$IFDEF VER150} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} +{$ENDIF} + +// Delphi 8 +{$IFDEF VER160} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} +{$ENDIF} + +// Delphi 2005 +{$IFDEF VER170} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} +{$ENDIF} + +{$IFDEF VER180} + {$UNDEF DELPHI_VERSION_UNKNOW} + // Delphi 2007 + {$IFDEF VER185} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + // Delphi 2006 + {$ELSE} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$ENDIF} +{$ENDIF} + +// Delphi 2009 +{$IFDEF VER200} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} +{$ENDIF} + +//Delphi 2010 +{$IFDEF VER210} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} +{$ENDIF} + +// Delphi XE +{$IFDEF VER220} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} +{$ENDIF} + +// Delphi XE2 (First FireMonkey and 64bit compiler) +{$IFDEF VER230} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} +{$ENDIF} + +// Delphi XE3 +{$IFDEF VER240} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} +{$ENDIF} + +// Delphi XE4 +{$IFDEF VER250} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} +{$ENDIF} + +// Delphi XE5 +{$IFDEF VER260} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} +{$ENDIF} + +// Delphi XE6 +{$IFDEF VER270} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} +{$ENDIF} + +// Delphi XE7 +{$IFDEF VER280} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} +{$ENDIF} + +// Delphi XE8 +{$IFDEF VER290} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} +{$ENDIF VER290} + +// Rad Studio 10 - Delphi Seattle +{$IFDEF VER300} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} +{$ENDIF} + +// Rad Studio 10.1 - Delphi Berlin +{$IFDEF VER310} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} +{$ENDIF} + +// Rad Studio 10.2 - Delphi Tokyo +{$IFDEF VER320} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} +{$ENDIF} + +// Rad Studio 10.3 - Delphi Rio +{$IFDEF VER330} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} + {$DEFINE DELPHI26_UP} +{$ENDIF} + +// Rad Studio 10.4 - Delphi Sydney +{$IFDEF VER340} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} + {$DEFINE DELPHI26_UP} + {$DEFINE DELPHI27_UP} +{$ENDIF} + +// Rad Studio 11.0 - Delphi Alexandria +{$IFDEF VER350} + {$UNDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} + {$DEFINE DELPHI26_UP} + {$DEFINE DELPHI27_UP} + {$DEFINE DELPHI28_UP} +{$ENDIF} + +{$IFDEF FPC} + {$DEFINE SUPPORTS_INLINE} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30200)} + {$DEFINE FPC_VER_320} + {$IFEND} +{$ELSE} + {$IFDEF DELPHI_VERSION_UNKNOW} + {$DEFINE DELPHI5_UP} + {$DEFINE DELPHI6_UP} + {$DEFINE DELPHI7_UP} + {$DEFINE DELPHI8_UP} + {$DEFINE DELPHI9_UP} + {$DEFINE DELPHI10_UP} + {$DEFINE DELPHI11_UP} + {$DEFINE DELPHI12_UP} + {$DEFINE DELPHI14_UP} + {$DEFINE DELPHI15_UP} + {$DEFINE DELPHI16_UP} + {$DEFINE DELPHI17_UP} + {$DEFINE DELPHI18_UP} + {$DEFINE DELPHI19_UP} + {$DEFINE DELPHI20_UP} + {$DEFINE DELPHI21_UP} + {$DEFINE DELPHI22_UP} + {$DEFINE DELPHI23_UP} + {$DEFINE DELPHI24_UP} + {$DEFINE DELPHI25_UP} + {$DEFINE DELPHI26_UP} + {$DEFINE DELPHI27_UP} + {$DEFINE DELPHI28_UP} + {$ENDIF} +{$ENDIF} + +{$IFDEF DELPHI9_UP} + {$DEFINE SUPPORTS_INLINE} +{$ENDIF} + +{$IF DEFINED(CPUX32) OR + DEFINED(CPU32) OR + DEFINED(CPU32BITS) OR + DEFINED(CPUARM32) OR + DEFINED(WIN32) OR + DEFINED(IOS32) OR + DEFINED(MACOS32) OR + DEFINED(LINUX32) OR + DEFINED(POSIX32) OR + DEFINED(ANDROID32)} + {$DEFINE TARGET_32BITS} +{$ELSE} + {$IF DEFINED(CPUX64) OR + DEFINED(CPU64) OR + DEFINED(CPU64BITS) OR + DEFINED(CPUARM64) OR + DEFINED(WIN64) OR + DEFINED(IOS64) OR + DEFINED(MACOS64) OR + DEFINED(LINUX64) OR + DEFINED(POSIX64) OR + DEFINED(ANDROID64)} + {$DEFINE TARGET_64BITS} + {$IFEND} +{$IFEND} + +// Delphi uses MACOS for the new MacOSX and DARWIN is not defined +// FPC uses DARWIN for the new MacOSX and MACOS is defined for the classic Macintosh OS (System 7) +// We define MACOSX to avoid conflicts in both situations +{$IFDEF FPC} + {$IFDEF DARWIN} + {$DEFINE MACOSX} + {$ENDIF} +{$ELSE} + {$IFDEF MACOS} + {$DEFINE MACOSX} + {$ENDIF} +{$ENDIF} diff --git a/demos/Lazarus_Windows/VirtualUIBrowser/uVirtualUIBrowser.lfm b/demos/Lazarus_Windows/VirtualUIBrowser/uVirtualUIBrowser.lfm new file mode 100644 index 00000000..85e58ba0 --- /dev/null +++ b/demos/Lazarus_Windows/VirtualUIBrowser/uVirtualUIBrowser.lfm @@ -0,0 +1,142 @@ +object Form1: TForm1 + Left = 284 + Height = 565 + Top = 44 + Width = 800 + Caption = 'VirtualUI Browser - Initializing browser. Please wait...' + ClientHeight = 565 + ClientWidth = 800 + Color = clBtnFace + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + OnDestroy = FormDestroy + OnHide = FormHide + OnShow = FormShow + Position = poScreenCenter + LCLVersion = '2.2.4.0' + object NavControlPnl: TPanel + Left = 0 + Height = 21 + Top = 0 + Width = 800 + Align = alTop + BevelOuter = bvNone + ClientHeight = 21 + ClientWidth = 800 + Enabled = False + TabOrder = 0 + object ComboBox1: TComboBox + Left = 0 + Height = 21 + Top = 0 + Width = 731 + Align = alClient + ItemHeight = 13 + Items.Strings = ( + 'https://www.google.co' + 'https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_select_form' + 'https://www.briskbard.com' + 'https://frames-per-second.appspot.com/' + ) + OnEnter = ComboBox1Enter + TabOrder = 0 + Text = 'https://www.google.com' + end + object Panel2: TPanel + Left = 731 + Height = 21 + Top = 0 + Width = 69 + Align = alRight + BevelOuter = bvNone + ClientHeight = 21 + ClientWidth = 69 + TabOrder = 1 + object GoBtn: TButton + Left = 4 + Height = 21 + Top = 0 + Width = 31 + Caption = 'Go' + OnClick = GoBtnClick + OnEnter = GoBtnEnter + TabOrder = 0 + end + object SnapshotBtn: TButton + Left = 38 + Height = 21 + Hint = 'Take snapshot' + Top = 0 + Width = 31 + Caption = 'µ' + Font.CharSet = SYMBOL_CHARSET + Font.Color = clWindowText + Font.Height = -24 + Font.Name = 'Webdings' + OnClick = SnapshotBtnClick + OnEnter = SnapshotBtnEnter + ParentFont = False + ParentShowHint = False + ShowHint = True + TabOrder = 1 + end + end + end + object Panel1: TBufferPanel + Left = 0 + Height = 544 + Top = 21 + Width = 800 + OnIMECancelComposition = Panel1IMECancelComposition + OnIMECommitText = Panel1IMECommitText + OnIMESetComposition = Panel1IMESetComposition + Align = alClient + OnUTF8KeyPress = Panel1UTF8KeyPress + Caption = 'Panel1' + TabOrder = 1 + TabStop = True + OnClick = Panel1Click + OnEnter = Panel1Enter + OnExit = Panel1Exit + OnMouseDown = Panel1MouseDown + OnMouseMove = Panel1MouseMove + OnMouseUp = Panel1MouseUp + OnMouseWheel = Panel1MouseWheel + OnKeyDown = Panel1KeyDown + OnKeyUp = Panel1KeyUp + OnResize = Panel1Resize + end + object chrmosr: TChromium + OnTooltip = chrmosrTooltip + OnCursorChange = chrmosrCursorChange + OnBeforePopup = chrmosrBeforePopup + OnAfterCreated = chrmosrAfterCreated + OnBeforeClose = chrmosrBeforeClose + OnGetViewRect = chrmosrGetViewRect + OnGetScreenPoint = chrmosrGetScreenPoint + OnGetScreenInfo = chrmosrGetScreenInfo + OnPopupShow = chrmosrPopupShow + OnPopupSize = chrmosrPopupSize + OnPaint = chrmosrPaint + OnIMECompositionRangeChanged = chrmosrIMECompositionRangeChanged + Left = 24 + Top = 56 + end + object SaveDialog1: TSaveDialog + Title = 'Save snapshot' + DefaultExt = '.bmp' + Filter = 'Bitmap files (*.bmp)|*.BMP' + Left = 24 + Top = 200 + end + object Timer1: TTimer + Enabled = False + Interval = 300 + OnTimer = Timer1Timer + Left = 24 + Top = 128 + end +end diff --git a/demos/Lazarus_Windows/VirtualUIBrowser/uVirtualUIBrowser.pas b/demos/Lazarus_Windows/VirtualUIBrowser/uVirtualUIBrowser.pas new file mode 100644 index 00000000..795145e8 --- /dev/null +++ b/demos/Lazarus_Windows/VirtualUIBrowser/uVirtualUIBrowser.pas @@ -0,0 +1,1019 @@ +// ************************************************************************ +// ***************************** CEF4Delphi ******************************* +// ************************************************************************ +// +// CEF4Delphi is based on DCEF3 which uses CEF 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 © 2022 Salvador Diaz 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 <hgourvest@gmail.com> + * 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. + * + *) + +unit uVirtualUIBrowser; + +{$MODE OBJFPC}{$H+} + +interface + +uses + VirtualUI_SDK, + Windows, LCLIntf, LCLType, LMessages, Messages, SysUtils, Variants, Classes, + SyncObjs, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Types, + uCEFChromium, uCEFTypes, uCEFInterfaces, uCEFConstants, uCEFBufferPanel, + uCEFChromiumEvents; + +type + + { TForm1 } + + TForm1 = class(TForm) + NavControlPnl: TPanel; + chrmosr: TChromium; + ComboBox1: TComboBox; + Panel2: TPanel; + GoBtn: TButton; + SnapshotBtn: TButton; + SaveDialog1: TSaveDialog; + Timer1: TTimer; + Panel1: TBufferPanel; + + procedure GoBtnClick(Sender: TObject); + procedure GoBtnEnter(Sender: TObject); + + procedure Panel1Enter(Sender: TObject); + procedure Panel1Exit(Sender: TObject); + procedure Panel1IMECancelComposition(Sender: TObject); + procedure Panel1IMECommitText(Sender: TObject; const aText: ustring; const replacement_range: PCefRange; relative_cursor_pos: integer); + procedure Panel1IMESetComposition(Sender: TObject; const aText: ustring; const underlines: TCefCompositionUnderlineDynArray; const replacement_range, selection_range: TCefRange); + procedure Panel1Resize(Sender: TObject); + procedure Panel1Click(Sender: TObject); + procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Panel1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); + procedure Panel1MouseLeave(Sender: TObject); + procedure Panel1MouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); + procedure Panel1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure Panel1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure Panel1UTF8KeyPress(Sender: TObject; var UTF8Key: TUTF8Char); + + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormHide(Sender: TObject); + procedure FormAfterMonitorDpiChanged(Sender: TObject; OldDPI, NewDPI: Integer); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + + procedure chrmosrPaint(Sender: TObject; const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; aWidth, aHeight: Integer); + procedure chrmosrCursorChange(Sender: TObject; const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult : boolean); + procedure chrmosrGetViewRect(Sender: TObject; const browser: ICefBrowser; var rect: TCefRect); + procedure chrmosrGetScreenPoint(Sender: TObject; const browser: ICefBrowser; viewX, viewY: Integer; var screenX, screenY: Integer; out Result: Boolean); + procedure chrmosrGetScreenInfo(Sender: TObject; const browser: ICefBrowser; var screenInfo: TCefScreenInfo; out Result: Boolean); + procedure chrmosrPopupShow(Sender: TObject; const browser: ICefBrowser; aShow: Boolean); + procedure chrmosrPopupSize(Sender: TObject; const browser: ICefBrowser; const rect: PCefRect); + procedure chrmosrAfterCreated(Sender: TObject; const browser: ICefBrowser); + procedure chrmosrTooltip(Sender: TObject; const browser: ICefBrowser; var aText: ustring; out Result: Boolean); + procedure chrmosrBeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean); + procedure chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser); + procedure chrmosrIMECompositionRangeChanged(Sender: TObject; const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect); + + procedure SnapshotBtnClick(Sender: TObject); + procedure SnapshotBtnEnter(Sender: TObject); + + procedure Timer1Timer(Sender: TObject); + procedure ComboBox1Enter(Sender: TObject); + + protected + FbFirst : boolean; + FPopUpBitmap : TBitmap; + FPopUpRect : TRect; + FShowPopUp : boolean; + FResizing : boolean; + FPendingResize : boolean; + FCanClose : boolean; + FClosing : boolean; + FResizeCS : TCriticalSection; + FIMECS : TCriticalSection; + FDeviceBounds : TCefRectDynArray; + FSelectedRange : TCefRange; + + FLastClickCount : integer; + FLastClickTime : integer; + FLastClickPoint : TPoint; + FLastClickButton : TMouseButton; + + function getModifiers(Shift: TShiftState): TCefEventFlags; + function GetButton(Button: TMouseButton): TCefMouseButtonType; + procedure DoResize; + procedure InitializeLastClick; + function CancelPreviousClick(x, y : integer; var aCurrentTime : integer) : boolean; + + procedure WMMove(var aMessage : TWMMove); message WM_MOVE; + procedure WMMoving(var aMessage : TMessage); message WM_MOVING; + procedure WMCaptureChanged(var aMessage : TMessage); message WM_CAPTURECHANGED; + procedure WMCancelMode(var aMessage : TMessage); message WM_CANCELMODE; + procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP; + procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP; + procedure WMSysChar(var aMessage: TMessage); message WM_SYSCHAR; + procedure WMSysKeyDown(var aMessage: TMessage); message WM_SYSKEYDOWN; + procedure WMSysKeyUp(var aMessage: TMessage); message WM_SYSKEYUP; + procedure WMDpiChanged(var Message: TMessage); message WM_DPICHANGED; + procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED; + procedure PendingResizeMsg(var aMessage : TMessage); message CEF_PENDINGRESIZE; + procedure PendingInvalidateMsg(var aMessage : TMessage); message CEF_PENDINGINVALIDATE; + procedure RangeChangedMsg(var aMessage : TMessage); message CEF_IMERANGECHANGED; + + public + { Public declarations } + end; + +var + Form1: TForm1; + +procedure CreateGlobalCEFApp; + +implementation + +{$R *.lfm} + +uses + Math, + uCEFMiscFunctions, uCEFApplication; + +// This demo is based on the SimpleOSRBrowser demo but it uses a different +// executable for the CEF subprocesses and it's configured to run inside VirtualUI + +// We have to use the OSR mode to avoid refresh issues in VirtualUI. +// Chromium requires running several subprocesses and that can be problematic +// with VirtualUI. That's why we use a different executable for the subprocesses +// and call VirtualUI.AllowExecute before initializing CEF. + +// Read the code comments in the SimpleOSRBrowser demo for more information. + +// This is the destruction sequence in OSR mode : +// 1- FormCloseQuery sets CanClose to the initial FCanClose value (False) and +// calls chrmosr.CloseBrowser(True). +// 2- chrmosr.CloseBrowser(True) will trigger chrmosr.OnClose and we have to +// set "aAction" to cbaClose and CEF will destroy the internal browser immediately. +// cbaClose is the default aAction value so this demo doesn't implement the OnClose event. +// 3- chrmosr.OnBeforeClose is triggered because the internal browser was destroyed. +// Sets FCanClose := True and sends WM_CLOSE to the form to close the demo. + + +procedure CreateGlobalCEFApp; +begin + // Start VirtualUI and allow the execution of CEF subprocesses with VirtualUIBrowser_sp.exe + VirtualUI.Start; + VirtualUI.AllowExecute('VirtualUIBrowser_sp.exe'); + + GlobalCEFApp := TCefApplication.Create; + GlobalCEFApp.WindowlessRenderingEnabled := True; + GlobalCEFApp.EnableHighDPISupport := True; + GlobalCEFApp.EnableGPU := True; + GlobalCEFApp.BrowserSubprocessPath := 'VirtualUIBrowser_sp.exe'; + //GlobalCEFApp.LogFile := 'debug.log'; + //GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE; +end; + +procedure TForm1.GoBtnClick(Sender: TObject); +begin + FResizeCS.Acquire; + FResizing := False; + FPendingResize := False; + FResizeCS.Release; + + chrmosr.LoadURL(UTF8Decode(ComboBox1.Text)); +end; + +procedure TForm1.chrmosrIMECompositionRangeChanged( Sender : TObject; + const browser : ICefBrowser; + const selected_range : PCefRange; + character_boundsCount : NativeUInt; + const character_bounds : PCefRect); +var + TempPRect : PCefRect; + i : NativeUInt; + TempScale : single; +begin + try + FIMECS.Acquire; + + // TChromium.OnIMECompositionRangeChanged is triggered in a different thread + // and all functions using a IMM context need to be executed in the same + // thread, in this case the main thread. We need to save the parameters and + // send a message to the form to execute Panel1.ChangeCompositionRange in + // the main thread. + + if (FDeviceBounds <> nil) then + begin + Finalize(FDeviceBounds); + FDeviceBounds := nil; + end; + + FSelectedRange := selected_range^; + + if (character_boundsCount > 0) then + begin + SetLength(FDeviceBounds, character_boundsCount); + + i := 0; + TempPRect := character_bounds; + TempScale := Panel1.ScreenScale; + + while (i < character_boundsCount) do + begin + FDeviceBounds[i] := TempPRect^; + LogicalToDevice(FDeviceBounds[i], TempScale); + + inc(TempPRect); + inc(i); + end; + end; + + PostMessage(Handle, CEF_IMERANGECHANGED, 0, 0); + finally + FIMECS.Release; + end; +end; + +procedure TForm1.GoBtnEnter(Sender: TObject); +begin + chrmosr.SetFocus(False); +end; + +procedure TForm1.chrmosrAfterCreated(Sender: TObject; const browser: ICefBrowser); +begin + PostMessage(Handle, CEF_AFTERCREATED, 0, 0); +end; + +procedure TForm1.chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser); +begin + FCanClose := True; + PostMessage(Handle, WM_CLOSE, 0, 0); +end; + +procedure TForm1.Panel1UTF8KeyPress(Sender: TObject; var UTF8Key: TUTF8Char); +var + TempKeyEvent : TCefKeyEvent; + TempString : UnicodeString; +begin + if Panel1.Focused then + begin + TempString := UTF8Decode(UTF8Key); + + if (length(TempString) > 0) then + begin + TempKeyEvent.kind := KEYEVENT_CHAR; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(WParam(TempString[1]), 0); + TempKeyEvent.windows_key_code := ord(TempString[1]); + TempKeyEvent.native_key_code := 0; + TempKeyEvent.is_system_key := ord(False); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; + end; +end; + +procedure TForm1.chrmosrBeforePopup(Sender: TObject; + const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, + targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; + userGesture: Boolean; const popupFeatures: TCefPopupFeatures; + var windowInfo: TCefWindowInfo; var client: ICefClient; + var settings: TCefBrowserSettings; + var extra_info: ICefDictionaryValue; + var noJavascriptAccess: Boolean; + var Result: Boolean); +begin + // For simplicity, this demo blocks all popup windows and new tabs + Result := (targetDisposition in [WOD_NEW_FOREGROUND_TAB, WOD_NEW_BACKGROUND_TAB, WOD_NEW_POPUP, WOD_NEW_WINDOW]); +end; + +procedure TForm1.chrmosrCursorChange(Sender : TObject; + const browser : ICefBrowser; + cursor_ : TCefCursorHandle; + cursorType : TCefCursorType; + const customCursorInfo : PCefCursorInfo; + var aResult : boolean); +begin + Panel1.Cursor := CefCursorToWindowsCursor(cursorType); + aResult := True; +end; + +procedure TForm1.chrmosrGetScreenInfo(Sender : TObject; + const browser : ICefBrowser; + var screenInfo : TCefScreenInfo; + out Result : Boolean); +var + TempRect : TCEFRect; + TempScale : single; +begin + TempScale := Panel1.ScreenScale; + TempRect.x := 0; + TempRect.y := 0; + TempRect.width := DeviceToLogical(Panel1.Width, TempScale); + TempRect.height := DeviceToLogical(Panel1.Height, TempScale); + + screenInfo.device_scale_factor := TempScale; + screenInfo.depth := 0; + screenInfo.depth_per_component := 0; + screenInfo.is_monochrome := Ord(False); + screenInfo.rect := TempRect; + screenInfo.available_rect := TempRect; + + Result := True; +end; + +procedure TForm1.chrmosrGetScreenPoint(Sender: TObject; + const browser: ICefBrowser; viewX, viewY: Integer; var screenX, + screenY: Integer; out Result: Boolean); +var + TempScreenPt, TempViewPt : TPoint; + TempScale : single; +begin + TempScale := Panel1.ScreenScale; + TempViewPt.x := LogicalToDevice(viewX, TempScale); + TempViewPt.y := LogicalToDevice(viewY, TempScale); + TempScreenPt := Panel1.ClientToScreen(TempViewPt); + screenX := TempScreenPt.x; + screenY := TempScreenPt.y; + Result := True; +end; + +procedure TForm1.chrmosrGetViewRect(Sender : TObject; + const browser : ICefBrowser; + var rect : TCefRect); +var + TempScale : single; +begin + TempScale := Panel1.ScreenScale; + rect.x := 0; + rect.y := 0; + rect.width := DeviceToLogical(Panel1.Width, TempScale); + rect.height := DeviceToLogical(Panel1.Height, TempScale); +end; + +procedure TForm1.chrmosrPaint(Sender: TObject; const browser: ICefBrowser; + kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; + const dirtyRects: PCefRectArray; const buffer: Pointer; aWidth, + aHeight: Integer); +var + src, dst: PByte; + i, j, TempLineSize, TempSrcOffset, TempDstOffset, SrcStride : Integer; + n : NativeUInt; + TempWidth, TempHeight : integer; + TempBufferBits : Pointer; + TempForcedResize : boolean; + TempBitmap : TBitmap; + TempSrcRect : TRect; +begin + try + FResizeCS.Acquire; + TempForcedResize := False; + + if Panel1.BeginBufferDraw then + begin + if (kind = PET_POPUP) then + begin + if (FPopUpBitmap = nil) or + (aWidth <> FPopUpBitmap.Width) or + (aHeight <> FPopUpBitmap.Height) then + begin + if (FPopUpBitmap <> nil) then FPopUpBitmap.Free; + + FPopUpBitmap := TBitmap.Create; + FPopUpBitmap.PixelFormat := pf32bit; + FPopUpBitmap.HandleType := bmDIB; + FPopUpBitmap.Width := aWidth; + FPopUpBitmap.Height := aHeight; + end; + + TempBitmap := FPopUpBitmap; + TempBitmap.BeginUpdate; + + TempWidth := FPopUpBitmap.Width; + TempHeight := FPopUpBitmap.Height; + end + else + begin + TempForcedResize := Panel1.UpdateBufferDimensions(aWidth, aHeight) or not(Panel1.BufferIsResized(False)); + + TempBitmap := Panel1.Buffer; + TempBitmap.BeginUpdate; + + TempWidth := Panel1.BufferWidth; + TempHeight := Panel1.BufferHeight; + end; + + SrcStride := aWidth * SizeOf(TRGBQuad); + n := 0; + + while (n < dirtyRectsCount) do + begin + if (dirtyRects^[n].x >= 0) and (dirtyRects^[n].y >= 0) then + begin + TempLineSize := min(dirtyRects^[n].width, TempWidth - dirtyRects^[n].x) * SizeOf(TRGBQuad); + + if (TempLineSize > 0) then + begin + TempSrcOffset := ((dirtyRects^[n].y * aWidth) + dirtyRects^[n].x) * SizeOf(TRGBQuad); + TempDstOffset := (dirtyRects^[n].x * SizeOf(TRGBQuad)); + + src := @PByte(buffer)[TempSrcOffset]; + + i := 0; + j := min(dirtyRects^[n].height, TempHeight - dirtyRects^[n].y); + + while (i < j) do + begin + TempBufferBits := TempBitmap.Scanline[dirtyRects^[n].y + i]; + dst := @PByte(TempBufferBits)[TempDstOffset]; + + Move(src^, dst^, TempLineSize); + + Inc(src, SrcStride); + inc(i); + end; + end; + end; + + inc(n); + end; + + TempBitmap.EndUpdate; + + if FShowPopup and (FPopUpBitmap <> nil) then + begin + TempSrcRect := Rect(0, 0, + min(FPopUpRect.Right - FPopUpRect.Left, FPopUpBitmap.Width), + min(FPopUpRect.Bottom - FPopUpRect.Top, FPopUpBitmap.Height)); + + Panel1.BufferDraw(FPopUpBitmap, TempSrcRect, FPopUpRect); + end; + + Panel1.EndBufferDraw; + + if HandleAllocated then PostMessage(Handle, CEF_PENDINGINVALIDATE, 0, 0); + + if (kind = PET_VIEW) then + begin + if (TempForcedResize or FPendingResize) and + HandleAllocated then + PostMessage(Handle, CEF_PENDINGRESIZE, 0, 0); + + FResizing := False; + FPendingResize := False; + end; + end; + finally + FResizeCS.Release; + end; +end; + +procedure TForm1.chrmosrPopupShow(Sender : TObject; + const browser : ICefBrowser; + aShow : Boolean); +begin + if aShow then + FShowPopUp := True + else + begin + FShowPopUp := False; + FPopUpRect := rect(0, 0, 0, 0); + + if (chrmosr <> nil) then chrmosr.Invalidate(PET_VIEW); + end; +end; + +procedure TForm1.chrmosrPopupSize(Sender : TObject; + const browser : ICefBrowser; + const rect : PCefRect); +begin + LogicalToDevice(rect^, Panel1.ScreenScale); + + FPopUpRect.Left := rect^.x; + FPopUpRect.Top := rect^.y; + FPopUpRect.Right := rect^.x + rect^.width - 1; + FPopUpRect.Bottom := rect^.y + rect^.height - 1; +end; + +procedure TForm1.chrmosrTooltip(Sender: TObject; const browser: ICefBrowser; var aText: ustring; out Result: Boolean); +begin + Panel1.hint := aText; + Panel1.ShowHint := (length(aText) > 0); + Result := True; +end; + +procedure TForm1.ComboBox1Enter(Sender: TObject); +begin + chrmosr.SetFocus(False); +end; + +function TForm1.getModifiers(Shift: TShiftState): TCefEventFlags; +begin + Result := EVENTFLAG_NONE; + + if (ssShift in Shift) then Result := Result or EVENTFLAG_SHIFT_DOWN; + if (ssAlt in Shift) then Result := Result or EVENTFLAG_ALT_DOWN; + if (ssCtrl in Shift) then Result := Result or EVENTFLAG_CONTROL_DOWN; + if (ssLeft in Shift) then Result := Result or EVENTFLAG_LEFT_MOUSE_BUTTON; + if (ssRight in Shift) then Result := Result or EVENTFLAG_RIGHT_MOUSE_BUTTON; + if (ssMiddle in Shift) then Result := Result or EVENTFLAG_MIDDLE_MOUSE_BUTTON; +end; + +function TForm1.GetButton(Button: TMouseButton): TCefMouseButtonType; +begin + case Button of + TMouseButton.mbRight : Result := MBT_RIGHT; + TMouseButton.mbMiddle : Result := MBT_MIDDLE; + else Result := MBT_LEFT; + end; +end; + +procedure TForm1.WMMove(var aMessage : TWMMove); +begin + inherited; + + if (chrmosr <> nil) then chrmosr.NotifyMoveOrResizeStarted; +end; + +procedure TForm1.WMMoving(var aMessage : TMessage); +begin + inherited; + + if (chrmosr <> nil) then chrmosr.NotifyMoveOrResizeStarted; +end; + +procedure TForm1.WMCaptureChanged(var aMessage : TMessage); +begin + inherited; + + if (chrmosr <> nil) then chrmosr.SendCaptureLostEvent; +end; + +procedure TForm1.WMCancelMode(var aMessage : TMessage); +begin + inherited; + + if (chrmosr <> nil) then chrmosr.SendCaptureLostEvent; +end; + +procedure TForm1.WMEnterMenuLoop(var aMessage: TMessage); +begin + inherited; + + if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then GlobalCEFApp.OsmodalLoop := True; +end; + +procedure TForm1.WMExitMenuLoop(var aMessage: TMessage); +begin + inherited; + + if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then GlobalCEFApp.OsmodalLoop := False; +end; + +procedure TForm1.WMSysChar(var aMessage: TMessage); +var + TempKeyEvent : TCefKeyEvent; +begin + inherited; + + if Panel1.Focused and (aMessage.wParam in [VK_BACK..VK_HELP]) then + begin + TempKeyEvent.kind := KEYEVENT_CHAR; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam); + TempKeyEvent.windows_key_code := aMessage.wParam; + TempKeyEvent.native_key_code := aMessage.lParam; + TempKeyEvent.is_system_key := ord(True); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + CefCheckAltGrPressed(aMessage.wParam, TempKeyEvent); + chrmosr.SendKeyEvent(@TempKeyEvent); + end; +end; + +procedure TForm1.WMSysKeyDown(var aMessage: TMessage); +var + TempKeyEvent : TCefKeyEvent; +begin + inherited; + + if Panel1.Focused and (aMessage.wParam in [VK_BACK..VK_HELP]) then + begin + TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam); + TempKeyEvent.windows_key_code := aMessage.wParam; + TempKeyEvent.native_key_code := aMessage.lParam; + TempKeyEvent.is_system_key := ord(True); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; +end; + +procedure TForm1.WMSysKeyUp(var aMessage: TMessage); +var + TempKeyEvent : TCefKeyEvent; +begin + inherited; + + if Panel1.Focused and (aMessage.wParam in [VK_BACK..VK_HELP]) then + begin + TempKeyEvent.kind := KEYEVENT_KEYUP; + TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam); + TempKeyEvent.windows_key_code := aMessage.wParam; + TempKeyEvent.native_key_code := aMessage.lParam; + TempKeyEvent.is_system_key := ord(True); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; +end; + +procedure TForm1.WMDpiChanged(var Message: TMessage); +begin + inherited; + + if (GlobalCEFApp <> nil) then + GlobalCEFApp.UpdateDeviceScaleFactor; + + if (chrmosr <> nil) then + begin + chrmosr.NotifyScreenInfoChanged; + chrmosr.WasResized; + end; +end; + +procedure TForm1.BrowserCreatedMsg(var aMessage : TMessage); +begin + Caption := 'VirtualUI Browser'; + NavControlPnl.Enabled := True; + GoBtn.Click; +end; + +procedure TForm1.FormAfterMonitorDpiChanged(Sender: TObject; OldDPI, NewDPI: Integer); +begin + if (chrmosr <> nil) then + begin + chrmosr.NotifyScreenInfoChanged; + chrmosr.WasResized; + end; +end; + +procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); +begin + CanClose := FCanClose; + + if not(FClosing) then + begin + FClosing := True; + Visible := False; + chrmosr.CloseBrowser(True); + end; +end; + +procedure TForm1.FormCreate(Sender: TObject); +begin + FbFirst := False; + FPopUpBitmap := nil; + FPopUpRect := rect(0, 0, 0, 0); + FShowPopUp := False; + FResizing := False; + FPendingResize := False; + FCanClose := False; + FClosing := False; + FDeviceBounds := nil; + + FSelectedRange.from := 0; + FSelectedRange.to_ := 0; + + FResizeCS := TCriticalSection.Create; + FIMECS := TCriticalSection.Create; + + InitializeLastClick; +end; + +procedure TForm1.FormDestroy(Sender: TObject); +begin + chrmosr.ShutdownDragAndDrop; + + if (FPopUpBitmap <> nil) then FreeAndNil(FPopUpBitmap); + if (FResizeCS <> nil) then FreeAndNil(FResizeCS); + if (FIMECS <> nil) then FreeAndNil(FIMECS); + + if (FDeviceBounds <> nil) then + begin + Finalize(FDeviceBounds); + FDeviceBounds := nil; + end; +end; + +procedure TForm1.FormHide(Sender: TObject); +begin + chrmosr.SetFocus(False); + chrmosr.WasHidden(True); +end; + +procedure TForm1.FormShow(Sender: TObject); +begin + if chrmosr.Initialized then + begin + chrmosr.WasHidden(False); + chrmosr.SetFocus(True); + end + else + begin + // opaque white background color + chrmosr.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF); + + // The IME handler needs to be created when Panel1 has a valid handle + // and before the browser creation. + // You can skip this if the user doesn't need an "Input Method Editor". + Panel1.CreateIMEHandler; + + if chrmosr.CreateBrowser(nil, '') then + chrmosr.InitializeDragAndDrop(Panel1) + else + Timer1.Enabled := True; + end; +end; + +procedure TForm1.Panel1Click(Sender: TObject); +begin + Panel1.SetFocus; +end; + +procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + TempEvent : TCefMouseEvent; + TempTime : integer; +begin + Panel1.SetFocus; + + if not(CancelPreviousClick(x, y, TempTime)) and (Button = FLastClickButton) then + inc(FLastClickCount) + else + begin + FLastClickPoint.x := x; + FLastClickPoint.y := y; + FLastClickCount := 1; + end; + + FLastClickTime := TempTime; + FLastClickButton := Button; + + TempEvent.x := X; + TempEvent.y := Y; + TempEvent.modifiers := getModifiers(Shift); + DeviceToLogical(TempEvent, Panel1.ScreenScale); + chrmosr.SendMouseClickEvent(@TempEvent, GetButton(Button), False, FLastClickCount); +end; + +procedure TForm1.Panel1MouseLeave(Sender: TObject); +var + TempEvent : TCefMouseEvent; + TempPoint : TPoint; + TempTime : integer; +begin + GetCursorPos(TempPoint); + TempPoint := Panel1.ScreenToclient(TempPoint); + + if CancelPreviousClick(TempPoint.x, TempPoint.y, TempTime) then InitializeLastClick; + + TempEvent.x := TempPoint.x; + TempEvent.y := TempPoint.y; + TempEvent.modifiers := GetCefMouseModifiers; + DeviceToLogical(TempEvent, Panel1.ScreenScale); + chrmosr.SendMouseMoveEvent(@TempEvent, True); +end; + +procedure TForm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); +var + TempEvent : TCefMouseEvent; + TempTime : integer; +begin + if CancelPreviousClick(x, y, TempTime) then InitializeLastClick; + + TempEvent.x := x; + TempEvent.y := y; + TempEvent.modifiers := getModifiers(Shift); + DeviceToLogical(TempEvent, Panel1.ScreenScale); + chrmosr.SendMouseMoveEvent(@TempEvent, False); +end; + +procedure TForm1.Panel1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + TempEvent : TCefMouseEvent; +begin + TempEvent.x := X; + TempEvent.y := Y; + TempEvent.modifiers := getModifiers(Shift); + DeviceToLogical(TempEvent, Panel1.ScreenScale); + chrmosr.SendMouseClickEvent(@TempEvent, GetButton(Button), True, FLastClickCount); +end; + +procedure TForm1.Panel1Resize(Sender: TObject); +begin + DoResize; +end; + +procedure TForm1.PendingResizeMsg(var aMessage : TMessage); +begin + DoResize; +end; + +procedure TForm1.PendingInvalidateMsg(var aMessage : TMessage); +begin + Panel1.Invalidate; +end; + +procedure TForm1.RangeChangedMsg(var aMessage : TMessage); +begin + try + FIMECS.Acquire; + Panel1.ChangeCompositionRange(FSelectedRange, FDeviceBounds); + finally + FIMECS.Release; + end; +end; + +procedure TForm1.DoResize; +begin + try + FResizeCS.Acquire; + + if FResizing then + FPendingResize := True + else + if Panel1.BufferIsResized then + chrmosr.Invalidate(PET_VIEW) + else + begin + FResizing := True; + chrmosr.WasResized; + end; + finally + FResizeCS.Release; + end; +end; + +procedure TForm1.InitializeLastClick; +begin + FLastClickCount := 1; + FLastClickTime := 0; + FLastClickPoint.x := 0; + FLastClickPoint.y := 0; + FLastClickButton := mbLeft; +end; + +function TForm1.CancelPreviousClick(x, y : integer; var aCurrentTime : integer) : boolean; +begin + aCurrentTime := GetMessageTime; + + Result := (abs(FLastClickPoint.x - x) > (GetSystemMetrics(SM_CXDOUBLECLK) div 2)) or + (abs(FLastClickPoint.y - y) > (GetSystemMetrics(SM_CYDOUBLECLK) div 2)) or + (cardinal(aCurrentTime - FLastClickTime) > GetDoubleClickTime); +end; + +procedure TForm1.Panel1Enter(Sender: TObject); +begin + chrmosr.SetFocus(True); +end; + +procedure TForm1.Panel1Exit(Sender: TObject); +begin + chrmosr.SetFocus(False); +end; + +procedure TForm1.Panel1IMECancelComposition(Sender: TObject); +begin + chrmosr.IMECancelComposition; +end; + +procedure TForm1.Panel1IMECommitText( Sender : TObject; + const aText : ustring; + const replacement_range : PCefRange; + relative_cursor_pos : Integer); +begin + chrmosr.IMECommitText(aText, replacement_range, relative_cursor_pos); +end; + +procedure TForm1.Panel1IMESetComposition( Sender : TObject; + const aText : ustring; + const underlines : TCefCompositionUnderlineDynArray; + const replacement_range : TCefRange; + const selection_range : TCefRange); +begin + chrmosr.IMESetComposition(aText, underlines, @replacement_range, @selection_range); +end; + +procedure TForm1.Panel1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); +var + TempKeyEvent : TCefKeyEvent; +begin + if (Key <> 0) and (chrmosr <> nil) then + begin + TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN; + TempKeyEvent.modifiers := getModifiers(Shift); + TempKeyEvent.windows_key_code := Key; + TempKeyEvent.native_key_code := 0; + TempKeyEvent.is_system_key := ord(False); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + + if (Key in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]) then Key := 0; + end; +end; + +procedure TForm1.Panel1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); +var + TempKeyEvent : TCefKeyEvent; +begin + if (Key <> 0) and (chrmosr <> nil) then + begin + TempKeyEvent.kind := KEYEVENT_KEYUP; + TempKeyEvent.modifiers := getModifiers(Shift); + TempKeyEvent.windows_key_code := Key; + TempKeyEvent.native_key_code := 0; + TempKeyEvent.is_system_key := ord(False); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; +end; + +procedure TForm1.Panel1MouseWheel(Sender: TObject; Shift: TShiftState; + WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); +var + TempEvent : TCefMouseEvent; +begin + TempEvent.x := MousePos.x; + TempEvent.y := MousePos.y; + TempEvent.modifiers := getModifiers(Shift); + DeviceToLogical(TempEvent, Panel1.ScreenScale); + + if CefIsKeyDown(VK_SHIFT) then + chrmosr.SendMouseWheelEvent(@TempEvent, WheelDelta, 0) + else + chrmosr.SendMouseWheelEvent(@TempEvent, 0, WheelDelta); +end; + +procedure TForm1.SnapshotBtnClick(Sender: TObject); +begin + if SaveDialog1.Execute then Panel1.SaveToFile(SaveDialog1.FileName); +end; + +procedure TForm1.SnapshotBtnEnter(Sender: TObject); +begin + chrmosr.SetFocus(False); +end; + +procedure TForm1.Timer1Timer(Sender: TObject); +begin + Timer1.Enabled := False; + + if chrmosr.CreateBrowser(nil, '') then + chrmosr.InitializeDragAndDrop(Panel1) + else + if not(chrmosr.Initialized) then Timer1.Enabled := True; +end; + +end. diff --git a/update_CEF4Delphi.json b/update_CEF4Delphi.json index ea5f2a50..52ffee42 100644 --- a/update_CEF4Delphi.json +++ b/update_CEF4Delphi.json @@ -2,7 +2,7 @@ "UpdateLazPackages" : [ { "ForceNotify" : true, - "InternalVersion" : 440, + "InternalVersion" : 441, "Name" : "cef4delphi_lazarus.lpk", "Version" : "106.1.0" }