diff --git a/demos/ConsoleBrowser/uWebBrowser.pas b/demos/ConsoleBrowser/uWebBrowser.pas index 71c47fbf..e4910902 100644 --- a/demos/ConsoleBrowser/uWebBrowser.pas +++ b/demos/ConsoleBrowser/uWebBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/CookieVisitor/uCookieVisitor.pas b/demos/CookieVisitor/uCookieVisitor.pas index f8f69ea2..fd1ac072 100644 --- a/demos/CookieVisitor/uCookieVisitor.pas +++ b/demos/CookieVisitor/uCookieVisitor.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/CustomResourceBrowser/uCustomResourceHandler.pas b/demos/CustomResourceBrowser/uCustomResourceHandler.pas index 96d82f54..63b007f7 100644 --- a/demos/CustomResourceBrowser/uCustomResourceHandler.pas +++ b/demos/CustomResourceBrowser/uCustomResourceHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/CustomResourceBrowser/uMainForm.pas b/demos/CustomResourceBrowser/uMainForm.pas index dae4006f..48e7fe7c 100644 --- a/demos/CustomResourceBrowser/uMainForm.pas +++ b/demos/CustomResourceBrowser/uMainForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/DLLBrowser/uCEF4DelphiLoader.pas b/demos/DLLBrowser/uCEF4DelphiLoader.pas index 5a10c312..c2d0e960 100644 --- a/demos/DLLBrowser/uCEF4DelphiLoader.pas +++ b/demos/DLLBrowser/uCEF4DelphiLoader.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/DLLBrowser/uWebBrowser.pas b/demos/DLLBrowser/uWebBrowser.pas index aa78d6f1..2571f6b6 100644 --- a/demos/DLLBrowser/uWebBrowser.pas +++ b/demos/DLLBrowser/uWebBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/DOMVisitor/uDOMVisitor.pas b/demos/DOMVisitor/uDOMVisitor.pas index 7dbc3390..ba1e991e 100644 --- a/demos/DOMVisitor/uDOMVisitor.pas +++ b/demos/DOMVisitor/uDOMVisitor.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/ExternalPumpBrowser/uExternalPumpBrowser.pas b/demos/ExternalPumpBrowser/uExternalPumpBrowser.pas index 1aa2927e..a6edc429 100644 --- a/demos/ExternalPumpBrowser/uExternalPumpBrowser.pas +++ b/demos/ExternalPumpBrowser/uExternalPumpBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/FMXExternalPumpBrowser/uFMXApplicationService.pas b/demos/FMXExternalPumpBrowser/uFMXApplicationService.pas index db2c50c7..420410b6 100644 --- a/demos/FMXExternalPumpBrowser/uFMXApplicationService.pas +++ b/demos/FMXExternalPumpBrowser/uFMXApplicationService.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/FMXExternalPumpBrowser/uFMXExternalPumpBrowser.pas b/demos/FMXExternalPumpBrowser/uFMXExternalPumpBrowser.pas index 85c9c3f5..02b89f18 100644 --- a/demos/FMXExternalPumpBrowser/uFMXExternalPumpBrowser.pas +++ b/demos/FMXExternalPumpBrowser/uFMXExternalPumpBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/FMXToolBoxBrowser/uChildForm.pas b/demos/FMXToolBoxBrowser/uChildForm.pas index 95f0fa4a..3c4f04d1 100644 --- a/demos/FMXToolBoxBrowser/uChildForm.pas +++ b/demos/FMXToolBoxBrowser/uChildForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/FMXToolBoxBrowser/uFMXApplicationService.pas b/demos/FMXToolBoxBrowser/uFMXApplicationService.pas index 81ea39c5..6b95c2a0 100644 --- a/demos/FMXToolBoxBrowser/uFMXApplicationService.pas +++ b/demos/FMXToolBoxBrowser/uFMXApplicationService.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/FMXToolBoxBrowser/uMainForm.pas b/demos/FMXToolBoxBrowser/uMainForm.pas index bf728a2d..06ff56c5 100644 --- a/demos/FMXToolBoxBrowser/uMainForm.pas +++ b/demos/FMXToolBoxBrowser/uMainForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/FullScreenBrowser/uMainForm.pas b/demos/FullScreenBrowser/uMainForm.pas index 4829da1d..8e973c80 100644 --- a/demos/FullScreenBrowser/uMainForm.pas +++ b/demos/FullScreenBrowser/uMainForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSDialog/uJSDialogBrowser.pas b/demos/JavaScript/JSDialog/uJSDialogBrowser.pas index 89fc24de..796d6694 100644 --- a/demos/JavaScript/JSDialog/uJSDialogBrowser.pas +++ b/demos/JavaScript/JSDialog/uJSDialogBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSEval/uJSEval.pas b/demos/JavaScript/JSEval/uJSEval.pas index cd748005..b9d03248 100644 --- a/demos/JavaScript/JSEval/uJSEval.pas +++ b/demos/JavaScript/JSEval/uJSEval.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.pas b/demos/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.pas index 5b219e4b..5347243b 100644 --- a/demos/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.pas +++ b/demos/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSExecutingFunctions/uMyV8Handler.pas b/demos/JavaScript/JSExecutingFunctions/uMyV8Handler.pas index 603abd32..4c00a1fe 100644 --- a/demos/JavaScript/JSExecutingFunctions/uMyV8Handler.pas +++ b/demos/JavaScript/JSExecutingFunctions/uMyV8Handler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSExtension/uJSExtension.pas b/demos/JavaScript/JSExtension/uJSExtension.pas index e73f6f2d..c054385e 100644 --- a/demos/JavaScript/JSExtension/uJSExtension.pas +++ b/demos/JavaScript/JSExtension/uJSExtension.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSExtension/uTestExtensionHandler.pas b/demos/JavaScript/JSExtension/uTestExtensionHandler.pas index e5013135..c20642ec 100644 --- a/demos/JavaScript/JSExtension/uTestExtensionHandler.pas +++ b/demos/JavaScript/JSExtension/uTestExtensionHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.pas b/demos/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.pas index 7d71ba59..9a1fef18 100644 --- a/demos/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.pas +++ b/demos/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSExtensionWithFunction/uMyV8Handler.pas b/demos/JavaScript/JSExtensionWithFunction/uMyV8Handler.pas index e20855d6..c472e01e 100644 --- a/demos/JavaScript/JSExtensionWithFunction/uMyV8Handler.pas +++ b/demos/JavaScript/JSExtensionWithFunction/uMyV8Handler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.pas b/demos/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.pas index eb45f45f..c82f8d8c 100644 --- a/demos/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.pas +++ b/demos/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSExtensionWithObjectParameter/uMyV8Handler.pas b/demos/JavaScript/JSExtensionWithObjectParameter/uMyV8Handler.pas index 9f25d64d..684fefd1 100644 --- a/demos/JavaScript/JSExtensionWithObjectParameter/uMyV8Handler.pas +++ b/demos/JavaScript/JSExtensionWithObjectParameter/uMyV8Handler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSSimpleExtension/uJSSimpleExtension.pas b/demos/JavaScript/JSSimpleExtension/uJSSimpleExtension.pas index d18d9003..26f9a2de 100644 --- a/demos/JavaScript/JSSimpleExtension/uJSSimpleExtension.pas +++ b/demos/JavaScript/JSSimpleExtension/uJSSimpleExtension.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.pas b/demos/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.pas index c93a0edf..31165b1a 100644 --- a/demos/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.pas +++ b/demos/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.pas b/demos/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.pas index 72a3b91f..870355dd 100644 --- a/demos/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.pas +++ b/demos/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.pas b/demos/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.pas index 9ccce222..e3044e55 100644 --- a/demos/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.pas +++ b/demos/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSWindowBindingWithFunction/uMyV8Handler.pas b/demos/JavaScript/JSWindowBindingWithFunction/uMyV8Handler.pas index 02015f68..32e969e3 100644 --- a/demos/JavaScript/JSWindowBindingWithFunction/uMyV8Handler.pas +++ b/demos/JavaScript/JSWindowBindingWithFunction/uMyV8Handler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.pas b/demos/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.pas index ac445b27..4a492a90 100644 --- a/demos/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.pas +++ b/demos/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/JavaScript/JSWindowBindingWithObject/uMyV8Accessor.pas b/demos/JavaScript/JSWindowBindingWithObject/uMyV8Accessor.pas index 05b17e44..e4c46f16 100644 --- a/demos/JavaScript/JSWindowBindingWithObject/uMyV8Accessor.pas +++ b/demos/JavaScript/JSWindowBindingWithObject/uMyV8Accessor.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/KioskOSRBrowser/uKioskOSRBrowser.pas b/demos/KioskOSRBrowser/uKioskOSRBrowser.pas index 53587418..b318e2c7 100644 --- a/demos/KioskOSRBrowser/uKioskOSRBrowser.pas +++ b/demos/KioskOSRBrowser/uKioskOSRBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -763,6 +763,7 @@ begin chrmosr.ShutdownDragAndDrop; if (FPopUpBitmap <> nil) then FreeAndNil(FPopUpBitmap); + if (FResizeCS <> nil) then FreeAndNil(FResizeCS); end; procedure TForm1.FormHide(Sender: TObject); diff --git a/demos/MDIBrowser/uChildForm.pas b/demos/MDIBrowser/uChildForm.pas index a1ec90ea..8d3e95b1 100644 --- a/demos/MDIBrowser/uChildForm.pas +++ b/demos/MDIBrowser/uChildForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/MDIBrowser/uMainForm.pas b/demos/MDIBrowser/uMainForm.pas index b85f2512..fb9b009a 100644 --- a/demos/MDIBrowser/uMainForm.pas +++ b/demos/MDIBrowser/uMainForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/MDIExternalPumpBrowser/uChildForm.pas b/demos/MDIExternalPumpBrowser/uChildForm.pas index 06197195..7dca489b 100644 --- a/demos/MDIExternalPumpBrowser/uChildForm.pas +++ b/demos/MDIExternalPumpBrowser/uChildForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/MDIExternalPumpBrowser/uMainForm.pas b/demos/MDIExternalPumpBrowser/uMainForm.pas index f8617205..d8f58ca0 100644 --- a/demos/MDIExternalPumpBrowser/uMainForm.pas +++ b/demos/MDIExternalPumpBrowser/uMainForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/MiniBrowser/uMiniBrowser.pas b/demos/MiniBrowser/uMiniBrowser.pas index e0d8ba5f..c535d6c8 100644 --- a/demos/MiniBrowser/uMiniBrowser.pas +++ b/demos/MiniBrowser/uMiniBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/MiniBrowser/uPreferences.pas b/demos/MiniBrowser/uPreferences.pas index 5190de7f..40ce8584 100644 --- a/demos/MiniBrowser/uPreferences.pas +++ b/demos/MiniBrowser/uPreferences.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.dfm b/demos/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.dfm index 5690c3ad..5530a957 100644 --- a/demos/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.dfm +++ b/demos/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.dfm @@ -108,6 +108,9 @@ object OSRExternalPumpBrowserFrm: TOSRExternalPumpBrowserFrm Top = 30 Width = 913 Height = 554 + OnIMECancelComposition = Panel1IMECancelComposition + OnIMECommitText = Panel1IMECommitText + OnIMESetComposition = Panel1IMESetComposition Align = alClient Caption = 'Panel1' TabOrder = 1 @@ -134,6 +137,7 @@ object OSRExternalPumpBrowserFrm: TOSRExternalPumpBrowserFrm OnPopupSize = chrmosrPopupSize OnPaint = chrmosrPaint OnCursorChange = chrmosrCursorChange + OnIMECompositionRangeChanged = chrmosrIMECompositionRangeChanged Left = 24 Top = 56 end diff --git a/demos/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.pas b/demos/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.pas index 001dd34e..1d7a8ae5 100644 --- a/demos/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.pas +++ b/demos/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -78,6 +78,9 @@ type procedure Panel1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure Panel1MouseLeave(Sender: TObject); + procedure Panel1IMECancelComposition(Sender: TObject); + procedure Panel1IMECommitText(Sender: TObject; const aText: ustring; const replacement_range: PCefRange; relative_cursor_pos: Integer); + procedure Panel1IMESetComposition(Sender: TObject; const aText: ustring; const underlines: TCefCompositionUnderlineDynArray; const replacement_range, selection_range: TCefRange); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); @@ -98,6 +101,7 @@ type procedure chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser); procedure chrmosrTooltip(Sender: TObject; const browser: ICefBrowser; var text: ustring; out Result: Boolean); procedure chrmosrBeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var noJavascriptAccess: Boolean; var Result: Boolean); + procedure chrmosrIMECompositionRangeChanged(Sender: TObject; const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect); procedure SnapshotBtnClick(Sender: TObject); procedure SnapshotBtnEnter(Sender: TObject); @@ -665,6 +669,7 @@ begin chrmosr.ShutdownDragAndDrop; if (FPopUpBitmap <> nil) then FreeAndNil(FPopUpBitmap); + if (FResizeCS <> nil) then FreeAndNil(FResizeCS); end; procedure TOSRExternalPumpBrowserFrm.FormHide(Sender: TObject); @@ -685,6 +690,8 @@ begin // opaque white background color chrmosr.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF); + Panel1.CreateIMEHandler; + if chrmosr.CreateBrowser(nil, '') then chrmosr.InitializeDragAndDrop(Panel1) else @@ -856,4 +863,66 @@ begin if not(chrmosr.Initialized) then Timer1.Enabled := True; end; +procedure TOSRExternalPumpBrowserFrm.Panel1IMECancelComposition(Sender: TObject); +begin + chrmosr.IMECancelComposition; +end; + +procedure TOSRExternalPumpBrowserFrm.Panel1IMECommitText( Sender : TObject; + const aText : ustring; + const replacement_range : PCefRange; + relative_cursor_pos : Integer); +begin + chrmosr.IMECommitText(aText, replacement_range, relative_cursor_pos); +end; + +procedure TOSRExternalPumpBrowserFrm.Panel1IMESetComposition( Sender : TObject; + const aText : ustring; + const underlines : TCefCompositionUnderlineDynArray; + const replacement_range : TCefRange; + const selection_range : TCefRange); +begin + chrmosr.IMESetComposition(aText, underlines, @replacement_range, @selection_range); +end; + +procedure TOSRExternalPumpBrowserFrm.chrmosrIMECompositionRangeChanged( Sender : TObject; + const browser : ICefBrowser; + const selected_range : PCefRange; + character_boundsCount : NativeUInt; + const character_bounds : PCefRect); +var + TempDeviceBounds : TCefRectDynArray; + TempPRect : PCefRect; + i : NativeUInt; +begin + TempDeviceBounds := nil; + + try + if (character_boundsCount > 0) then + begin + SetLength(TempDeviceBounds, character_boundsCount); + + i := 0; + TempPRect := character_bounds; + + while (i < character_boundsCount) do + begin + TempDeviceBounds[i] := TempPRect^; + LogicalToDevice(TempDeviceBounds[i], GlobalCEFApp.DeviceScaleFactor); + + inc(TempPRect); + inc(i); + end; + end; + + Panel1.ChangeCompositionRange(selected_range^, TempDeviceBounds); + finally + if (TempDeviceBounds <> nil) then + begin + Finalize(TempDeviceBounds); + TempDeviceBounds := nil; + end; + end; +end; + end. diff --git a/demos/PopupBrowser/uChildForm.pas b/demos/PopupBrowser/uChildForm.pas index 9d694795..4674e2ad 100644 --- a/demos/PopupBrowser/uChildForm.pas +++ b/demos/PopupBrowser/uChildForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/PopupBrowser/uMainForm.pas b/demos/PopupBrowser/uMainForm.pas index 618a8fc2..2a7fd95e 100644 --- a/demos/PopupBrowser/uMainForm.pas +++ b/demos/PopupBrowser/uMainForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/PopupBrowser2/uChildForm.pas b/demos/PopupBrowser2/uChildForm.pas index 948b5474..c18408b2 100644 --- a/demos/PopupBrowser2/uChildForm.pas +++ b/demos/PopupBrowser2/uChildForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/PopupBrowser2/uMainForm.pas b/demos/PopupBrowser2/uMainForm.pas index 3269de2e..e932df0b 100644 --- a/demos/PopupBrowser2/uMainForm.pas +++ b/demos/PopupBrowser2/uMainForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/PostInspectorBrowser/uPostInspectorBrowser.pas b/demos/PostInspectorBrowser/uPostInspectorBrowser.pas index df2573ce..511199e8 100644 --- a/demos/PostInspectorBrowser/uPostInspectorBrowser.pas +++ b/demos/PostInspectorBrowser/uPostInspectorBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/SchemeRegistrationBrowser/uHelloScheme.pas b/demos/SchemeRegistrationBrowser/uHelloScheme.pas index 2ce74e9c..528510c2 100644 --- a/demos/SchemeRegistrationBrowser/uHelloScheme.pas +++ b/demos/SchemeRegistrationBrowser/uHelloScheme.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.pas b/demos/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.pas index 2227181c..22ee30fa 100644 --- a/demos/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.pas +++ b/demos/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/SimpleBrowser/uSimpleBrowser.pas b/demos/SimpleBrowser/uSimpleBrowser.pas index 736d2f8f..5e3c8d16 100644 --- a/demos/SimpleBrowser/uSimpleBrowser.pas +++ b/demos/SimpleBrowser/uSimpleBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/SimpleBrowser2/uSimpleBrowser2.pas b/demos/SimpleBrowser2/uSimpleBrowser2.pas index 889ffe71..2e459cd9 100644 --- a/demos/SimpleBrowser2/uSimpleBrowser2.pas +++ b/demos/SimpleBrowser2/uSimpleBrowser2.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.pas b/demos/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.pas index ec4bed91..ae0c9a26 100644 --- a/demos/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.pas +++ b/demos/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/SimpleFMXBrowser/uFMXApplicationService.pas b/demos/SimpleFMXBrowser/uFMXApplicationService.pas index 1826db47..cdb4f091 100644 --- a/demos/SimpleFMXBrowser/uFMXApplicationService.pas +++ b/demos/SimpleFMXBrowser/uFMXApplicationService.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/SimpleFMXBrowser/uSimpleFMXBrowser.pas b/demos/SimpleFMXBrowser/uSimpleFMXBrowser.pas index cee2b44d..58f9c419 100644 --- a/demos/SimpleFMXBrowser/uSimpleFMXBrowser.pas +++ b/demos/SimpleFMXBrowser/uSimpleFMXBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/SimpleLazOSRBrowser/SimpleLazOSRBrowser.lpi b/demos/SimpleLazOSRBrowser/SimpleLazOSRBrowser.lpi index ec22b57a..a5ffe8a0 100644 --- a/demos/SimpleLazOSRBrowser/SimpleLazOSRBrowser.lpi +++ b/demos/SimpleLazOSRBrowser/SimpleLazOSRBrowser.lpi @@ -1,7 +1,7 @@ - + @@ -24,9 +24,10 @@ - - - + + + + diff --git a/demos/SimpleLazOSRBrowser/SimpleLazOSRBrowser.lps b/demos/SimpleLazOSRBrowser/SimpleLazOSRBrowser.lps index 91b1d3d1..e480b115 100644 --- a/demos/SimpleLazOSRBrowser/SimpleLazOSRBrowser.lps +++ b/demos/SimpleLazOSRBrowser/SimpleLazOSRBrowser.lps @@ -2,17 +2,17 @@ - + - + - + - + @@ -21,14 +21,14 @@ - - - - - - - + + + + + + + @@ -43,10 +43,11 @@ - - - + + + + @@ -60,10 +61,11 @@ - - - + + + + @@ -155,18 +157,187 @@ - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demos/SimpleLazOSRBrowser/usimplelazosrbrowser.lfm b/demos/SimpleLazOSRBrowser/usimplelazosrbrowser.lfm index 88854c89..46517d42 100644 --- a/demos/SimpleLazOSRBrowser/usimplelazosrbrowser.lfm +++ b/demos/SimpleLazOSRBrowser/usimplelazosrbrowser.lfm @@ -16,7 +16,7 @@ object Form1: TForm1 OnHide = FormHide OnShow = FormShow Position = poScreenCenter - LCLVersion = '1.8.4.0' + LCLVersion = '2.0.0.3' object NavControlPnl: TPanel Left = 0 Height = 21 @@ -90,6 +90,9 @@ object Form1: TForm1 Height = 544 Top = 21 Width = 800 + OnIMECancelComposition = Panel1IMECancelComposition + OnIMECommitText = Panel1IMECommitText + OnIMESetComposition = Panel1IMESetComposition Align = alClient OnUTF8KeyPress = Panel1UTF8KeyPress Caption = 'Panel1' @@ -119,6 +122,7 @@ object Form1: TForm1 OnPopupSize = chrmosrPopupSize OnPaint = chrmosrPaint OnCursorChange = chrmosrCursorChange + OnIMECompositionRangeChanged = chrmosrIMECompositionRangeChanged left = 24 top = 56 end diff --git a/demos/SimpleLazOSRBrowser/usimplelazosrbrowser.pas b/demos/SimpleLazOSRBrowser/usimplelazosrbrowser.pas index f86b4739..2b88f824 100644 --- a/demos/SimpleLazOSRBrowser/usimplelazosrbrowser.pas +++ b/demos/SimpleLazOSRBrowser/usimplelazosrbrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -43,8 +43,8 @@ interface uses Windows, LCLIntf, LCLType, LMessages, Messages, SysUtils, Variants, Classes, SyncObjs, - Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, - uCEFChromium, uCEFTypes, uCEFInterfaces, uCEFConstants, uBufferPanel, Types; + Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Types, + uCEFChromium, uCEFTypes, uCEFInterfaces, uCEFConstants, uBufferPanel, uCEFChromiumEvents; type @@ -66,6 +66,9 @@ type procedure Panel1Enter(Sender: TObject); procedure Panel1Exit(Sender: TObject); + procedure Panel1IMECancelComposition(Sender: TObject); + procedure Panel1IMECommitText(Sender: TObject; const aText: ustring; const replacement_range: PCefRange; relative_cursor_pos: integer); + procedure Panel1IMESetComposition(Sender: TObject; const aText: ustring; const underlines: TCefCompositionUnderlineDynArray; const replacement_range, selection_range: TCefRange); procedure Panel1Resize(Sender: TObject); procedure Panel1Click(Sender: TObject); procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); @@ -96,6 +99,7 @@ type procedure chrmosrBeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var noJavascriptAccess: Boolean; var Result: Boolean); procedure chrmosrClose(Sender: TObject; const browser: ICefBrowser; out Result: Boolean); procedure chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser); + procedure chrmosrIMECompositionRangeChanged(Sender: TObject; const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect); procedure SnapshotBtnClick(Sender: TObject); procedure Timer1Timer(Sender: TObject); @@ -111,7 +115,10 @@ type FPendingResize : boolean; FCanClose : boolean; FClosing : boolean; - FResizeCS : TCriticalSection; + FResizeCS : TCriticalSection; + FIMECS : TCriticalSection; + FDeviceBounds : TCefRectDynArray; + FSelectedRange : TCefRange; FLastClickCount : integer; FLastClickTime : integer; @@ -135,7 +142,8 @@ type procedure WMSysKeyUp(var aMessage: TMessage); message WM_SYSKEYUP; procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED; procedure PendingResizeMsg(var aMessage : TMessage); message CEF_PENDINGRESIZE; - procedure PendingInvalidateMsg(var aMessage : TMessage); message CEF_PENDINGINVALIDATE; + procedure PendingInvalidateMsg(var aMessage : TMessage); message CEF_PENDINGINVALIDATE; + procedure RangeChangedMsg(var aMessage : TMessage); message CEF_IMERANGECHANGED; public { Public declarations } @@ -169,6 +177,55 @@ begin chrmosr.LoadURL(ComboBox1.Text); end; +procedure TForm1.chrmosrIMECompositionRangeChanged( Sender : TObject; + const browser : ICefBrowser; + const selected_range : PCefRange; + character_boundsCount : NativeUInt; + const character_bounds : PCefRect); +var + TempPRect : PCefRect; + i : NativeUInt; +begin + try + FIMECS.Acquire; + + // TChromium.OnIMECompositionRangeChanged is triggered in a different thread + // and all functions using a IMM context need to be executed in the same + // thread, in this case the main thread. We need to save the parameters and + // send a message to the form to execute Panel1.ChangeCompositionRange in + // the main thread. + + if (FDeviceBounds <> nil) then + begin + Finalize(FDeviceBounds); + FDeviceBounds := nil; + end; + + FSelectedRange := selected_range^; + + if (character_boundsCount > 0) then + begin + SetLength(FDeviceBounds, character_boundsCount); + + i := 0; + TempPRect := character_bounds; + + while (i < character_boundsCount) do + begin + FDeviceBounds[i] := TempPRect^; + LogicalToDevice(FDeviceBounds[i], GlobalCEFApp.DeviceScaleFactor); + + inc(TempPRect); + inc(i); + end; + end; + + PostMessage(Handle, CEF_IMERANGECHANGED, 0, 0); + finally + FIMECS.Release; + end; +end; + procedure TForm1.GoBtnEnter(Sender: TObject); begin chrmosr.SendFocusEvent(False); @@ -614,7 +671,13 @@ begin FPendingResize := False; FCanClose := False; FClosing := False; + FDeviceBounds := nil; + + FSelectedRange.from := 0; + FSelectedRange.to_ := 0; + FResizeCS := TCriticalSection.Create; + FIMECS := TCriticalSection.Create; InitializeLastClick; end; @@ -623,7 +686,15 @@ procedure TForm1.FormDestroy(Sender: TObject); begin chrmosr.ShutdownDragAndDrop; - if (FPopUpBitmap <> nil) then FreeAndNil(FPopUpBitmap); + if (FPopUpBitmap <> nil) then FreeAndNil(FPopUpBitmap); + if (FResizeCS <> nil) then FreeAndNil(FResizeCS); + if (FIMECS <> nil) then FreeAndNil(FIMECS); + + if (FDeviceBounds <> nil) then + begin + Finalize(FDeviceBounds); + FDeviceBounds := nil; + end; end; procedure TForm1.FormHide(Sender: TObject); @@ -644,6 +715,11 @@ begin // opaque white background color chrmosr.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF); + // The IME handler needs to be created when Panel1 has a valid handle + // and before the browser creation. + // You can skip this if the user doesn't need an "Input Method Editor". + Panel1.CreateIMEHandler; + if chrmosr.CreateBrowser(nil, '') then chrmosr.InitializeDragAndDrop(Panel1) else @@ -752,6 +828,16 @@ begin Panel1.Invalidate; end; +procedure TForm1.RangeChangedMsg(var aMessage : TMessage); +begin + try + FIMECS.Acquire; + Panel1.ChangeCompositionRange(FSelectedRange, FDeviceBounds); + finally + FIMECS.Release; + end; +end; + procedure TForm1.DoResize; begin try @@ -800,6 +886,28 @@ begin chrmosr.SendFocusEvent(False); end; +procedure TForm1.Panel1IMECancelComposition(Sender: TObject); +begin + chrmosr.IMECancelComposition; +end; + +procedure TForm1.Panel1IMECommitText( Sender : TObject; + const aText : ustring; + const replacement_range : PCefRange; + relative_cursor_pos : Integer); +begin + chrmosr.IMECommitText(aText, replacement_range, relative_cursor_pos); +end; + +procedure TForm1.Panel1IMESetComposition( Sender : TObject; + const aText : ustring; + const underlines : TCefCompositionUnderlineDynArray; + const replacement_range : TCefRange; + const selection_range : TCefRange); +begin + chrmosr.IMESetComposition(aText, underlines, @replacement_range, @selection_range); +end; + procedure TForm1.Panel1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); var TempKeyEvent : TCefKeyEvent; diff --git a/demos/SimpleLazarusBrowser/SimpleLazarusBrowser.lpi b/demos/SimpleLazarusBrowser/SimpleLazarusBrowser.lpi index 08245704..7ee3f522 100644 --- a/demos/SimpleLazarusBrowser/SimpleLazarusBrowser.lpi +++ b/demos/SimpleLazarusBrowser/SimpleLazarusBrowser.lpi @@ -1,7 +1,7 @@ - + @@ -18,9 +18,10 @@ - - - + + + + diff --git a/demos/SimpleLazarusBrowser/SimpleLazarusBrowser.lps b/demos/SimpleLazarusBrowser/SimpleLazarusBrowser.lps index b235cf9c..7e9cf979 100644 --- a/demos/SimpleLazarusBrowser/SimpleLazarusBrowser.lps +++ b/demos/SimpleLazarusBrowser/SimpleLazarusBrowser.lps @@ -2,16 +2,16 @@ - + - + - + @@ -20,11 +20,11 @@ + - - - + + @@ -84,9 +84,13 @@ - - + + + + + + @@ -360,8 +364,8 @@ - + @@ -372,10 +376,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demos/SimpleLazarusBrowser/SimpleLazarusBrowser.res b/demos/SimpleLazarusBrowser/SimpleLazarusBrowser.res index 877868cb..f6e84995 100644 Binary files a/demos/SimpleLazarusBrowser/SimpleLazarusBrowser.res and b/demos/SimpleLazarusBrowser/SimpleLazarusBrowser.res differ diff --git a/demos/SimpleLazarusBrowser/usimplelazarusbrowser.lfm b/demos/SimpleLazarusBrowser/usimplelazarusbrowser.lfm index bf0f1c16..9a7832e2 100644 --- a/demos/SimpleLazarusBrowser/usimplelazarusbrowser.lfm +++ b/demos/SimpleLazarusBrowser/usimplelazarusbrowser.lfm @@ -1,7 +1,7 @@ object Form1: TForm1 Left = 298 Height = 574 - Top = 142 + Top = 218 Width = 878 Caption = 'Initializing browser. Please wait...' ClientHeight = 574 @@ -10,7 +10,7 @@ object Form1: TForm1 OnCreate = FormCreate OnShow = FormShow Position = poScreenCenter - LCLVersion = '1.8.4.0' + LCLVersion = '2.0.0.3' object AddressPnl: TPanel Left = 0 Height = 23 diff --git a/demos/SimpleLazarusBrowser/usimplelazarusbrowser.pas b/demos/SimpleLazarusBrowser/usimplelazarusbrowser.pas index 490c5d14..560c9f8b 100644 --- a/demos/SimpleLazarusBrowser/usimplelazarusbrowser.pas +++ b/demos/SimpleLazarusBrowser/usimplelazarusbrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/SimpleOSRBrowser/uSimpleOSRBrowser.dfm b/demos/SimpleOSRBrowser/uSimpleOSRBrowser.dfm index e9dd2436..03b33fe7 100644 --- a/demos/SimpleOSRBrowser/uSimpleOSRBrowser.dfm +++ b/demos/SimpleOSRBrowser/uSimpleOSRBrowser.dfm @@ -107,6 +107,9 @@ object Form1: TForm1 Top = 30 Width = 988 Height = 638 + OnIMECancelComposition = Panel1IMECancelComposition + OnIMECommitText = Panel1IMECommitText + OnIMESetComposition = Panel1IMESetComposition Align = alClient Caption = 'Panel1' TabOrder = 1 @@ -133,6 +136,7 @@ object Form1: TForm1 OnPopupSize = chrmosrPopupSize OnPaint = chrmosrPaint OnCursorChange = chrmosrCursorChange + OnIMECompositionRangeChanged = chrmosrIMECompositionRangeChanged Left = 24 Top = 56 end diff --git a/demos/SimpleOSRBrowser/uSimpleOSRBrowser.pas b/demos/SimpleOSRBrowser/uSimpleOSRBrowser.pas index 6bb4b527..6e657933 100644 --- a/demos/SimpleOSRBrowser/uSimpleOSRBrowser.pas +++ b/demos/SimpleOSRBrowser/uSimpleOSRBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -45,7 +45,7 @@ uses {$IFDEF DELPHI16_UP} Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, System.SyncObjs, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, - Vcl.ExtCtrls, Vcl.AppEvnts, + Vcl.ExtCtrls, Vcl.AppEvnts, WinApi.imm, {$ELSE} Windows, Messages, SysUtils, Variants, Classes, SyncObjs, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, AppEvnts, @@ -78,6 +78,9 @@ type procedure Panel1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure Panel1MouseLeave(Sender: TObject); + procedure Panel1IMECancelComposition(Sender: TObject); + procedure Panel1IMECommitText(Sender: TObject; const aText: ustring; const replacement_range: PCefRange; relative_cursor_pos: Integer); + procedure Panel1IMESetComposition(Sender: TObject; const aText: ustring; const underlines: TCefCompositionUnderlineDynArray; const replacement_range, selection_range: TCefRange); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); @@ -98,6 +101,7 @@ type procedure chrmosrBeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var noJavascriptAccess: Boolean; var Result: Boolean); procedure chrmosrClose(Sender: TObject; const browser: ICefBrowser; out Result: Boolean); procedure chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser); + procedure chrmosrIMECompositionRangeChanged(Sender: TObject; const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect); procedure SnapshotBtnClick(Sender: TObject); procedure Timer1Timer(Sender: TObject); @@ -113,6 +117,9 @@ type FCanClose : boolean; FClosing : boolean; FResizeCS : TCriticalSection; + FIMECS : TCriticalSection; + FDeviceBounds : TCefRectDynArray; + FSelectedRange : TCefRange; FLastClickCount : integer; FLastClickTime : integer; @@ -133,6 +140,7 @@ type procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP; procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED; procedure PendingResizeMsg(var aMessage : TMessage); message CEF_PENDINGRESIZE; + procedure RangeChangedMsg(var aMessage : TMessage); message CEF_IMERANGECHANGED; public { Public declarations } @@ -647,7 +655,13 @@ begin FPendingResize := False; FCanClose := False; FClosing := False; + FDeviceBounds := nil; + + FSelectedRange.from := 0; + FSelectedRange.to_ := 0; + FResizeCS := TCriticalSection.Create; + FIMECS := TCriticalSection.Create; InitializeLastClick; end; @@ -657,6 +671,14 @@ begin chrmosr.ShutdownDragAndDrop; if (FPopUpBitmap <> nil) then FreeAndNil(FPopUpBitmap); + if (FResizeCS <> nil) then FreeAndNil(FResizeCS); + if (FIMECS <> nil) then FreeAndNil(FIMECS); + + if (FDeviceBounds <> nil) then + begin + Finalize(FDeviceBounds); + FDeviceBounds := nil; + end; end; procedure TForm1.FormHide(Sender: TObject); @@ -677,6 +699,11 @@ begin // opaque white background color chrmosr.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF); + // The IME handler needs to be created when Panel1 has a valid handle + // and before the browser creation. + // You can skip this if the user doesn't need an "Input Method Editor". + Panel1.CreateIMEHandler; + if chrmosr.CreateBrowser(nil, '') then chrmosr.InitializeDragAndDrop(Panel1) else @@ -780,6 +807,16 @@ begin DoResize; end; +procedure TForm1.RangeChangedMsg(var aMessage : TMessage); +begin + try + FIMECS.Acquire; + Panel1.ChangeCompositionRange(FSelectedRange, FDeviceBounds); + finally + FIMECS.Release; + end; +end; + procedure TForm1.DoResize; begin try @@ -848,4 +885,75 @@ begin if not(chrmosr.Initialized) then Timer1.Enabled := True; end; +procedure TForm1.chrmosrIMECompositionRangeChanged( Sender : TObject; + const browser : ICefBrowser; + const selected_range : PCefRange; + character_boundsCount : NativeUInt; + const character_bounds : PCefRect); +var + TempPRect : PCefRect; + i : NativeUInt; +begin + try + FIMECS.Acquire; + + // TChromium.OnIMECompositionRangeChanged is triggered in a different thread + // and all functions using a IMM context need to be executed in the same + // thread, in this case the main thread. We need to save the parameters and + // send a message to the form to execute Panel1.ChangeCompositionRange in + // the main thread. + + if (FDeviceBounds <> nil) then + begin + Finalize(FDeviceBounds); + FDeviceBounds := nil; + end; + + FSelectedRange := selected_range^; + + if (character_boundsCount > 0) then + begin + SetLength(FDeviceBounds, character_boundsCount); + + i := 0; + TempPRect := character_bounds; + + while (i < character_boundsCount) do + begin + FDeviceBounds[i] := TempPRect^; + LogicalToDevice(FDeviceBounds[i], GlobalCEFApp.DeviceScaleFactor); + + inc(TempPRect); + inc(i); + end; + end; + + PostMessage(Handle, CEF_IMERANGECHANGED, 0, 0); + finally + FIMECS.Release; + end; +end; + +procedure TForm1.Panel1IMECancelComposition(Sender: TObject); +begin + chrmosr.IMECancelComposition; +end; + +procedure TForm1.Panel1IMECommitText( Sender : TObject; + const aText : ustring; + const replacement_range : PCefRange; + relative_cursor_pos : Integer); +begin + chrmosr.IMECommitText(aText, replacement_range, relative_cursor_pos); +end; + +procedure TForm1.Panel1IMESetComposition( Sender : TObject; + const aText : ustring; + const underlines : TCefCompositionUnderlineDynArray; + const replacement_range : TCefRange; + const selection_range : TCefRange); +begin + chrmosr.IMESetComposition(aText, underlines, @replacement_range, @selection_range); +end; + end. diff --git a/demos/SimpleServer/uSimpleServer.pas b/demos/SimpleServer/uSimpleServer.pas index a115851d..9bc581b4 100644 --- a/demos/SimpleServer/uSimpleServer.pas +++ b/demos/SimpleServer/uSimpleServer.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/SubProcess/uCEFLoader.pas b/demos/SubProcess/uCEFLoader.pas index 282edb57..e06a1eca 100644 --- a/demos/SubProcess/uCEFLoader.pas +++ b/demos/SubProcess/uCEFLoader.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/SubProcess/uSimpleBrowser.pas b/demos/SubProcess/uSimpleBrowser.pas index d3cc2060..38e139ec 100644 --- a/demos/SubProcess/uSimpleBrowser.pas +++ b/demos/SubProcess/uSimpleBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/TabbedBrowser/uMainForm.pas b/demos/TabbedBrowser/uMainForm.pas index dfa3cbf2..f53c56ab 100644 --- a/demos/TabbedBrowser/uMainForm.pas +++ b/demos/TabbedBrowser/uMainForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/ToolBoxBrowser/uChildForm.pas b/demos/ToolBoxBrowser/uChildForm.pas index 6a4b20d4..3cfd16bb 100644 --- a/demos/ToolBoxBrowser/uChildForm.pas +++ b/demos/ToolBoxBrowser/uChildForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/ToolBoxBrowser/uMainForm.pas b/demos/ToolBoxBrowser/uMainForm.pas index 96b2a0d0..b4b060f8 100644 --- a/demos/ToolBoxBrowser/uMainForm.pas +++ b/demos/ToolBoxBrowser/uMainForm.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/demos/URLRequest/uURLRequest.pas b/demos/URLRequest/uURLRequest.pas index ad273cae..eae8dffd 100644 --- a/demos/URLRequest/uURLRequest.pas +++ b/demos/URLRequest/uURLRequest.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Díaz Fau. All rights reserved. +// Copyright © 2019 Salvador Díaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/packages/CEF4Delphi.dpk b/packages/CEF4Delphi.dpk index 50398286..6edef099 100644 --- a/packages/CEF4Delphi.dpk +++ b/packages/CEF4Delphi.dpk @@ -166,7 +166,8 @@ contains uCEFWinControl in '..\source\uCEFWinControl.pas', uCEFLinkedWindowParent in '..\source\uCEFLinkedWindowParent.pas', uCEFUrlRequestClientEvents in '..\source\uCEFUrlRequestClientEvents.pas', - uCEFUrlRequestClientComponent in '..\source\uCEFUrlRequestClientComponent.pas'; + uCEFUrlRequestClientComponent in '..\source\uCEFUrlRequestClientComponent.pas', + uCEFOSRIMEHandler in '..\source\uCEFOSRIMEHandler.pas'; end. diff --git a/packages/CEF4Delphi_D7.dpk b/packages/CEF4Delphi_D7.dpk index da59126b..4b902e4c 100644 --- a/packages/CEF4Delphi_D7.dpk +++ b/packages/CEF4Delphi_D7.dpk @@ -163,6 +163,7 @@ contains uCEFWinControl in '..\source\uCEFWinControl.pas', uCEFLinkedWindowParent in '..\source\uCEFLinkedWindowParent.pas', uCEFUrlRequestClientEvents in '..\source\uCEFUrlRequestClientEvents.pas', - uCEFUrlRequestClientComponent in '..\source\uCEFUrlRequestClientComponent.pas'; + uCEFUrlRequestClientComponent in '..\source\uCEFUrlRequestClientComponent.pas', + uCEFOSRIMEHandler in '..\source\uCEFOSRIMEHandler.pas'; end. diff --git a/packages/CEF4Delphi_D7_Register.pas b/packages/CEF4Delphi_D7_Register.pas index ed019a50..cbbfd45f 100644 --- a/packages/CEF4Delphi_D7_Register.pas +++ b/packages/CEF4Delphi_D7_Register.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/packages/CEF4Delphi_FMX.dpk b/packages/CEF4Delphi_FMX.dpk index 6196b7c1..559ee61c 100644 --- a/packages/CEF4Delphi_FMX.dpk +++ b/packages/CEF4Delphi_FMX.dpk @@ -170,7 +170,8 @@ contains uCEFWinControl in '..\source\uCEFWinControl.pas', uCEFLinkedWindowParent in '..\source\uCEFLinkedWindowParent.pas', uCEFUrlRequestClientEvents in '..\source\uCEFUrlRequestClientEvents.pas', - uCEFUrlRequestClientComponent in '..\source\uCEFUrlRequestClientComponent.pas'; + uCEFUrlRequestClientComponent in '..\source\uCEFUrlRequestClientComponent.pas', + uCEFOSRIMEHandler in '..\source\uCEFOSRIMEHandler.pas'; end. diff --git a/packages/CEF4Delphi_FMX.dproj b/packages/CEF4Delphi_FMX.dproj index 433d67c5..8c8ba521 100644 --- a/packages/CEF4Delphi_FMX.dproj +++ b/packages/CEF4Delphi_FMX.dproj @@ -272,6 +272,7 @@ + Base diff --git a/packages/CEF4Delphi_FMX.res b/packages/CEF4Delphi_FMX.res index 89743307..391381f9 100644 Binary files a/packages/CEF4Delphi_FMX.res and b/packages/CEF4Delphi_FMX.res differ diff --git a/packages/CEF4Delphi_FMX_Register.pas b/packages/CEF4Delphi_FMX_Register.pas index dfd527fa..f5cf014c 100644 --- a/packages/CEF4Delphi_FMX_Register.pas +++ b/packages/CEF4Delphi_FMX_Register.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/packages/CEF4Delphi_Register.pas b/packages/CEF4Delphi_Register.pas index 94b16236..9a8c6696 100644 --- a/packages/CEF4Delphi_Register.pas +++ b/packages/CEF4Delphi_Register.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/packages/cef4delphi_lazarus.lpk b/packages/cef4delphi_lazarus.lpk index 97caaf81..edfb876e 100644 --- a/packages/cef4delphi_lazarus.lpk +++ b/packages/cef4delphi_lazarus.lpk @@ -21,7 +21,7 @@ - + @@ -578,6 +578,10 @@ + + + + diff --git a/packages/cef4delphi_lazarus.lps b/packages/cef4delphi_lazarus.lps new file mode 100644 index 00000000..ba92bfc9 --- /dev/null +++ b/packages/cef4delphi_lazarus.lps @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/cef4delphi_lazarus.pas b/packages/cef4delphi_lazarus.pas index 3f7becd3..bf2a8431 100644 --- a/packages/cef4delphi_lazarus.pas +++ b/packages/cef4delphi_lazarus.pas @@ -46,7 +46,8 @@ uses uCEFWriteHandler, uCEFX509Certificate, uCEFX509CertPrincipal, uCEFXmlReader, uCEFZipReader, uCEFChromium, uBufferPanel, uCEFServer, uCEFServerComponent, uCEFServerEvents, uCEFServerHandler, uCEFWinControl, uCEFLinkedWindowParent, - uCEFUrlRequestClientEvents, uCEFUrlRequestClientComponent, LazarusPackageIntf; + uCEFUrlRequestClientEvents, uCEFUrlRequestClientComponent, + uCEFOSRIMEHandler, LazarusPackageIntf; implementation diff --git a/source/uBufferPanel.pas b/source/uBufferPanel.pas index 04a99f82..0a92d5b7 100644 --- a/source/uBufferPanel.pas +++ b/source/uBufferPanel.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -47,10 +47,10 @@ interface uses {$IFDEF DELPHI16_UP} - {$IFDEF MSWINDOWS}Winapi.Windows, Winapi.Messages, Vcl.ExtCtrls, Vcl.Controls, Vcl.Graphics,{$ENDIF} + {$IFDEF MSWINDOWS}Winapi.Windows, Winapi.Messages, Vcl.ExtCtrls, Vcl.Controls, Vcl.Graphics, WinApi.Imm,{$ENDIF} System.Classes, System.SyncObjs, System.SysUtils, {$ELSE} - {$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, Forms, Controls, Graphics, + {$IFDEF MSWINDOWS}Windows, imm, {$ENDIF} Classes, Forms, Controls, Graphics, {$IFDEF FPC} LCLProc, LCLType, LCLIntf, LResources, LMessages, InterfaceBase, {$ELSE} @@ -58,15 +58,24 @@ uses {$ENDIF} ExtCtrls, SyncObjs, SysUtils, {$ENDIF} - uCEFConstants; + {$IFDEF MSWINDOWS}uCEFOSRIMEHandler,{$ENDIF} uCEFConstants, uCEFTypes; type + TOnIMECommitTextEvent = procedure(Sender: TObject; const aText : ustring; const replacement_range : PCefRange; relative_cursor_pos : integer) of object; + TOnIMESetCompositionEvent = procedure(Sender: TObject; const aText : ustring; const underlines : TCefCompositionUnderlineDynArray; const replacement_range, selection_range : TCefRange) of object; + {$IFNDEF FPC}{$IFDEF DELPHI16_UP}[ComponentPlatformsAttribute(pidWin32 or pidWin64)]{$ENDIF}{$ENDIF} TBufferPanel = class(TCustomPanel) protected - FMutex : THandle; - FBuffer : TBitmap; - FScanlineSize : integer; + FMutex : THandle; + FBuffer : TBitmap; + FScanlineSize : integer; + {$IFDEF MSWINDOWS} + FIMEHandler : TCEFOSRIMEHandler; + FOnIMECancelComposition : TNotifyEvent; + FOnIMECommitText : TOnIMECommitTextEvent; + FOnIMESetComposition : TOnIMESetCompositionEvent; + {$ENDIF} procedure CreateSyncObj; @@ -81,8 +90,14 @@ type function SaveBufferToFile(const aFilename : string) : boolean; procedure Paint; override; - + {$IFDEF MSWINDOWS} + procedure WndProc(var aMessage: TMessage); override; procedure WMEraseBkgnd(var aMessage : TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMIMEStartComp(var aMessage: TMessage); + procedure WMIMEEndComp(var aMessage: TMessage); + procedure WMIMESetContext(var aMessage: TMessage); + procedure WMIMEComposition(var aMessage: TMessage); + {$ENDIF} public constructor Create(AOwner: TComponent); override; @@ -95,6 +110,8 @@ type procedure BufferDraw(x, y : integer; const aBitmap : TBitmap); function UpdateBufferDimensions(aWidth, aHeight : integer) : boolean; function BufferIsResized(aUseMutex : boolean = True) : boolean; + procedure CreateIMEHandler; + procedure ChangeCompositionRange(const selection_range : TCefRange; const character_bounds : TCefRectDynArray); property Buffer : TBitmap read FBuffer; property ScanlineSize : integer read FScanlineSize; @@ -105,6 +122,12 @@ type property DockManager; published + {$IFDEF MSWINDOWS} + property OnIMECancelComposition : TNotifyEvent read FOnIMECancelComposition write FOnIMECancelComposition; + property OnIMECommitText : TOnIMECommitTextEvent read FOnIMECommitText write FOnIMECommitText; + property OnIMESetComposition : TOnIMESetCompositionEvent read FOnIMESetComposition write FOnIMESetComposition; + {$ENDIF} + property Align; property Alignment; property Anchors; @@ -210,6 +233,13 @@ begin FMutex := 0; FBuffer := nil; + + {$IFDEF MSWINDOWS} + FIMEHandler := nil; + FOnIMECancelComposition := nil; + FOnIMECommitText := nil; + FOnIMESetComposition := nil; + {$ENDIF} end; destructor TBufferPanel.Destroy; @@ -217,6 +247,10 @@ begin DestroyBuffer; DestroySyncObj; + {$IFDEF MSWINDOWS} + if (FIMEHandler <> nil) then FreeAndNil(FIMEHandler); + {$ENDIF} + inherited Destroy; end; @@ -225,20 +259,48 @@ begin inherited AfterConstruction; CreateSyncObj; + + {$IFDEF MSWINDOWS} + {$IFNDEF FPC} + ImeMode := imDontCare; + ImeName := ''; + {$ENDIF} + {$ENDIF} +end; + +procedure TBufferPanel.CreateIMEHandler; +begin + {$IFDEF MSWINDOWS} + if (FIMEHandler = nil) and HandleAllocated then + FIMEHandler := TCEFOSRIMEHandler.Create(Handle); + {$ENDIF} +end; + +procedure TBufferPanel.ChangeCompositionRange(const selection_range : TCefRange; + const character_bounds : TCefRectDynArray); +begin + {$IFDEF MSWINDOWS} + if (FIMEHandler <> nil) then + FIMEHandler.ChangeCompositionRange(selection_range, character_bounds); + {$ENDIF} end; procedure TBufferPanel.CreateSyncObj; begin + {$IFDEF MSWINDOWS} FMutex := CreateMutex(nil, False, nil); + {$ENDIF} end; procedure TBufferPanel.DestroySyncObj; begin + {$IFDEF MSWINDOWS} if (FMutex <> 0) then begin CloseHandle(FMutex); FMutex := 0; end; + {$ENDIF} end; procedure TBufferPanel.DestroyBuffer; @@ -279,17 +341,23 @@ end; function TBufferPanel.InvalidatePanel : boolean; begin + {$IFDEF MSWINDOWS} Result := HandleAllocated and PostMessage(Handle, CM_INVALIDATE, 0, 0); + {$ENDIF} end; function TBufferPanel.BeginBufferDraw : boolean; begin + {$IFDEF MSWINDOWS} Result := (FMutex <> 0) and (WaitForSingleObject(FMutex, 5000) = WAIT_OBJECT_0); + {$ENDIF} end; procedure TBufferPanel.EndBufferDraw; begin + {$IFDEF MSWINDOWS} if (FMutex <> 0) then ReleaseMutex(FMutex); + {$ENDIF} end; function TBufferPanel.CopyBuffer : boolean; @@ -327,11 +395,130 @@ begin end; end; +{$IFDEF MSWINDOWS} +procedure TBufferPanel.WndProc(var aMessage: TMessage); +begin + case aMessage.Msg of + WM_IME_STARTCOMPOSITION : WMIMEStartComp(aMessage); + WM_IME_COMPOSITION : WMIMEComposition(aMessage); + + WM_IME_ENDCOMPOSITION : + begin + WMIMEEndComp(aMessage); + inherited WndProc(aMessage); + end; + + WM_IME_SETCONTEXT : + begin + aMessage.LParam := aMessage.LParam and not(ISC_SHOWUICOMPOSITIONWINDOW); + inherited WndProc(aMessage); + WMIMESetContext(aMessage); + end; + + else inherited WndProc(aMessage); + end; +end; + procedure TBufferPanel.WMEraseBkgnd(var aMessage : TWMEraseBkgnd); begin aMessage.Result := 1; end; +procedure TBufferPanel.WMIMEStartComp(var aMessage: TMessage); +begin + if (FIMEHandler <> nil) then + begin + {$IFNDEF FPC} + FInImeComposition := False; + {$ENDIF} + + FIMEHandler.CreateImeWindow; + FIMEHandler.MoveImeWindow; + FIMEHandler.ResetComposition; + end; +end; + +procedure TBufferPanel.WMIMEEndComp(var aMessage: TMessage); +begin + if assigned(FOnIMECancelComposition) then FOnIMECancelComposition(self); + + if (FIMEHandler <> nil) then + begin + FIMEHandler.ResetComposition; + FIMEHandler.DestroyImeWindow; + end; +end; + +procedure TBufferPanel.WMIMESetContext(var aMessage: TMessage); +begin + if (FIMEHandler <> nil) then + begin + FIMEHandler.CreateImeWindow; + FIMEHandler.MoveImeWindow; + end; +end; + +procedure TBufferPanel.WMIMEComposition(var aMessage: TMessage); +var + TempText : ustring; + TempRange : TCefRange; + TempCompStart : integer; + TempUnderlines : TCefCompositionUnderlineDynArray; + TempSelection : TCefRange; +begin + TempText := ''; + TempCompStart := 0; + TempUnderlines := nil; + + try + if (FIMEHandler <> nil) then + begin + if FIMEHandler.GetResult(aMessage.LParam, TempText) then + begin + if assigned(FOnIMECommitText) then + begin + TempRange.from := high(Integer); + TempRange.to_ := high(Integer); + + FOnIMECommitText(self, TempText, @TempRange, 0); + end; + + FIMEHandler.ResetComposition; + end; + + if FIMEHandler.GetComposition(aMessage.LParam, TempText, TempUnderlines, TempCompStart) then + begin + if assigned(FOnIMESetComposition) then + begin + TempRange.from := high(Integer); + TempRange.to_ := high(Integer); + + TempSelection.from := TempCompStart; + TempSelection.to_ := TempCompStart + length(TempText); + + FOnIMESetComposition(self, TempText, TempUnderlines, TempRange, TempSelection); + end; + + FIMEHandler.UpdateCaretPosition(pred(TempCompStart)); + end + else + begin + if assigned(FOnIMECancelComposition) then FOnIMECancelComposition(self); + + FIMEHandler.ResetComposition; + FIMEHandler.DestroyImeWindow; + end; + end; + finally + if (TempUnderlines <> nil) then + begin + Finalize(TempUnderlines); + TempUnderlines := nil; + end; + end; +end; +{$ENDIF} + function TBufferPanel.GetBufferBits : pointer; begin if (FBuffer <> nil) then diff --git a/source/uCEFAccessibilityHandler.pas b/source/uCEFAccessibilityHandler.pas index dcfe0d58..c2a65b04 100644 --- a/source/uCEFAccessibilityHandler.pas +++ b/source/uCEFAccessibilityHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFApp.pas b/source/uCEFApp.pas index 50f549c5..1e69ebb9 100644 --- a/source/uCEFApp.pas +++ b/source/uCEFApp.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFApplication.pas b/source/uCEFApplication.pas index d15370bd..d14626c9 100644 --- a/source/uCEFApplication.pas +++ b/source/uCEFApplication.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -67,8 +67,13 @@ const CEF_CHROMEELF_VERSION_RELEASE = 3578; CEF_CHROMEELF_VERSION_BUILD = 80; + {$IFDEF MSWINDOWS} LIBCEF_DLL = 'libcef.dll'; CHROMEELF_DLL = 'chrome_elf.dll'; + {$ELSE} + LIBCEF_DLL = 'libcef.so'; + CHROMEELF_DLL = ''; + {$ENDIF} type TCefApplication = class @@ -271,7 +276,9 @@ type function SingleExeProcessing : boolean; function CheckCEFLibrary : boolean; procedure RegisterWidevineCDM; + {$IFDEF MSWINDOWS} function FindFlashDLL(var aFileName : string) : boolean; + {$ENDIF} procedure ShowErrorMessageDlg(const aError : string); virtual; function ParseProcessType : TCefProcessType; @@ -601,7 +608,9 @@ begin FChromeVersionInfo.Release := CEF_CHROMEELF_VERSION_RELEASE; FChromeVersionInfo.Build := CEF_CHROMEELF_VERSION_BUILD; + {$IFDEF MSWINDOWS} if (FProcessType = ptBrowser) then GetDLLVersion(ChromeElfPath, FChromeVersionInfo); + {$ENDIF} IsMultiThread := True; @@ -808,7 +817,9 @@ begin else FFrameworkDirPath := ''; + {$IFDEF MSWINDOWS} if (FProcessType = ptBrowser) then GetDLLVersion(ChromeElfPath, FChromeVersionInfo); + {$ENDIF} end; procedure TCefApplication.SetResourcesDirPath(const aValue : ustring); @@ -858,6 +869,9 @@ var TempMachine : integer; TempVersionInfo : TFileVersionInfo; begin + {$IFNDEF MSWINDOWS} + Result := True; + {$ELSE} Result := False; if not(FCheckCEFFiles) or (FProcessType <> ptBrowser) then @@ -894,7 +908,6 @@ begin CEF_SUPPORTED_VERSION_RELEASE, CEF_SUPPORTED_VERSION_BUILD) then begin - {$IFDEF MSWINDOWS} if GetDLLHeaderMachine(LibCefPath, TempMachine) then case TempMachine of CEF_IMAGE_FILE_MACHINE_I386 : @@ -937,9 +950,6 @@ begin end else Result := True; - {$ELSE} - Result := True; - {$ENDIF} end else begin @@ -959,6 +969,7 @@ begin if FSetCurrentDir then chdir(TempOldDir); end; + {$ENDIF} end; function TCefApplication.StartMainProcess : boolean; @@ -1173,7 +1184,11 @@ begin TempNewDir := TempOldDir + '(' + inttostr(i) + ')'; until not(DirectoryExists(TempNewDir)); + {$IFDEF MSWINDOWS} if MoveFileW(PWideChar(TempOldDir + chr(0)), PWideChar(TempNewDir + chr(0))) then + {$ELSE} + if RenameFile(TempOldDir, TempNewDir) then + {$ENDIF} begin TempThread := TCEFDirectoryDeleterThread.Create(TempNewDir); {$IFDEF DELPHI14_UP} @@ -1216,6 +1231,7 @@ begin end; end; +{$IFDEF MSWINDOWS} function TCefApplication.FindFlashDLL(var aFileName : string) : boolean; var TempSearchRec : TSearchRec; @@ -1249,6 +1265,7 @@ begin if CustomExceptionHandler('TCefApplication.FindFlashDLL', e) then raise; end; end; +{$ENDIF} procedure TCefApplication.ShowErrorMessageDlg(const aError : string); begin @@ -1443,6 +1460,7 @@ var begin if (commandLine <> nil) and (FProcessType = ptBrowser) and (processType = '') then begin + {$IFDEF MSWINDOWS} if FindFlashDLL(TempFileName) and GetDLLVersion(TempFileName, TempVersionInfo) then begin @@ -1453,6 +1471,7 @@ begin commandLine.AppendSwitchWithValue('--ppapi-flash-version', FileVersionInfoToString(TempVersionInfo)); end else + {$ENDIF} if FFlashEnabled then begin if FEnableGPU then commandLine.AppendSwitch('--enable-gpu-plugin'); @@ -1779,9 +1798,14 @@ begin if (FLibHandle = 0) then begin - FStatus := asErrorLoadingLibrary; + FStatus := asErrorLoadingLibrary; + + {$IFDEF MSWINDOWS} TempString := 'Error loading libcef.dll' + CRLF + CRLF + 'Error code : 0x' + inttohex(GetLastError, 8); + {$ELSE} + TempString := 'Error loading the CEF binaries'; + {$ENDIF} ShowErrorMessageDlg(TempString); exit; diff --git a/source/uCEFAuthCallback.pas b/source/uCEFAuthCallback.pas index 076084ca..e4233c60 100644 --- a/source/uCEFAuthCallback.pas +++ b/source/uCEFAuthCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFBaseRefCounted.pas b/source/uCEFBaseRefCounted.pas index 8c1aac2c..edbb141e 100644 --- a/source/uCEFBaseRefCounted.pas +++ b/source/uCEFBaseRefCounted.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFBaseScopedWrapper.pas b/source/uCEFBaseScopedWrapper.pas index 1a3d4468..c9efda5b 100644 --- a/source/uCEFBaseScopedWrapper.pas +++ b/source/uCEFBaseScopedWrapper.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFBeforeDownloadCallback.pas b/source/uCEFBeforeDownloadCallback.pas index b22626ae..4efb55d9 100644 --- a/source/uCEFBeforeDownloadCallback.pas +++ b/source/uCEFBeforeDownloadCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFBinaryValue.pas b/source/uCEFBinaryValue.pas index 5fe5c4b8..5d534090 100644 --- a/source/uCEFBinaryValue.pas +++ b/source/uCEFBinaryValue.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFBrowser.pas b/source/uCEFBrowser.pas index 14016b8d..68284902 100644 --- a/source/uCEFBrowser.pas +++ b/source/uCEFBrowser.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -131,7 +131,7 @@ type procedure NotifyMoveOrResizeStarted; function GetWindowlessFrameRate : Integer; procedure SetWindowlessFrameRate(frameRate: Integer); - procedure IMESetComposition(const text: ustring; underlinesCount : NativeUInt; const underlines : PCefCompositionUnderline; const replacement_range, selection_range : PCefRange); + procedure IMESetComposition(const text: ustring; const underlines : TCefCompositionUnderlineDynArray; const replacement_range, selection_range : PCefRange); procedure IMECommitText(const text: ustring; const replacement_range : PCefRange; relative_cursor_pos : integer); procedure IMEFinishComposingText(keep_selection : boolean); procedure IMECancelComposition; @@ -577,20 +577,50 @@ begin end; procedure TCefBrowserHostRef.IMESetComposition(const text : ustring; - underlinesCount : NativeUInt; - const underlines : PCefCompositionUnderline; + const underlines : TCefCompositionUnderlineDynArray; const replacement_range : PCefRange; const selection_range : PCefRange); var - TempString : TCefString; + TempString : TCefString; + TempCount, i : NativeUInt; + TempUnderlines : PCefCompositionUnderline; + TempItem : PCefCompositionUnderline; begin - TempString := CefString(text); - PCefBrowserHost(FData)^.ime_set_composition(PCefBrowserHost(FData), - @TempString, - underlinesCount, - underlines, - replacement_range, - selection_range); + TempCount := 0; + TempUnderlines := nil; + + try + TempString := CefString(text); + + if (underlines <> nil) then + begin + TempCount := length(underlines); + GetMem(TempUnderlines, TempCount * SizeOf(TCefCompositionUnderline)); + + TempItem := TempUnderlines; + i := 0; + + while (i < TempCount) do + begin + TempItem^.range := underlines[i].range; + TempItem^.color := underlines[i].color; + TempItem^.background_color := underlines[i].background_color; + TempItem^.thick := underlines[i].thick; + + inc(i); + inc(TempItem); + end; + end; + + PCefBrowserHost(FData)^.ime_set_composition(PCefBrowserHost(FData), + @TempString, + TempCount, + TempUnderlines, + replacement_range, + selection_range); + finally + if (TempUnderlines <> nil) then FreeMem(TempUnderlines); + end; end; procedure TCefBrowserHostRef.IMECommitText(const text: ustring; const replacement_range : PCefRange; relative_cursor_pos : integer); diff --git a/source/uCEFBrowserProcessHandler.pas b/source/uCEFBrowserProcessHandler.pas index 693bef39..466f76c9 100644 --- a/source/uCEFBrowserProcessHandler.pas +++ b/source/uCEFBrowserProcessHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFCallback.pas b/source/uCEFCallback.pas index 7e533de0..0f894906 100644 --- a/source/uCEFCallback.pas +++ b/source/uCEFCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFChromium.pas b/source/uCEFChromium.pas index ff8eedb8..ffe0e52e 100644 --- a/source/uCEFChromium.pas +++ b/source/uCEFChromium.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -252,7 +252,7 @@ type function GetZoomLevel : double; function GetZoomPct : double; function GetIsPopUp : boolean; - function GetWindowHandle : THandle; + function GetWindowHandle : TCefWindowHandle; function GetWindowlessFrameRate : integer; function GetFrameIsFocused : boolean; function GetInitialized : boolean; @@ -331,8 +331,9 @@ type function MustCreateJsDialogHandler : boolean; virtual; function MustCreateDragHandler : boolean; virtual; function MustCreateFindHandler : boolean; virtual; - + {$IFDEF MSWINDOWS} procedure PrefsAvailableMsg(var aMessage : TMessage); + {$ENDIF} function GetParentForm : TCustomForm; procedure ApplyZoomStep; procedure DelayedDragging; @@ -342,10 +343,12 @@ type procedure InitializeWindowInfo(aParentHandle : HWND; aParentRect : TRect; const aWindowName : ustring); virtual; procedure InitializeDevToolsWindowInfo(aDevTools : TWinControl); virtual; - procedure FreeAndNilStub(var aStub : pointer); - procedure CreateStub(const aMethod : TWndMethod; var aStub : Pointer); + {$IFDEF MSWINDOWS} procedure WndProc(var aMessage: TMessage); - {$IFNDEF FPC} + {$ENDIF} + {$IFNDEF FPC} + procedure CreateStub(const aMethod : TWndMethod; var aStub : Pointer); + procedure FreeAndNilStub(var aStub : pointer); procedure BrowserCompWndProc(var aMessage: TMessage); procedure WidgetCompWndProc(var aMessage: TMessage); procedure RenderCompWndProc(var aMessage: TMessage); @@ -564,6 +567,11 @@ type procedure DragSourceEndedAt(x, y: Integer; op: TCefDragOperation); procedure DragSourceSystemDragEnded; + procedure IMESetComposition(const text: ustring; const underlines : TCefCompositionUnderlineDynArray; const replacement_range, selection_range : PCefRange); + procedure IMECommitText(const text: ustring; const replacement_range : PCefRange; relative_cursor_pos : integer); + procedure IMEFinishComposingText(keep_selection : boolean); + procedure IMECancelComposition; + property DefaultUrl : ustring read FDefaultUrl write FDefaultUrl; property Options : TChromiumOptions read FOptions write FOptions; @@ -585,7 +593,7 @@ type property CanGoBack : boolean read GetCanGoBack; property CanGoForward : boolean read GetCanGoForward; property IsPopUp : boolean read GetIsPopUp; - property WindowHandle : THandle read GetWindowHandle; + property WindowHandle : TCefWindowHandle read GetWindowHandle; property BrowserHandle : THandle read FBrowserCompHWND; property WidgetHandle : THandle read FWidgetCompHWND; property RenderHandle : THandle read FRenderCompHWND; @@ -793,7 +801,7 @@ begin FBrowserCompStub := nil; FWidgetCompStub := nil; FRenderCompStub := nil; - {$ENDIF} + {$ENDIF} FBrowserCompHWND := 0; FWidgetCompHWND := 0; FRenderCompHWND := 0; @@ -893,6 +901,7 @@ begin FBrowserId := 0; end; +{$IFNDEF FPC} procedure TChromium.CreateStub(const aMethod : TWndMethod; var aStub : Pointer); begin if (aStub = nil) then aStub := MakeObjectInstance(aMethod); @@ -906,6 +915,7 @@ begin aStub := nil; end; end; +{$ENDIF} procedure TChromium.DestroyClientHandler; begin @@ -933,8 +943,10 @@ begin if not(csDesigning in ComponentState) then begin {$IFDEF FPC} + {$IFDEF MSWINDOWS} TempWndMethod := @WndProc; FCompHandle := AllocateHWnd(TempWndMethod); + {$ENDIF} {$ELSE} FCompHandle := AllocateHWnd(WndProc); {$ENDIF} @@ -1182,23 +1194,39 @@ procedure TChromium.InitializeWindowInfo( aParentHandle : HWND; aParentRect : TRect; const aWindowName : ustring); begin + {$IFDEF MSWINDOWS} if FIsOSR then WindowInfoAsWindowless(FWindowInfo, FCompHandle, aWindowName) else WindowInfoAsChild(FWindowInfo, aParentHandle, aParentRect, aWindowName); + {$ELSE} + if FIsOSR then + WindowInfoAsWindowless(FWindowInfo, FCompHandle) + else + WindowInfoAsChild(FWindowInfo, aParentHandle, aParentRect); + {$ENDIF} end; procedure TChromium.InitializeDevToolsWindowInfo(aDevTools : TWinControl); begin + {$IFDEF MSWINDOWS} if (aDevTools <> nil) then WindowInfoAsChild(FDevWindowInfo, aDevTools.Handle, aDevTools.ClientRect, aDevTools.Name) else - WindowInfoAsPopUp(FDevWindowInfo, WindowHandle, DEVTOOLS_WINDOWNAME); + WindowInfoAsPopUp(FDevWindowInfo, WindowHandle, DEVTOOLS_WINDOWNAME); + {$ELSE} + if (aDevTools <> nil) then + WindowInfoAsChild(FDevWindowInfo, aDevTools.Handle, aDevTools.ClientRect) + else + WindowInfoAsPopUp(FDevWindowInfo, WindowHandle); + {$ENDIF} end; procedure TChromium.InitializeDragAndDrop(const aDropTargetCtrl : TWinControl); +{$IFNDEF FPC} var TempDropTarget : IDropTarget; +{$ENDIF} begin {$IFNDEF FPC} if FIsOSR and @@ -1238,15 +1266,18 @@ end; procedure TChromium.ShutdownDragAndDrop; begin + {$IFDEF MSWINDOWS} if FDragAndDropInitialized and (FDropTargetCtrl <> nil) then begin RevokeDragDrop(FDropTargetCtrl.Handle); FDragAndDropInitialized := False; end; + {$ENDIF} end; procedure TChromium.ToMouseEvent(grfKeyState : Longint; pt : TPoint; var aMouseEvent : TCefMouseEvent); begin + {$IFDEF MSWINDOWS} if (FDropTargetCtrl <> nil) then begin pt := FDropTargetCtrl.ScreenToClient(pt); @@ -1254,6 +1285,7 @@ begin aMouseEvent.y := pt.y; aMouseEvent.modifiers := GetCefMouseModifiers(grfKeyState); end; + {$ENDIF} end; procedure TChromium.DragDropManager_OnDragEnter(Sender: TObject; const aDragData : ICefDragData; grfKeyState: Longint; pt: TPoint; var dwEffect: Longint); @@ -1263,6 +1295,7 @@ var begin if (GlobalCEFApp <> nil) then begin + {$IFDEF MSWINDOWS} ToMouseEvent(grfKeyState, pt, TempMouseEvent); DropEffectToDragOperation(dwEffect, TempAllowedOps); DeviceToLogical(TempMouseEvent, GlobalCEFApp.DeviceScaleFactor); @@ -1271,6 +1304,7 @@ begin DragTargetDragOver(@TempMouseEvent, TempAllowedOps); DragOperationToDropEffect(FDragOperations, dwEffect); + {$ENDIF} end; end; @@ -1281,6 +1315,7 @@ var begin if (GlobalCEFApp <> nil) then begin + {$IFDEF MSWINDOWS} ToMouseEvent(grfKeyState, pt, TempMouseEvent); DropEffectToDragOperation(dwEffect, TempAllowedOps); DeviceToLogical(TempMouseEvent, GlobalCEFApp.DeviceScaleFactor); @@ -1288,6 +1323,7 @@ begin DragTargetDragOver(@TempMouseEvent, TempAllowedOps); DragOperationToDropEffect(FDragOperations, dwEffect); + {$ENDIF} end; end; @@ -1303,6 +1339,7 @@ var begin if (GlobalCEFApp <> nil) then begin + {$IFDEF MSWINDOWS} ToMouseEvent(grfKeyState, pt, TempMouseEvent); DropEffectToDragOperation(dwEffect, TempAllowedOps); DeviceToLogical(TempMouseEvent, GlobalCEFApp.DeviceScaleFactor); @@ -1311,6 +1348,7 @@ begin DragTargetDrop(@TempMouseEvent); DragOperationToDropEffect(FDragOperations, dwEffect); + {$ENDIF} end; end; @@ -1688,7 +1726,7 @@ begin Result := (FBrowser <> nil); end; -function TChromium.GetWindowHandle : THandle; +function TChromium.GetWindowHandle : TCefWindowHandle; begin if Initialized then Result := FBrowser.Host.WindowHandle @@ -2258,6 +2296,7 @@ var begin Result := False; + {$IFDEF MSWINDOWS} if not(FIsOSR) then begin TempHWND := GetWindowHandle; @@ -2282,6 +2321,7 @@ begin ReleaseDC(TempHWND, TempDC); end; end; + {$ENDIF} end; function TChromium.IsSameBrowser(const aBrowser : ICefBrowser) : boolean; @@ -2813,6 +2853,7 @@ var TempPrefs : TStringList; begin Result := False; + {$IFDEF MSWINDOWS} TempPrefs := nil; try @@ -2833,6 +2874,7 @@ begin SendCompMessage(CEF_PREFERENCES_SAVED, Ord(Result)); if (TempPrefs <> nil) then FreeAndNil(TempPrefs); end; + {$ENDIF} end; procedure TChromium.doResolvedHostAvailable(result: TCefErrorCode; const resolvedIps: TStrings); @@ -2912,10 +2954,12 @@ begin Result := assigned(FOnFindResult); end; +{$IFDEF MSWINDOWS} procedure TChromium.PrefsAvailableMsg(var aMessage : TMessage); begin if assigned(FOnPrefsAvailable) then FOnPrefsAvailable(self, (aMessage.WParam <> 0)); end; +{$ENDIF} function TChromium.SendCompMessage(aMsg : cardinal; wParam : cardinal; lParam : integer) : boolean; begin @@ -3035,14 +3079,17 @@ begin {$IFDEF DELPHI16_UP} WinApi.Windows.SetParent(GetWindow(aDevTools.Handle, GW_CHILD), 0); {$ELSE} + {$IFDEF MSWINDOWS} Windows.SetParent(GetWindow(aDevTools.Handle, GW_CHILD), 0); {$ENDIF} + {$ENDIF} end; if (FBrowser <> nil) then FBrowser.Host.CloseDevTools; end; end; +{$IFDEF MSWINDOWS} procedure TChromium.WndProc(var aMessage: TMessage); begin case aMessage.Msg of @@ -3052,6 +3099,7 @@ begin else aMessage.Result := DefWindowProc(FCompHandle, aMessage.Msg, aMessage.WParam, aMessage.LParam); end; end; +{$ENDIF} {$IFNDEF FPC} procedure TChromium.BrowserCompWndProc(var aMessage: TMessage); @@ -3642,13 +3690,13 @@ begin (browser.Identifier = FBrowserId) then begin FBrowserCompHWND := browser.Host.WindowHandle; - + {$IFDEF MSWINDOWS} if (FBrowserCompHWND <> 0) then FWidgetCompHWND := FindWindowEx(FBrowserCompHWND, 0, 'Chrome_WidgetWin_0', ''); if (FWidgetCompHWND <> 0) then FRenderCompHWND := FindWindowEx(FWidgetCompHWND, 0, 'Chrome_RenderWidgetHostHWND', 'Chrome Legacy Window'); - + {$ENDIF} {$IFNDEF FPC} if assigned(FOnBrowserCompMsg) and (FBrowserCompHWND <> 0) and (FOldBrowserCompWndPrc = nil) then begin @@ -4043,6 +4091,33 @@ begin if Initialized then FBrowser.Host.DragSourceSystemDragEnded; end; +procedure TChromium.IMESetComposition(const text : ustring; + const underlines : TCefCompositionUnderlineDynArray; + const replacement_range : PCefRange; + const selection_range : PCefRange); +begin + if Initialized then + FBrowser.Host.IMESetComposition(text, underlines, replacement_range, selection_range); +end; + +procedure TChromium.IMECommitText(const text : ustring; + const replacement_range : PCefRange; + relative_cursor_pos : integer); +begin + if Initialized then + FBrowser.Host.IMECommitText(text, replacement_range, relative_cursor_pos); +end; + +procedure TChromium.IMEFinishComposingText(keep_selection : boolean); +begin + if Initialized then FBrowser.Host.IMEFinishComposingText(keep_selection); +end; + +procedure TChromium.IMECancelComposition; +begin + if Initialized then FBrowser.Host.IMECancelComposition; +end; + {$IFDEF FPC} procedure Register; begin diff --git a/source/uCEFChromiumEvents.pas b/source/uCEFChromiumEvents.pas index a7a7d9f8..728dc151 100644 --- a/source/uCEFChromiumEvents.pas +++ b/source/uCEFChromiumEvents.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFChromiumFontOptions.pas b/source/uCEFChromiumFontOptions.pas index 2454fedf..23c2737d 100644 --- a/source/uCEFChromiumFontOptions.pas +++ b/source/uCEFChromiumFontOptions.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFChromiumOptions.pas b/source/uCEFChromiumOptions.pas index 43da52a6..e26d9671 100644 --- a/source/uCEFChromiumOptions.pas +++ b/source/uCEFChromiumOptions.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFChromiumWindow.pas b/source/uCEFChromiumWindow.pas index c9088849..667f32ea 100644 --- a/source/uCEFChromiumWindow.pas +++ b/source/uCEFChromiumWindow.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -72,6 +72,7 @@ type FUseSetFocus : boolean; function GetBrowserInitialized : boolean; + {$IFDEF MSWINDOWS} function GetChildWindowHandle : THandle; override; procedure WndProc(var aMessage: TMessage); override; @@ -79,7 +80,7 @@ type procedure OnCloseMsg(var aMessage : TMessage); message CEF_DOONCLOSE; procedure OnBeforeCloseMsg(var aMessage : TMessage); message CEF_DOONBEFORECLOSE; procedure OnAfterCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED; - + {$ENDIF} procedure WebBrowser_OnClose(Sender: TObject; const browser: ICefBrowser; out Result: Boolean); procedure WebBrowser_OnBeforeClose(Sender: TObject; const browser: ICefBrowser); procedure WebBrowser_OnAfterCreated(Sender: TObject; const browser: ICefBrowser); @@ -139,6 +140,7 @@ begin end; end; +{$IFDEF MSWINDOWS} function TChromiumWindow.GetChildWindowHandle : THandle; begin Result := 0; @@ -180,6 +182,7 @@ begin else inherited WndProc(aMessage); end; end; +{$ENDIF} function TChromiumWindow.GetBrowserInitialized : boolean; begin @@ -188,25 +191,31 @@ end; procedure TChromiumWindow.WebBrowser_OnClose(Sender: TObject; const browser: ICefBrowser; out Result: Boolean); begin + Result := False; + {$IFDEF MSWINDOWS} if assigned(FOnClose) then begin PostMessage(Handle, CEF_DOONCLOSE, 0, 0); Result := True; - end - else - Result := False; + end; + {$ENDIF} end; procedure TChromiumWindow.WebBrowser_OnBeforeClose(Sender: TObject; const browser: ICefBrowser); begin + {$IFDEF MSWINDOWS} if assigned(FOnBeforeClose) then PostMessage(Handle, CEF_DOONBEFORECLOSE, 0, 0); + {$ENDIF} end; procedure TChromiumWindow.WebBrowser_OnAfterCreated(Sender: TObject; const browser: ICefBrowser); begin + {$IFDEF MSWINDOWS} PostMessage(Handle, CEF_AFTERCREATED, 0, 0); + {$ENDIF} end; +{$IFDEF MSWINDOWS} procedure TChromiumWindow.OnCloseMsg(var aMessage : TMessage); begin if assigned(FOnClose) then FOnClose(self); @@ -222,6 +231,7 @@ begin UpdateSize; if assigned(FOnAfterCreated) then FOnAfterCreated(self); end; +{$ENDIF} function TChromiumWindow.CreateBrowser : boolean; begin diff --git a/source/uCEFClient.pas b/source/uCEFClient.pas index 58e6bd59..1297a66a 100644 --- a/source/uCEFClient.pas +++ b/source/uCEFClient.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFCommandLine.pas b/source/uCEFCommandLine.pas index 19fb7bdc..fcd925a5 100644 --- a/source/uCEFCommandLine.pas +++ b/source/uCEFCommandLine.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFCompletionCallback.pas b/source/uCEFCompletionCallback.pas index 8f25b748..17afd0d6 100644 --- a/source/uCEFCompletionCallback.pas +++ b/source/uCEFCompletionCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFConstants.pas b/source/uCEFConstants.pas index cb3e1e38..5a282ef9 100644 --- a/source/uCEFConstants.pas +++ b/source/uCEFConstants.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -389,6 +389,7 @@ const CEF_DESTROY = WM_APP + $A06; CEF_DOONBEFORECLOSE = WM_APP + $A07; CEF_PENDINGINVALIDATE = WM_APP + $A08; + CEF_IMERANGECHANGED = WM_APP + $A09; {$ENDIF} CEF_TIMER_MINIMUM = $0000000A; diff --git a/source/uCEFContextMenuHandler.pas b/source/uCEFContextMenuHandler.pas index 8a910b53..582a2538 100644 --- a/source/uCEFContextMenuHandler.pas +++ b/source/uCEFContextMenuHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFContextMenuParams.pas b/source/uCEFContextMenuParams.pas index f034c4c6..2aaf3d8e 100644 --- a/source/uCEFContextMenuParams.pas +++ b/source/uCEFContextMenuParams.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFCookieManager.pas b/source/uCEFCookieManager.pas index 4779f6db..4360b664 100644 --- a/source/uCEFCookieManager.pas +++ b/source/uCEFCookieManager.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFCookieVisitor.pas b/source/uCEFCookieVisitor.pas index 7bcc972b..2f83fe4f 100644 --- a/source/uCEFCookieVisitor.pas +++ b/source/uCEFCookieVisitor.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFCustomStreamReader.pas b/source/uCEFCustomStreamReader.pas index cf65ddce..4af9efae 100644 --- a/source/uCEFCustomStreamReader.pas +++ b/source/uCEFCustomStreamReader.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDeleteCookiesCallback.pas b/source/uCEFDeleteCookiesCallback.pas index 7d740958..cfcb01d1 100644 --- a/source/uCEFDeleteCookiesCallback.pas +++ b/source/uCEFDeleteCookiesCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDialogHandler.pas b/source/uCEFDialogHandler.pas index 457d6b02..eb4e7742 100644 --- a/source/uCEFDialogHandler.pas +++ b/source/uCEFDialogHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDictionaryValue.pas b/source/uCEFDictionaryValue.pas index 8697ee09..fad03328 100644 --- a/source/uCEFDictionaryValue.pas +++ b/source/uCEFDictionaryValue.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDisplayHandler.pas b/source/uCEFDisplayHandler.pas index 6cf5558c..95e14206 100644 --- a/source/uCEFDisplayHandler.pas +++ b/source/uCEFDisplayHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDomDocument.pas b/source/uCEFDomDocument.pas index e171d125..5c69fb03 100644 --- a/source/uCEFDomDocument.pas +++ b/source/uCEFDomDocument.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDomNode.pas b/source/uCEFDomNode.pas index 839ba3ea..3948baef 100644 --- a/source/uCEFDomNode.pas +++ b/source/uCEFDomNode.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDomVisitor.pas b/source/uCEFDomVisitor.pas index 6929d82c..b5764464 100644 --- a/source/uCEFDomVisitor.pas +++ b/source/uCEFDomVisitor.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDownLoadItem.pas b/source/uCEFDownLoadItem.pas index bf06264f..367ec5ce 100644 --- a/source/uCEFDownLoadItem.pas +++ b/source/uCEFDownLoadItem.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDownloadHandler.pas b/source/uCEFDownloadHandler.pas index 4947c599..82d82a29 100644 --- a/source/uCEFDownloadHandler.pas +++ b/source/uCEFDownloadHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDownloadImageCallBack.pas b/source/uCEFDownloadImageCallBack.pas index d4f5be2d..3d9b89f4 100644 --- a/source/uCEFDownloadImageCallBack.pas +++ b/source/uCEFDownloadImageCallBack.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDownloadItemCallback.pas b/source/uCEFDownloadItemCallback.pas index 857461ee..e5bc399b 100644 --- a/source/uCEFDownloadItemCallback.pas +++ b/source/uCEFDownloadItemCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDragAndDropMgr.pas b/source/uCEFDragAndDropMgr.pas index ab250cf7..101f7ad1 100644 --- a/source/uCEFDragAndDropMgr.pas +++ b/source/uCEFDragAndDropMgr.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDragData.pas b/source/uCEFDragData.pas index 449d0ee9..9b98b6cb 100644 --- a/source/uCEFDragData.pas +++ b/source/uCEFDragData.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFDragHandler.pas b/source/uCEFDragHandler.pas index 2d593f16..84c0c647 100644 --- a/source/uCEFDragHandler.pas +++ b/source/uCEFDragHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFEndTracingCallback.pas b/source/uCEFEndTracingCallback.pas index 543b626b..525387ed 100644 --- a/source/uCEFEndTracingCallback.pas +++ b/source/uCEFEndTracingCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFExtension.pas b/source/uCEFExtension.pas index 07a2eb6f..20c49615 100644 --- a/source/uCEFExtension.pas +++ b/source/uCEFExtension.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFExtensionHandler.pas b/source/uCEFExtensionHandler.pas index b7040533..717ae073 100644 --- a/source/uCEFExtensionHandler.pas +++ b/source/uCEFExtensionHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFFileDialogCallback.pas b/source/uCEFFileDialogCallback.pas index 4b377942..adf070c8 100644 --- a/source/uCEFFileDialogCallback.pas +++ b/source/uCEFFileDialogCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFFindHandler.pas b/source/uCEFFindHandler.pas index 96c27407..1fe62758 100644 --- a/source/uCEFFindHandler.pas +++ b/source/uCEFFindHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFFocusHandler.pas b/source/uCEFFocusHandler.pas index 9c709450..70fd014c 100644 --- a/source/uCEFFocusHandler.pas +++ b/source/uCEFFocusHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFFrame.pas b/source/uCEFFrame.pas index 62421837..49fb2106 100644 --- a/source/uCEFFrame.pas +++ b/source/uCEFFrame.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFGetExtensionResourceCallback.pas b/source/uCEFGetExtensionResourceCallback.pas index 21bd0a3c..12f2e55d 100644 --- a/source/uCEFGetExtensionResourceCallback.pas +++ b/source/uCEFGetExtensionResourceCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFImage.pas b/source/uCEFImage.pas index 33051b24..76f07a1a 100644 --- a/source/uCEFImage.pas +++ b/source/uCEFImage.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -52,7 +52,7 @@ uses {$IFDEF DELPHI16_UP} {$IFDEF MSWINDOWS}WinApi.Windows,{$ENDIF} {$ELSE} - Windows, + {$IFDEF MSWINDOWS}Windows,{$ENDIF} {$ENDIF} uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes; diff --git a/source/uCEFInterfaces.pas b/source/uCEFInterfaces.pas index d01fbc5a..da876b18 100644 --- a/source/uCEFInterfaces.pas +++ b/source/uCEFInterfaces.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -489,7 +489,7 @@ type procedure NotifyMoveOrResizeStarted; function GetWindowlessFrameRate : Integer; procedure SetWindowlessFrameRate(frameRate: Integer); - procedure IMESetComposition(const text: ustring; underlinesCount : NativeUInt; const underlines : PCefCompositionUnderline; const replacement_range, selection_range : PCefRange); + procedure IMESetComposition(const text: ustring; const underlines : TCefCompositionUnderlineDynArray; const replacement_range, selection_range : PCefRange); procedure IMECommitText(const text: ustring; const replacement_range : PCefRange; relative_cursor_pos : integer); procedure IMEFinishComposingText(keep_selection : boolean); procedure IMECancelComposition; diff --git a/source/uCEFJsDialogCallback.pas b/source/uCEFJsDialogCallback.pas index 737ebcd8..e13c2d8a 100644 --- a/source/uCEFJsDialogCallback.pas +++ b/source/uCEFJsDialogCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFJsDialogHandler.pas b/source/uCEFJsDialogHandler.pas index 3fc0d6b0..ece8b4a9 100644 --- a/source/uCEFJsDialogHandler.pas +++ b/source/uCEFJsDialogHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFKeyboardHandler.pas b/source/uCEFKeyboardHandler.pas index b23f57e3..20980e26 100644 --- a/source/uCEFKeyboardHandler.pas +++ b/source/uCEFKeyboardHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFLibFunctions.pas b/source/uCEFLibFunctions.pas index f16586b6..3ed5c910 100644 --- a/source/uCEFLibFunctions.pas +++ b/source/uCEFLibFunctions.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFLifeSpanHandler.pas b/source/uCEFLifeSpanHandler.pas index c5a79883..5e5b2e7c 100644 --- a/source/uCEFLifeSpanHandler.pas +++ b/source/uCEFLifeSpanHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFLinkedWindowParent.pas b/source/uCEFLinkedWindowParent.pas index df5c824c..b3aad969 100644 --- a/source/uCEFLinkedWindowParent.pas +++ b/source/uCEFLinkedWindowParent.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -70,7 +70,9 @@ type procedure SetChromium(aValue : TChromium); function GetChildWindowHandle : THandle; override; + {$IFDEF MSWINDOWS} procedure WndProc(var aMessage: TMessage); override; + {$ENDIF} procedure Notification(AComponent: TComponent; Operation: TOperation); override; public @@ -107,6 +109,7 @@ begin if (Result = 0) then Result := inherited GetChildWindowHandle; end; +{$IFDEF MSWINDOWS} procedure TCEFLinkedWindowParent.WndProc(var aMessage: TMessage); var TempHandle : THandle; @@ -139,6 +142,7 @@ begin else inherited WndProc(aMessage); end; end; +{$ENDIF} procedure TCEFLinkedWindowParent.Notification(AComponent: TComponent; Operation: TOperation); begin diff --git a/source/uCEFListValue.pas b/source/uCEFListValue.pas index e4bfc3d2..873b27dc 100644 --- a/source/uCEFListValue.pas +++ b/source/uCEFListValue.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFLoadHandler.pas b/source/uCEFLoadHandler.pas index 0dd3b63c..f40c62d8 100644 --- a/source/uCEFLoadHandler.pas +++ b/source/uCEFLoadHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFMenuModel.pas b/source/uCEFMenuModel.pas index a2aab5cc..6a24c37c 100644 --- a/source/uCEFMenuModel.pas +++ b/source/uCEFMenuModel.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFMenuModelDelegate.pas b/source/uCEFMenuModelDelegate.pas index 5d2c1aef..65a767b5 100644 --- a/source/uCEFMenuModelDelegate.pas +++ b/source/uCEFMenuModelDelegate.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFMiscFunctions.pas b/source/uCEFMiscFunctions.pas index 74b025ea..061e184c 100644 --- a/source/uCEFMiscFunctions.pas +++ b/source/uCEFMiscFunctions.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -53,6 +53,7 @@ uses {$IFDEF MSWINDOWS}WinApi.Windows, WinApi.ActiveX,{$ENDIF} System.IOUtils, System.Classes, System.SysUtils, System.UITypes, System.Math, {$ELSE} {$IFDEF MSWINDOWS}Windows, ActiveX,{$ENDIF} {$IFDEF DELPHI14_UP}IOUtils,{$ENDIF} Classes, SysUtils, Controls, Graphics, Math, + {$IFDEF FPC}LCLType,{$IFNDEF MSWINDOWS}InterfaceBase, Forms,{$ENDIF}{$ENDIF} {$ENDIF} uCEFTypes, uCEFInterfaces, uCEFLibFunctions, uCEFResourceHandler, uCEFRegisterCDMCallback, uCEFConstants; @@ -159,9 +160,11 @@ function CefRemoveCrossOriginWhitelistEntry(const SourceOrigin, TargetProtocol, function CefClearCrossOriginWhitelist: Boolean; procedure UInt64ToFileVersionInfo(const aVersion : uint64; var aVersionInfo : TFileVersionInfo); +{$IFDEF MSWINDOWS} function GetExtendedFileVersion(const aFileName : string) : uint64; function GetStringFileInfo(const aFileName, aField : string; var aValue : string) : boolean; function GetDLLVersion(const aDLLFile : string; var aVersionInfo : TFileVersionInfo) : boolean; +{$ENDIF} function SplitLongString(aSrcString : string) : string; function GetAbsoluteDirPath(const aSrcPath : string; var aRsltPath : string) : boolean; @@ -169,10 +172,12 @@ function CheckSubprocessPath(const aSubprocessPath : string; var aMissingFiles : function CheckLocales(const aLocalesDirPath : string; var aMissingFiles : string; const aLocalesRequired : string = '') : boolean; function CheckResources(const aResourcesDirPath : string; var aMissingFiles : string; aCheckDevResources: boolean = True; aCheckExtensions: boolean = True) : boolean; function CheckDLLs(const aFrameworkDirPath : string; var aMissingFiles : string) : boolean; -function CheckDLLVersion(const aDLLFile : string; aMajor, aMinor, aRelease, aBuild : uint16) : boolean; +{$IFDEF MSWINDOWS} +function CheckDLLVersion(const aDLLFile : string; aMajor, aMinor, aRelease, aBuild : uint16) : boolean; +function GetDLLHeaderMachine(const aDLLFile : string; var aMachine : integer) : boolean; +{$ENDIF} function FileVersionInfoToString(const aVersionInfo : TFileVersionInfo) : string; function CheckFilesExist(var aList : TStringList; var aMissingFiles : string) : boolean; -function GetDLLHeaderMachine(const aDLLFile : string; var aMachine : integer) : boolean; function Is32BitProcess : boolean; function CefParseUrl(const url: ustring; var parts: TUrlParts): Boolean; @@ -202,15 +207,17 @@ function CefDeleteFile(const path: ustring; recursive: Boolean): Boolean; function CefZipDirectory(const srcDir, destFile: ustring; includeHiddenFiles: Boolean): Boolean; procedure CefLoadCRLSetsFile(const path : ustring); +{$IFDEF MSWINDOWS} function CefIsKeyDown(aWparam : WPARAM) : boolean; function CefIsKeyToggled(aWparam : WPARAM) : boolean; +function GetCefMouseModifiers : TCefEventFlags; overload; function GetCefMouseModifiers(awparam : WPARAM) : TCefEventFlags; overload; -function GetCefMouseModifiers : TCefEventFlags; overload; -function GetCefKeyboardModifiers(aWparam : WPARAM; aLparam : LPARAM) : TCefEventFlags; +function GetCefKeyboardModifiers(aWparam : WPARAM; aLparam : LPARAM) : TCefEventFlags; function GefCursorToWindowsCursor(aCefCursor : TCefCursorType) : TCursor; procedure DropEffectToDragOperation(aEffect : Longint; var aAllowedOps : TCefDragOperations); procedure DragOperationToDropEffect(const aDragOperations : TCefDragOperations; var aEffect: Longint); +{$ENDIF} function DeviceToLogical(aValue : integer; const aDeviceScaleFactor : double) : integer; overload; procedure DeviceToLogical(var aEvent : TCEFMouseEvent; const aDeviceScaleFactor : double); overload; @@ -394,6 +401,7 @@ end; function CefTimeToSystemTime(const dt: TCefTime): TSystemTime; begin + {$IFDEF MSWINDOWS} Result.wYear := dt.year; Result.wMonth := dt.month; Result.wDayOfWeek := dt.day_of_week; @@ -402,10 +410,21 @@ begin Result.wMinute := dt.minute; Result.wSecond := dt.second; Result.wMilliseconds := dt.millisecond; + {$ELSE} + Result.Year := dt.year; + Result.Month := dt.month; + Result.DayOfWeek := dt.day_of_week; + Result.Day := dt.day_of_month; + Result.Hour := dt.hour; + Result.Minute := dt.minute; + Result.Second := dt.second; + Result.Millisecond := dt.millisecond; + {$ENDIF} end; function SystemTimeToCefTime(const dt: TSystemTime): TCefTime; begin + {$IFDEF MSWINDOWS} Result.year := dt.wYear; Result.month := dt.wMonth; Result.day_of_week := dt.wDayOfWeek; @@ -414,12 +433,25 @@ begin Result.minute := dt.wMinute; Result.second := dt.wSecond; Result.millisecond := dt.wMilliseconds; + {$ELSE} + Result.year := dt.Year; + Result.month := dt.Month; + Result.day_of_week := dt.DayOfWeek; + Result.day_of_month := dt.Day; + Result.hour := dt.Hour; + Result.minute := dt.Minute; + Result.second := dt.Second; + Result.millisecond := dt.Millisecond; + {$ENDIF} end; function CefTimeToDateTime(const dt: TCefTime): TDateTime; +{$IFDEF MSWINDOWS} var TempTime : TSystemTime; +{$ENDIF} begin + {$IFDEF MSWINDOWS} Result := 0; try @@ -430,12 +462,20 @@ begin on e : exception do if CustomExceptionHandler('CefTimeToDateTime', e) then raise; end; + {$ELSE} + Result := EncodeDate(dt.year, dt.month, dt.day_of_month) + EncodeTime(dt.hour, dt.minute, dt.second, dt.millisecond); + {$ENDIF} end; function DateTimeToCefTime(dt: TDateTime): TCefTime; var + {$IFDEF MSWINDOWS} TempTime : TSystemTime; + {$ELSE} + TempYear, TempMonth, TempDay, TempHour, TempMin, TempSec, TempMSec : Word; + {$ENDIF} begin + {$IFDEF MSWINDOWS} FillChar(Result, SizeOf(TCefTime), 0); try @@ -446,6 +486,19 @@ begin on e : exception do if CustomExceptionHandler('DateTimeToCefTime', e) then raise; end; + {$ELSE} + DecodeDate(dt, TempYear, TempMonth, TempDay); + DecodeTime(dt, TempHour, TempMin, TempSec, TempMSec); + + Result.year := TempYear; + Result.month := TempMonth; + Result.day_of_week := DayOfWeek(dt); + Result.day_of_month := TempMonth; + Result.hour := TempHour; + Result.minute := TempMin; + Result.second := TempSec; + Result.millisecond := TempMSec; + {$ENDIF} end; function cef_string_wide_copy(const src: PWideChar; src_len: NativeUInt; output: PCefStringWide): Integer; @@ -595,12 +648,12 @@ begin aWindowInfo.window := 0; end; -procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : THandle); +procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle); begin - aWindowInfo.x := integer(CW_USEDEFAULT); - aWindowInfo.y := integer(CW_USEDEFAULT); - aWindowInfo.width := integer(CW_USEDEFAULT); - aWindowInfo.height := integer(CW_USEDEFAULT); + aWindowInfo.x := 0; + aWindowInfo.y := 0; + aWindowInfo.width := 0; + aWindowInfo.height := 0; aWindowInfo.parent_window := aParent; aWindowInfo.windowless_rendering_enabled := ord(False); aWindowInfo.shared_texture_enabled := ord(False); @@ -608,7 +661,7 @@ begin aWindowInfo.window := 0; end; -procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : THandle); +procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle); begin aWindowInfo.x := 0; aWindowInfo.y := 0; @@ -676,7 +729,11 @@ var begin if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then begin + {$IFDEF MSWINDOWS} TempString := 'PID: ' + IntToStr(GetCurrentProcessID) + ', TID: ' + IntToStr(GetCurrentThreadID); + {$ELSE} + TempString := 'PID: ' + IntToStr(GetProcessID()) + ', TID: ' + IntToStr(GetCurrentThreadID()); + {$ENDIF} case GlobalCEFApp.ProcessType of ptBrowser : TempString := TempString + ', PT: Browser'; @@ -1054,6 +1111,7 @@ begin aVersionInfo.Build := uint16(aVersion and $FFFF); end; +{$IFDEF MSWINDOWS} function GetExtendedFileVersion(const aFileName : string) : uint64; var TempSize : DWORD; @@ -1197,7 +1255,8 @@ begin on e : exception do if CustomExceptionHandler('GetDLLVersion', e) then raise; end; -end; +end; +{$ENDIF} function FileVersionInfoToString(const aVersionInfo : TFileVersionInfo) : string; begin @@ -1207,6 +1266,7 @@ begin IntToStr(aVersionInfo.Build); end; +{$IFDEF MSWINDOWS} function CheckDLLVersion(const aDLLFile : string; aMajor, aMinor, aRelease, aBuild : uint16) : boolean; var TempVersionInfo : TFileVersionInfo; @@ -1258,7 +1318,8 @@ begin finally if (TempStream <> nil) then FreeAndNil(TempStream); end; -end; +end; +{$ENDIF} function Is32BitProcess : boolean; {$IFDEF MSWINDOWS} @@ -1348,7 +1409,11 @@ begin {$IFDEF DELPHI12_UP} Result := PathIsRelativeUnicode(PChar(aPath)); {$ELSE} - Result := PathIsRelativeAnsi(PChar(aPath)); + {$IFDEF MSWINDOWS} + Result := PathIsRelativeAnsi(PChar(aPath)); + {$ELSE} + Result := (length(aPath) > 0) and (aPath[1] <> '/'); + {$ENDIF} {$ENDIF} end; @@ -1653,6 +1718,7 @@ begin end; end; +{$IFDEF MSWINDOWS} function CefIsKeyDown(aWparam : WPARAM) : boolean; begin Result := (GetKeyState(aWparam) < 0); @@ -1799,7 +1865,7 @@ begin else Result := crDefault; end; -end; +end; procedure DropEffectToDragOperation(aEffect: Longint; var aAllowedOps : TCefDragOperations); begin @@ -1817,7 +1883,8 @@ begin if ((aDragOperations and DRAG_OPERATION_COPY) <> 0) then aEffect := aEffect or DROPEFFECT_COPY; if ((aDragOperations and DRAG_OPERATION_LINK) <> 0) then aEffect := aEffect or DROPEFFECT_LINK; if ((aDragOperations and DRAG_OPERATION_MOVE) <> 0) then aEffect := aEffect or DROPEFFECT_MOVE; -end; +end; +{$ENDIF} function DeviceToLogical(aValue : integer; const aDeviceScaleFactor : double) : integer; begin @@ -1850,12 +1917,18 @@ begin end; function GetScreenDPI : integer; +{$IFDEF MSWINDOWS} var TempDC : HDC; +{$ENDIF} begin + {$IFDEF MSWINDOWS} TempDC := GetDC(0); Result := GetDeviceCaps(TempDC, LOGPIXELSX); ReleaseDC(0, TempDC); + {$ELSE} + Result := screen.PrimaryMonitor.PixelsPerInch; + {$ENDIF} end; function GetDeviceScaleFactor : single; diff --git a/source/uCEFNavigationEntry.pas b/source/uCEFNavigationEntry.pas index 8ee6dcda..29fc609d 100644 --- a/source/uCEFNavigationEntry.pas +++ b/source/uCEFNavigationEntry.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFNavigationEntryVisitor.pas b/source/uCEFNavigationEntryVisitor.pas index 489dc0aa..d82f442c 100644 --- a/source/uCEFNavigationEntryVisitor.pas +++ b/source/uCEFNavigationEntryVisitor.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFOSRIMEHandler.pas b/source/uCEFOSRIMEHandler.pas new file mode 100644 index 00000000..fe9f869f --- /dev/null +++ b/source/uCEFOSRIMEHandler.pas @@ -0,0 +1,754 @@ +// ************************************************************************ +// ***************************** CEF4Delphi ******************************* +// ************************************************************************ +// +// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based +// browser in Delphi applications. +// +// The original license of DCEF3 still applies to CEF4Delphi. +// +// For more information about CEF4Delphi visit : +// https://www.briskbard.com/index.php?lang=en&pageid=cef +// +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. +// +// ************************************************************************ +// ************ vvvv Original license and comments below vvvv ************* +// ************************************************************************ +(* + * Delphi Chromium Embedded 3 + * + * Usage allowed under the restrictions of the Lesser GNU General Public License + * or alternatively the restrictions of the Mozilla Public License 1.1 + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for + * the specific language governing rights and limitations under the License. + * + * Unit owner : Henri Gourvest + * Web site : http://www.progdigy.com + * Repository : http://code.google.com/p/delphichromiumembedded/ + * Group : http://groups.google.com/group/delphichromiumembedded + * + * Embarcadero Technologies, Inc is not permitted to use or redistribute + * this source code without explicit permission. + * + *) + +unit uCEFOSRIMEHandler; + +{$IFDEF FPC} + {$MODE OBJFPC}{$H+} +{$ENDIF} + +{$I cef.inc} + +interface + +uses + {$IFDEF DELPHI16_UP} + {$IFDEF MSWINDOWS}WinApi.Windows,{$ENDIF} System.Classes, System.Math, WinApi.imm, + {$ELSE} + {$IFDEF MSWINDOWS}Windows, imm, {$IFDEF FPC}imm_dyn,{$ENDIF}{$ENDIF} Classes, Math, + {$ENDIF} + uCEFTypes; + +const + DEFAULT_BLINK_UNDERLINE_COLOR = $FF000000; // Black SkColor + DEFAULT_BLINK_BACKGROUND_COLOR = $00000000; // White SkColor + + KEYBOARD_LAYOUT_EN_US = $0409; + +type + {$IFNDEF MSWINDOWS} + {$IFDEF FPC} + // Define some types to compile in Linux with Lazarus + HWND = NativeUInt; + LANGID = Word; + HIMC = Integer; + LPARAM = NativeInt; + WParam = NativeUInt; + PWChar = ^WideChar; + {$ENDIF} + {$ENDIF} + + TCEFOSRIMEHandler = class + protected + FHWND : HWND; + FCompositionRange : TCefRange; + FCursorIndex : integer; + FIMERect : TCefRect; + FSystemCaret : boolean; + FInputLanguageID : LANGID; + FCompositionBounds : TCefRectDynArray; + FIsComposing : boolean; + FIMM32DLL : THandle; + + function GetPrimaryLangID : word; + function GetSubLangID : word; + function GetInitialized : boolean; + + procedure GetCompositionInfo(imc : HIMC; aParam : LPARAM; var composition_text : ustring; var underlines : TCefCompositionUnderlineDynArray; var composition_start : integer); + function GetString(imc : HIMC; aParam : WParam; aType : integer; var aResult : ustring) : boolean; + {$IFDEF MSWINDOWS} + function IsSelectionAttribute(aAttribute : byte) : boolean; + {$ENDIF} + procedure GetCompositionSelectionRange(imc : HIMC; var target_start, target_end : integer); + procedure GetCompositionUnderlines(imc : HIMC; target_start, target_end : integer; var underlines : TCefCompositionUnderlineDynArray); + + public + constructor Create(aHWND : HWND); + destructor Destroy; override; + + {$IFDEF MSWINDOWS} + procedure SetInputLanguage; + {$ENDIF} + procedure CreateImeWindow; + procedure DestroyImeWindow; + procedure CleanupComposition; + procedure ResetComposition; + function GetResult(aParam : LPARAM; var aResult : ustring) : boolean; + function GetComposition(aParam : LPARAM; var composition_text : ustring; var underlines : TCefCompositionUnderlineDynArray; var composition_start : integer) : boolean; + procedure EnableIME; + procedure DisableIME; + procedure CancelIME; + procedure UpdateCaretPosition(index : integer); + procedure ChangeCompositionRange(const selection_range : TCefRange; const character_bounds : TCefRectDynArray); + procedure MoveImeWindow; + + property IsComposing : boolean read FIsComposing; + property InputLanguageID : LANGID read FInputLanguageID; + property PrimaryLangID : word read GetPrimaryLangID; + property SubLangID : word read GetSubLangID; + property Initialized : boolean read GetInitialized; + + end; + +implementation + +uses + {$IFDEF DELPHI16_UP} + System.SysUtils, + {$ELSE} + SysUtils, + {$ENDIF} + uCEFMiscFunctions; + +constructor TCEFOSRIMEHandler.Create(aHWND : HWND); +begin + inherited Create; + + FHWND := aHWND; + FCompositionRange.from := 0; + FCompositionRange.to_ := 0; + FCursorIndex := -1; + FIMERect.x := -1; + FIMERect.y := -1; + FIMERect.width := 0; + FIMERect.height := 0; + FSystemCaret := False; + FCompositionBounds := nil; + FIsComposing := False; + FIMM32DLL := 0; + {$IFDEF MSWINDOWS} + FInputLanguageID := LANG_USER_DEFAULT; + {$IFNDEF FPC} + FIMM32DLL := SafeLoadLibrary('imm32.dll'); + {$ENDIF} + {$ENDIF} +end; + +destructor TCEFOSRIMEHandler.Destroy; +begin + DestroyImeWindow; + + {$IFDEF MSWINDOWS} + if (FIMM32DLL <> 0) then + begin + FreeLibrary(FIMM32DLL); + FIMM32DLL := 0; + end; + {$ENDIF} + + if (FCompositionBounds <> nil) then + begin + Finalize(FCompositionBounds); + FCompositionBounds := nil; + end; + + inherited Destroy; +end; + +function TCEFOSRIMEHandler.GetPrimaryLangID : word; +begin + Result := FInputLanguageID and $03FF; +end; + +function TCEFOSRIMEHandler.GetSubLangID : word; +begin + Result := (FInputLanguageID and $FC00) shr 10; +end; + +function TCEFOSRIMEHandler.GetInitialized : boolean; +begin + {$IFDEF MSWINDOWS} + {$IFNDEF FPC} + Result := (FIMM32DLL <> 0); + {$ELSE} + Result := True; + {$ENDIF} + {$ELSE} + Result := False; + {$ENDIF} +end; + +procedure TCEFOSRIMEHandler.GetCompositionInfo( imc : HIMC; + aParam : LPARAM; + var composition_text : ustring; + var underlines : TCefCompositionUnderlineDynArray; + var composition_start : integer); +var + TempStart : integer; + TempEnd : integer; + TempLen : integer; + i : integer; +begin + if (underlines <> nil) then + begin + Finalize(underlines, 0); + underlines := nil; + end; + + TempLen := length(composition_text); + TempStart := TempLen; + TempEnd := TempLen; + + {$IFDEF MSWINDOWS} + if ((aParam and GCS_COMPATTR) <> 0) then + GetCompositionSelectionRange(imc, TempStart, TempEnd); + + if ((aParam and CS_NOMOVECARET) = 0) and ((aParam and GCS_CURSORPOS) <> 0) then + composition_start := ImmGetCompositionString(imc, GCS_CURSORPOS, nil, 0) + else + composition_start := 0; + + if ((aParam and GCS_COMPCLAUSE) <> 0) then + GetCompositionUnderlines(imc, TempStart, TempEnd, underlines); + {$ENDIF} + + if (underlines = nil) or (length(underlines) = 0) then + begin + i := 0; + + if (TempStart > 0) then inc(i); + if (TempEnd > TempStart) then inc(i); + if (TempEnd < TempLen) then inc(i); + + if (i > 0) then + begin + SetLength(underlines, i); + i := 0; + + if (TempStart > 0) then + begin + underlines[i].color := DEFAULT_BLINK_UNDERLINE_COLOR; + underlines[i].background_color := DEFAULT_BLINK_BACKGROUND_COLOR; + underlines[i].range.from := 0; + underlines[i].range.to_ := TempStart; + underlines[i].thick := 0; + + inc(i); + end; + + if (TempEnd > TempStart) then + begin + underlines[i].color := DEFAULT_BLINK_UNDERLINE_COLOR; + underlines[i].background_color := DEFAULT_BLINK_BACKGROUND_COLOR; + underlines[i].range.from := TempStart; + underlines[i].range.to_ := TempEnd; + underlines[i].thick := 1; + + inc(i); + end; + + if (TempEnd < TempLen) then + begin + underlines[i].color := DEFAULT_BLINK_UNDERLINE_COLOR; + underlines[i].background_color := DEFAULT_BLINK_BACKGROUND_COLOR; + underlines[i].range.from := TempEnd; + underlines[i].range.to_ := TempLen; + underlines[i].thick := 0; + end; + end; + end; +end; + +function TCEFOSRIMEHandler.GetString(imc : HIMC; aParam : WParam; aType : integer; var aResult : ustring) : boolean; +var + TempBufferLen : integer; + TempBuffer : PWChar; +begin + Result := False; + + if ((aParam and aType) = 0) then exit; + + {$IFDEF MSWINDOWS} + {$IFDEF FPC} + TempBufferLen := ImmGetCompositionStringW(imc, aType, nil, 0); + {$ELSE} + TempBufferLen := ImmGetCompositionString(imc, aType, nil, 0); + {$ENDIF} + + if (GetLastError <> 0) or (TempBufferLen <= 0) then exit; + {$ENDIF} + + TempBuffer := nil; + TempBufferLen := TempBufferLen + SizeOf(wchar); + + try + try + GetMem(TempBuffer, TempBufferLen); + FillChar(TempBuffer^, TempBufferLen, 0); + + {$IFDEF MSWINDOWS} + {$IFDEF FPC} + TempBufferLen := ImmGetCompositionStringW(imc, aType, TempBuffer, TempBufferLen); + {$ELSE} + TempBufferLen := ImmGetCompositionString(imc, aType, TempBuffer, TempBufferLen); + {$ENDIF} + {$ENDIF} + + if (TempBufferLen > 0) then + begin + aResult := TempBuffer; + Result := True; + end; + except + on e : exception do + if CustomExceptionHandler('TCEFOSRIMEHandler.GetString', e) then raise; + end; + finally + if (TempBuffer <> nil) then FreeMem(TempBuffer); + end; +end; + +{$IFDEF MSWINDOWS} +function TCEFOSRIMEHandler.IsSelectionAttribute(aAttribute : byte) : boolean; +begin + Result := (aAttribute = ATTR_TARGET_CONVERTED) or + (aAttribute = ATTR_TARGET_NOTCONVERTED); +end; +{$ENDIF} + +procedure TCEFOSRIMEHandler.GetCompositionSelectionRange(imc : HIMC; var target_start, target_end : integer); +var + i : integer; + TempBufferLen : integer; + TempBuffer : array of byte; +begin + TempBuffer := nil; + {$IFDEF MSWINDOWS} + try + try + TempBufferLen := ImmGetCompositionString(imc, GCS_COMPATTR, nil, 0); + + if (GetLastError = 0) and (TempBufferLen > 0) then + begin + SetLength(TempBuffer, TempBufferLen); + for i := 0 to pred(TempBufferLen) do TempBuffer[i] := 0; + + TempBufferLen := ImmGetCompositionString(imc, GCS_COMPATTR, @TempBuffer[0], TempBufferLen); + + if (TempBufferLen > 0) then + begin + i := 0; + while (i < TempBufferLen) do + if IsSelectionAttribute(TempBuffer[i]) then + begin + target_start := i; + break; + end + else + inc(i); + + while (i < TempBufferLen) do + if not(IsSelectionAttribute(TempBuffer[i])) then + begin + target_end := i; + break; + end + else + inc(i); + end; + end; + except + on e : exception do + if CustomExceptionHandler('TCEFOSRIMEHandler.GetCompositionSelectionRange', e) then raise; + end; + finally + if (TempBuffer <> nil) then + begin + Finalize(TempBuffer); + TempBuffer := nil; + end; + end; + {$ENDIF} +end; + +procedure TCEFOSRIMEHandler.GetCompositionUnderlines( imc : HIMC; + target_start : integer; + target_end : integer; + var underlines : TCefCompositionUnderlineDynArray); +var + i, j, TempSize : integer; + TempUndLen : integer; + TempBufferLen : integer; + TempBuffer : array of cardinal; +begin + TempBuffer := nil; + + {$IFDEF MSWINDOWS} + try + try + TempBufferLen := ImmGetCompositionString(imc, GCS_COMPCLAUSE, nil, 0); + + if (GetLastError = 0) and (TempBufferLen > 0) then + begin + TempSize := TempBufferLen div SizeOf(cardinal); + SetLength(TempBuffer, TempSize); + for i := 0 to pred(TempSize) do TempBuffer[i] := 0; + + TempBufferLen := ImmGetCompositionString(imc, GCS_COMPCLAUSE, @TempBuffer[0], TempBufferLen); + + if (TempBufferLen > 0) then + begin + TempSize := TempBufferLen div SizeOf(cardinal); + + if (underlines <> nil) then + TempUndLen := length(underlines) + else + TempUndLen := 0; + + SetLength(underlines, TempUndLen + pred(TempSize)); + i := 0; + + while (i < pred(TempSize)) do + begin + j := i + TempUndLen; + + underlines[j].range.from := TempBuffer[i]; + underlines[j].range.to_ := TempBuffer[succ(i)]; + underlines[j].color := DEFAULT_BLINK_UNDERLINE_COLOR; + underlines[j].background_color := DEFAULT_BLINK_BACKGROUND_COLOR; + + if (underlines[j].range.from >= target_start) and + (underlines[j].range.to_ <= target_end) then + underlines[j].thick := 1 + else + underlines[j].thick := 0; + + inc(i); + end; + end; + end; + except + on e : exception do + if CustomExceptionHandler('TCEFOSRIMEHandler.GetCompositionUnderlines', e) then raise; + end; + finally + if (TempBuffer <> nil) then + begin + Finalize(TempBuffer); + TempBuffer := nil; + end; + end; + {$ENDIF} +end; + +{$IFDEF MSWINDOWS} +procedure TCEFOSRIMEHandler.SetInputLanguage; +var + TempName : array[0..KL_NAMELENGTH] of char; + TempLayout : string; + i : integer; + TempID : LANGID; +begin + TempID := KEYBOARD_LAYOUT_EN_US; + + try + try + for i := 0 to KL_NAMELENGTH do TempName[i] := #0; + + if GetKeyboardLayoutName(TempName) then + begin + TempLayout := trim(copy(TempName, KL_NAMELENGTH div 2, KL_NAMELENGTH)); + if (length(TempLayout) > 0) then TempID := StrToInt('$' + TempLayout); + end; + except + on e : exception do + if CustomExceptionHandler('TCEFOSRIMEHandler.SetInputLanguage', e) then raise; + end; + finally + FInputLanguageID := TempID; + end; +end; +{$ENDIF} + +procedure TCEFOSRIMEHandler.CreateImeWindow; +begin + {$IFDEF MSWINDOWS} + if ((PrimaryLangID = LANG_CHINESE) or (PrimaryLangID = LANG_JAPANESE)) and + not(FSystemCaret) and + CreateCaret(FHWND, 0, 1, 1) then + FSystemCaret := True; + {$ENDIF} +end; + +procedure TCEFOSRIMEHandler.DestroyImeWindow; +begin + if FSystemCaret then + begin + {$IFDEF MSWINDOWS} + DestroyCaret(); + {$ENDIF} + FSystemCaret := False; + end; +end; + +procedure TCEFOSRIMEHandler.CleanupComposition; +var + TempIMC : HIMC; +begin + if Initialized and FIsComposing then + begin + {$IFDEF MSWINDOWS} + TempIMC := ImmGetContext(FHWND); + + if (TempIMC <> 0) then + try + ImmNotifyIME(TempIMC, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); + finally + ImmReleaseContext(FHWND, TempIMC); + end; + + ResetComposition; + {$ENDIF} + end; +end; + +procedure TCEFOSRIMEHandler.ResetComposition; +begin + FIsComposing := False; + FCursorIndex := -1; +end; + +function TCEFOSRIMEHandler.GetResult(aParam : LPARAM; var aResult : ustring) : boolean; +var + TempIMC : HIMC; +begin + Result := False; + if not(Initialized) then exit; + + {$IFDEF MSWINDOWS} + TempIMC := ImmGetContext(FHWND); + + if (TempIMC <> 0) then + try + Result := GetString(TempIMC, aParam, GCS_RESULTSTR, aResult); + finally + ImmReleaseContext(FHWND, TempIMC); + end; + {$ENDIF} +end; + +function TCEFOSRIMEHandler.GetComposition( aParam : LPARAM; + var composition_text : ustring; + var underlines : TCefCompositionUnderlineDynArray; + var composition_start : integer) : boolean; +var + TempIMC : HIMC; +begin + Result := False; + if not(Initialized) then exit; + + {$IFDEF MSWINDOWS} + TempIMC := ImmGetContext(FHWND); + + if (TempIMC <> 0) then + try + if GetString(TempIMC, aParam, GCS_COMPSTR, composition_text) then + begin + GetCompositionInfo(TempIMC, aParam, composition_text, underlines, composition_start); + FIsComposing := True; + Result := True; + end; + finally + ImmReleaseContext(FHWND, TempIMC); + end; + {$ENDIF} +end; + +procedure TCEFOSRIMEHandler.EnableIME; +begin + {$IFDEF MSWINDOWS} + if Initialized then + begin + {$IFDEF DELPHI16_UP} + ImmAssociateContextEx(FHWND, 0, IACE_DEFAULT); + {$ELSE} + ImmAssociateContext(FHWND, 0); + {$ENDIF} + end; + {$ENDIF} +end; + +procedure TCEFOSRIMEHandler.DisableIME; +begin + {$IFDEF MSWINDOWS} + if Initialized then + begin + CleanupComposition(); + {$IFDEF DELPHI16_UP} + ImmAssociateContextEx(FHWND, 0, 0); + {$ELSE} + ImmAssociateContext(FHWND, 0); + {$ENDIF} + end; + {$ENDIF} +end; + +procedure TCEFOSRIMEHandler.CancelIME; +var + TempIMC : HIMC; +begin + if Initialized and FIsComposing then + begin + {$IFDEF MSWINDOWS} + TempIMC := ImmGetContext(FHWND); + + if (TempIMC <> 0) then + try + ImmNotifyIME(TempIMC, NI_COMPOSITIONSTR, CPS_CANCEL, 0); + finally + ImmReleaseContext(FHWND, TempIMC); + end; + + ResetComposition; + {$ENDIF} + end; +end; + +procedure TCEFOSRIMEHandler.UpdateCaretPosition(index : integer); +begin + FCursorIndex := index; + MoveImeWindow(); +end; + +procedure TCEFOSRIMEHandler.ChangeCompositionRange(const selection_range : TCefRange; + const character_bounds : TCefRectDynArray); +var + i : integer; +begin + FCompositionRange := selection_range; + + if (character_bounds <> nil) then + begin + SetLength(FCompositionBounds, length(character_bounds)); + i := pred(length(character_bounds)); + + while (i >= 0) do + begin + FCompositionBounds[i] := character_bounds[i]; + dec(i); + end; + end + else + begin + Finalize(FCompositionBounds); + FCompositionBounds := nil; + end; + + MoveImeWindow(); +end; + +procedure TCEFOSRIMEHandler.MoveImeWindow; +{$IFDEF MSWINDOWS} +var + TempRect : TCefRect; + TempLocation : integer; + TempIMC : HIMC; + TempCandidate : TCandidateForm; +const + CARET_MARGIN = 1; +{$ENDIF} +begin + {$IFDEF MSWINDOWS} + if not(Initialized) and (GetFocus <> FHWND) then exit; + + TempRect := FIMERect; + TempLocation := FCursorIndex; + + if (TempLocation = -1) then + TempLocation := FCompositionRange.from; + + if (TempLocation >= FCompositionRange.from) then + TempLocation := TempLocation - FCompositionRange.from; + + if (FCompositionBounds = nil) then + exit + else + if (TempLocation >= 0) and + (TempLocation < length(FCompositionBounds)) then + TempRect := FCompositionBounds[TempLocation] + else + if (length(FCompositionBounds) > 0) then + TempRect := FCompositionBounds[pred(length(FCompositionBounds))] + else + exit; + + TempIMC := ImmGetContext(FHWND); + + if (TempIMC <> 0) then + try + if (PrimaryLangID = LANG_CHINESE) then + begin + TempCandidate.dwIndex := 0; + TempCandidate.dwStyle := CFS_CANDIDATEPOS; + TempCandidate.ptCurrentPos.X := TempRect.x; + TempCandidate.ptCurrentPos.Y := TempRect.y; + TempCandidate.rcArea.Left := 0; + TempCandidate.rcArea.Top := 0; + TempCandidate.rcArea.Right := 0; + TempCandidate.rcArea.Bottom := 0; + + ImmSetCandidateWindow(TempIMC, @TempCandidate); + end; + + if FSystemCaret then + case PrimaryLangID of + LANG_JAPANESE : SetCaretPos(TempRect.x, TempRect.y + TempRect.height); + else SetCaretPos(TempRect.x, TempRect.y); + end; + + + if (PrimaryLangID = LANG_KOREAN) then + TempRect.y := TempRect.y + CARET_MARGIN; + + TempCandidate.dwIndex := 0; + TempCandidate.dwStyle := CFS_EXCLUDE; + TempCandidate.ptCurrentPos.X := TempRect.x; + TempCandidate.ptCurrentPos.Y := TempRect.y; + TempCandidate.rcArea.Left := TempRect.x; + TempCandidate.rcArea.Top := TempRect.y; + TempCandidate.rcArea.Right := TempRect.x + TempRect.width; + TempCandidate.rcArea.Bottom := TempRect.y + TempRect.height; + + ImmSetCandidateWindow(TempIMC, @TempCandidate); + finally + ImmReleaseContext(FHWND, TempIMC); + end; + {$ENDIF} +end; + + +end. diff --git a/source/uCEFPDFPrintCallback.pas b/source/uCEFPDFPrintCallback.pas index 0839a2e5..ecec181d 100644 --- a/source/uCEFPDFPrintCallback.pas +++ b/source/uCEFPDFPrintCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFPDFPrintOptions.pas b/source/uCEFPDFPrintOptions.pas index 449c4f8c..ccf07929 100644 --- a/source/uCEFPDFPrintOptions.pas +++ b/source/uCEFPDFPrintOptions.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFPostData.pas b/source/uCEFPostData.pas index 6ce1dd01..f505687e 100644 --- a/source/uCEFPostData.pas +++ b/source/uCEFPostData.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFPostDataElement.pas b/source/uCEFPostDataElement.pas index e63f60dc..4d1a37e2 100644 --- a/source/uCEFPostDataElement.pas +++ b/source/uCEFPostDataElement.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFPrintSettings.pas b/source/uCEFPrintSettings.pas index af74ed26..96409e14 100644 --- a/source/uCEFPrintSettings.pas +++ b/source/uCEFPrintSettings.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFProcessMessage.pas b/source/uCEFProcessMessage.pas index 6e161d06..e23ee7ae 100644 --- a/source/uCEFProcessMessage.pas +++ b/source/uCEFProcessMessage.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFRegisterCDMCallback.pas b/source/uCEFRegisterCDMCallback.pas index f478df7b..2960ee88 100644 --- a/source/uCEFRegisterCDMCallback.pas +++ b/source/uCEFRegisterCDMCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFRenderHandler.pas b/source/uCEFRenderHandler.pas index f68fca28..d6364666 100644 --- a/source/uCEFRenderHandler.pas +++ b/source/uCEFRenderHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFRenderProcessHandler.pas b/source/uCEFRenderProcessHandler.pas index 9b46f6cc..0a3ddea3 100644 --- a/source/uCEFRenderProcessHandler.pas +++ b/source/uCEFRenderProcessHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFRequest.pas b/source/uCEFRequest.pas index 2dde3242..bf26644a 100644 --- a/source/uCEFRequest.pas +++ b/source/uCEFRequest.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFRequestCallback.pas b/source/uCEFRequestCallback.pas index e369c838..d4b6cc24 100644 --- a/source/uCEFRequestCallback.pas +++ b/source/uCEFRequestCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFRequestContext.pas b/source/uCEFRequestContext.pas index f5253dd5..61e8ac36 100644 --- a/source/uCEFRequestContext.pas +++ b/source/uCEFRequestContext.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFRequestContextHandler.pas b/source/uCEFRequestContextHandler.pas index f20a4c86..70980bd7 100644 --- a/source/uCEFRequestContextHandler.pas +++ b/source/uCEFRequestContextHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFRequestHandler.pas b/source/uCEFRequestHandler.pas index 9062e486..00fe80e2 100644 --- a/source/uCEFRequestHandler.pas +++ b/source/uCEFRequestHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFResolveCallback.pas b/source/uCEFResolveCallback.pas index 1d61e7c9..2a889ecd 100644 --- a/source/uCEFResolveCallback.pas +++ b/source/uCEFResolveCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFResourceBundle.pas b/source/uCEFResourceBundle.pas index fa4b56e1..5e1621d1 100644 --- a/source/uCEFResourceBundle.pas +++ b/source/uCEFResourceBundle.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFResourceBundleHandler.pas b/source/uCEFResourceBundleHandler.pas index f9c74a2e..1175a4da 100644 --- a/source/uCEFResourceBundleHandler.pas +++ b/source/uCEFResourceBundleHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFResourceHandler.pas b/source/uCEFResourceHandler.pas index 557a4b7e..9da7d4da 100644 --- a/source/uCEFResourceHandler.pas +++ b/source/uCEFResourceHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFResponse.pas b/source/uCEFResponse.pas index e4e6c0ec..3c7b3bfc 100644 --- a/source/uCEFResponse.pas +++ b/source/uCEFResponse.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFResponseFilter.pas b/source/uCEFResponseFilter.pas index e30f740c..b07739a5 100644 --- a/source/uCEFResponseFilter.pas +++ b/source/uCEFResponseFilter.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFRunContextMenuCallback.pas b/source/uCEFRunContextMenuCallback.pas index 35546b17..23156665 100644 --- a/source/uCEFRunContextMenuCallback.pas +++ b/source/uCEFRunContextMenuCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFRunFileDialogCallback.pas b/source/uCEFRunFileDialogCallback.pas index 03d4ab48..5f148f2f 100644 --- a/source/uCEFRunFileDialogCallback.pas +++ b/source/uCEFRunFileDialogCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFSSLStatus.pas b/source/uCEFSSLStatus.pas index f8c05852..a0aaa651 100644 --- a/source/uCEFSSLStatus.pas +++ b/source/uCEFSSLStatus.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFSchemeHandlerFactory.pas b/source/uCEFSchemeHandlerFactory.pas index 584cb27b..5a49ef19 100644 --- a/source/uCEFSchemeHandlerFactory.pas +++ b/source/uCEFSchemeHandlerFactory.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFSchemeRegistrar.pas b/source/uCEFSchemeRegistrar.pas index 47220252..d57de257 100644 --- a/source/uCEFSchemeRegistrar.pas +++ b/source/uCEFSchemeRegistrar.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFSelectClientCertificateCallback.pas b/source/uCEFSelectClientCertificateCallback.pas index 009f61cb..b1b6eb2e 100644 --- a/source/uCEFSelectClientCertificateCallback.pas +++ b/source/uCEFSelectClientCertificateCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFServer.pas b/source/uCEFServer.pas index f789c5c2..c4c7bcef 100644 --- a/source/uCEFServer.pas +++ b/source/uCEFServer.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFServerComponent.pas b/source/uCEFServerComponent.pas index 7c18b399..055e45e2 100644 --- a/source/uCEFServerComponent.pas +++ b/source/uCEFServerComponent.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -53,7 +53,7 @@ uses {$IFDEF MSWINDOWS}WinApi.Windows, WinApi.Messages, WinApi.ActiveX,{$ENDIF} System.Classes, Vcl.Controls, Vcl.Graphics, Vcl.Forms, System.Math, {$ELSE} - {$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, Forms, Controls, Graphics, ActiveX, Math, + {$IFDEF MSWINDOWS}Windows, ActiveX,{$ENDIF} Classes, Forms, Controls, Graphics, Math, {$IFDEF FPC} LCLProc, LCLType, LCLIntf, LResources, LMessages, InterfaceBase, {$ELSE} diff --git a/source/uCEFServerEvents.pas b/source/uCEFServerEvents.pas index 85569bc3..7d486c7e 100644 --- a/source/uCEFServerEvents.pas +++ b/source/uCEFServerEvents.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFServerHandler.pas b/source/uCEFServerHandler.pas index d07bd892..9cb83b5e 100644 --- a/source/uCEFServerHandler.pas +++ b/source/uCEFServerHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFSetCookieCallback.pas b/source/uCEFSetCookieCallback.pas index ca8cd553..7c5e7fb2 100644 --- a/source/uCEFSetCookieCallback.pas +++ b/source/uCEFSetCookieCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFSslInfo.pas b/source/uCEFSslInfo.pas index 2cad1646..b6d48fb8 100644 --- a/source/uCEFSslInfo.pas +++ b/source/uCEFSslInfo.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFStreamReader.pas b/source/uCEFStreamReader.pas index 5503197f..dc64b198 100644 --- a/source/uCEFStreamReader.pas +++ b/source/uCEFStreamReader.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFStreamWriter.pas b/source/uCEFStreamWriter.pas index a4ebccfd..2c00b8ed 100644 --- a/source/uCEFStreamWriter.pas +++ b/source/uCEFStreamWriter.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFStringList.pas b/source/uCEFStringList.pas index 6756958b..cb7c5359 100644 --- a/source/uCEFStringList.pas +++ b/source/uCEFStringList.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFStringMap.pas b/source/uCEFStringMap.pas index d3cd3c10..750ad1c6 100644 --- a/source/uCEFStringMap.pas +++ b/source/uCEFStringMap.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFStringMultimap.pas b/source/uCEFStringMultimap.pas index 84efd41a..f5104c76 100644 --- a/source/uCEFStringMultimap.pas +++ b/source/uCEFStringMultimap.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFStringVisitor.pas b/source/uCEFStringVisitor.pas index c1889471..5460b198 100644 --- a/source/uCEFStringVisitor.pas +++ b/source/uCEFStringVisitor.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFTask.pas b/source/uCEFTask.pas index 6c1ae254..cdf00129 100644 --- a/source/uCEFTask.pas +++ b/source/uCEFTask.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFTaskRunner.pas b/source/uCEFTaskRunner.pas index 785e3238..76133ab1 100644 --- a/source/uCEFTaskRunner.pas +++ b/source/uCEFTaskRunner.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFThread.pas b/source/uCEFThread.pas index e0c9c96b..6a4229ae 100644 --- a/source/uCEFThread.pas +++ b/source/uCEFThread.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFTypes.pas b/source/uCEFTypes.pas index 44aac696..ee8abc0c 100644 --- a/source/uCEFTypes.pas +++ b/source/uCEFTypes.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -390,7 +390,8 @@ type width : Integer; height : Integer; end; - TCefRectArray = array[0..(High(Integer) div SizeOf(TCefRect))-1] of TCefRect; + TCefRectArray = array[0..(High(Integer) div SizeOf(TCefRect))-1] of TCefRect; + TCefRectDynArray = array of TCefRect; // /include/internal/cef_types.h (cef_point_t) TCefPoint = record @@ -943,6 +944,7 @@ type background_color : TCefColor; thick : integer; end; + TCefCompositionUnderlineDynArray = array of TCefCompositionUnderline; // /include/internal/cef_time.h (cef_time_t) TCefTime = record diff --git a/source/uCEFUrlRequest.pas b/source/uCEFUrlRequest.pas index cd2dc658..93b67dc4 100644 --- a/source/uCEFUrlRequest.pas +++ b/source/uCEFUrlRequest.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFUrlRequestClientComponent.pas b/source/uCEFUrlRequestClientComponent.pas index 7b6f7783..7e271c62 100644 --- a/source/uCEFUrlRequestClientComponent.pas +++ b/source/uCEFUrlRequestClientComponent.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -53,7 +53,7 @@ uses {$IFDEF MSWINDOWS}WinApi.Windows, WinApi.Messages, WinApi.ActiveX,{$ENDIF} System.Classes, Vcl.Controls, Vcl.Graphics, Vcl.Forms, System.Math, {$ELSE} - {$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, Forms, Controls, Graphics, ActiveX, Math, + {$IFDEF MSWINDOWS}Windows, ActiveX,{$ENDIF} Classes, Forms, Controls, Graphics, Math, {$IFDEF FPC} LCLProc, LCLType, LCLIntf, LResources, LMessages, InterfaceBase, {$ELSE} diff --git a/source/uCEFUrlRequestClientEvents.pas b/source/uCEFUrlRequestClientEvents.pas index 15b6d449..617fffbe 100644 --- a/source/uCEFUrlRequestClientEvents.pas +++ b/source/uCEFUrlRequestClientEvents.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFUrlrequestClient.pas b/source/uCEFUrlrequestClient.pas index 5e5817c4..6aac6b2f 100644 --- a/source/uCEFUrlrequestClient.pas +++ b/source/uCEFUrlrequestClient.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFV8Exception.pas b/source/uCEFV8Exception.pas index c2632a1b..9bd155f6 100644 --- a/source/uCEFV8Exception.pas +++ b/source/uCEFV8Exception.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFValue.pas b/source/uCEFValue.pas index 1b9a05d4..84e54d66 100644 --- a/source/uCEFValue.pas +++ b/source/uCEFValue.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFWaitableEvent.pas b/source/uCEFWaitableEvent.pas index 1cc11ede..b8225c0d 100644 --- a/source/uCEFWaitableEvent.pas +++ b/source/uCEFWaitableEvent.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFWebPluginInfo.pas b/source/uCEFWebPluginInfo.pas index 2878b56d..1894c538 100644 --- a/source/uCEFWebPluginInfo.pas +++ b/source/uCEFWebPluginInfo.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFWebPluginInfoVisitor.pas b/source/uCEFWebPluginInfoVisitor.pas index a773a334..0380a5de 100644 --- a/source/uCEFWebPluginInfoVisitor.pas +++ b/source/uCEFWebPluginInfoVisitor.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFWebPluginUnstableCallback.pas b/source/uCEFWebPluginUnstableCallback.pas index f805940f..d78a501a 100644 --- a/source/uCEFWebPluginUnstableCallback.pas +++ b/source/uCEFWebPluginUnstableCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFWinControl.pas b/source/uCEFWinControl.pas index 0c985649..23a04648 100644 --- a/source/uCEFWinControl.pas +++ b/source/uCEFWinControl.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -99,9 +99,11 @@ uses function TCEFWinControl.GetChildWindowHandle : THandle; begin + {$IFDEF MSWINDOWS} if not(csDesigning in ComponentState) and HandleAllocated then Result := GetWindow(Handle, GW_CHILD) else + {$ENDIF} Result := 0; end; @@ -143,7 +145,7 @@ begin TempHWND := ChildWindowHandle; if (TempHWND = 0) then exit; - + {$IFDEF MSWINDOWS} {$IFDEF DELPHI16_UP}Winapi.{$ENDIF}Windows.GetClientRect(TempHWND, TempRect); TempDC := GetDC(TempHWND); TempWidth := TempRect.Right - TempRect.Left; @@ -157,14 +159,17 @@ begin TempDC, 0, 0, SRCCOPY); ReleaseDC(TempHWND, TempDC); + {$ENDIF} end; function TCEFWinControl.DestroyChildWindow : boolean; var TempHWND : HWND; begin + {$IFDEF MSWINDOWS} TempHWND := ChildWindowHandle; Result := (TempHWND <> 0) and DestroyWindow(TempHWND); + {$ENDIF} end; procedure TCEFWinControl.Resize; diff --git a/source/uCEFWindowParent.pas b/source/uCEFWindowParent.pas index d9e085d7..07c28818 100644 --- a/source/uCEFWindowParent.pas +++ b/source/uCEFWindowParent.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -65,7 +65,9 @@ type {$IFNDEF FPC}{$IFDEF DELPHI16_UP}[ComponentPlatformsAttribute(pidWin32 or pidWin64)]{$ENDIF}{$ENDIF} TCEFWindowParent = class(TCEFWinControl) protected + {$IFDEF MSWINDOWS} procedure WndProc(var aMessage: TMessage); override; + {$ENDIF} end; {$IFDEF FPC} @@ -77,6 +79,7 @@ implementation uses uCEFMiscFunctions, uCEFClient, uCEFConstants; +{$IFDEF MSWINDOWS} procedure TCEFWindowParent.WndProc(var aMessage: TMessage); var TempHandle : THandle; @@ -103,6 +106,7 @@ begin else inherited WndProc(aMessage); end; end; +{$ENDIF} {$IFDEF FPC} procedure Register; diff --git a/source/uCEFWorkScheduler.pas b/source/uCEFWorkScheduler.pas index 14fcd396..df1c5304 100644 --- a/source/uCEFWorkScheduler.pas +++ b/source/uCEFWorkScheduler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -81,7 +81,9 @@ type procedure DestroyThread; procedure DeallocateWindowHandle; procedure DepleteWork; + {$IFDEF MSWINDOWS} procedure WndProc(var aMessage: TMessage); + {$ENDIF} procedure NextPulse(aInterval : integer); procedure ScheduleWork(const delay_ms : int64); procedure DoWork; @@ -173,6 +175,7 @@ begin if not(csDesigning in ComponentState) then begin + {$IFDEF MSWINDOWS} if (GlobalCEFApp <> nil) and ((GlobalCEFApp.ProcessType = ptBrowser) or GlobalCEFApp.SingleProcess) then begin @@ -183,6 +186,7 @@ begin FCompHandle := AllocateHWnd(WndProc); {$ENDIF} end; + {$ENDIF} CreateThread; end; @@ -219,6 +223,7 @@ begin end; end; +{$IFDEF MSWINDOWS} procedure TCEFWorkScheduler.WndProc(var aMessage: TMessage); begin if (aMessage.Msg = CEF_PUMPHAVEWORK) then @@ -226,6 +231,7 @@ begin else aMessage.Result := DefWindowProc(FCompHandle, aMessage.Msg, aMessage.WParam, aMessage.LParam); end; +{$ENDIF} procedure TCEFWorkScheduler.DeallocateWindowHandle; begin @@ -273,8 +279,10 @@ end; procedure TCEFWorkScheduler.ScheduleMessagePumpWork(const delay_ms : int64); begin + {$IFDEF MSWINDOWS} if not(FStopped) and (FCompHandle <> 0) then PostMessage(FCompHandle, CEF_PUMPHAVEWORK, 0, LPARAM(delay_ms)); + {$ENDIF} end; procedure TCEFWorkScheduler.StopScheduler; diff --git a/source/uCEFWorkSchedulerThread.pas b/source/uCEFWorkSchedulerThread.pas index 4cc10e60..c9d45af0 100644 --- a/source/uCEFWorkSchedulerThread.pas +++ b/source/uCEFWorkSchedulerThread.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFWriteHandler.pas b/source/uCEFWriteHandler.pas index f76ff768..d84ddc6a 100644 --- a/source/uCEFWriteHandler.pas +++ b/source/uCEFWriteHandler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -49,10 +49,12 @@ unit uCEFWriteHandler; interface uses - {$IFDEF DELPHI16_UP} - {$IFDEF MSWINDOWS}WinApi.Windows,{$ENDIF} - {$ELSE} - Windows, + {$IFDEF MSWINDOWS} + {$IFDEF DELPHI16_UP} + WinApi.Windows, + {$ELSE} + Windows, + {$ENDIF} {$ENDIF} uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes; @@ -218,9 +220,11 @@ end; constructor TCefBytesWriteHandler.Create(aGrow : NativeUInt); begin inherited Create; - + {$IFDEF MSWINDOWS} InitializeCriticalSection(FCriticalSection); - + {$ELSE} + InitCriticalSection(FCriticalSection); + {$ENDIF} FGrow := aGrow; FBufferSize := aGrow; FOffset := 0; @@ -232,15 +236,18 @@ destructor TCefBytesWriteHandler.Destroy; begin if (FBuffer <> nil) then FreeMem(FBuffer); - DeleteCriticalSection(FCriticalSection); - - FCriticalSection.DebugInfo := nil; - FCriticalSection.LockCount := 0; - FCriticalSection.RecursionCount := 0; - FCriticalSection.OwningThread := 0; - FCriticalSection.LockSemaphore := 0; - {$IFNDEF FPC} - FCriticalSection.Reserved := 0; + {$IFDEF MSWINDOWS} + DeleteCriticalSection(FCriticalSection); + FCriticalSection.DebugInfo := nil; + FCriticalSection.LockCount := 0; + FCriticalSection.RecursionCount := 0; + FCriticalSection.OwningThread := 0; + FCriticalSection.LockSemaphore := 0; + {$IFNDEF FPC} + FCriticalSection.Reserved := 0; + {$ENDIF} + {$ELSE} + DoneCriticalSection(FCriticalSection); {$ENDIF} inherited Destroy; @@ -261,7 +268,7 @@ begin begin TempPointer := Pointer(cardinal(FBuffer) + FOffset); - CopyMemory(TempPointer, ptr, TempSize); + Move(ptr^, TempPointer^, TempSize); FOffset := FOffset + TempSize; Result := n; diff --git a/source/uCEFX509CertPrincipal.pas b/source/uCEFX509CertPrincipal.pas index acd91a6e..eb6e2db4 100644 --- a/source/uCEFX509CertPrincipal.pas +++ b/source/uCEFX509CertPrincipal.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFX509Certificate.pas b/source/uCEFX509Certificate.pas index de0ea324..698a6d43 100644 --- a/source/uCEFX509Certificate.pas +++ b/source/uCEFX509Certificate.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFXmlReader.pas b/source/uCEFXmlReader.pas index 0d4f5e0a..fc2d3614 100644 --- a/source/uCEFXmlReader.pas +++ b/source/uCEFXmlReader.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFZipReader.pas b/source/uCEFZipReader.pas index fff7df3a..eeb002f4 100644 --- a/source/uCEFZipReader.pas +++ b/source/uCEFZipReader.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFv8Accessor.pas b/source/uCEFv8Accessor.pas index 5e3aeae5..71805b10 100644 --- a/source/uCEFv8Accessor.pas +++ b/source/uCEFv8Accessor.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFv8ArrayBufferReleaseCallback.pas b/source/uCEFv8ArrayBufferReleaseCallback.pas index 6dc04c66..ecf5c7a4 100644 --- a/source/uCEFv8ArrayBufferReleaseCallback.pas +++ b/source/uCEFv8ArrayBufferReleaseCallback.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFv8Context.pas b/source/uCEFv8Context.pas index 24b4618e..029df22d 100644 --- a/source/uCEFv8Context.pas +++ b/source/uCEFv8Context.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFv8Handler.pas b/source/uCEFv8Handler.pas index b28cb511..268f16cf 100644 --- a/source/uCEFv8Handler.pas +++ b/source/uCEFv8Handler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* @@ -53,7 +53,7 @@ uses {$IFDEF MSWINDOWS}WinApi.Windows,{$ENDIF} System.Rtti, System.TypInfo, System.Variants, System.SysUtils, System.Classes, System.Math, System.SyncObjs, {$ELSE} - {$IFDEF DELPHI14_UP}Rtti,{$ENDIF} TypInfo, Variants, SysUtils, Classes, Math, SyncObjs, Windows, + {$IFDEF DELPHI14_UP}Rtti,{$ENDIF} TypInfo, Variants, SysUtils, Classes, Math, SyncObjs, {$IFDEF MSWINDOWS}Windows,{$ENDIF} {$ENDIF} uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes; diff --git a/source/uCEFv8Interceptor.pas b/source/uCEFv8Interceptor.pas index 23bf60b5..0532ed2c 100644 --- a/source/uCEFv8Interceptor.pas +++ b/source/uCEFv8Interceptor.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFv8StackFrame.pas b/source/uCEFv8StackFrame.pas index 0ae636bb..d6d1db5c 100644 --- a/source/uCEFv8StackFrame.pas +++ b/source/uCEFv8StackFrame.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFv8StackTrace.pas b/source/uCEFv8StackTrace.pas index dfb9b4db..6d57990e 100644 --- a/source/uCEFv8StackTrace.pas +++ b/source/uCEFv8StackTrace.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uCEFv8Value.pas b/source/uCEFv8Value.pas index 1e5a57d4..740f5221 100644 --- a/source/uCEFv8Value.pas +++ b/source/uCEFv8Value.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uFMXBufferPanel.pas b/source/uFMXBufferPanel.pas index ecdb5ecf..7cac902e 100644 --- a/source/uFMXBufferPanel.pas +++ b/source/uFMXBufferPanel.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uFMXChromium.pas b/source/uFMXChromium.pas index 66729529..be199b6a 100644 --- a/source/uFMXChromium.pas +++ b/source/uFMXChromium.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uFMXWindowParent.pas b/source/uFMXWindowParent.pas index 5a122dba..44f110d8 100644 --- a/source/uFMXWindowParent.pas +++ b/source/uFMXWindowParent.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uFMXWorkScheduler.pas b/source/uFMXWorkScheduler.pas index 62bb0187..c414a77a 100644 --- a/source/uFMXWorkScheduler.pas +++ b/source/uFMXWorkScheduler.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* diff --git a/source/uOLEDragAndDrop.pas b/source/uOLEDragAndDrop.pas index 81e3a4d4..f31d7abb 100644 --- a/source/uOLEDragAndDrop.pas +++ b/source/uOLEDragAndDrop.pas @@ -10,7 +10,7 @@ // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // -// Copyright © 2018 Salvador Diaz Fau. All rights reserved. +// Copyright © 2019 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv *************