diff --git a/.gitignore b/.gitignore index cd7d7dc1..27b4d2a6 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,5 @@ dunitx-results.xml !/Binary/** !/Tools/Setup/Style/*.dll !/Tools/*.exe +unins*.dat +*.delphilsp.json diff --git a/Samples/CreateAsInterface/CreateAsInterfaceFmxDemo.dpr b/Samples/CreateAsInterface/CreateAsInterfaceFmxDemo.dpr new file mode 100644 index 00000000..10aea464 --- /dev/null +++ b/Samples/CreateAsInterface/CreateAsInterfaceFmxDemo.dpr @@ -0,0 +1,24 @@ +program CreateAsInterfaceFmxDemo; + +uses + System.StartUpCopy, + FMX.Forms, + CreateAsInterfaceFmxMain in 'CreateAsInterfaceFmxMain.pas' {Form32}, + System.Skia.API in '..\..\Source\System.Skia.API.pas', + System.Skia in '..\..\Source\System.Skia.pas', + FMX.Skia.AnimatedCodec in '..\..\Source\FMX\FMX.Skia.AnimatedCodec.pas', + FMX.Skia.Canvas.GL in '..\..\Source\FMX\FMX.Skia.Canvas.GL.pas', + FMX.Skia.Canvas.Metal in '..\..\Source\FMX\FMX.Skia.Canvas.Metal.pas', + FMX.Skia.Canvas in '..\..\Source\FMX\FMX.Skia.Canvas.pas', + FMX.Skia.Filter in '..\..\Source\FMX\FMX.Skia.Filter.pas', + FMX.Skia in '..\..\Source\FMX\FMX.Skia.pas', + FMX.Skia.Printer in '..\..\Source\FMX\FMX.Skia.Printer.pas', + FMX.Skia.Canvas.Vulkan in 'C:\Program Files (x86)\Embarcadero\Studio\23.0\source\fmx\FMX.Skia.Canvas.Vulkan.pas'; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TForm32, Form32); + Application.Run; +end. diff --git a/Samples/CreateAsInterface/CreateAsInterfaceFmxDemo.dproj b/Samples/CreateAsInterface/CreateAsInterfaceFmxDemo.dproj new file mode 100644 index 00000000..43f288e2 --- /dev/null +++ b/Samples/CreateAsInterface/CreateAsInterfaceFmxDemo.dproj @@ -0,0 +1,358 @@ + + + True + Application + Debug + FMX + CreateAsInterfaceFmxDemo.dpr + Win32 + {4B69E98D-E040-40C1-842B-834D8E213761} + CreateAsInterfaceFmxDemo + 20.3 + 693395 + + + 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 + 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 + + + CreateAsInterfaceFmxDemo + true + true + true + true + true + true + true + true + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + ..\Source;..\Source\FMX;$(DCC_UnitSearchPath) + $(BDS)\bin\delphi_PROJECTICNS.icns + $(BDS)\bin\delphi_PROJECTICON.ico + + + $(BDS)\bin\Artwork\Android\FM_AdaptiveIcon_Background.xml + $(BDS)\bin\Artwork\Android\FM_AdaptiveIcon_Foreground.xml + $(BDS)\bin\Artwork\Android\FM_AdaptiveIcon_Monochrome.xml + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png + $(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_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 + $(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_VectorizedNotificationIcon.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplash.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplashDark.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplashV31.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplashV31Dark.xml + Debug + soapserver;fmx;emshosting;DbxCommonDriver;bindengine;IndyIPCommon;emsclient;FireDACCommonDriver;IndyProtocols;RadiantShapesFmx_Design;IndyIPClient;dbxcds;FmxTeeUI;emsedge;bindcompfmx;FireDACSqliteDriver;DbxClientDriver;soapmidas;fmxFireDAC;dbexpress;inet;DataSnapCommon;fmxase;dbrtl;FireDACDBXDriver;CustomIPTransport;DBXInterBaseDriver;IndySystem;RadiantShapesFmx;bindcomp;FireDACCommon;emsserverresource;inetstn;RESTBackendComponents;IndyCore;bindcompdbx;rtl;RESTComponents;DBXSqliteDriver;IndyIPServer;dsnapxml;DataSnapClient;DataSnapProviderClient;DataSnapFireDAC;emsclientfiredac;FireDAC;FireDACDSDriver;xmlrtl;tethering;dsnap;CloudService;FMXTee;DataSnapNativeClient;soaprtl;FireDACIBDriver;$(DCC_UsePackage) + activity-1.7.2.dex.jar;annotation-experimental-1.4.1.dex.jar;annotation-jvm-1.8.1.dex.jar;annotations-13.0.dex.jar;appcompat-1.2.0.dex.jar;appcompat-resources-1.2.0.dex.jar;billing-7.1.1.dex.jar;biometric-1.1.0.dex.jar;browser-1.4.0.dex.jar;cloud-messaging.dex.jar;collection-jvm-1.4.2.dex.jar;concurrent-futures-1.1.0.dex.jar;core-1.15.0.dex.jar;core-common-2.2.0.dex.jar;core-ktx-1.15.0.dex.jar;core-runtime-2.2.0.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;error_prone_annotations-2.9.0.dex.jar;exifinterface-1.3.6.dex.jar;firebase-annotations-16.2.0.dex.jar;firebase-common-20.3.1.dex.jar;firebase-components-17.1.0.dex.jar;firebase-datatransport-18.1.7.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-encoders-proto-16.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.1.3.dex.jar;firebase-installations-interop-17.1.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-23.1.2.dex.jar;fmx.dex.jar;fragment-1.2.5.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;kotlin-stdlib-1.8.22.dex.jar;kotlin-stdlib-common-1.8.22.dex.jar;kotlin-stdlib-jdk7-1.8.22.dex.jar;kotlin-stdlib-jdk8-1.8.22.dex.jar;kotlinx-coroutines-android-1.6.4.dex.jar;kotlinx-coroutines-core-jvm-1.6.4.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.6.2.dex.jar;lifecycle-livedata-2.6.2.dex.jar;lifecycle-livedata-core-2.6.2.dex.jar;lifecycle-runtime-2.6.2.dex.jar;lifecycle-service-2.6.2.dex.jar;lifecycle-viewmodel-2.6.2.dex.jar;lifecycle-viewmodel-savedstate-2.6.2.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;okio-jvm-3.4.0.dex.jar;play-services-ads-22.2.0.dex.jar;play-services-ads-base-22.2.0.dex.jar;play-services-ads-identifier-18.0.0.dex.jar;play-services-ads-lite-22.2.0.dex.jar;play-services-appset-16.0.1.dex.jar;play-services-base-18.5.0.dex.jar;play-services-basement-18.4.0.dex.jar;play-services-cloud-messaging-17.0.1.dex.jar;play-services-location-21.0.1.dex.jar;play-services-maps-18.1.0.dex.jar;play-services-measurement-base-20.1.2.dex.jar;play-services-measurement-sdk-api-20.1.2.dex.jar;play-services-stats-17.0.2.dex.jar;play-services-tasks-18.2.0.dex.jar;print-1.0.0.dex.jar;profileinstaller-1.3.0.dex.jar;room-common-2.2.5.dex.jar;room-runtime-2.2.5.dex.jar;savedstate-1.2.1.dex.jar;sqlite-2.1.0.dex.jar;sqlite-framework-2.1.0.dex.jar;startup-runtime-1.1.1.dex.jar;tracing-1.2.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.1.8.dex.jar;transport-runtime-3.1.8.dex.jar;user-messaging-platform-2.0.0.dex.jar;vectordrawable-1.1.0.dex.jar;vectordrawable-animated-1.1.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.7.0.dex.jar + true + false + true + true + true + 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=;minSdkVersion=23;targetSdkVersion=35 + + + $(BDS)\bin\Artwork\Android\FM_AdaptiveIcon_Background.xml + $(BDS)\bin\Artwork\Android\FM_AdaptiveIcon_Foreground.xml + $(BDS)\bin\Artwork\Android\FM_AdaptiveIcon_Monochrome.xml + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png + $(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_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 + $(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_VectorizedNotificationIcon.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplash.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplashDark.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplashV31.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplashV31Dark.xml + Debug + soapserver;fmx;emshosting;DbxCommonDriver;bindengine;IndyIPCommon;emsclient;FireDACCommonDriver;IndyProtocols;RadiantShapesFmx_Design;IndyIPClient;dbxcds;FmxTeeUI;emsedge;bindcompfmx;FireDACSqliteDriver;DbxClientDriver;soapmidas;fmxFireDAC;dbexpress;inet;DataSnapCommon;dbrtl;FireDACDBXDriver;CustomIPTransport;DBXInterBaseDriver;IndySystem;RadiantShapesFmx;bindcomp;FireDACCommon;emsserverresource;inetstn;RESTBackendComponents;IndyCore;bindcompdbx;rtl;RESTComponents;DBXSqliteDriver;IndyIPServer;dsnapxml;DataSnapClient;DataSnapProviderClient;DataSnapFireDAC;emsclientfiredac;FireDAC;FireDACDSDriver;xmlrtl;tethering;dsnap;CloudService;FMXTee;DataSnapNativeClient;soaprtl;FireDACIBDriver;$(DCC_UsePackage) + activity-1.7.2.dex.jar;annotation-experimental-1.4.1.dex.jar;annotation-jvm-1.8.1.dex.jar;annotations-13.0.dex.jar;appcompat-1.2.0.dex.jar;appcompat-resources-1.2.0.dex.jar;billing-7.1.1.dex.jar;biometric-1.1.0.dex.jar;browser-1.4.0.dex.jar;cloud-messaging.dex.jar;collection-jvm-1.4.2.dex.jar;concurrent-futures-1.1.0.dex.jar;core-1.15.0.dex.jar;core-common-2.2.0.dex.jar;core-ktx-1.15.0.dex.jar;core-runtime-2.2.0.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;error_prone_annotations-2.9.0.dex.jar;exifinterface-1.3.6.dex.jar;firebase-annotations-16.2.0.dex.jar;firebase-common-20.3.1.dex.jar;firebase-components-17.1.0.dex.jar;firebase-datatransport-18.1.7.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-encoders-proto-16.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.1.3.dex.jar;firebase-installations-interop-17.1.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-23.1.2.dex.jar;fmx.dex.jar;fragment-1.2.5.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;kotlin-stdlib-1.8.22.dex.jar;kotlin-stdlib-common-1.8.22.dex.jar;kotlin-stdlib-jdk7-1.8.22.dex.jar;kotlin-stdlib-jdk8-1.8.22.dex.jar;kotlinx-coroutines-android-1.6.4.dex.jar;kotlinx-coroutines-core-jvm-1.6.4.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.6.2.dex.jar;lifecycle-livedata-2.6.2.dex.jar;lifecycle-livedata-core-2.6.2.dex.jar;lifecycle-runtime-2.6.2.dex.jar;lifecycle-service-2.6.2.dex.jar;lifecycle-viewmodel-2.6.2.dex.jar;lifecycle-viewmodel-savedstate-2.6.2.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;okio-jvm-3.4.0.dex.jar;play-services-ads-22.2.0.dex.jar;play-services-ads-base-22.2.0.dex.jar;play-services-ads-identifier-18.0.0.dex.jar;play-services-ads-lite-22.2.0.dex.jar;play-services-appset-16.0.1.dex.jar;play-services-base-18.5.0.dex.jar;play-services-basement-18.4.0.dex.jar;play-services-cloud-messaging-17.0.1.dex.jar;play-services-location-21.0.1.dex.jar;play-services-maps-18.1.0.dex.jar;play-services-measurement-base-20.1.2.dex.jar;play-services-measurement-sdk-api-20.1.2.dex.jar;play-services-stats-17.0.2.dex.jar;play-services-tasks-18.2.0.dex.jar;print-1.0.0.dex.jar;profileinstaller-1.3.0.dex.jar;room-common-2.2.5.dex.jar;room-runtime-2.2.5.dex.jar;savedstate-1.2.1.dex.jar;sqlite-2.1.0.dex.jar;sqlite-framework-2.1.0.dex.jar;startup-runtime-1.1.1.dex.jar;tracing-1.2.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.1.8.dex.jar;transport-runtime-3.1.8.dex.jar;user-messaging-platform-2.0.0.dex.jar;vectordrawable-1.1.0.dex.jar;vectordrawable-animated-1.1.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.7.0.dex.jar + true + false + true + true + true + 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=;minSdkVersion=23;targetSdkVersion=35 + + + soapserver;DataSnapServer;fmx;emshosting;DbxCommonDriver;bindengine;FireDACCommonODBC;emsclient;FireDACCommonDriver;IndyProtocols;RadiantShapesFmx_Design;dbxcds;emsedge;inetdb;FireDACSqliteDriver;DbxClientDriver;FireDACASADriver;soapmidas;dbexpress;FireDACInfxDriver;inet;DataSnapCommon;dbrtl;FireDACOracleDriver;CustomIPTransport;FireDACMSSQLDriver;DataSnapIndy10ServerTransport;DataSnapConnectors;FireDACMongoDBDriver;IndySystem;RadiantShapesFmx;FireDACTDataDriver;bindcomp;FireDACCommon;DataSnapServerMidas;FireDACODBCDriver;emsserverresource;inetstn;RESTBackendComponents;IndyCore;rtl;FireDACMySQLDriver;FireDACADSDriver;RESTComponents;dsnapxml;DataSnapClient;DataSnapFireDAC;emsclientfiredac;FireDACPgDriver;FireDAC;xmlrtl;dsnap;CloudService;FireDACDb2Driver;DataSnapNativeClient;DatasnapConnectorsFreePascal;soaprtl;FireDACIBDriver;$(DCC_UsePackage) + + + Debug + soapserver;DataSnapServer;fmx;emshosting;DbxCommonDriver;bindengine;IndyIPCommon;FireDACCommonODBC;emsclient;FireDACCommonDriver;IndyProtocols;RadiantShapesFmx_Design;IndyIPClient;dbxcds;FmxTeeUI;emsedge;bindcompfmx;DBXFirebirdDriver;inetdb;FireDACSqliteDriver;DbxClientDriver;FireDACASADriver;soapmidas;fmxFireDAC;dbexpress;DBXMySQLDriver;inet;DataSnapCommon;fmxase;dbrtl;FireDACDBXDriver;FireDACOracleDriver;fmxdae;CustomIPTransport;FireDACMSSQLDriver;DataSnapIndy10ServerTransport;DBXInterBaseDriver;FireDACMongoDBDriver;IndySystem;RadiantShapesFmx;FireDACTDataDriver;bindcomp;FireDACCommon;DataSnapServerMidas;FireDACODBCDriver;emsserverresource;inetstn;RESTBackendComponents;IndyCore;bindcompdbx;rtl;FireDACMySQLDriver;RESTComponents;DBXSqliteDriver;IndyIPServer;dsnapxml;DataSnapClient;DataSnapProviderClient;DataSnapFireDAC;emsclientfiredac;FireDACPgDriver;FireDAC;FireDACDSDriver;inetdbxpress;xmlrtl;tethering;dsnap;CloudService;DBXSybaseASADriver;DBXOracleDriver;DBXInformixDriver;fmxobj;FMXTee;DataSnapNativeClient;soaprtl;FireDACIBDriver;$(DCC_UsePackage) + 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;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing the Bluetooth interface + + + Debug + soapserver;DataSnapServer;fmx;emshosting;DbxCommonDriver;bindengine;IndyIPCommon;FireDACCommonODBC;emsclient;FireDACCommonDriver;IndyProtocols;RadiantShapesFmx_Design;IndyIPClient;dbxcds;FmxTeeUI;emsedge;bindcompfmx;DBXFirebirdDriver;inetdb;FireDACSqliteDriver;DbxClientDriver;FireDACASADriver;soapmidas;fmxFireDAC;dbexpress;DBXMySQLDriver;inet;DataSnapCommon;fmxase;dbrtl;FireDACDBXDriver;FireDACOracleDriver;fmxdae;CustomIPTransport;FireDACMSSQLDriver;DataSnapIndy10ServerTransport;DBXInterBaseDriver;FireDACMongoDBDriver;IndySystem;RadiantShapesFmx;FireDACTDataDriver;bindcomp;FireDACCommon;DataSnapServerMidas;FireDACODBCDriver;emsserverresource;inetstn;RESTBackendComponents;IndyCore;bindcompdbx;rtl;FireDACMySQLDriver;RESTComponents;DBXSqliteDriver;IndyIPServer;dsnapxml;DataSnapClient;DataSnapProviderClient;DataSnapFireDAC;emsclientfiredac;FireDACPgDriver;FireDAC;FireDACDSDriver;inetdbxpress;xmlrtl;tethering;dsnap;CloudService;DBXSybaseASADriver;DBXOracleDriver;DBXInformixDriver;fmxobj;FMXTee;DataSnapNativeClient;soaprtl;FireDACIBDriver;$(DCC_UsePackage) + 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;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing the Bluetooth interface + + + Debug + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + soapserver;vclwinx;DataSnapServer;fmx;emshosting;vclie;DbxCommonDriver;bindengine;IndyIPCommon;VCLRESTComponents;DBXMSSQLDriver;FireDACCommonODBC;emsclient;FireDACCommonDriver;appanalytics;IndyProtocols;vclx;RadiantShapesFmx_Design;Skia.Package.RTL;IndyIPClient;dbxcds;vcledge;bindcompvclwinx;FmxTeeUI;emsedge;bindcompfmx;DBXFirebirdDriver;VCLColorTrackers;inetdb;FireDACSqliteDriver;DbxClientDriver;FireDACASADriver;Tee;soapmidas;vclactnband;TeeUI;fmxFireDAC;dbexpress;FireDACInfxDriver;DBXMySQLDriver;VclSmp;inet;DataSnapCommon;vcltouch;fmxase;DBXOdbcDriver;dbrtl;FireDACDBXDriver;FireDACOracleDriver;Skia.Package.FMX;fmxdae;TeeDB;FireDACMSAccDriver;CustomIPTransport;FireDACMSSQLDriver;DataSnapIndy10ServerTransport;DataSnapConnectors;vcldsnap;DBXInterBaseDriver;FireDACMongoDBDriver;IndySystem;RadiantShapesFmx;FireDACTDataDriver;Skia.Package.VCL;vcldb;vclFireDAC;bindcomp;FireDACCommon;DataSnapServerMidas;FireDACODBCDriver;emsserverresource;inetstn;DOSCommandDR;RESTBackendComponents;IndyCore;bindcompdbx;rtl;FireDACMySQLDriver;RaizeComponentsVclDb;FireDACADSDriver;RESTComponents;DBXSqliteDriver;vcl;IndyIPServer;dsnapxml;VirtualTreesDR;DataSnapClient;dsnapcon;DataSnapProviderClient;adortl;DBXSybaseASEDriver;DBXDb2Driver;vclimg;DataSnapFireDAC;emsclientfiredac;FireDACPgDriver;FireDAC;FireDACDSDriver;inetdbxpress;xmlrtl;tethering;bindcompvcl;dsnap;CloudService;DBXSybaseASADriver;DBXOracleDriver;FireDACDb2Driver;DBXInformixDriver;fmxobj;FMXTee;bindcompvclsmp;DataSnapNativeClient;DatasnapConnectorsFreePascal;soaprtl;RaizeComponentsVcl;FireDACIBDriver;$(DCC_UsePackage) + $(BDS)\bin\default_app.manifest + 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 + + + Debug + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + soapserver;vclwinx;DataSnapServer;fmx;emshosting;vclie;DbxCommonDriver;bindengine;IndyIPCommon;VCLRESTComponents;DBXMSSQLDriver;FireDACCommonODBC;emsclient;FireDACCommonDriver;appanalytics;IndyProtocols;vclx;RadiantShapesFmx_Design;IndyIPClient;dbxcds;vcledge;bindcompvclwinx;FmxTeeUI;emsedge;bindcompfmx;DBXFirebirdDriver;VCLColorTrackers;inetdb;FireDACSqliteDriver;DbxClientDriver;FireDACASADriver;Tee;soapmidas;vclactnband;TeeUI;fmxFireDAC;dbexpress;FireDACInfxDriver;DBXMySQLDriver;VclSmp;inet;DataSnapCommon;vcltouch;fmxase;DBXOdbcDriver;dbrtl;FireDACDBXDriver;FireDACOracleDriver;fmxdae;TeeDB;FireDACMSAccDriver;CustomIPTransport;FireDACMSSQLDriver;DataSnapIndy10ServerTransport;DataSnapConnectors;vcldsnap;DBXInterBaseDriver;FireDACMongoDBDriver;IndySystem;RadiantShapesFmx;FireDACTDataDriver;Skia.Package.VCL;vcldb;vclFireDAC;bindcomp;FireDACCommon;DataSnapServerMidas;FireDACODBCDriver;emsserverresource;inetstn;DOSCommandDR;RESTBackendComponents;IndyCore;bindcompdbx;rtl;FireDACMySQLDriver;RaizeComponentsVclDb;FireDACADSDriver;RESTComponents;DBXSqliteDriver;vcl;IndyIPServer;dsnapxml;VirtualTreesDR;DataSnapClient;dsnapcon;DataSnapProviderClient;adortl;DBXSybaseASEDriver;DBXDb2Driver;vclimg;DataSnapFireDAC;emsclientfiredac;FireDACPgDriver;FireDAC;FireDACDSDriver;inetdbxpress;xmlrtl;tethering;bindcompvcl;dsnap;CloudService;DBXSybaseASADriver;DBXOracleDriver;FireDACDb2Driver;DBXInformixDriver;fmxobj;FMXTee;bindcompvclsmp;DataSnapNativeClient;DatasnapConnectorsFreePascal;soaprtl;RaizeComponentsVcl;FireDACIBDriver;$(DCC_UsePackage) + $(BDS)\bin\default_app.manifest + 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 + + + Debug + soapserver;fmx;emshosting;DbxCommonDriver;bindengine;IndyIPCommon;emsclient;FireDACCommonDriver;IndyProtocols;RadiantShapesFmx_Design;IndyIPClient;dbxcds;FmxTeeUI;emsedge;bindcompfmx;FireDACSqliteDriver;DbxClientDriver;soapmidas;fmxFireDAC;dbexpress;inet;DataSnapCommon;fmxase;dbrtl;FireDACDBXDriver;CustomIPTransport;DBXInterBaseDriver;IndySystem;RadiantShapesFmx;bindcomp;FireDACCommon;emsserverresource;inetstn;RESTBackendComponents;IndyCore;bindcompdbx;rtl;RESTComponents;DBXSqliteDriver;IndyIPServer;dsnapxml;DataSnapClient;DataSnapProviderClient;DataSnapFireDAC;emsclientfiredac;FireDAC;FireDACDSDriver;xmlrtl;tethering;dsnap;CloudService;FMXTee;DataSnapNativeClient;soaprtl;FireDACIBDriver;$(DCC_UsePackage) + $(MSBuildProjectName) + true + 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 + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.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_NotificationIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.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_LaunchImage_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_60x60.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_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + + + soapserver;fmx;emshosting;DbxCommonDriver;bindengine;IndyIPCommon;emsclient;FireDACCommonDriver;IndyProtocols;RadiantShapesFmx_Design;IndyIPClient;dbxcds;FmxTeeUI;emsedge;bindcompfmx;FireDACSqliteDriver;DbxClientDriver;soapmidas;fmxFireDAC;dbexpress;inet;DataSnapCommon;fmxase;dbrtl;FireDACDBXDriver;CustomIPTransport;DBXInterBaseDriver;IndySystem;RadiantShapesFmx;bindcomp;FireDACCommon;emsserverresource;inetstn;RESTBackendComponents;IndyCore;bindcompdbx;rtl;RESTComponents;DBXSqliteDriver;IndyIPServer;dsnapxml;DataSnapClient;DataSnapProviderClient;DataSnapFireDAC;emsclientfiredac;FireDAC;FireDACDSDriver;xmlrtl;tethering;dsnap;CloudService;FMXTee;DataSnapNativeClient;soaprtl;FireDACIBDriver;$(DCC_UsePackage) + true + 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 + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.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_NotificationIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.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_LaunchImage_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_60x60.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_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + + + true + true + DEBUG;$(DCC_Define) + true + true + false + true + true + + + PerMonitorV2 + false + true + 1033 + + + PerMonitorV2 + + + 0 + RELEASE;$(DCC_Define) + false + 0 + + + PerMonitorV2 + + + PerMonitorV2 + + + + MainSource + + +
Form32
+ fmx +
+ + + + + + + + + + + + Base + + + Cfg_1 + Base + + + Cfg_2 + Base + +
+ + Delphi.Personality.12 + Application + + + + CreateAsInterfaceFmxDemo.dpr + + + + + True + True + True + False + True + True + True + True + False + True + True + + + 12 + + + + +
diff --git a/Samples/CreateAsInterface/CreateAsInterfaceFmxMain.fmx b/Samples/CreateAsInterface/CreateAsInterfaceFmxMain.fmx new file mode 100644 index 00000000..8693423d --- /dev/null +++ b/Samples/CreateAsInterface/CreateAsInterfaceFmxMain.fmx @@ -0,0 +1,19 @@ +object Form32: TForm32 + Left = 0 + Top = 0 + Caption = 'Skia4Delphi Proposal' + ClientHeight = 366 + ClientWidth = 570 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + DesignerMasterStyle = 0 + object SkPaintBox1: TSkPaintBox + Position.X = 96.000000000000000000 + Position.Y = 48.000000000000000000 + Size.Width = 281.000000000000000000 + Size.Height = 217.000000000000000000 + Size.PlatformDefault = False + OnDraw = SkPaintBox1Draw + end +end diff --git a/Samples/CreateAsInterface/CreateAsInterfaceFmxMain.pas b/Samples/CreateAsInterface/CreateAsInterfaceFmxMain.pas new file mode 100644 index 00000000..57114cd7 --- /dev/null +++ b/Samples/CreateAsInterface/CreateAsInterfaceFmxMain.pas @@ -0,0 +1,38 @@ +unit CreateAsInterfaceFmxMain; + +interface + +uses + System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, + FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, + System.Skia, FMX.Skia, FMX.Controls.Presentation, FMX.StdCtrls; + +type + TForm32 = class(TForm) + SkPaintBox1: TSkPaintBox; + procedure SkPaintBox1Draw(ASender: TObject; const ACanvas: ISkCanvas; + const ADest: TRectF; const AOpacity: Single); + private + { Private declarations } + public + { Public declarations } + end; + +var + Form32: TForm32; + +implementation + +{$R *.fmx} + +procedure TForm32.SkPaintBox1Draw(ASender: TObject; + const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); +begin + var family := TSkTypeface.MakeFromName('Segoe Script', TSkFontStyle.Italic); + var font := TSkFont.Make(family, 24); + var paint := TSkPaint.Make(); + paint.Color := TAlphaColors.Blueviolet; + ACanvas.DrawSimpleText('.Make',2,30,font,paint); +end; + +end. diff --git a/Samples/CreateAsInterface/CreateAsInterfaceVclDemo.dpr b/Samples/CreateAsInterface/CreateAsInterfaceVclDemo.dpr new file mode 100644 index 00000000..9af7c954 --- /dev/null +++ b/Samples/CreateAsInterface/CreateAsInterfaceVclDemo.dpr @@ -0,0 +1,17 @@ +program CreateAsInterfaceVclDemo; + +uses + Vcl.Forms, + CreateAsInterfaceVclMain in 'CreateAsInterfaceVclMain.pas' {SkIntfDemoMain}, + System.Skia.API in '..\..\Source\System.Skia.API.pas', + System.Skia in '..\..\Source\System.Skia.pas', + Vcl.Skia in '..\..\Source\VCL\Vcl.Skia.pas'; + +{$R *.res} + +begin + Application.Initialize; + Application.MainFormOnTaskbar := True; + Application.CreateForm(TSkIntfDemoMain, SkIntfDemoMain); + Application.Run; +end. diff --git a/Samples/CreateAsInterface/CreateAsInterfaceVclDemo.dproj b/Samples/CreateAsInterface/CreateAsInterfaceVclDemo.dproj new file mode 100644 index 00000000..050460e0 --- /dev/null +++ b/Samples/CreateAsInterface/CreateAsInterfaceVclDemo.dproj @@ -0,0 +1,158 @@ + + + True + Application + Debug + VCL + CreateAsInterfaceVclDemo.dpr + Win32 + {FCB99591-6739-45CE-9331-E46C62D778C0} + CreateAsInterfaceVclDemo + 20.3 + 3 + + + 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 + + + CreateAsInterfaceVclDemo + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) + $(BDS)\bin\delphi_PROJECTICON.ico + + + Debug + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + soapserver;vclwinx;DataSnapServer;fmx;emshosting;vclie;DbxCommonDriver;bindengine;IndyIPCommon;VCLRESTComponents;DBXMSSQLDriver;FireDACCommonODBC;emsclient;FireDACCommonDriver;appanalytics;IndyProtocols;vclx;Skia.Package.RTL;RadiantShapesFmx_Design;IndyIPClient;dbxcds;vcledge;bindcompvclwinx;FmxTeeUI;emsedge;bindcompfmx;DBXFirebirdDriver;VCLColorTrackers;inetdb;FireDACSqliteDriver;DbxClientDriver;FireDACASADriver;Tee;soapmidas;vclactnband;TeeUI;fmxFireDAC;dbexpress;FireDACInfxDriver;DBXMySQLDriver;VclSmp;inet;DataSnapCommon;vcltouch;fmxase;DBXOdbcDriver;dbrtl;FireDACDBXDriver;FireDACOracleDriver;Skia.Package.FMX;fmxdae;TeeDB;FireDACMSAccDriver;CustomIPTransport;FireDACMSSQLDriver;DataSnapIndy10ServerTransport;DataSnapConnectors;vcldsnap;DBXInterBaseDriver;FireDACMongoDBDriver;IndySystem;RadiantShapesFmx;FireDACTDataDriver;Skia.Package.VCL;vcldb;vclFireDAC;bindcomp;FireDACCommon;DataSnapServerMidas;FireDACODBCDriver;emsserverresource;inetstn;DOSCommandDR;RESTBackendComponents;IndyCore;bindcompdbx;rtl;FireDACMySQLDriver;RaizeComponentsVclDb;FireDACADSDriver;RESTComponents;DBXSqliteDriver;vcl;IndyIPServer;dsnapxml;VirtualTreesDR;DataSnapClient;dsnapcon;DataSnapProviderClient;adortl;DBXSybaseASEDriver;DBXDb2Driver;vclimg;DataSnapFireDAC;emsclientfiredac;FireDACPgDriver;FireDAC;FireDACDSDriver;inetdbxpress;xmlrtl;tethering;bindcompvcl;dsnap;CloudService;DBXSybaseASADriver;DBXOracleDriver;FireDACDb2Driver;DBXInformixDriver;fmxobj;FMXTee;bindcompvclsmp;DataSnapNativeClient;DatasnapConnectorsFreePascal;soaprtl;RaizeComponentsVcl;FireDACIBDriver;$(DCC_UsePackage) + $(BDS)\bin\default_app.manifest + 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 + + + Debug + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + soapserver;vclwinx;DataSnapServer;fmx;emshosting;vclie;DbxCommonDriver;bindengine;IndyIPCommon;VCLRESTComponents;DBXMSSQLDriver;FireDACCommonODBC;emsclient;FireDACCommonDriver;appanalytics;IndyProtocols;vclx;RadiantShapesFmx_Design;IndyIPClient;dbxcds;vcledge;bindcompvclwinx;FmxTeeUI;emsedge;bindcompfmx;DBXFirebirdDriver;VCLColorTrackers;inetdb;FireDACSqliteDriver;DbxClientDriver;FireDACASADriver;Tee;soapmidas;vclactnband;TeeUI;fmxFireDAC;dbexpress;FireDACInfxDriver;DBXMySQLDriver;VclSmp;inet;DataSnapCommon;vcltouch;fmxase;DBXOdbcDriver;dbrtl;FireDACDBXDriver;FireDACOracleDriver;fmxdae;TeeDB;FireDACMSAccDriver;CustomIPTransport;FireDACMSSQLDriver;DataSnapIndy10ServerTransport;DataSnapConnectors;vcldsnap;DBXInterBaseDriver;FireDACMongoDBDriver;IndySystem;RadiantShapesFmx;FireDACTDataDriver;Skia.Package.VCL;vcldb;vclFireDAC;bindcomp;FireDACCommon;DataSnapServerMidas;FireDACODBCDriver;emsserverresource;inetstn;DOSCommandDR;RESTBackendComponents;IndyCore;bindcompdbx;rtl;FireDACMySQLDriver;RaizeComponentsVclDb;FireDACADSDriver;RESTComponents;DBXSqliteDriver;vcl;IndyIPServer;dsnapxml;VirtualTreesDR;DataSnapClient;dsnapcon;DataSnapProviderClient;adortl;DBXSybaseASEDriver;DBXDb2Driver;vclimg;DataSnapFireDAC;emsclientfiredac;FireDACPgDriver;FireDAC;FireDACDSDriver;inetdbxpress;xmlrtl;tethering;bindcompvcl;dsnap;CloudService;DBXSybaseASADriver;DBXOracleDriver;FireDACDb2Driver;DBXInformixDriver;fmxobj;FMXTee;bindcompvclsmp;DataSnapNativeClient;DatasnapConnectorsFreePascal;soaprtl;RaizeComponentsVcl;FireDACIBDriver;$(DCC_UsePackage) + $(BDS)\bin\default_app.manifest + 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 + + + true + true + DEBUG;$(DCC_Define) + true + true + false + true + true + + + PerMonitorV2 + false + + + PerMonitorV2 + + + 0 + RELEASE;$(DCC_Define) + false + 0 + + + PerMonitorV2 + + + PerMonitorV2 + + + + MainSource + + +
SkIntfDemoMain
+ dfm +
+ + + + + + Base + + + Cfg_1 + Base + + + Cfg_2 + Base + +
+ + Delphi.Personality.12 + Application + + + + CreateAsInterfaceVclDemo.dpr + + + + True + True + + + 12 + + + + +
diff --git a/Samples/CreateAsInterface/CreateAsInterfaceVclMain.dfm b/Samples/CreateAsInterface/CreateAsInterfaceVclMain.dfm new file mode 100644 index 00000000..b1ad8921 --- /dev/null +++ b/Samples/CreateAsInterface/CreateAsInterfaceVclMain.dfm @@ -0,0 +1,30 @@ +object SkIntfDemoMain: TSkIntfDemoMain + Left = 0 + Top = 0 + Margins.Left = 5 + Margins.Top = 5 + Margins.Right = 5 + Margins.Bottom = 5 + Caption = 'Skia4Delphi Proposal' + ClientHeight = 405 + ClientWidth = 532 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -18 + Font.Name = 'Segoe UI' + Font.Style = [] + PixelsPerInch = 144 + TextHeight = 25 + object SkPaintBox1: TSkPaintBox + Left = 10 + Top = 10 + Width = 385 + Height = 277 + Margins.Left = 5 + Margins.Top = 5 + Margins.Right = 5 + Margins.Bottom = 5 + OnDraw = SkPaintBox1Draw + end +end diff --git a/Samples/CreateAsInterface/CreateAsInterfaceVclMain.pas b/Samples/CreateAsInterface/CreateAsInterfaceVclMain.pas new file mode 100644 index 00000000..5778faad --- /dev/null +++ b/Samples/CreateAsInterface/CreateAsInterfaceVclMain.pas @@ -0,0 +1,37 @@ +unit CreateAsInterfaceVclMain; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, System.Skia, Vcl.Skia, System.Types, System.UITypes; + +type + TSkIntfDemoMain = class(TForm) + SkPaintBox1: TSkPaintBox; + procedure SkPaintBox1Draw(ASender: TObject; const ACanvas: ISkCanvas; + const ADest: TRectF; const AOpacity: Single); + private + { Private declarations } + public + { Public declarations } + end; + +var + SkIntfDemoMain: TSkIntfDemoMain; + +implementation + +{$R *.dfm} + +procedure TSkIntfDemoMain.SkPaintBox1Draw(ASender: TObject; + const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); +begin + var family := TSkTypeface.MakeFromName('Segoe Script', TSkFontStyle.Italic); + var font := TSkFont.Make(family, 24); + var paint := TSkPaint.Make(); + paint.Color := TAlphaColors.Blueviolet; + ACanvas.DrawSimpleText('.Make',2,30,font,paint); +end; + +end. diff --git a/Samples/CreateAsInterface/CreateAsInterfaces.groupproj b/Samples/CreateAsInterface/CreateAsInterfaces.groupproj new file mode 100644 index 00000000..760a574d --- /dev/null +++ b/Samples/CreateAsInterface/CreateAsInterfaces.groupproj @@ -0,0 +1,48 @@ + + + {36AB3BD2-8480-405E-9C0C-C24E62C7DB4F} + + + + + + + + + + + Default.Personality.12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/CreateAsInterface/readme.md b/Samples/CreateAsInterface/readme.md new file mode 100644 index 00000000..59fbdcbe --- /dev/null +++ b/Samples/CreateAsInterface/readme.md @@ -0,0 +1,146 @@ +# Skia4Delphi Proposal & Demo to CreateAsInterface with `.Make` + +Most of the Skia API is exposed as interfaces. This takes advantage of reference counting, which is nice to have. Usually, the class has limited public methods and most functionality is exposed through the interface. Here is the declaration for `TSkPaint` and `ISkPaint` for example. + +**Update:** Changed the proposed method name to **`.Make`** instead of *`.CreateAsInterface`* per [viniciusfbb suggestion](https://github.com/skia4delphi/skia4delphi/pull/408#issuecomment-2787132333). + +```Delphi +type + { ISkPaint } + + ISkPaint = interface(ISkObject) + ['{C95825F8-0D51-4BCE-8945-84AFE6264213}'] + function GetAlpha: Byte; + function GetAlphaF: Single; + + { ... 50 other PUBLIC members ...} + + property StrokeWidth: Single read GetStrokeWidth write SetStrokeWidth; + property Style: TSkPaintStyle read GetStyle write SetStyle; + end; + + { TSkPaint } + + TSkPaint = class(TSkObject, ISkPaint) + strict private + function GetAlpha: Byte; + function GetAlphaF: Single; + + { ... 34 other STRICT PRIVATE members ... } + + procedure SetStrokeWidth(const AValue: Single); + procedure SetStyle(const AValue: TSkPaintStyle); + public + constructor Create; overload; + constructor Create(const APaint: ISkPaint); overload; + constructor Create(const AStyle: TSkPaintStyle); overload; + end; + ``` + +This is fine for *traditional* variable declarations: + +```Delphi +var + paint: ISkPaint; +begin + paint := TSkPaint.Create; + paint.Color := TAlphaColors.Darkorange; +end; +``` + +Unfortunately, it is *incompatible* with **type inferance**: + +```Delphi +begin + var inferred := TSkPaint.Create; + inferred.Color := TAlphaColors.Darkorange; // E2003 Undeclared identifier: 'Color' +end; +``` + +Forces the more verbose form of inline variable declaration: + +```Delphi +begin + var explicit: ISkPaint := TSkPaint.Create(); + explicit.Color := TAlphaColors.Darkorange; +end; +``` + +The proposed `.Make` methods fix this: + +```Delphi +begin + var better := TSkPaint.Make(); + better.Color := TAlphaColors.Darkorange; +end; +``` + +Simply duplicate the existing constructors: + +```Delphi +public + constructor Create; overload; + constructor Create(const APaint: ISkPaint); overload; + constructor Create(const AStyle: TSkPaintStyle); overload; +end; +``` + +Making as a `class function` with the name `Make` using the same arguments, and returning the `interface`. Finally `deprictate` the constructor. + +```Delphi +public + class function Make: ISkPaint; overload; static; + class function Make(const AStyle: TSkPaintStyle): ISkPaint; overload; static; + class function MakeCopy(const APaint: ISkPaint): ISkPaint; static; + constructor Create; overload; deprecated 'Use TSkPaint.Make instead.'; + constructor Create(const APaint: ISkPaint); overload; deprecated 'Use TSkPaint.MakeCopy instead.'; + constructor Create(const AStyle: TSkPaintStyle); overload; deprecated 'Use TSkPaint.Make instead.'; +end; +``` + +The implementation calls the existing constructors, but since `Result` is explicitly the Interface, the code works as expected: + +```Delphi +implementation + +{ TSkPaint } + +class function TSkPaint.Make: ISkPaint; +begin + Result := TSkPaint.Create(); +end; + +class function TSkPaint.MakeCopy(const APaint: ISkPaint): ISkPaint; +begin + Result := TSkPaint.Create(APaint); +end; + +class function TSkPaint.Make(const AStyle: TSkPaintStyle): ISkPaint; +begin + Result := TSkPaint.Create(AStyle); +end; +``` + +Type inference is as preferable. Beyond less typing it makes code more maintainable (type only needs to be changed in one place) and reduces errors resulting from mismatched types and constructors. The easier it is to take advantage of this feature in Delphi the better. + +## Modified classes + +* TSkColorFilter - For color transformations +* TSkFont - Font rendering and text metrics handling +* TSkPaint - Graphics styling configuration including colors, strokes, and effects +* TSkParagraphBuilder - A builder class for creating formatted text paragraphs with advanced text layout features like styles, fonts, and text decorations +* TSkParagraphStyle - Styling configuration for paragraph layouts +* TSkPath - Vector path definition and manipulation +* TSkPathBuilder - Used for building paths incrementally +* TSkPathMeasure - For measuring and extracting information about paths +* TSkPictureRecorder - Used for recording drawing commands +* TSkPixmap - For pixel buffer access +* TSkRegion - Represents a 2D set of pixels for clipping or hit-testing +* TSkRoundRect - Used for rounded rectangles +* TSkRuntimeBlenderBuilder - A builder class for creating custom blend modes at runtime, enabling custom pixel blending operations +* TSkRuntimeShaderBuilder - A builder class for creating custom shaders at runtime, allowing dynamic generation of graphical effects and patterns +* TSkShaper - Text shaping engine for complex script rendering +* TSkString - String handling utilities for Skia +* TSkStrutStyle - Text layout configuration for line spacing and alignment +* TSkTextStyle - Text styling configuration for paragraphs +* TSkUnicode - Unicode text processing and manipulation utilities for international text handling diff --git a/Source/FMX/FMX.Skia.Canvas.pas b/Source/FMX/FMX.Skia.Canvas.pas index 03da75cf..58f76ee7 100644 --- a/Source/FMX/FMX.Skia.Canvas.pas +++ b/Source/FMX/FMX.Skia.Canvas.pas @@ -1869,7 +1869,7 @@ function TSkCanvasCustom.BeginPaintWithBrush(const ABrush: TBrush; ABrushData.Brush := ABrushData.Brush.Resource.Brush; if (ABrushData.Brush = nil) or (ABrushData.Brush.Kind = TBrushKind.None) then Exit(nil); - ABrushData.Paint := TSkPaint.Create(TSkPaintStyle.Fill); + ABrushData.Paint := TSkPaint.Make(TSkPaintStyle.Fill); BeginPaint(ARect, AOpacity, ABrushData); Result := TSkPaint(ABrushData.Paint); end; @@ -1896,8 +1896,8 @@ function TSkCanvasCustom.BeginPaintWithStrokeBrush(const ABrush: TStrokeBrush; end; if (ABrushData.Brush = nil) or (ABrushData.Brush.Kind = TBrushKind.None) or (SameValue(LFinalStrokeBrush.Thickness, 0, TEpsilon.Position)) then Exit(nil); - ABrushData.Paint := TSkPaint.Create(TSkPaintStyle.Stroke); - BeginPaint(ARect, AOpacity, ABrushData); + ABrushData.Paint := TSkPaint.Make(TSkPaintStyle.Stroke); + BeginPaint(ARect, AOpacity, ABrushData); ABrushData.Paint.StrokeCap := StrokeCap[LFinalStrokeBrush.Cap]; ABrushData.Paint.StrokeJoin := StrokeJoin[LFinalStrokeBrush.Join]; ABrushData.Paint.StrokeWidth := LFinalStrokeBrush.Thickness; @@ -1976,7 +1976,7 @@ function TSkCanvasCustom.DoBeginScene({$IF CompilerVersion < 35}const {$ENDIF}AC begin if Length(AClipRects) > 1 then begin - LPathBuilder := TSkPathBuilder.Create; + LPathBuilder := TSkPathBuilder.Make; for I := 0 to Length(AClipRects) - 1 do LPathBuilder.AddRect(AClipRects[I]); ACanvas.ClipPath(LPathBuilder.Snapshot, TSkClipOp.Intersect, True); @@ -2036,7 +2036,7 @@ procedure TSkCanvasCustom.DoDrawBitmap(const ABitmap: FMX.Graphics.TBitmap; LSrcRect := ASrcRect * TRectF.Create(0, 0, ABitmap.Width, ABitmap.Height); if ABitmap.HandleAllocated and (not LSrcRect.IsEmpty) and (not ADestRect.IsEmpty) then begin - LPaint := TSkPaint.Create; + LPaint := TSkPaint.Make; LPaint.AlphaF := AOpacity; {$IFDEF MODULATE_CANVAS} if FModulateColor <> TAlphaColors.White then @@ -2301,7 +2301,7 @@ function TSkCanvasCustom.PtInPath(const APoint: TPointF; LPaint: ISkPaint; LPath: ISkPath; begin - LPaint := TSkPaint.Create; + LPaint := TSkPaint.Make; LPath := LPaint.GetFillPath(APath.ToSkPath); Result := (LPath <> nil) and (LPath.Contains(APoint.X, APoint.Y)); end; @@ -3400,7 +3400,7 @@ procedure TSkTextLayout.UpdateParagraph; function CreateTextStyle(const AAttribute: TTextAttribute): ISkTextStyle; begin - Result := TSkTextStyle.Create; + Result := TSkTextStyle.Make; if AAttribute.Font <> nil then InitializeTextStyle(Result, AAttribute.Font, AAttribute.Color) else @@ -3409,7 +3409,7 @@ procedure TSkTextLayout.UpdateParagraph; function CreateDefaultTextStyle: ISkTextStyle; begin - Result := TSkTextStyle.Create; + Result := TSkTextStyle.Make; InitializeTextStyle(Result, Font, Color); end; @@ -3421,7 +3421,7 @@ procedure TSkTextLayout.UpdateParagraph; LAttribute: TTextAttributedRange; LMinFontSize: Single; begin - Result := TSkParagraphStyle.Create; + Result := TSkParagraphStyle.Make; if RightToLeft then Result.TextDirection := TSkTextDirection.RightToLeft; if Trimming in [TTextTrimming.Character, TTextTrimming.Word] then @@ -3492,8 +3492,8 @@ procedure TSkTextLayout.UpdateParagraph; FOpacity := Opacity; LAttributes := GetNormalizedAttributes(ASubText, ASubTextPosition); try - LBuilder := TSkParagraphBuilder.Create(CreateParagraphStyle(LAttributes, AMaxLines), - TSkDefaultProviders.TypefaceFont); + LBuilder := TSkParagraphBuilder.Make(CreateParagraphStyle(LAttributes, AMaxLines), + TSkDefaultProviders.TypefaceFont); LLastAttributeEndIndex := 0; for LAttribute in LAttributes do begin @@ -3668,7 +3668,7 @@ function TSkTextLayout.TGraphemesMap.CreateGraphemesMapping( SetLength(Result, Length(AText) + 1); if AText <> '' then begin - LUnicode := TSkUnicode.Create; + LUnicode := TSkUnicode.Make; LGraphemesIterator := LUnicode.GetBreakIterator(TSkBreakType.Graphemes, AText); LGraphemesIterator.MoveNext; I := 0; diff --git a/Source/FMX/FMX.Skia.pas b/Source/FMX/FMX.Skia.pas index cec0b3b6..c1450934 100644 --- a/Source/FMX/FMX.Skia.pas +++ b/Source/FMX/FMX.Skia.pas @@ -1459,7 +1459,7 @@ procedure DrawDesignBorder(const ACanvas: ISkCanvas; ADest: TRectF; const AOpaci var LPaint: ISkPaint; begin - LPaint := TSkPaint.Create(TSkPaintStyle.Stroke); + LPaint := TSkPaint.Make(TSkPaintStyle.Stroke); LPaint.Color := DesignBorderColor; LPaint.AlphaF := AOpacity; LPaint.StrokeWidth := 1; @@ -1714,7 +1714,7 @@ function TSkPathDataHelper.ToSkPath: ISkPath; I: Integer; LPathBuilder: ISkPathBuilder; begin - LPathBuilder := TSkPathBuilder.Create(TSkPathFillType.EvenOdd); + LPathBuilder := TSkPathBuilder.Make(TSkPathFillType.EvenOdd); I := 0; while I < Count do begin @@ -2346,22 +2346,22 @@ procedure TSkSvgBrush.Render(const ACanvas: ISkCanvas; const ADestRect: TRectF; LCanvas: ISkCanvas; LPaint: ISkPaint; begin - LPictureRecorder := TSkPictureRecorder.Create; + LPictureRecorder := TSkPictureRecorder.Make; LCanvas := LPictureRecorder.BeginRecording(AWrappedDest.Width, AWrappedDest.Height); if AIntrinsicSize.IsZero then begin if AWrapMode <> TSkSvgWrapMode.Default then begin LCanvas.Scale(AWrappedDest.Width / ASvgRect.Width, AWrappedDest.Height / ASvgRect.Height); - ADOM.Root.Width := TSkSVGLength.Create(ASvgRect.Width, TSkSVGLengthUnit.Pixel); + ADOM.Root.Width := TSkSVGLength.Create(ASvgRect.Width, TSkSVGLengthUnit.Pixel); ADOM.Root.Height := TSkSVGLength.Create(ASvgRect.Height, TSkSVGLengthUnit.Pixel); end; end else LCanvas.Scale(AWrappedDest.Width / ASvgRect.Width, AWrappedDest.Height / ASvgRect.Height); ADOM.Render(LCanvas); - LPicture := LPictureRecorder.FinishRecording; - LPaint := TSkPaint.Create; + LPicture := LPictureRecorder.FinishRecording; + LPaint := TSkPaint.Make; if FGrayScale then LPaint.ColorFilter := TSkColorFilter.MakeMatrix(TSkColorMatrix.CreateSaturation(0)) else if FOverrideColor <> TAlphaColors.Null then @@ -3782,7 +3782,7 @@ procedure TSkDefaultAnimationCodec.Render(const ACanvas: ISkCanvas; LPaint := nil else begin - LPaint := TSkPaint.Create; + LPaint := TSkPaint.Make; LPaint.AlphaF := AOpacity; end; case Quality of @@ -5401,9 +5401,9 @@ procedure TSkLabel.Draw(const ACanvas: ISkCanvas; const ADest: TRectF; LLastRect: TRectF; LLastColor: TAlphaColor; begin - LPictureRecorder := TSkPictureRecorder.Create; + LPictureRecorder := TSkPictureRecorder.Make; LCanvas := LPictureRecorder.BeginRecording(ADest); - LPaint := TSkPaint.Create; + LPaint := TSkPaint.Make; LPaint.AntiAlias := True; LTextEndIndex := 0; LRects := nil; @@ -5673,7 +5673,7 @@ function TSkLabel.GetParagraph: ISkParagraph; begin if (ADecorations.StrokeColor <> TAlphaColors.Null) and not SameValue(ADecorations.Thickness, 0, TEpsilon.Position) then begin - LPaint := TSkPaint.Create(TSkPaintStyle.Stroke); + LPaint := TSkPaint.Make(TSkPaintStyle.Stroke); LPaint.Color := ADecorations.StrokeColor; LPaint.StrokeWidth := (ADecorations.Thickness / 2) * (ATextStyle.FontSize / 14); ATextStyle.SetForegroundColor(LPaint); @@ -5690,7 +5690,7 @@ function TSkLabel.GetParagraph: ISkParagraph; const ADefaultTextStyle: ISkTextStyle; const ADrawKind: TDrawKind): ISkTextStyle; begin - Result := TSkTextStyle.Create; + Result := TSkTextStyle.Make; if TStyledSetting.FontColor in AWordsItem.StyledSettings then Result.Color := ResultingTextSettings.FontColor else @@ -5725,7 +5725,7 @@ function TSkLabel.GetParagraph: ISkParagraph; function CreateDefaultTextStyle(const ADrawKind: TDrawKind): ISkTextStyle; begin - Result := TSkTextStyle.Create; + Result := TSkTextStyle.Make; Result.Color := ResultingTextSettings.FontColor; Result.FontFamilies := GetFontFamilies(ResultingTextSettings.Font.Families); Result.FontSize := GetFontSize(ResultingTextSettings.Font.Size); @@ -5741,7 +5741,7 @@ function TSkLabel.GetParagraph: ISkParagraph; const SkTextAlign: array[TSkTextHorzAlign] of TSkTextAlign = (TSkTextAlign.Center, TSkTextAlign.Start, TSkTextAlign.Terminate, TSkTextAlign.Justify); begin - Result := TSkParagraphStyle.Create; + Result := TSkParagraphStyle.Make; FLastFillTextFlags := FillTextFlags; if TFillTextFlag.RightToLeft in FLastFillTextFlags then Result.TextDirection := TSkTextDirection.RightToLeft; @@ -5764,7 +5764,7 @@ function TSkLabel.GetParagraph: ISkParagraph; begin LFontBehavior := nil; LDefaultTextStyle := CreateDefaultTextStyle(ADrawKind); - LBuilder := TSkParagraphBuilder.Create(CreateParagraphStyle(LDefaultTextStyle), TSkDefaultProviders.TypefaceFont); + LBuilder := TSkParagraphBuilder.Make(CreateParagraphStyle(LDefaultTextStyle), TSkDefaultProviders.TypefaceFont); for I := 0 to FWords.Count- 1 do begin if FWords[I].Text = '' then diff --git a/Source/System.Skia.pas b/Source/System.Skia.pas index d1ac52df..63c6a7d2 100644 --- a/Source/System.Skia.pas +++ b/Source/System.Skia.pas @@ -1572,12 +1572,12 @@ TSkColorSpace = class(TSkNonVirtualReferenceCounted, ISkColorSpace) function MakeLinearGamma: ISkColorSpace; function MakeSRGBGamma: ISkColorSpace; function ToProfile: ISkColorSpaceICCProfile; - function ToXyz(out ADest: TSkColorSpaceXyz): Boolean; - class function Make(const AProfile: ISkColorSpaceICCProfile): ISkColorSpace; static; - class function MakeRGB(const ATransferFunction: TSkColorSpaceTransferFunction; const AToXyzD50: TSkColorSpaceXyz): ISkColorSpace; static; - class function MakeSRGB: ISkColorSpace; static; - class function MakeSRGBLinear: ISkColorSpace; static; - class procedure __RefHandle(const AHandle: sk_handle_t); override; + function ToXyz(out ADest: TSkColorSpaceXyz): Boolean; + class function Make(const AProfile: ISkColorSpaceICCProfile): ISkColorSpace; static; inline; + class function MakeRGB(const ATransferFunction: TSkColorSpaceTransferFunction; const AToXyzD50: TSkColorSpaceXyz): ISkColorSpace; static; inline; + class function MakeSRGB: ISkColorSpace; static; inline; + class function MakeSRGBLinear: ISkColorSpace; static; inline; + class procedure __RefHandle(const AHandle: sk_handle_t); override; class procedure __UnrefHandle(const AHandle: sk_handle_t); override; end; @@ -1742,9 +1742,11 @@ TSkFont = class(TSkObject, ISkFont) function UnicharsToGlyphs(const AUnichars: TArray): TArray; class procedure path_proc(const path: sk_path_t; const matrix: psk_matrix_t; context: Pointer); cdecl; static; public - constructor Create(ATypeface: ISkTypeface = nil; const ASize: Single = 12; const AScaleX: Single = 1; const ASkewX: Single = 0); overload; - constructor Create(const AFont: ISkFont); overload; - class procedure __DestroyHandle(const AHandle: sk_handle_t); override; + constructor Create(ATypeface: ISkTypeface = nil; const ASize: Single = 12; const AScaleX: Single = 1; const ASkewX: Single = 0); overload; deprecated 'Use TSkFont.Make instead.'; + constructor Create(const AFont: ISkFont); overload; deprecated 'Use TSkFont.Make instead.'; + class function Make(ATypeface: ISkTypeface = nil; const ASize: Single = 12; const AScaleX: Single = 1; const ASkewX: Single = 0): ISkFont; overload; inline; + class function MakeCopy(const AFont: ISkFont): ISkFont; overload; inline; + class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; {$HPPEMIT END '#define SkFont(...) __SkCreate(TSkFont, ISkFont, __VA_ARGS__)'} @@ -2057,13 +2059,16 @@ TSkPaint = class(TSkObject, ISkPaint) procedure SetStrokeJoin(const AValue: TSkStrokeJoin); procedure SetStrokeMiter(const AValue: Single); procedure SetStrokeWidth(const AValue: Single); - procedure SetStyle(const AValue: TSkPaintStyle); - public - constructor Create; overload; - constructor Create(const APaint: ISkPaint); overload; - constructor Create(const AStyle: TSkPaintStyle); overload; - class procedure __DestroyHandle(const AHandle: sk_handle_t); override; - end; + procedure SetStyle(const AValue: TSkPaintStyle); + public + constructor Create; overload; deprecated 'Use TSkPaint.Make instead.'; + constructor Create(const APaint: ISkPaint); overload; deprecated 'Use TSkPaint.MakeCopy instead.'; + constructor Create(const AStyle: TSkPaintStyle); overload; deprecated 'Use TSkPaint.Make instead.'; + class function Make: ISkPaint; overload; inline; + class function MakeCopy(const APaint: ISkPaint): ISkPaint; overload; inline; + class function Make(const AStyle: TSkPaintStyle): ISkPaint; overload; inline; + class procedure __DestroyHandle(const AHandle: sk_handle_t); override; + end; {$HPPEMIT END '#define SkPaint(...) __SkCreate(TSkPaint, ISkPaint, __VA_ARGS__)'} @@ -2177,11 +2182,14 @@ TPathIterator = class(TSkEnumerable, ISkPathIterator) procedure SerializeToStream(const AStream: TStream); function ToSVG: string; function Transform(const AMatrix: TMatrix): ISkPath; - public - constructor Create(const ASVG: string); overload; - constructor Create(const ABytes: TBytes); overload; - constructor Create(const AStream: TStream); overload; - class function ConvertConicToQuads(const APoint1, APoint2, APoint3: TPointF; const AWeight: Single; const APower2: Integer): TArray; static; + public + constructor Create(const ASVG: string); overload; deprecated 'Use TSkPath.Make instead.'; + constructor Create(const ABytes: TBytes); overload; deprecated 'Use TSkPath.Make instead.'; + constructor Create(const AStream: TStream); overload; deprecated 'Use TSkPath.Make instead.'; + class function Make(const AStream: TStream): ISkPath; overload; inline; + class function Make(const ASVG: string): ISkPath; overload; inline; + class function Make(const ABytes: TBytes): ISkPath; overload; inline; + class function ConvertConicToQuads(const APoint1, APoint2, APoint3: TPointF; const AWeight: Single; const APower2: Integer): TArray; static; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -2241,7 +2249,7 @@ TPathIterator = class(TSkEnumerable, ISkPathIterator) { TSkPathBuilder } - TSkPathBuilder = class(TSkObject, ISkPathBuilder) + TSkPathBuilder = class(TSkObject, ISkPathBuilder) strict private procedure AddArc(const AOval: TRectF; const AStartAngle, ASweepAngle: Single); procedure AddCircle(const ACenter: TPointF; ARadius: Single; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; @@ -2288,9 +2296,12 @@ TSkPathBuilder = class(TSkObject, ISkPathBuilder) function Snapshot: ISkPath; procedure ToggleInverseFillType; public - constructor Create; overload; - constructor Create(const APathBuilder: ISkPathBuilder); overload; - constructor Create(const AFillType: TSkPathFillType); overload; + constructor Create; overload; deprecated 'Use TSkPathBuilder.Make instead.'; + constructor Create(const APathBuilder: ISkPathBuilder); overload; deprecated 'Use TSkPathBuilder.MakeCopy instead.'; + constructor Create(const AFillType: TSkPathFillType); overload; deprecated 'Use TSkPathBuilder.Make instead.'; + class function Make: ISkPathBuilder; overload; static; inline; + class function MakeCopy(const APathBuilder: ISkPathBuilder): ISkPathBuilder; static; inline; + class function Make(const AFillType: TSkPathFillType): ISkPathBuilder; overload; static; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -2346,7 +2357,8 @@ TSkPathMeasure = class(TSkObject, ISkPathMeasure) function IsClosed: Boolean; function NextContour: Boolean; public - constructor Create(const APath: ISkPath; const AForceClosed: Boolean = False; const AResScale: Single = 1); + class function Make(const APath: ISkPath; const AForceClosed: Boolean = False; const AResScale: Single = 1): ISkPathMeasure; static; inline; + constructor Create(const APath: ISkPath; const AForceClosed: Boolean = False; const AResScale: Single = 1); deprecated 'Use TSkPathMeasure.Make instead.'; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -2408,7 +2420,8 @@ TSkPictureRecorder = class(TSkObject, ISkPictureRecorder) function FinishRecording: ISkPicture; overload; function FinishRecording(const ACullRect: TRectF): ISkPicture; overload; public - constructor Create; + constructor Create; overload; deprecated 'Use TSkPictureRecorder.Make instead.'; + class function Make: ISkPictureRecorder; static; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -2485,7 +2498,8 @@ TSkPixmap = class(TSkObject, ISkPixmap) function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASampling: TSkSamplingOptions): Boolean; overload; procedure SetColorSpace(AValue: ISkColorSpace); public - constructor Create(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt); + constructor Create(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt); deprecated 'Use TSkPixmap.Make instead.'; + class function Make(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt): ISkPixmap; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -2606,9 +2620,12 @@ TRegionSpanerator = class(TSkEnumerable, ISkRegionSpanerator) function SetRects(const ARects: TArray): Boolean; procedure Translate(const ADeltaX, ADeltaY: Integer); public - constructor Create; overload; - constructor Create(const ARegion: ISkRegion); overload; - constructor Create(const ARect: TRect); overload; + constructor Create; overload; deprecated 'Use TSkRegion.Make instead.'; + constructor Create(const ARegion: ISkRegion); overload; deprecated 'Use TSkRegion.MakeCopy instead.'; + constructor Create(const ARect: TRect); overload; deprecated 'Use TSkRegion.Make instead.'; + class function Make: ISkRegion; overload; static; inline; + class function MakeCopy(const ARegion: ISkRegion): ISkRegion; static; inline; + class function Make(const ARect: TRect): ISkRegion; overload; static; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -2675,15 +2692,19 @@ TSkRoundRect = class(TSkObject, ISkRoundRect) procedure SetOval(const ARect: TRectF); procedure SetRect(const ARect: TRectF); overload; procedure SetRect(const ARect: TRectF; const ARadiusX, ARadiusY: Single); overload; - procedure SetRect(const ARect: TRectF; const ARadii: TSkRoundRectRadii); overload; - function Transform(const AMatrix: TMatrix): ISkRoundRect; - public - constructor Create; overload; - constructor Create(const ARoundRect: ISkRoundRect); overload; - constructor Create(const ARect: TRectF; const ARadiusX, ARadiusY: Single); overload; - constructor Create(const ARect: TRectF; const ARadii: TSkRoundRectRadii); overload; - class procedure __DestroyHandle(const AHandle: sk_handle_t); override; - end; + procedure SetRect(const ARect: TRectF; const ARadii: TSkRoundRectRadii); overload; + function Transform(const AMatrix: TMatrix): ISkRoundRect; + public + constructor Create; overload; deprecated 'Use TSkRoundRect.Make instead'; + constructor Create(const ARect: TRectF; const ARadiusX, ARadiusY: Single); overload; deprecated 'Use TSkRoundRect.Make instead'; + constructor Create(const ARoundRect: ISkRoundRect); overload; deprecated 'Use TSkRoundRect.Make instead'; + constructor Create(const ARect: TRectF; const ARadii: TSkRoundRectRadii); overload; deprecated 'Use TSkRoundRect.Make instead'; + class function Make: ISkRoundRect; overload; static; inline; + class function Make(const ARect: TRectF; const ARadiusX, ARadiusY: Single): ISkRoundRect; overload; static; inline; + class function Make(const ARoundRect: ISkRoundRect): ISkRoundRect; overload; static; inline; + class function Make(const ARect: TRectF; const ARadii: TSkRoundRectRadii): ISkRoundRect; overload; static; inline; + class procedure __DestroyHandle(const AHandle: sk_handle_t); override; + end; {$HPPEMIT END '#define SkRoundRect(...) __SkCreate(TSkRoundRect, ISkRoundRect, __VA_ARGS__)'} @@ -2861,11 +2882,12 @@ TSkRuntimeBlenderBuilder = class(TSkRuntimeEffectBuilder, ISkRuntimeBlenderBui strict private function MakeBlender: ISkBlender; public - constructor Create(const AEffect: ISkRuntimeEffect); + constructor Create(const AEffect: ISkRuntimeEffect); + class function Make(const AEffect: ISkRuntimeEffect): ISkRuntimeBlenderBuilder; static; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; - {$HPPEMIT END '#define SkRuntimeBlenderBuilder(...) __SkCreate(TSkRuntimeBlenderBuilder, ISkRuntimeBlenderBuilder, __VA_ARGS__)'} + {$HPPEMIT END '#define SkRuntimeBlenderBuilder(...) __SkCreate(TSkRuntimeBlenderBuilder, ISkRuntimeBlenderBuilder, __VA_ARGS__)'} { ISkRuntimeShaderBuilder } @@ -2887,6 +2909,7 @@ TSkRuntimeShaderBuilder = class(TSkRuntimeEffectBuilder, ISkRuntimeShaderBuild function MakeShader(const ALocalMatrix: TMatrix): ISkShader; overload; public constructor Create(const AEffect: ISkRuntimeEffect); + class function Make(const AEffect: ISkRuntimeEffect): ISkRuntimeShaderBuilder; static; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -3170,10 +3193,10 @@ TSkParticleEffect = class(TSkReferenceCounted, ISkParticleEffect) property UniformData: PSingleArray read GetUniformData; property UniformDataCount: Integer read GetUniformDataCount; property UniformName[const AIndex: NativeUInt]: string read GetUniformName; - class function Make(const AData: string; const AResourceProvider: ISkResourceProvider = nil): ISkParticleEffect; static; deprecated; - class function MakeFromFile(const AFileName: string): ISkParticleEffect; static; deprecated; - class function MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider = nil): ISkParticleEffect; static; deprecated; - end; + class function Make(const AData: string; const AResourceProvider: ISkResourceProvider = nil): ISkParticleEffect; static; + class function MakeFromFile(const AFileName: string): ISkParticleEffect; static; + class function MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider = nil): ISkParticleEffect; static; + end; { ISkottieAnimation } @@ -3218,10 +3241,10 @@ TSkottieAnimation = class(TSkNonVirtualReferenceCounted, ISkottieAnimation) property OutPoint: Double read GetOutPoint; property Size: TSizeF read GetSize; property Version: string read GetVersion; - class function Make(const AData: string; const AResourceProvider: ISkResourceProvider = nil; const AFontProvider: ISkTypefaceFontProvider = nil): ISkottieAnimation; static; - class function MakeFromFile(const AFileName: string; const AFontProvider: ISkTypefaceFontProvider = nil): ISkottieAnimation; static; - class function MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider = nil; const AFontProvider: ISkTypefaceFontProvider = nil): ISkottieAnimation; static; - class procedure __RefHandle(const AHandle: sk_handle_t); override; + class function Make(const AData: string; const AResourceProvider: ISkResourceProvider = nil; const AFontProvider: ISkTypefaceFontProvider = nil): ISkottieAnimation; static; + class function MakeFromFile(const AFileName: string; const AFontProvider: ISkTypefaceFontProvider = nil): ISkottieAnimation; static; + class function MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider = nil; const AFontProvider: ISkTypefaceFontProvider = nil): ISkottieAnimation; static; + class procedure __RefHandle(const AHandle: sk_handle_t); override; class procedure __UnrefHandle(const AHandle: sk_handle_t); override; end; @@ -3306,8 +3329,10 @@ TSkParagraphBuilder = class(TSkObject, ISkParagraphBuilder) procedure Pop; procedure PushStyle(const ATextStyle: ISkTextStyle); public - constructor Create(const AParagraphStyle: ISkParagraphStyle); overload; - constructor Create(const AParagraphStyle: ISkParagraphStyle; const AFontProvider: ISkTypefaceFontProvider; const AEnableFontFallback: Boolean = True); overload; + constructor Create(const AParagraphStyle: ISkParagraphStyle); overload; deprecated 'Use TSkParagraphBuilder.Make instead'; + constructor Create(const AParagraphStyle: ISkParagraphStyle; const AFontProvider: ISkTypefaceFontProvider; const AEnableFontFallback: Boolean = True); overload; deprecated 'Use TSkParagraphBuilder.Make instead'; + class function Make(const AParagraphStyle: ISkParagraphStyle): ISkParagraphBuilder; overload; static; inline; + class function Make(const AParagraphStyle: ISkParagraphStyle; const AFontProvider: ISkTypefaceFontProvider; const AEnableFontFallback: Boolean = True): ISkParagraphBuilder; overload; static; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -3366,7 +3391,8 @@ TSkStrutStyle = class(TSkObject, ISkStrutStyle) procedure SetHeightMultiplier(const AValue: Single); procedure SetLeading(const AValue: Single); public - constructor Create; + constructor Create; overload; deprecated 'Use TSkStrutStyle.Make instead'; + class function Make: ISkStrutStyle; static; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -3425,7 +3451,8 @@ TSkParagraphStyle = class(TSkObject, ISkParagraphStyle) procedure SetTextHeightBehaviors(const AValue: TSkTextHeightBehaviors); procedure SetTextStyle(AValue: ISkTextStyle); public - constructor Create; + constructor Create; deprecated 'Use TSkParagraphStyle.Make instead'; + class function Make: ISkParagraphStyle; static; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -3532,7 +3559,8 @@ TSkTextStyle = class(TSkObject, ISkTextStyle) procedure SetLocale(const AValue: string); procedure SetWordSpacing(const AValue: Single); public - constructor Create; + constructor Create; deprecated 'Use TSkTextStyle.Make instead'; + class function Make: ISkTextStyle; static; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -3610,7 +3638,8 @@ TSkShaper = class(TSkObject, ISkShaper) function Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single): ISkTextBlob; overload; function Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single; const AOffset: TPointF; out AEndPoint: TPointF): ISkTextBlob; overload; public - constructor Create; + constructor Create; deprecated 'Use TSkShaper.Make instead'; + class function Make: ISkShaper; static; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -3647,10 +3676,10 @@ TSkSVGDOM = class(TSkReferenceCounted, ISkSVGDOM) procedure Render(const ACanvas: ISkCanvas); procedure SetContainerSize(const ASize: TSizeF); property Root: ISkSVGSVG read GetRoot; - class function Make(const AData: string; const AResourceProvider: ISkResourceProvider = nil; const AFontProvider: ISkTypefaceFontProvider = nil): ISkSVGDOM; static; - class function MakeFromFile(const AFileName: string; const AFontProvider: ISkTypefaceFontProvider = nil): ISkSVGDOM; static; - class function MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider = nil; const AFontProvider: ISkTypefaceFontProvider = nil): ISkSVGDOM; static; - end; + class function Make(const AData: string; const AResourceProvider: ISkResourceProvider = nil; const AFontProvider: ISkTypefaceFontProvider = nil): ISkSVGDOM; static; + class function MakeFromFile(const AFileName: string; const AFontProvider: ISkTypefaceFontProvider = nil): ISkSVGDOM; static; + class function MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider = nil; const AFontProvider: ISkTypefaceFontProvider = nil): ISkSVGDOM; static; + end; { ISkSVGNode } @@ -3757,7 +3786,8 @@ TUnicodeBreakIterator = class(TSkEnumerable, IS class procedure break_proc(position, status: int32_t; context: Pointer); cdecl; static; class procedure codepoint_proc(unichar: sk_unichar_t; start, &end: int32_t; context: Pointer); cdecl; static; public - constructor Create; + constructor Create; deprecated 'Use Make instead'; + class function Make: ISkUnicode; static; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -3992,7 +4022,8 @@ TSkString = class(TSkObject, ISkString) strict private function GetText: string; public - constructor Create; + constructor Create; deprecated 'Use Make instead'; + class function Make: ISkString; static; inline; class procedure __DestroyHandle(const AHandle: sk_handle_t); override; end; @@ -5054,7 +5085,7 @@ constructor TSkFrame.Create(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt; const ADuration: Integer); begin - Pixmap := TSkPixmap.Create(AImageInfo, APixels, ARowBytes); + Pixmap := TSkPixmap.Make(AImageInfo, APixels, ARowBytes); Duration := ADuration; end; @@ -5144,7 +5175,7 @@ class function TSkImageEncoder.Encode(const ASrcImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(ASrcImageInfo, ASrcPixels, ASrcRowBytes); + LPixmap := TSkPixmap.Make(ASrcImageInfo, ASrcPixels, ASrcRowBytes); Result := Encode(LPixmap, AEncodedImageFormat, AQuality); end; @@ -5180,7 +5211,7 @@ class function TSkImageEncoder.EncodeToFile(const AFileName: string; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(ASrcImageInfo, ASrcPixels, ASrcRowBytes); + LPixmap := TSkPixmap.Make(ASrcImageInfo, ASrcPixels, ASrcRowBytes); Result := EncodeToFile(AFileName, LPixmap, AEncodedImageFormat, AQuality); end; @@ -5204,7 +5235,7 @@ class function TSkImageEncoder.EncodeToStream(const AStream: TStream; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(ASrcImageInfo, ASrcPixels, ASrcRowBytes); + LPixmap := TSkPixmap.Make(ASrcImageInfo, ASrcPixels, ASrcRowBytes); Result := EncodeToStream(AStream, LPixmap, AEncodedImageFormat, AQuality); end; @@ -7268,9 +7299,24 @@ constructor TSkFont.Create(ATypeface: ISkTypeface; const ASize, AScaleX, constructor TSkFont.Create(const AFont: ISkFont); begin - if not Assigned(AFont) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFont']); - inherited Create(sk4d_font_create2(AFont.Handle)); + if not Assigned(AFont) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFont']); + inherited Create(sk4d_font_create2(AFont.Handle)); +end; + +class function TSkFont.MakeCopy(const AFont: ISkFont): ISkFont; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkFont.Create(AFont); + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkFont.Make(ATypeface: ISkTypeface; + const ASize, AScaleX, ASkewX: Single): ISkFont; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkFont.Create(ATypeface, ASize, AScaleX, ASkewX); + {$WARN SYMBOL_DEPRECATED ON} end; function TSkFont.GetBaselineSnap: Boolean; @@ -7449,8 +7495,10 @@ function TSkFont.IsEqual(const AFont: ISkFont): Boolean; function TSkFont.MakeWithSize(const ASize: Single): ISkFont; begin - Result := TSkFont.Create(Self); - Result.Size := ASize; + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkFont.Create(Self); + Result.Size := ASize; + {$WARN SYMBOL_DEPRECATED ON} end; function TSkFont.MeasureText(const AText: string; out ABounds: TRectF; @@ -7702,7 +7750,7 @@ class function TSkImage.MakeCrossContext(const AContext: IGrDirectContext; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(AImageInfo, APixels, ARowBytes); + LPixmap := TSkPixmap.Make(AImageInfo, APixels, ARowBytes); Result := MakeCrossContext(AContext, LPixmap, ABuildMips, ALimitToMaxTextureSize); end; @@ -7818,7 +7866,7 @@ class function TSkImage.MakeFromRaster(const AImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(AImageInfo, APixels, ARowBytes); + LPixmap := TSkPixmap.Make(AImageInfo, APixels, ARowBytes); Result := MakeFromRaster(LPixmap, ARasterReleaseProc); end; @@ -7854,7 +7902,7 @@ class function TSkImage.MakeRasterCopy(const AImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(AImageInfo, APixels, ARowBytes); + LPixmap := TSkPixmap.Make(AImageInfo, APixels, ARowBytes); Result := MakeRasterCopy(LPixmap); end; @@ -7971,7 +8019,7 @@ function TSkImage.ReadPixels(const ADestImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(ADestImageInfo, ADestPixels, ADestRowBytes); + LPixmap := TSkPixmap.Make(ADestImageInfo, ADestPixels, ADestRowBytes); Result := ReadPixels(LPixmap, ASrcX, ASrcY, ACachingHint, AContext); end; @@ -7982,7 +8030,7 @@ function TSkImage.ScalePixels(const ADestImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(ADestImageInfo, ADestPixels, ADestRowBytes); + LPixmap := TSkPixmap.Make(ADestImageInfo, ADestPixels, ADestRowBytes); Result := ScalePixels(LPixmap, ASampling, ACachingHint); end; @@ -7992,7 +8040,7 @@ function TSkImage.ScalePixels(const ADestImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(ADestImageInfo, ADestPixels, ADestRowBytes); + LPixmap := TSkPixmap.Make(ADestImageInfo, ADestPixels, ADestRowBytes); Result := ScalePixels(LPixmap, ACachingHint); end; @@ -8034,7 +8082,7 @@ class function TSkImageFilter.MakeAlphaThreshold(const ARegion: TRect; var LRegion: ISkRegion; begin - LRegion := TSkRegion.Create; + LRegion := TSkRegion.Make; LRegion.SetRect(ARegion); Result := MakeAlphaThreshold(LRegion, AInnerMin, AOuterMax, AInput); end; @@ -8534,8 +8582,31 @@ constructor TSkPaint.Create(const APaint: ISkPaint); constructor TSkPaint.Create(const AStyle: TSkPaintStyle); begin - Create; - SetStyle(AStyle); + {$WARN SYMBOL_DEPRECATED OFF} + Create; + SetStyle(AStyle); + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkPaint.Make: ISkPaint; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkPaint.Create(); + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkPaint.MakeCopy(const APaint: ISkPaint): ISkPaint; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkPaint.Create(APaint); + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkPaint.Make(const AStyle: TSkPaintStyle): ISkPaint; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkPaint.Create(AStyle); + {$WARN SYMBOL_DEPRECATED ON} end; function TSkPaint.GetAlpha: Byte; @@ -8780,19 +8851,21 @@ class function TSkPath.ConvertConicToQuads(const APoint1, APoint2, constructor TSkPath.Create(const ASVG: string); begin - inherited Create(sk4d_path_create(MarshaledAString(MarshaledAString(UTF8String(ASVG))))); + inherited Create(sk4d_path_create(MarshaledAString(MarshaledAString(UTF8String(ASVG))))); end; constructor TSkPath.Create(const ABytes: TBytes); var LStream: TStream; begin - LStream := TBytesStream.Create(ABytes); - try - Create(LStream); - finally - LStream.Free; - end; + {$WARN SYMBOL_DEPRECATED OFF} + LStream := TBytesStream.Create(ABytes); + try + Create(LStream); + finally + LStream.Free; + end; + {$WARN SYMBOL_DEPRECATED ON} end; constructor TSkPath.Create(const AStream: TStream); @@ -8907,10 +8980,33 @@ function TSkPath.IsRoundRect(out ARoundRect: ISkRoundRect): Boolean; var LRoundRect: ISkRoundRect; begin - LRoundRect := TSkRoundRect.Create; - Result := sk4d_path_is_rrect(Handle, TSkBindings.SafeHandle(LRoundRect)); - if Result then - ARoundRect := LRoundRect; + {$WARN SYMBOL_DEPRECATED OFF} + LRoundRect := TSkRoundRect.Create; + {$WARN SYMBOL_DEPRECATED ON} + Result := sk4d_path_is_rrect(Handle, TSkBindings.SafeHandle(LRoundRect)); + if Result then + ARoundRect := LRoundRect; +end; + +class function TSkPath.Make(const AStream: TStream): ISkPath; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkPath.Create(AStream); + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkPath.Make(const ASVG: string): ISkPath; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkPath.Create(ASVG); + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkPath.Make(const ABytes: TBytes): ISkPath; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkPath.Create(ABytes); + {$WARN SYMBOL_DEPRECATED ON} end; function TSkPath.IsRoundRect: Boolean; @@ -9102,8 +9198,10 @@ constructor TSkPathBuilder.Create; constructor TSkPathBuilder.Create(const AFillType: TSkPathFillType); begin - Create; - SetFillType(AFillType); + {$WARN SYMBOL_DEPRECATED OFF} + Create; + {$WARN SYMBOL_DEPRECATED ON} + SetFillType(AFillType); end; constructor TSkPathBuilder.Create(const APathBuilder: ISkPathBuilder); @@ -9159,9 +9257,30 @@ procedure TSkPathBuilder.LineTo(const APoint: TPointF); sk4d_pathbuilder_line_to(Handle, @APoint); end; +class function TSkPathBuilder.Make: ISkPathBuilder; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkPathBuilder.Create; + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkPathBuilder.MakeCopy(const APathBuilder: ISkPathBuilder): ISkPathBuilder; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkPathBuilder.Create(APathBuilder); + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkPathBuilder.Make(const AFillType: TSkPathFillType): ISkPathBuilder; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkPathBuilder.Create(AFillType); + {$WARN SYMBOL_DEPRECATED ON} +end; + procedure TSkPathBuilder.MoveTo(const AX, AY: Single); begin - MoveTo(TPointF.Create(AX, AY)); + MoveTo(TPointF.Create(AX, AY)); end; procedure TSkPathBuilder.MoveTo(const APoint: TPointF); @@ -9369,6 +9488,13 @@ constructor TSkPathMeasure.Create(const APath: ISkPath; inherited Create(sk4d_pathmeasure_create(APath.Handle, AForceClosed, AResScale)); end; +class function TSkPathMeasure.Make(const APath: ISkPath; const AForceClosed: Boolean = False; const AResScale: Single = 1): ISkPathMeasure; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkBindings.SafeCreate(sk4d_pathmeasure_create(APath.Handle, AForceClosed, AResScale)); + {$WARN SYMBOL_DEPRECATED ON} +end; + function TSkPathMeasure.GetLength: Single; begin Result := sk4d_pathmeasure_get_length(Handle); @@ -9512,7 +9638,16 @@ function TSkPictureRecorder.BeginRecording(const ABounds: TRectF): ISkCanvas; constructor TSkPictureRecorder.Create; begin + {$WARN SYMBOL_DEPRECATED OFF} inherited Create(sk4d_picturerecorder_create()); + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkPictureRecorder.Make: ISkPictureRecorder; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkPictureRecorder.Create; + {$WARN SYMBOL_DEPRECATED ON} end; function TSkPictureRecorder.FinishRecording: ISkPicture; @@ -9542,6 +9677,14 @@ constructor TSkPixmap.Create(const AImageInfo: TSkImageInfo; inherited Create(sk4d_pixmap_create(@LImageInfo, APixels, ARowBytes)); end; +class function TSkPixmap.Make(const AImageInfo: TSkImageInfo; + const APixels: Pointer; const ARowBytes: NativeUInt): ISkPixmap; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkPixmap.Create(AImageInfo, APixels, ARowBytes); + {$WARN SYMBOL_DEPRECATED ON} +end; + function TSkPixmap.Erase(const AColor: TAlphaColorF; const ASubset: TRectF; AColorSpace: ISkColorSpace): Boolean; begin @@ -9654,8 +9797,10 @@ function TSkPixmap.ReadPixels(const ADestImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin + {$WARN SYMBOL_DEPRECATED OFF} LPixmap := TSkPixmap.Create(ADestImageInfo, ADestPixels, ADestRowBytes); Result := ReadPixels(LPixmap, ASrcX, ASrcY); + {$WARN SYMBOL_DEPRECATED ON} end; function TSkPixmap.ScalePixels(const ADestImageInfo: TSkImageInfo; @@ -9664,7 +9809,7 @@ function TSkPixmap.ScalePixels(const ADestImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(ADestImageInfo, ADestPixels, ADestRowBytes); + LPixmap := TSkPixmap.Make(ADestImageInfo, ADestPixels, ADestRowBytes); Result := ScalePixels(LPixmap, ASampling); end; @@ -9673,8 +9818,10 @@ function TSkPixmap.ScalePixels(const ADestImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin + {$WARN SYMBOL_DEPRECATED OFF} LPixmap := TSkPixmap.Create(ADestImageInfo, ADestPixels, ADestRowBytes); Result := ScalePixels(LPixmap); + {$WARN SYMBOL_DEPRECATED ON} end; function TSkPixmap.ScalePixels(const ADest: ISkPixmap; @@ -9721,8 +9868,10 @@ function TSkRegion.Contains(const AX, AY: Integer): Boolean; constructor TSkRegion.Create(const ARect: TRect); begin + {$WARN SYMBOL_DEPRECATED OFF} Create; SetRect(ARect); + {$WARN SYMBOL_DEPRECATED ON} end; constructor TSkRegion.Create(const ARegion: ISkRegion); @@ -9737,6 +9886,27 @@ constructor TSkRegion.Create; inherited Create(sk4d_region_create()); end; +class function TSkRegion.Make: ISkRegion; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkRegion.Create; + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkRegion.MakeCopy(const ARegion: ISkRegion): ISkRegion; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkRegion.Create(ARegion); + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkRegion.Make(const ARect: TRect): ISkRegion; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkRegion.Create(ARect); + {$WARN SYMBOL_DEPRECATED ON} +end; + function TSkRegion.GetBoundaryPath: ISkPath; begin Result := TSkBindings.SafeCreate(sk4d_region_get_boundary_path(Handle)); @@ -9945,8 +10115,10 @@ function TSkRoundRect.Contains(const ARect: TRect): Boolean; constructor TSkRoundRect.Create(const ARect: TRectF; const ARadiusX, ARadiusY: Single); begin - Create; - SetRect(ARect, ARadiusX, ARadiusY); + {$WARN SYMBOL_DEPRECATED OFF} + Create; + {$WARN SYMBOL_DEPRECATED ON} + SetRect(ARect, ARadiusX, ARadiusY); end; constructor TSkRoundRect.Create(const ARoundRect: ISkRoundRect); @@ -9964,8 +10136,10 @@ constructor TSkRoundRect.Create; constructor TSkRoundRect.Create(const ARect: TRectF; const ARadii: TSkRoundRectRadii); begin - Create; - SetRect(ARect, ARadii); + {$WARN SYMBOL_DEPRECATED OFF} + Create; + {$WARN SYMBOL_DEPRECATED ON} + SetRect(ARect, ARadii); end; procedure TSkRoundRect.Deflate(const ADeltaX, ADeltaY: Single); @@ -10042,7 +10216,35 @@ function TSkRoundRect.IsSimple: Boolean; function TSkRoundRect.IsValid: Boolean; begin - Result := sk4d_rrect_is_valid(Handle); + Result := sk4d_rrect_is_valid(Handle); +end; + +class function TSkRoundRect.Make: ISkRoundRect; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkRoundRect.Create; + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkRoundRect.Make(const ARect: TRectF; const ARadiusX, ARadiusY: Single): ISkRoundRect; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkRoundRect.Create(ARect, ARadiusX, ARadiusY); + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkRoundRect.Make(const ARoundRect: ISkRoundRect): ISkRoundRect; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkRoundRect.Create(ARoundRect); + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkRoundRect.Make(const ARect: TRectF; const ARadii: TSkRoundRectRadii): ISkRoundRect; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkRoundRect.Create(ARect, ARadii); + {$WARN SYMBOL_DEPRECATED ON} end; procedure TSkRoundRect.Offset(const ADeltaX, ADeltaY: Single); @@ -10069,28 +10271,28 @@ procedure TSkRoundRect.SetOval(const ARect: TRectF); procedure TSkRoundRect.SetRect(const ARect: TRectF; const ARadii: TSkRoundRectRadii); begin - sk4d_rrect_set_rect2(Handle, @ARect, @ARadii); + sk4d_rrect_set_rect2(Handle, @ARect, @ARadii); end; procedure TSkRoundRect.SetRect(const ARect: TRectF; const ARadiusX, - ARadiusY: Single); + ARadiusY: Single); begin - sk4d_rrect_set_rect3(Handle, @ARect, ARadiusX, ARadiusY); + sk4d_rrect_set_rect3(Handle, @ARect, ARadiusX, ARadiusY); end; procedure TSkRoundRect.SetRect(const ARect: TRectF); begin - sk4d_rrect_set_rect(Handle, @ARect); + sk4d_rrect_set_rect(Handle, @ARect); end; function TSkRoundRect.Transform(const AMatrix: TMatrix): ISkRoundRect; begin - Result := TSkBindings.SafeCreate(sk4d_rrect_transform(Handle, @AMatrix)); + Result := TSkBindings.SafeCreate(sk4d_rrect_transform(Handle, @AMatrix)); end; class procedure TSkRoundRect.__DestroyHandle(const AHandle: sk_handle_t); begin - sk4d_rrect_destroy(AHandle); + sk4d_rrect_destroy(AHandle); end; { TSkRuntimeEffect } @@ -10255,7 +10457,7 @@ class function TSkRuntimeEffect.MakeForBlender(const ASkSL: MarshaledAString; begin if Length(ASKSL) < 1 then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['ASKSL']); - LErrorText := TSkString.Create; + LErrorText := TSkString.Make; Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_for_blender(ASkSL, LErrorText.Handle)); AErrorText := LErrorText.Text; end; @@ -10279,7 +10481,7 @@ class function TSkRuntimeEffect.MakeForColorFilter( begin if Length(ASKSL) < 1 then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['ASKSL']); - LErrorText := TSkString.Create; + LErrorText := TSkString.Make; Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_for_color_filter(ASKSL, LErrorText.Handle)); AErrorText := LErrorText.Text; end; @@ -10317,9 +10519,9 @@ class function TSkRuntimeEffect.MakeForShader(const ASkSL: MarshaledAString; begin if Length(ASKSL) < 1 then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['ASKSL']); - LErrorText := TSkString.Create; + LErrorText := TSkString.Make; Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_for_shader(ASkSL, LErrorText.Handle)); - AErrorText := LErrorText.Text; + AErrorText := LErrorText.Text; end; class function TSkRuntimeEffect.MakeForShader( @@ -10603,7 +10805,15 @@ constructor TSkRuntimeBlenderBuilder.Create(const AEffect: ISkRuntimeEffect); begin if not Assigned(AEffect) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AEffect']); - inherited Create(sk4d_runtimeblendbuilder_create(AEffect.Handle)); + inherited Create(sk4d_runtimeblendbuilder_create(AEffect.Handle)); +end; + +class function TSkRuntimeBlenderBuilder.Make( + const AEffect: ISkRuntimeEffect): ISkRuntimeBlenderBuilder; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkRuntimeBlenderBuilder.Create(AEffect); + {$WARN SYMBOL_DEPRECATED ON} end; function TSkRuntimeBlenderBuilder.MakeBlender: ISkBlender; @@ -10626,6 +10836,13 @@ constructor TSkRuntimeShaderBuilder.Create(const AEffect: ISkRuntimeEffect); inherited Create(sk4d_runtimeshaderbuilder_create(AEffect.Handle)); end; +class function TSkRuntimeShaderBuilder.Make(const AEffect: ISkRuntimeEffect): ISkRuntimeShaderBuilder; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkRuntimeShaderBuilder.Create(AEffect); + {$WARN SYMBOL_DEPRECATED ON} +end; + function TSkRuntimeShaderBuilder.MakeImage(const AImageInfo: TSkImageInfo; const AMipmapped: Boolean; const AContext: IGrDirectContext): ISkImage; var @@ -11337,8 +11554,10 @@ class function TSkSurface.MakeRasterDirect(const AImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(AImageInfo, APixels, ARowBytes); - Result := MakeRasterDirect(LPixmap, ARasterReleaseProc); + {$WARN SYMBOL_DEPRECATED OFF} + LPixmap := TSkPixmap.Create(AImageInfo, APixels, ARowBytes); + Result := MakeRasterDirect(LPixmap, ARasterReleaseProc); + {$WARN SYMBOL_DEPRECATED ON} end; class function TSkSurface.MakeRasterDirect(const AImageInfo: TSkImageInfo; @@ -11348,8 +11567,10 @@ class function TSkSurface.MakeRasterDirect(const AImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(AImageInfo, APixels, ARowBytes); - Result := MakeRasterDirect(LPixmap, AProperties, ARasterReleaseProc); + {$WARN SYMBOL_DEPRECATED OFF} + LPixmap := TSkPixmap.Create(AImageInfo, APixels, ARowBytes); + Result := MakeRasterDirect(LPixmap, AProperties, ARasterReleaseProc); + {$WARN SYMBOL_DEPRECATED ON} end; class function TSkSurface.MakeRasterDirect(const APixmap: ISkPixmap; @@ -11415,8 +11636,10 @@ function TSkSurface.ReadPixels(const ADestImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(ADestImageInfo, ADestPixels, ADestRowBytes); - Result := ReadPixels(LPixmap, ASrcX, ASrcY); + {$WARN SYMBOL_DEPRECATED OFF} + LPixmap := TSkPixmap.Create(ADestImageInfo, ADestPixels, ADestRowBytes); + Result := ReadPixels(LPixmap, ASrcX, ASrcY); + {$WARN SYMBOL_DEPRECATED ON} end; function TSkSurface.ReadPixels(const ADest: ISkPixmap; const ASrcX, @@ -11448,8 +11671,10 @@ procedure TSkSurface.WritePixels(const ASrcImageInfo: TSkImageInfo; var LPixmap: ISkPixmap; begin - LPixmap := TSkPixmap.Create(ASrcImageInfo, ASrcPixels, ASrcRowBytes); - WritePixels(LPixmap, ADestX, ADestY); + {$WARN SYMBOL_DEPRECATED OFF} + LPixmap := TSkPixmap.Create(ASrcImageInfo, ASrcPixels, ASrcRowBytes); + WritePixels(LPixmap, ADestX, ADestY); + {$WARN SYMBOL_DEPRECATED ON} end; procedure TSkSurface.WritePixels(const ASrc: ISkPixmap; const ADestX, @@ -11720,7 +11945,7 @@ class function TSkParticleEffect.Make(const AData: string; class function TSkParticleEffect.MakeFromFile( const AFileName: string): ISkParticleEffect; begin - if Length(AFileName) = 0 then + if Length(AFileName) = 0 then raise ESkException.Create(SFileNameIsEmpty); Result := TSkBindings.SafeCreate(sk4d_particleeffect_make_from_file(MarshaledAString(UTF8String(AFileName)))); end; @@ -12026,6 +12251,21 @@ constructor TSkParagraphBuilder.Create( inherited Create(sk4d_paragraphbuilder_create(AParagraphStyle.Handle)); end; +class function TSkParagraphBuilder.Make( + const AParagraphStyle: ISkParagraphStyle): ISkParagraphBuilder; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkParagraphBuilder.Create(AParagraphStyle); + {$WARN SYMBOL_DEPRECATED ON} +end; + +class function TSkParagraphBuilder.Make(const AParagraphStyle: ISkParagraphStyle; const AFontProvider: ISkTypefaceFontProvider; const AEnableFontFallback: Boolean = True): ISkParagraphBuilder; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkParagraphBuilder.Create(AParagraphStyle, AFontProvider, AEnableFontFallback); + {$WARN SYMBOL_DEPRECATED ON} +end; + procedure TSkParagraphBuilder.Pop; begin sk4d_paragraphbuilder_pop(Handle); @@ -12050,6 +12290,13 @@ constructor TSkStrutStyle.Create; inherited Create(sk4d_strutstyle_create()); end; +class function TSkStrutStyle.Make: ISkStrutStyle; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkStrutStyle.Create; + {$WARN SYMBOL_DEPRECATED ON} +end; + function TSkStrutStyle.GetEnabled: Boolean; begin Result := sk4d_strutstyle_get_enabled(Handle); @@ -12167,6 +12414,13 @@ constructor TSkParagraphStyle.Create; inherited Create(sk4d_paragraphstyle_create()); end; +class function TSkParagraphStyle.Make: ISkParagraphStyle; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkParagraphStyle.Create; + {$WARN SYMBOL_DEPRECATED ON} +end; + procedure TSkParagraphStyle.DisableHinting; begin sk4d_paragraphstyle_disable_hinting(Handle); @@ -12288,6 +12542,12 @@ procedure TSkTextStyle.ClearForegroundColor; sk4d_textstyle_clear_foreground_color(Handle); end; +class function TSkTextStyle.Make: ISkTextStyle; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkTextStyle.Create; + {$WARN SYMBOL_DEPRECATED ON} +end; constructor TSkTextStyle.Create; begin @@ -12598,6 +12858,13 @@ constructor TSkShaper.Create; inherited Create(sk4d_shaper_create()); end; +class function TSkShaper.Make: ISkShaper; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkShaper.Create; + {$WARN SYMBOL_DEPRECATED ON} +end; + function TSkShaper.Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single): ISkTextBlob; begin @@ -12797,6 +13064,13 @@ constructor TSkUnicode.Create; inherited Create(sk4d_unicode_create()); end; +class function TSkUnicode.Make: ISkUnicode; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkUnicode.Create; + {$WARN SYMBOL_DEPRECATED ON} +end; + procedure TSkUnicode.ForEachBidiRegion(const AText: string; const ADirection: TSkDirection; const AProc: TSkUnicodeBidiRegionProc); begin @@ -13029,6 +13303,13 @@ constructor TSkString.Create; inherited Create(sk4d_string_create()); end; +class function TSkString.Make: ISkString; +begin + {$WARN SYMBOL_DEPRECATED OFF} + Result := TSkString.Create; + {$WARN SYMBOL_DEPRECATED ON} +end; + function TSkString.GetText: string; begin Result := string(sk4d_string_get_text(Handle)); diff --git a/Source/VCL/Vcl.Skia.pas b/Source/VCL/Vcl.Skia.pas index 5ba58381..09edb2fb 100644 --- a/Source/VCL/Vcl.Skia.pas +++ b/Source/VCL/Vcl.Skia.pas @@ -1402,7 +1402,7 @@ procedure DrawDesignBorder(const ACanvas: ISkCanvas; ADest: TRectF; const AOpaci var LPaint: ISkPaint; begin - LPaint := TSkPaint.Create(TSkPaintStyle.Stroke); + LPaint := TSkPaint.Make(TSkPaintStyle.Stroke); LPaint.Color := DesignBorderColor; LPaint.AlphaF := AOpacity; LPaint.StrokeWidth := 1; @@ -2132,9 +2132,9 @@ procedure TSkSvgBrush.Render(const ACanvas: ISkCanvas; const ADestRect: TRectF; LPictureRecorder: ISkPictureRecorder; LCanvas: ISkCanvas; LPaint: ISkPaint; - begin - LPictureRecorder := TSkPictureRecorder.Create; - LCanvas := LPictureRecorder.BeginRecording(AWrappedDest.Width, AWrappedDest.Height); + begin + LPictureRecorder := TSkPictureRecorder.Make; + LCanvas := LPictureRecorder.BeginRecording(AWrappedDest.Width, AWrappedDest.Height); if AIntrinsicSize.IsZero then begin if AWrapMode <> TSkSvgWrapMode.Default then @@ -2147,9 +2147,9 @@ procedure TSkSvgBrush.Render(const ACanvas: ISkCanvas; const ADestRect: TRectF; else LCanvas.Scale(AWrappedDest.Width / ASvgRect.Width, AWrappedDest.Height / ASvgRect.Height); ADOM.Render(LCanvas); - LPicture := LPictureRecorder.FinishRecording; - LPaint := TSkPaint.Create; - if FGrayScale then + LPicture := LPictureRecorder.FinishRecording; + LPaint := TSkPaint.Make; + if FGrayScale then LPaint.ColorFilter := TSkColorFilter.MakeMatrix(TSkColorMatrix.CreateSaturation(0)) else if FOverrideColor <> TAlphaColors.Null then LPaint.ColorFilter := TSkColorFilter.MakeBlend(FOverrideColor, TSkBlendMode.SrcIn); @@ -2673,9 +2673,9 @@ function TSkGlControlRender.TryRender(const ABackgroundBuffer: TBitmap; const AO UpdateCache; if FCachedImage <> nil then - begin - LPaint := TSkPaint.Create; - LPaint.Alpha := AOpacity; + begin + LPaint := TSkPaint.Make; + LPaint.Alpha := AOpacity; LSurface.Canvas.DrawImage(FCachedImage, 0, 0, LPaint); end else @@ -2761,9 +2761,9 @@ procedure TSkCustomWinControl.Draw(const ACanvas: ISkCanvas; const ADest: TRectF LPaint: ISkPaint; begin if TAlphaColorRec(FBackgroundColor).A > 0 then - begin - LPaint := TSkPaint.Create; - LPaint.Color := FBackgroundColor; + begin + LPaint := TSkPaint.Make; + LPaint.Color := FBackgroundColor; LPaint.AntiAlias := True; ACanvas.DrawRect(ADest, LPaint); end; @@ -4230,9 +4230,9 @@ procedure TSkDefaultAnimationCodec.Render(const ACanvas: ISkCanvas; if SameValue(AOpacity, 1, TEpsilon.Position) then LPaint := nil else - begin - LPaint := TSkPaint.Create; - LPaint.AlphaF := AOpacity; + begin + LPaint := TSkPaint.Make; + LPaint.AlphaF := AOpacity; end; ACanvas.DrawImageRect(FAnimationCodec.Frame, ADest, TSkSamplingOptions.Medium, LPaint); end; @@ -5630,11 +5630,11 @@ procedure TSkLabel.Draw(const ACanvas: ISkCanvas; const ADest: TRectF; LRectsColor: TArray; LLastRect: TRectF; LLastColor: TAlphaColor; - begin - LPictureRecorder := TSkPictureRecorder.Create; - LCanvas := LPictureRecorder.BeginRecording(ADest); - LPaint := TSkPaint.Create; - LPaint.AntiAlias := True; + begin + LPictureRecorder := TSkPictureRecorder.Make; + LCanvas := LPictureRecorder.BeginRecording(ADest); + LPaint := TSkPaint.Make; + LPaint.AntiAlias := True; LTextEndIndex := 0; LRects := nil; for I := 0 to FWords.Count - 1 do @@ -5812,9 +5812,9 @@ function TSkLabel.GetParagraph: ISkParagraph; if ADrawKind = TDrawKind.Stroke then begin if (ADecorations.StrokeColor <> TAlphaColors.Null) and not SameValue(ADecorations.Thickness, 0, TEpsilon.Position) then - begin - LPaint := TSkPaint.Create(TSkPaintStyle.Stroke); - LPaint.Color := ADecorations.StrokeColor; + begin + LPaint := TSkPaint.Make(TSkPaintStyle.Stroke); + LPaint.Color := ADecorations.StrokeColor; LPaint.StrokeWidth := (ADecorations.Thickness / 2) * (ATextStyle.FontSize / 14); ATextStyle.SetForegroundColor(LPaint); end @@ -5828,9 +5828,9 @@ function TSkLabel.GetParagraph: ISkParagraph; function CreateTextStyle(const AWordsItem: TCustomWordsItem; const ADefaultTextStyle: ISkTextStyle; const ADrawKind: TDrawKind): ISkTextStyle; - begin - Result := TSkTextStyle.Create; - if TSkStyledSetting.FontColor in AWordsItem.StyledSettings then + begin + Result := TSkTextStyle.Make; + if TSkStyledSetting.FontColor in AWordsItem.StyledSettings then Result.Color := ResultingTextSettings.FontColor else Result.Color := AWordsItem.FontColor; @@ -5861,9 +5861,9 @@ function TSkLabel.GetParagraph: ISkParagraph; end; function CreateDefaultTextStyle(const ADrawKind: TDrawKind): ISkTextStyle; - begin - Result := TSkTextStyle.Create; - Result.Color := ResultingTextSettings.FontColor; + begin + Result := TSkTextStyle.Make; + Result.Color := ResultingTextSettings.FontColor; Result.FontFamilies := GetFontFamilies(ResultingTextSettings.Font.Families); Result.FontSize := ResultingTextSettings.Font.Size; Result.FontStyle := TSkFontStyle.Create(SkFontWeightValue[ResultingTextSettings.Font.Weight], SkFontWidthValue[ResultingTextSettings.Font.Stretch], SkFontSlant[ResultingTextSettings.Font.Slant]); @@ -5873,9 +5873,9 @@ function TSkLabel.GetParagraph: ISkParagraph; end; function CreateParagraphStyle(const ADefaultTextStyle: ISkTextStyle): ISkParagraphStyle; - begin - Result := TSkParagraphStyle.Create; - if UseRightToLeftAlignment then + begin + Result := TSkParagraphStyle.Make; + if UseRightToLeftAlignment then Result.TextDirection := TSkTextDirection.RightToLeft; if ResultingTextSettings.Trimming in [TSkTextTrimming.Character, TSkTextTrimming.Word] then Result.Ellipsis := '...'; @@ -5893,11 +5893,10 @@ function TSkLabel.GetParagraph: ISkParagraph; LDefaultTextStyle: ISkTextStyle; LText: string; I: Integer; - begin - LDefaultTextStyle := CreateDefaultTextStyle(ADrawKind); - LBuilder := TSkParagraphBuilder.Create(CreateParagraphStyle(LDefaultTextStyle), TSkDefaultProviders.TypefaceFont); - - for I := 0 to FWords.Count- 1 do + begin + LDefaultTextStyle := CreateDefaultTextStyle(ADrawKind); + LBuilder := TSkParagraphBuilder.Make(CreateParagraphStyle(LDefaultTextStyle), TSkDefaultProviders.TypefaceFont); + for I := 0 to FWords.Count- 1 do begin if FWords[I].Caption = '' then Continue; @@ -6431,9 +6430,9 @@ function TSkGraphic.GetBuffer(const ASize: TSize; const AOpacity: Byte): TBitmap if AOpacity = High(AOpacity) then LPaint := nil else - begin - LPaint := TSkPaint.Create; - LPaint.Alpha := AOpacity; + begin + LPaint := TSkPaint.Make; + LPaint.Alpha := AOpacity; end; if (FBuffer.Width = Width) and (FBuffer.Height = Height) then ACanvas.DrawImage(FImage, 0, 0, LPaint)