mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-06-02 21:57:37 +02:00
Update to CEF 3.3497.1829.g004ef91
- Added the TCEFLinkedWindowParent component.
This commit is contained in:
parent
8ebb5fb527
commit
0cf7c5f6b3
@ -52,7 +52,7 @@ object SchemeRegistrationBrowserFrm: TSchemeRegistrationBrowserFrm
|
|||||||
Align = alClient
|
Align = alClient
|
||||||
ItemIndex = 1
|
ItemIndex = 1
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Text = 'hello://test.html'
|
Text = 'hello://simplexsl.xml'
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
'https://www.google.com'
|
'https://www.google.com'
|
||||||
'hello://test.html')
|
'hello://test.html')
|
||||||
|
@ -23,6 +23,7 @@ object Form1: TForm1
|
|||||||
Width = 1038
|
Width = 1038
|
||||||
Height = 594
|
Height = 594
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
TabStop = True
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
OnClose = ChromiumWindow1Close
|
OnClose = ChromiumWindow1Close
|
||||||
OnBeforeClose = ChromiumWindow1BeforeClose
|
OnBeforeClose = ChromiumWindow1BeforeClose
|
||||||
|
@ -49,7 +49,8 @@ uses
|
|||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics,
|
Windows, Messages, SysUtils, Variants, Classes, Graphics,
|
||||||
Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
|
Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFChromium, uCEFWindowParent, uCEFChromiumWindow, uCEFTypes, uCEFInterfaces;
|
uCEFChromium, uCEFWindowParent, uCEFChromiumWindow, uCEFTypes, uCEFInterfaces,
|
||||||
|
uCEFWinControl;
|
||||||
|
|
||||||
type
|
type
|
||||||
TForm1 = class(TForm)
|
TForm1 = class(TForm)
|
||||||
|
@ -8,10 +8,10 @@
|
|||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="SimpleLazOSRBrowser.lpr"/>
|
<Filename Value="SimpleLazOSRBrowser.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="31"/>
|
<TopLine Value="31"/>
|
||||||
<CursorPos X="10" Y="43"/>
|
<CursorPos X="10" Y="43"/>
|
||||||
<UsageCount Value="40"/>
|
<UsageCount Value="40"/>
|
||||||
<Loaded Value="True"/>
|
|
||||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
<ComponentName Value="Form1"/>
|
<ComponentName Value="Form1"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<EditorIndex Value="2"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="186"/>
|
<TopLine Value="186"/>
|
||||||
<CursorPos X="15" Y="191"/>
|
<CursorPos X="15" Y="191"/>
|
||||||
<UsageCount Value="40"/>
|
<UsageCount Value="40"/>
|
||||||
@ -28,8 +28,6 @@
|
|||||||
<Item0 Y="189" ID="1"/>
|
<Item0 Y="189" ID="1"/>
|
||||||
<Item1 X="5" Y="805" ID="2"/>
|
<Item1 X="5" Y="805" ID="2"/>
|
||||||
</Bookmarks>
|
</Bookmarks>
|
||||||
<Loaded Value="True"/>
|
|
||||||
<LoadedDesigner Value="True"/>
|
|
||||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
<Unit2>
|
||||||
@ -44,11 +42,10 @@
|
|||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="..\..\source\uBufferPanel.pas"/>
|
<Filename Value="..\..\source\uBufferPanel.pas"/>
|
||||||
<EditorIndex Value="1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="95"/>
|
<TopLine Value="95"/>
|
||||||
<CursorPos X="41" Y="126"/>
|
<CursorPos X="41" Y="126"/>
|
||||||
<UsageCount Value="17"/>
|
<UsageCount Value="17"/>
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit3>
|
</Unit3>
|
||||||
<Unit4>
|
<Unit4>
|
||||||
<Filename Value="..\..\..\..\lcl\lcltype.pp"/>
|
<Filename Value="..\..\..\..\lcl\lcltype.pp"/>
|
||||||
@ -106,11 +103,10 @@
|
|||||||
</Unit10>
|
</Unit10>
|
||||||
<Unit11>
|
<Unit11>
|
||||||
<Filename Value="..\..\source\uCEFMiscFunctions.pas"/>
|
<Filename Value="..\..\source\uCEFMiscFunctions.pas"/>
|
||||||
<EditorIndex Value="3"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="1220"/>
|
<TopLine Value="1220"/>
|
||||||
<CursorPos Y="1231"/>
|
<CursorPos Y="1231"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit11>
|
</Unit11>
|
||||||
<Unit12>
|
<Unit12>
|
||||||
<Filename Value="..\..\source\uCEFConstants.pas"/>
|
<Filename Value="..\..\source\uCEFConstants.pas"/>
|
||||||
@ -159,126 +155,15 @@
|
|||||||
<Unit18>
|
<Unit18>
|
||||||
<Filename Value="..\..\source\uCEFApplication.pas"/>
|
<Filename Value="..\..\source\uCEFApplication.pas"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<EditorIndex Value="4"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="839"/>
|
<TopLine Value="839"/>
|
||||||
<CursorPos X="58" Y="846"/>
|
<CursorPos X="58" Y="846"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit18>
|
</Unit18>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="28" HistoryIndex="27">
|
<General>
|
||||||
<Position1>
|
<ActiveWindowIndexAtStart Value="-1"/>
|
||||||
<Filename Value="..\..\source\uBufferPanel.pas"/>
|
</General>
|
||||||
<Caret Line="163" Column="28" TopLine="43"/>
|
<JumpHistory HistoryIndex="-1"/>
|
||||||
</Position1>
|
|
||||||
<Position2>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="800" Column="81" TopLine="787"/>
|
|
||||||
</Position2>
|
|
||||||
<Position3>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="191" Column="3" TopLine="180"/>
|
|
||||||
</Position3>
|
|
||||||
<Position4>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="78" Column="25" TopLine="73"/>
|
|
||||||
</Position4>
|
|
||||||
<Position5>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="789" TopLine="788"/>
|
|
||||||
</Position5>
|
|
||||||
<Position6>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="203" Column="48" TopLine="173"/>
|
|
||||||
</Position6>
|
|
||||||
<Position7>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="800" Column="5" TopLine="785"/>
|
|
||||||
</Position7>
|
|
||||||
<Position8>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="190" TopLine="172"/>
|
|
||||||
</Position8>
|
|
||||||
<Position9>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="78" TopLine="62"/>
|
|
||||||
</Position9>
|
|
||||||
<Position10>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="191" Column="23" TopLine="188"/>
|
|
||||||
</Position10>
|
|
||||||
<Position11>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="197" Column="53" TopLine="185"/>
|
|
||||||
</Position11>
|
|
||||||
<Position12>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="206" Column="76" TopLine="179"/>
|
|
||||||
</Position12>
|
|
||||||
<Position13>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="76" Column="15" TopLine="61"/>
|
|
||||||
</Position13>
|
|
||||||
<Position14>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="814" Column="3" TopLine="810"/>
|
|
||||||
</Position14>
|
|
||||||
<Position15>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="78" Column="15" TopLine="59"/>
|
|
||||||
</Position15>
|
|
||||||
<Position16>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="203" Column="68" TopLine="188"/>
|
|
||||||
</Position16>
|
|
||||||
<Position17>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="206" Column="66" TopLine="188"/>
|
|
||||||
</Position17>
|
|
||||||
<Position18>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="196" TopLine="186"/>
|
|
||||||
</Position18>
|
|
||||||
<Position19>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="198" TopLine="186"/>
|
|
||||||
</Position19>
|
|
||||||
<Position20>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="200" TopLine="186"/>
|
|
||||||
</Position20>
|
|
||||||
<Position21>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="196" Column="47" TopLine="186"/>
|
|
||||||
</Position21>
|
|
||||||
<Position22>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="195" TopLine="186"/>
|
|
||||||
</Position22>
|
|
||||||
<Position23>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="197" TopLine="186"/>
|
|
||||||
</Position23>
|
|
||||||
<Position24>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="199" TopLine="186"/>
|
|
||||||
</Position24>
|
|
||||||
<Position25>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="200" TopLine="186"/>
|
|
||||||
</Position25>
|
|
||||||
<Position26>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="201" TopLine="186"/>
|
|
||||||
</Position26>
|
|
||||||
<Position27>
|
|
||||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
|
||||||
<Caret Line="191" Column="15" TopLine="186"/>
|
|
||||||
</Position27>
|
|
||||||
<Position28>
|
|
||||||
<Filename Value="..\..\source\uCEFMiscFunctions.pas"/>
|
|
||||||
<Caret Line="1231" TopLine="1220"/>
|
|
||||||
</Position28>
|
|
||||||
</JumpHistory>
|
|
||||||
</ProjectSession>
|
</ProjectSession>
|
||||||
</CONFIG>
|
</CONFIG>
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Version Value="10"/>
|
<Version Value="10"/>
|
||||||
<BuildModes Active="Default"/>
|
<BuildModes Active="Default"/>
|
||||||
<Units Count="34">
|
<Units Count="36">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="SimpleLazarusBrowser.lpr"/>
|
<Filename Value="SimpleLazarusBrowser.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="7"/>
|
<TopLine Value="5"/>
|
||||||
<CursorPos X="47" Y="22"/>
|
<CursorPos X="43" Y="5"/>
|
||||||
<UsageCount Value="38"/>
|
<UsageCount Value="38"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
@ -138,7 +138,8 @@
|
|||||||
</Unit16>
|
</Unit16>
|
||||||
<Unit17>
|
<Unit17>
|
||||||
<Filename Value="..\..\source\uCEFApplication.pas"/>
|
<Filename Value="..\..\source\uCEFApplication.pas"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<EditorIndex Value="-1"/>
|
||||||
|
<WindowIndex Value="-1"/>
|
||||||
<TopLine Value="2169"/>
|
<TopLine Value="2169"/>
|
||||||
<CursorPos Y="44"/>
|
<CursorPos Y="44"/>
|
||||||
<UsageCount Value="13"/>
|
<UsageCount Value="13"/>
|
||||||
@ -146,7 +147,6 @@
|
|||||||
<Item0 X="60" Y="956" ID="1"/>
|
<Item0 X="60" Y="956" ID="1"/>
|
||||||
<Item1 X="9" Y="894" ID="3"/>
|
<Item1 X="9" Y="894" ID="3"/>
|
||||||
</Bookmarks>
|
</Bookmarks>
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit17>
|
</Unit17>
|
||||||
<Unit18>
|
<Unit18>
|
||||||
<Filename Value="C:\lazarus\lcl\forms.pp"/>
|
<Filename Value="C:\lazarus\lcl\forms.pp"/>
|
||||||
@ -264,6 +264,22 @@
|
|||||||
<CursorPos X="3" Y="338"/>
|
<CursorPos X="3" Y="338"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit33>
|
</Unit33>
|
||||||
|
<Unit34>
|
||||||
|
<Filename Value="..\..\packages\cef4delphi_lazarus.pas"/>
|
||||||
|
<UnitName Value="CEF4Delphi_Lazarus"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="50"/>
|
||||||
|
<CursorPos X="16" Y="62"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit34>
|
||||||
|
<Unit35>
|
||||||
|
<Filename Value="..\..\source\uCEFLinkedWindowParent.pas"/>
|
||||||
|
<IsVisibleTab Value="True"/>
|
||||||
|
<TopLine Value="31"/>
|
||||||
|
<CursorPos X="28" Y="38"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit35>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory HistoryIndex="-1"/>
|
<JumpHistory HistoryIndex="-1"/>
|
||||||
</ProjectSession>
|
</ProjectSession>
|
||||||
|
@ -162,7 +162,9 @@ contains
|
|||||||
uCEFServerEvents in '..\source\uCEFServerEvents.pas',
|
uCEFServerEvents in '..\source\uCEFServerEvents.pas',
|
||||||
uCEFServerComponent in '..\source\uCEFServerComponent.pas',
|
uCEFServerComponent in '..\source\uCEFServerComponent.pas',
|
||||||
uCEFStringList in '..\source\uCEFStringList.pas',
|
uCEFStringList in '..\source\uCEFStringList.pas',
|
||||||
uCEFv8ArrayBufferReleaseCallback in '..\source\uCEFv8ArrayBufferReleaseCallback.pas';
|
uCEFv8ArrayBufferReleaseCallback in '..\source\uCEFv8ArrayBufferReleaseCallback.pas',
|
||||||
|
uCEFWinControl in '..\source\uCEFWinControl.pas',
|
||||||
|
uCEFLinkedWindowParent in '..\source\uCEFLinkedWindowParent.pas';
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -254,6 +254,8 @@
|
|||||||
<DCCReference Include="..\source\uCEFServerComponent.pas"/>
|
<DCCReference Include="..\source\uCEFServerComponent.pas"/>
|
||||||
<DCCReference Include="..\source\uCEFStringList.pas"/>
|
<DCCReference Include="..\source\uCEFStringList.pas"/>
|
||||||
<DCCReference Include="..\source\uCEFv8ArrayBufferReleaseCallback.pas"/>
|
<DCCReference Include="..\source\uCEFv8ArrayBufferReleaseCallback.pas"/>
|
||||||
|
<DCCReference Include="..\source\uCEFWinControl.pas"/>
|
||||||
|
<DCCReference Include="..\source\uCEFLinkedWindowParent.pas"/>
|
||||||
<BuildConfiguration Include="Base">
|
<BuildConfiguration Include="Base">
|
||||||
<Key>Base</Key>
|
<Key>Base</Key>
|
||||||
</BuildConfiguration>
|
</BuildConfiguration>
|
||||||
|
@ -159,6 +159,8 @@ contains
|
|||||||
uCEFServerEvents in '..\source\uCEFServerEvents.pas',
|
uCEFServerEvents in '..\source\uCEFServerEvents.pas',
|
||||||
uCEFServerComponent in '..\source\uCEFServerComponent.pas',
|
uCEFServerComponent in '..\source\uCEFServerComponent.pas',
|
||||||
uCEFStringList in '..\source\uCEFStringList.pas',
|
uCEFStringList in '..\source\uCEFStringList.pas',
|
||||||
uCEFv8ArrayBufferReleaseCallback in '..\source\uCEFv8ArrayBufferReleaseCallback.pas';
|
uCEFv8ArrayBufferReleaseCallback in '..\source\uCEFv8ArrayBufferReleaseCallback.pas',
|
||||||
|
uCEFWinControl in '..\source\uCEFWinControl.pas',
|
||||||
|
uCEFLinkedWindowParent in '..\source\uCEFLinkedWindowParent.pas';
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -49,12 +49,13 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes,
|
Classes,
|
||||||
uCEFChromium, uCEFWindowParent, uCEFChromiumWindow, uBufferPanel, uCEFWorkScheduler, uCEFServerComponent;
|
uCEFChromium, uCEFWindowParent, uCEFChromiumWindow, uBufferPanel, uCEFWorkScheduler,
|
||||||
|
uCEFServerComponent, uCEFLinkedWindowParent;
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
begin
|
begin
|
||||||
RegisterComponents('Chromium', [TChromium, TCEFWindowParent, TChromiumWindow, TBufferPanel,
|
RegisterComponents('Chromium', [TChromium, TCEFWindowParent, TChromiumWindow, TBufferPanel,
|
||||||
TCEFWorkScheduler, TCEFServerComponent]);
|
TCEFWorkScheduler, TCEFServerComponent, TCEFLinkedWindowParent]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -12,18 +12,17 @@ package CEF4Delphi_FMX;
|
|||||||
{$LOCALSYMBOLS ON}
|
{$LOCALSYMBOLS ON}
|
||||||
{$LONGSTRINGS ON}
|
{$LONGSTRINGS ON}
|
||||||
{$OPENSTRINGS ON}
|
{$OPENSTRINGS ON}
|
||||||
{$OPTIMIZATION OFF}
|
{$OPTIMIZATION ON}
|
||||||
{$OVERFLOWCHECKS ON}
|
{$OVERFLOWCHECKS ON}
|
||||||
{$RANGECHECKS ON}
|
{$RANGECHECKS ON}
|
||||||
{$REFERENCEINFO ON}
|
{$REFERENCEINFO ON}
|
||||||
{$SAFEDIVIDE OFF}
|
{$SAFEDIVIDE OFF}
|
||||||
{$STACKFRAMES ON}
|
{$STACKFRAMES OFF}
|
||||||
{$TYPEDADDRESS OFF}
|
{$TYPEDADDRESS OFF}
|
||||||
{$VARSTRINGCHECKS ON}
|
{$VARSTRINGCHECKS ON}
|
||||||
{$WRITEABLECONST OFF}
|
{$WRITEABLECONST OFF}
|
||||||
{$MINENUMSIZE 1}
|
{$MINENUMSIZE 1}
|
||||||
{$IMAGEBASE $400000}
|
{$IMAGEBASE $400000}
|
||||||
{$DEFINE DEBUG}
|
|
||||||
{$ENDIF IMPLICITBUILDING}
|
{$ENDIF IMPLICITBUILDING}
|
||||||
{$DESCRIPTION 'CEF4Delphi'}
|
{$DESCRIPTION 'CEF4Delphi'}
|
||||||
{$IMPLICITBUILD OFF}
|
{$IMPLICITBUILD OFF}
|
||||||
@ -167,7 +166,9 @@ contains
|
|||||||
uFMXWorkScheduler in '..\source\uFMXWorkScheduler.pas',
|
uFMXWorkScheduler in '..\source\uFMXWorkScheduler.pas',
|
||||||
uCEFStringList in '..\source\uCEFStringList.pas',
|
uCEFStringList in '..\source\uCEFStringList.pas',
|
||||||
uFMXWindowParent in '..\source\uFMXWindowParent.pas',
|
uFMXWindowParent in '..\source\uFMXWindowParent.pas',
|
||||||
uCEFv8ArrayBufferReleaseCallback in '..\source\uCEFv8ArrayBufferReleaseCallback.pas';
|
uCEFv8ArrayBufferReleaseCallback in '..\source\uCEFv8ArrayBufferReleaseCallback.pas',
|
||||||
|
uCEFWinControl in '..\source\uCEFWinControl.pas',
|
||||||
|
uCEFLinkedWindowParent in '..\source\uCEFLinkedWindowParent.pas';
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -268,6 +268,8 @@
|
|||||||
<DCCReference Include="..\source\uCEFStringList.pas"/>
|
<DCCReference Include="..\source\uCEFStringList.pas"/>
|
||||||
<DCCReference Include="..\source\uFMXWindowParent.pas"/>
|
<DCCReference Include="..\source\uFMXWindowParent.pas"/>
|
||||||
<DCCReference Include="..\source\uCEFv8ArrayBufferReleaseCallback.pas"/>
|
<DCCReference Include="..\source\uCEFv8ArrayBufferReleaseCallback.pas"/>
|
||||||
|
<DCCReference Include="..\source\uCEFWinControl.pas"/>
|
||||||
|
<DCCReference Include="..\source\uCEFLinkedWindowParent.pas"/>
|
||||||
<BuildConfiguration Include="Base">
|
<BuildConfiguration Include="Base">
|
||||||
<Key>Base</Key>
|
<Key>Base</Key>
|
||||||
</BuildConfiguration>
|
</BuildConfiguration>
|
||||||
|
Binary file not shown.
@ -49,14 +49,16 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
System.Classes,
|
System.Classes,
|
||||||
uCEFChromium, uCEFWindowParent, uCEFChromiumWindow, uBufferPanel, uCEFWorkScheduler,
|
uCEFChromium, uCEFWindowParent, uCEFChromiumWindow, uBufferPanel,
|
||||||
uFMXBufferPanel, uFMXChromium, uFMXWorkScheduler, uCEFServerComponent;
|
uCEFWorkScheduler, uFMXBufferPanel, uFMXChromium, uFMXWorkScheduler,
|
||||||
|
uCEFServerComponent, uCEFLinkedWindowParent;
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
begin
|
begin
|
||||||
RegisterComponents('Chromium', [TChromium, TCEFWindowParent, TChromiumWindow, TBufferPanel,
|
RegisterComponents('Chromium', [TChromium, TCEFWindowParent, TChromiumWindow,
|
||||||
TFMXBufferPanel, TFMXChromium, TFMXWorkScheduler,
|
TBufferPanel, TFMXBufferPanel, TFMXChromium,
|
||||||
TCEFWorkScheduler, TCEFServerComponent]);
|
TFMXWorkScheduler, TCEFWorkScheduler,
|
||||||
|
TCEFServerComponent, TCEFLinkedWindowParent]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -54,12 +54,12 @@ uses
|
|||||||
Classes,
|
Classes,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFChromium, uCEFWindowParent, uCEFChromiumWindow, uBufferPanel, uCEFWorkScheduler,
|
uCEFChromium, uCEFWindowParent, uCEFChromiumWindow, uBufferPanel, uCEFWorkScheduler,
|
||||||
uCEFServerComponent;
|
uCEFServerComponent, uCEFLinkedWindowParent;
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
begin
|
begin
|
||||||
RegisterComponents('Chromium', [TChromium, TCEFWindowParent, TChromiumWindow, TBufferPanel,
|
RegisterComponents('Chromium', [TChromium, TCEFWindowParent, TChromiumWindow, TBufferPanel,
|
||||||
TCEFWorkScheduler, TCEFServerComponent]);
|
TCEFWorkScheduler, TCEFServerComponent, TCEFLinkedWindowParent]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
<Description Value="CEF4Delphi"/>
|
<Description Value="CEF4Delphi"/>
|
||||||
<Version Major="1"/>
|
<Version Major="1"/>
|
||||||
<Files Count="133">
|
<Files Count="135">
|
||||||
<Item1>
|
<Item1>
|
||||||
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
||||||
<UnitName Value="uCEFAccessibilityHandler"/>
|
<UnitName Value="uCEFAccessibilityHandler"/>
|
||||||
@ -560,6 +560,15 @@
|
|||||||
<Filename Value="..\source\res\tchromiumwindow.lrs"/>
|
<Filename Value="..\source\res\tchromiumwindow.lrs"/>
|
||||||
<Type Value="LRS"/>
|
<Type Value="LRS"/>
|
||||||
</Item133>
|
</Item133>
|
||||||
|
<Item134>
|
||||||
|
<Filename Value="..\source\uCEFWinControl.pas"/>
|
||||||
|
<UnitName Value="uCEFWinControl"/>
|
||||||
|
</Item134>
|
||||||
|
<Item135>
|
||||||
|
<Filename Value="..\source\uCEFLinkedWindowParent.pas"/>
|
||||||
|
<HasRegisterProc Value="True"/>
|
||||||
|
<UnitName Value="uCEFLinkedWindowParent"/>
|
||||||
|
</Item135>
|
||||||
</Files>
|
</Files>
|
||||||
<RequiredPkgs Count="3">
|
<RequiredPkgs Count="3">
|
||||||
<Item1>
|
<Item1>
|
||||||
|
@ -45,7 +45,8 @@ uses
|
|||||||
uCEFWindowParent, uCEFWorkScheduler, uCEFWorkSchedulerThread,
|
uCEFWindowParent, uCEFWorkScheduler, uCEFWorkSchedulerThread,
|
||||||
uCEFWriteHandler, uCEFX509Certificate, uCEFX509CertPrincipal, uCEFXmlReader,
|
uCEFWriteHandler, uCEFX509Certificate, uCEFX509CertPrincipal, uCEFXmlReader,
|
||||||
uCEFZipReader, uCEFChromium, uBufferPanel, uCEFServer, uCEFServerComponent,
|
uCEFZipReader, uCEFChromium, uBufferPanel, uCEFServer, uCEFServerComponent,
|
||||||
uCEFServerEvents, uCEFServerHandler, LazarusPackageIntf;
|
uCEFServerEvents, uCEFServerHandler, uCEFWinControl, uCEFLinkedWindowParent,
|
||||||
|
LazarusPackageIntf;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -57,6 +58,7 @@ begin
|
|||||||
RegisterUnit('uCEFChromium', @uCEFChromium.Register);
|
RegisterUnit('uCEFChromium', @uCEFChromium.Register);
|
||||||
RegisterUnit('uBufferPanel', @uBufferPanel.Register);
|
RegisterUnit('uBufferPanel', @uBufferPanel.Register);
|
||||||
RegisterUnit('uCEFServerComponent', @uCEFServerComponent.Register);
|
RegisterUnit('uCEFServerComponent', @uCEFServerComponent.Register);
|
||||||
|
RegisterUnit('uCEFLinkedWindowParent', @uCEFLinkedWindowParent.Register);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
e:\lazarus\tools\lazres.exe ..\..\source\res\tbufferpanel.lrs tbufferpanel.png
|
c:\lazarus\tools\lazres.exe ..\..\source\res\tbufferpanel.lrs tbufferpanel.png
|
||||||
e:\lazarus\tools\lazres.exe ..\..\source\res\tcefservercomponent.lrs tcefservercomponent.png
|
c:\lazarus\tools\lazres.exe ..\..\source\res\tcefservercomponent.lrs tcefservercomponent.png
|
||||||
e:\lazarus\tools\lazres.exe ..\..\source\res\tcefwindowparent.lrs tcefwindowparent.png
|
c:\lazarus\tools\lazres.exe ..\..\source\res\tcefwindowparent.lrs tcefwindowparent.png
|
||||||
e:\lazarus\tools\lazres.exe ..\..\source\res\tcefworkscheduler.lrs tcefworkscheduler.png
|
c:\lazarus\tools\lazres.exe ..\..\source\res\tceflinkedwindowparent.lrs tceflinkedwindowparent.png
|
||||||
e:\lazarus\tools\lazres.exe ..\..\source\res\tchromium.lrs tchromium.png
|
c:\lazarus\tools\lazres.exe ..\..\source\res\tcefworkscheduler.lrs tcefworkscheduler.png
|
||||||
e:\lazarus\tools\lazres.exe ..\..\source\res\tchromiumwindow.lrs tchromiumwindow.png
|
c:\lazarus\tools\lazres.exe ..\..\source\res\tchromium.lrs tchromium.png
|
||||||
|
c:\lazarus\tools\lazres.exe ..\..\source\res\tchromiumwindow.lrs tchromiumwindow.png
|
||||||
pause
|
pause
|
Binary file not shown.
@ -1,6 +1,7 @@
|
|||||||
TChromium BITMAP "chromium.bmp"
|
TChromium BITMAP "chromium.bmp"
|
||||||
TFMXChromium BITMAP "chromium.bmp"
|
TFMXChromium BITMAP "chromium.bmp"
|
||||||
TCEFWindowParent BITMAP "windowparent.bmp"
|
TCEFWindowParent BITMAP "windowparent.bmp"
|
||||||
|
TCEFLinkedWindowParent BITMAP "windowparent.bmp"
|
||||||
TChromiumWindow BITMAP "chromiumwindow.bmp"
|
TChromiumWindow BITMAP "chromiumwindow.bmp"
|
||||||
TBufferPanel BITMAP "bufferpanel.bmp"
|
TBufferPanel BITMAP "bufferpanel.bmp"
|
||||||
TFMXBufferPanel BITMAP "bufferpanel.bmp"
|
TFMXBufferPanel BITMAP "bufferpanel.bmp"
|
||||||
|
BIN
packages/res/tceflinkedwindowparent.png
Normal file
BIN
packages/res/tceflinkedwindowparent.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 271 B |
13
source/res/tceflinkedwindowparent.lrs
Normal file
13
source/res/tceflinkedwindowparent.lrs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
LazarusResources.Add('tceflinkedwindowparent','PNG',[
|
||||||
|
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#2#0#0#0'o'#21#170#175
|
||||||
|
+#0#0#0#9'pHYs'#0#0#13#215#0#0#13#215#1'B('#155'x'#0#0#0#7'tIME'#7#226#5#11#10
|
||||||
|
+#31'&'#154'y'#22#237#0#0#0#174'IDAT8'#203#173#148';'#14#196' '#12'D'#241#136
|
||||||
|
+#130#179' q'#255'+'#144#27#228#20'i'#144#136#20'18'#5#171#253#148#27#219#189
|
||||||
|
+#159#158#199#150'EU'#131'G'#197#214#218#190#239'FJ'#206'9'#212'ZI'#170#161'H'
|
||||||
|
+#214'ZA'#18#128'E'#7#0'I'#4#167'r'#3#197#16#194#156#211#7#180'2{'#140#16#145
|
||||||
|
+#143#145#15'HU-'#211#173#165#199'E!i'#9'HU_'#163'Y'#140#188'G'#179#27#173#222
|
||||||
|
+#184'('#150#140#0#204'9'#253#140#236#25#173#27't52f'#244#3#178#27#249#189#145
|
||||||
|
+#235#186#0#164#148','#151#221'{'#151#227'8'#182'm;'#207's'#140#241#239#15#16
|
||||||
|
+#17#17'I)'#149'R'#228#187#249'AR'#239#127#127#3#232'x'#222'a'#127#10#207#215
|
||||||
|
+#0#0#0#0'IEND'#174'B`'#130
|
||||||
|
]);
|
@ -61,7 +61,7 @@ uses
|
|||||||
const
|
const
|
||||||
CEF_SUPPORTED_VERSION_MAJOR = 3;
|
CEF_SUPPORTED_VERSION_MAJOR = 3;
|
||||||
CEF_SUPPORTED_VERSION_MINOR = 3497;
|
CEF_SUPPORTED_VERSION_MINOR = 3497;
|
||||||
CEF_SUPPORTED_VERSION_RELEASE = 1827;
|
CEF_SUPPORTED_VERSION_RELEASE = 1829;
|
||||||
CEF_SUPPORTED_VERSION_BUILD = 0;
|
CEF_SUPPORTED_VERSION_BUILD = 0;
|
||||||
|
|
||||||
CEF_CHROMEELF_VERSION_MAJOR = 69;
|
CEF_CHROMEELF_VERSION_MAJOR = 69;
|
||||||
|
@ -52,7 +52,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF DELPHI16_UP}
|
{$IFDEF DELPHI16_UP}
|
||||||
{$IFDEF MSWINDOWS}WinApi.Windows, WinApi.Messages,{$ENDIF} System.Classes,
|
{$IFDEF MSWINDOWS}WinApi.Windows, WinApi.Messages,{$ENDIF} System.Classes, Vcl.Controls,
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
{$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, Forms, Controls, Graphics,
|
{$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, Forms, Controls, Graphics,
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
@ -61,18 +61,20 @@ uses
|
|||||||
Messages,
|
Messages,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFWindowParent, uCEFChromium, uCEFInterfaces, uCEFConstants, uCEFTypes;
|
uCEFWindowParent, uCEFChromium, uCEFInterfaces, uCEFConstants, uCEFTypes, uCEFWinControl;
|
||||||
|
|
||||||
type
|
type
|
||||||
TChromiumWindow = class(TCEFWindowParent)
|
TChromiumWindow = class(TCEFWinControl)
|
||||||
protected
|
protected
|
||||||
FChromium : TChromium;
|
FChromium : TChromium;
|
||||||
FOnClose : TNotifyEvent;
|
FOnClose : TNotifyEvent;
|
||||||
FOnBeforeClose : TNotifyEvent;
|
FOnBeforeClose : TNotifyEvent;
|
||||||
FOnAfterCreated : TNotifyEvent;
|
FOnAfterCreated : TNotifyEvent;
|
||||||
|
|
||||||
function GetChildWindowHandle : THandle; override;
|
|
||||||
function GetBrowserInitialized : boolean;
|
function GetBrowserInitialized : boolean;
|
||||||
|
function GetChildWindowHandle : THandle; override;
|
||||||
|
|
||||||
|
procedure WndProc(var aMessage: TMessage); override;
|
||||||
|
|
||||||
procedure OnCloseMsg(var aMessage : TMessage); message CEF_DOONCLOSE;
|
procedure OnCloseMsg(var aMessage : TMessage); message CEF_DOONCLOSE;
|
||||||
procedure OnBeforeCloseMsg(var aMessage : TMessage); message CEF_DOONBEFORECLOSE;
|
procedure OnBeforeCloseMsg(var aMessage : TMessage); message CEF_DOONBEFORECLOSE;
|
||||||
@ -144,6 +146,39 @@ begin
|
|||||||
if (Result = 0) then Result := inherited GetChildWindowHandle;
|
if (Result = 0) then Result := inherited GetChildWindowHandle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TChromiumWindow.WndProc(var aMessage: TMessage);
|
||||||
|
var
|
||||||
|
TempHandle : THandle;
|
||||||
|
begin
|
||||||
|
case aMessage.Msg of
|
||||||
|
WM_SETFOCUS:
|
||||||
|
begin
|
||||||
|
if (FChromium <> nil) then
|
||||||
|
FChromium.SetFocus(True)
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
TempHandle := ChildWindowHandle;
|
||||||
|
if (TempHandle <> 0) then PostMessage(TempHandle, WM_SETFOCUS, aMessage.WParam, 0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
inherited WndProc(aMessage);
|
||||||
|
end;
|
||||||
|
|
||||||
|
WM_ERASEBKGND:
|
||||||
|
if (ChildWindowHandle = 0) then inherited WndProc(aMessage);
|
||||||
|
|
||||||
|
CM_WANTSPECIALKEY:
|
||||||
|
if not(TWMKey(aMessage).CharCode in [VK_LEFT .. VK_DOWN, VK_RETURN, VK_ESCAPE]) then
|
||||||
|
aMessage.Result := 1
|
||||||
|
else
|
||||||
|
inherited WndProc(aMessage);
|
||||||
|
|
||||||
|
WM_GETDLGCODE : aMessage.Result := DLGC_WANTARROWS or DLGC_WANTCHARS;
|
||||||
|
|
||||||
|
else inherited WndProc(aMessage);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TChromiumWindow.GetBrowserInitialized : boolean;
|
function TChromiumWindow.GetBrowserInitialized : boolean;
|
||||||
begin
|
begin
|
||||||
Result := (FChromium <> nil) and FChromium.Initialized;
|
Result := (FChromium <> nil) and FChromium.Initialized;
|
||||||
|
165
source/uCEFLinkedWindowParent.pas
Normal file
165
source/uCEFLinkedWindowParent.pas
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
// ************************************************************************
|
||||||
|
// ***************************** CEF4Delphi *******************************
|
||||||
|
// ************************************************************************
|
||||||
|
//
|
||||||
|
// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based
|
||||||
|
// browser in Delphi applications.
|
||||||
|
//
|
||||||
|
// The original license of DCEF3 still applies to CEF4Delphi.
|
||||||
|
//
|
||||||
|
// For more information about CEF4Delphi visit :
|
||||||
|
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
||||||
|
//
|
||||||
|
// Copyright © 2018 Salvador Diaz Fau. All rights reserved.
|
||||||
|
//
|
||||||
|
// ************************************************************************
|
||||||
|
// ************ vvvv Original license and comments below vvvv *************
|
||||||
|
// ************************************************************************
|
||||||
|
(*
|
||||||
|
* Delphi Chromium Embedded 3
|
||||||
|
*
|
||||||
|
* Usage allowed under the restrictions of the Lesser GNU General Public License
|
||||||
|
* or alternatively the restrictions of the Mozilla Public License 1.1
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||||
|
* the specific language governing rights and limitations under the License.
|
||||||
|
*
|
||||||
|
* Unit owner : Henri Gourvest <hgourvest@gmail.com>
|
||||||
|
* Web site : http://www.progdigy.com
|
||||||
|
* Repository : http://code.google.com/p/delphichromiumembedded/
|
||||||
|
* Group : http://groups.google.com/group/delphichromiumembedded
|
||||||
|
*
|
||||||
|
* Embarcadero Technologies, Inc is not permitted to use or redistribute
|
||||||
|
* this source code without explicit permission.
|
||||||
|
*
|
||||||
|
*)
|
||||||
|
|
||||||
|
unit uCEFLinkedWindowParent;
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$MODE OBJFPC}{$H+}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFNDEF CPUX64}
|
||||||
|
{$ALIGN ON}
|
||||||
|
{$MINENUMSIZE 4}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$I cef.inc}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
{$IFDEF MSWINDOWS}WinApi.Windows, WinApi.Messages,{$ENDIF} System.Classes, Vcl.Controls, Vcl.Graphics,
|
||||||
|
{$ELSE}
|
||||||
|
{$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, Forms, Controls, Graphics,
|
||||||
|
{$IFDEF FPC}
|
||||||
|
LCLProc, LCLType, LCLIntf, LResources, LMessages, InterfaceBase,
|
||||||
|
{$ELSE}
|
||||||
|
Messages,
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
|
uCEFWinControl, uCEFTypes, uCEFInterfaces, uCEFChromium;
|
||||||
|
|
||||||
|
type
|
||||||
|
TCEFLinkedWindowParent = class(TCEFWinControl)
|
||||||
|
protected
|
||||||
|
FChromium : TChromium;
|
||||||
|
|
||||||
|
procedure SetChromium(aValue : TChromium);
|
||||||
|
|
||||||
|
function GetChildWindowHandle : THandle; override;
|
||||||
|
procedure WndProc(var aMessage: TMessage); override;
|
||||||
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||||
|
|
||||||
|
public
|
||||||
|
constructor Create(AOwner : TComponent); override;
|
||||||
|
|
||||||
|
published
|
||||||
|
property Chromium : TChromium read FChromium write SetChromium;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
|
||||||
|
procedure Register;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
uCEFMiscFunctions, uCEFClient, uCEFConstants;
|
||||||
|
|
||||||
|
constructor TCEFLinkedWindowParent.Create(AOwner : TComponent);
|
||||||
|
begin
|
||||||
|
inherited Create(AOwner);
|
||||||
|
|
||||||
|
FChromium := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCEFLinkedWindowParent.GetChildWindowHandle : THandle;
|
||||||
|
begin
|
||||||
|
Result := 0;
|
||||||
|
|
||||||
|
if (FChromium <> nil) then Result := FChromium.WindowHandle;
|
||||||
|
|
||||||
|
if (Result = 0) then Result := inherited GetChildWindowHandle;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEFLinkedWindowParent.WndProc(var aMessage: TMessage);
|
||||||
|
var
|
||||||
|
TempHandle : THandle;
|
||||||
|
begin
|
||||||
|
case aMessage.Msg of
|
||||||
|
WM_SETFOCUS:
|
||||||
|
begin
|
||||||
|
if (FChromium <> nil) then
|
||||||
|
FChromium.SetFocus(True)
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
TempHandle := ChildWindowHandle;
|
||||||
|
if (TempHandle <> 0) then PostMessage(TempHandle, WM_SETFOCUS, aMessage.WParam, 0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
inherited WndProc(aMessage);
|
||||||
|
end;
|
||||||
|
|
||||||
|
WM_ERASEBKGND:
|
||||||
|
if (ChildWindowHandle = 0) then inherited WndProc(aMessage);
|
||||||
|
|
||||||
|
CM_WANTSPECIALKEY:
|
||||||
|
if not(TWMKey(aMessage).CharCode in [VK_LEFT .. VK_DOWN, VK_RETURN, VK_ESCAPE]) then
|
||||||
|
aMessage.Result := 1
|
||||||
|
else
|
||||||
|
inherited WndProc(aMessage);
|
||||||
|
|
||||||
|
WM_GETDLGCODE : aMessage.Result := DLGC_WANTARROWS or DLGC_WANTCHARS;
|
||||||
|
|
||||||
|
else inherited WndProc(aMessage);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEFLinkedWindowParent.Notification(AComponent: TComponent; Operation: TOperation);
|
||||||
|
begin
|
||||||
|
inherited Notification(AComponent, Operation);
|
||||||
|
|
||||||
|
if (Operation = opRemove) and (AComponent = FChromium) then FChromium := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEFLinkedWindowParent.SetChromium(aValue : TChromium);
|
||||||
|
begin
|
||||||
|
FChromium := aValue;
|
||||||
|
if (aValue <> nil) then aValue.FreeNotification(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
procedure Register;
|
||||||
|
begin
|
||||||
|
{$I res/tceflinkedwindowparent.lrs}
|
||||||
|
RegisterComponents('Chromium', [TCEFLinkedWindowParent]);
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
end.
|
173
source/uCEFWinControl.pas
Normal file
173
source/uCEFWinControl.pas
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
// ************************************************************************
|
||||||
|
// ***************************** CEF4Delphi *******************************
|
||||||
|
// ************************************************************************
|
||||||
|
//
|
||||||
|
// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based
|
||||||
|
// browser in Delphi applications.
|
||||||
|
//
|
||||||
|
// The original license of DCEF3 still applies to CEF4Delphi.
|
||||||
|
//
|
||||||
|
// For more information about CEF4Delphi visit :
|
||||||
|
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
||||||
|
//
|
||||||
|
// Copyright © 2018 Salvador Diaz Fau. All rights reserved.
|
||||||
|
//
|
||||||
|
// ************************************************************************
|
||||||
|
// ************ vvvv Original license and comments below vvvv *************
|
||||||
|
// ************************************************************************
|
||||||
|
(*
|
||||||
|
* Delphi Chromium Embedded 3
|
||||||
|
*
|
||||||
|
* Usage allowed under the restrictions of the Lesser GNU General Public License
|
||||||
|
* or alternatively the restrictions of the Mozilla Public License 1.1
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||||
|
* the specific language governing rights and limitations under the License.
|
||||||
|
*
|
||||||
|
* Unit owner : Henri Gourvest <hgourvest@gmail.com>
|
||||||
|
* Web site : http://www.progdigy.com
|
||||||
|
* Repository : http://code.google.com/p/delphichromiumembedded/
|
||||||
|
* Group : http://groups.google.com/group/delphichromiumembedded
|
||||||
|
*
|
||||||
|
* Embarcadero Technologies, Inc is not permitted to use or redistribute
|
||||||
|
* this source code without explicit permission.
|
||||||
|
*
|
||||||
|
*)
|
||||||
|
|
||||||
|
unit uCEFWinControl;
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$MODE OBJFPC}{$H+}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFNDEF CPUX64}
|
||||||
|
{$ALIGN ON}
|
||||||
|
{$MINENUMSIZE 4}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$I cef.inc}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
{$IFDEF MSWINDOWS}WinApi.Windows, {$ENDIF} System.Classes, Vcl.Controls, Vcl.Graphics,
|
||||||
|
{$ELSE}
|
||||||
|
{$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, Forms, Controls, Graphics,
|
||||||
|
{$IFDEF FPC}
|
||||||
|
LCLProc, LCLType, LCLIntf, LResources, InterfaceBase,
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
|
uCEFTypes, uCEFInterfaces;
|
||||||
|
|
||||||
|
type
|
||||||
|
TCEFWinControl = class(TWinControl)
|
||||||
|
protected
|
||||||
|
function GetChildWindowHandle : THandle; virtual;
|
||||||
|
procedure Resize; override;
|
||||||
|
|
||||||
|
public
|
||||||
|
function TakeSnapshot(var aBitmap : TBitmap) : boolean;
|
||||||
|
function DestroyChildWindow : boolean;
|
||||||
|
procedure CreateHandle; override;
|
||||||
|
procedure UpdateSize;
|
||||||
|
|
||||||
|
property ChildWindowHandle : THandle read GetChildWindowHandle;
|
||||||
|
|
||||||
|
published
|
||||||
|
property Align;
|
||||||
|
property Anchors;
|
||||||
|
property Color;
|
||||||
|
property Constraints;
|
||||||
|
property TabStop;
|
||||||
|
property TabOrder;
|
||||||
|
property Visible;
|
||||||
|
property Enabled;
|
||||||
|
property ShowHint;
|
||||||
|
property Hint;
|
||||||
|
property OnResize;
|
||||||
|
property DoubleBuffered;
|
||||||
|
{$IFDEF DELPHI12_UP}
|
||||||
|
property ParentDoubleBuffered;
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
uCEFMiscFunctions, uCEFClient, uCEFConstants;
|
||||||
|
|
||||||
|
function TCEFWinControl.GetChildWindowHandle : THandle;
|
||||||
|
begin
|
||||||
|
if not(csDesigning in ComponentState) and HandleAllocated then
|
||||||
|
Result := GetWindow(Handle, GW_CHILD)
|
||||||
|
else
|
||||||
|
Result := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEFWinControl.CreateHandle;
|
||||||
|
begin
|
||||||
|
inherited CreateHandle;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEFWinControl.UpdateSize;
|
||||||
|
var
|
||||||
|
TempRect : TRect;
|
||||||
|
TempHWND : THandle;
|
||||||
|
begin
|
||||||
|
TempHWND := ChildWindowHandle;
|
||||||
|
if (TempHWND = 0) then exit;
|
||||||
|
|
||||||
|
TempRect := GetClientRect;
|
||||||
|
|
||||||
|
SetWindowPos(TempHWND, 0,
|
||||||
|
0, 0, TempRect.right, TempRect.bottom,
|
||||||
|
SWP_NOZORDER);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCEFWinControl.TakeSnapshot(var aBitmap : TBitmap) : boolean;
|
||||||
|
var
|
||||||
|
TempHWND : HWND;
|
||||||
|
TempDC : HDC;
|
||||||
|
TempRect : TRect;
|
||||||
|
TempWidth : Integer;
|
||||||
|
TempHeight : Integer;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
if (aBitmap = nil) then exit;
|
||||||
|
|
||||||
|
TempHWND := ChildWindowHandle;
|
||||||
|
if (TempHWND = 0) then exit;
|
||||||
|
|
||||||
|
{$IFDEF DELPHI16_UP}Winapi.{$ENDIF}Windows.GetClientRect(TempHWND, TempRect);
|
||||||
|
TempDC := GetDC(TempHWND);
|
||||||
|
TempWidth := TempRect.Right - TempRect.Left;
|
||||||
|
TempHeight := TempRect.Bottom - TempRect.Top;
|
||||||
|
|
||||||
|
aBitmap := TBitmap.Create;
|
||||||
|
aBitmap.Height := TempHeight;
|
||||||
|
aBitmap.Width := TempWidth;
|
||||||
|
|
||||||
|
Result := BitBlt(aBitmap.Canvas.Handle, 0, 0, TempWidth, TempHeight,
|
||||||
|
TempDC, 0, 0, SRCCOPY);
|
||||||
|
|
||||||
|
ReleaseDC(TempHWND, TempDC);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCEFWinControl.DestroyChildWindow : boolean;
|
||||||
|
var
|
||||||
|
TempHWND : HWND;
|
||||||
|
begin
|
||||||
|
TempHWND := ChildWindowHandle;
|
||||||
|
Result := (TempHWND <> 0) and DestroyWindow(TempHWND);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEFWinControl.Resize;
|
||||||
|
begin
|
||||||
|
inherited Resize;
|
||||||
|
|
||||||
|
UpdateSize;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
@ -52,7 +52,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF DELPHI16_UP}
|
{$IFDEF DELPHI16_UP}
|
||||||
{$IFDEF MSWINDOWS}WinApi.Windows, WinApi.Messages,{$ENDIF} System.Classes, Vcl.Controls, Vcl.Graphics,
|
{$IFDEF MSWINDOWS}WinApi.Windows, WinApi.Messages,{$ENDIF} System.Classes, Vcl.Controls, Vcl.Graphics,
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
{$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, Forms, Controls, Graphics,
|
{$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, Forms, Controls, Graphics,
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
@ -61,39 +61,12 @@ uses
|
|||||||
Messages,
|
Messages,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFTypes, uCEFInterfaces;
|
uCEFWinControl, uCEFTypes, uCEFInterfaces;
|
||||||
|
|
||||||
type
|
type
|
||||||
TCEFWindowParent = class(TWinControl)
|
TCEFWindowParent = class(TCEFWinControl)
|
||||||
protected
|
protected
|
||||||
function GetChildWindowHandle : THandle; virtual;
|
|
||||||
|
|
||||||
procedure WndProc(var aMessage: TMessage); override;
|
procedure WndProc(var aMessage: TMessage); override;
|
||||||
|
|
||||||
public
|
|
||||||
procedure UpdateSize;
|
|
||||||
function TakeSnapshot(var aBitmap : TBitmap) : boolean;
|
|
||||||
function DestroyChildWindow : boolean;
|
|
||||||
procedure CreateHandle; override;
|
|
||||||
procedure Resize; override;
|
|
||||||
|
|
||||||
property ChildWindowHandle : THandle read GetChildWindowHandle;
|
|
||||||
|
|
||||||
published
|
|
||||||
property Align;
|
|
||||||
property Anchors;
|
|
||||||
property Color;
|
|
||||||
property Constraints;
|
|
||||||
property TabStop;
|
|
||||||
property TabOrder;
|
|
||||||
property Visible;
|
|
||||||
property Enabled;
|
|
||||||
property ShowHint;
|
|
||||||
property Hint;
|
|
||||||
property DoubleBuffered;
|
|
||||||
{$IFDEF DELPHI12_UP}
|
|
||||||
property ParentDoubleBuffered;
|
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
@ -105,47 +78,6 @@ implementation
|
|||||||
uses
|
uses
|
||||||
uCEFMiscFunctions, uCEFClient, uCEFConstants;
|
uCEFMiscFunctions, uCEFClient, uCEFConstants;
|
||||||
|
|
||||||
function TCEFWindowParent.GetChildWindowHandle : THandle;
|
|
||||||
begin
|
|
||||||
if not(csDesigning in ComponentState) and HandleAllocated then
|
|
||||||
Result := GetWindow(Handle, GW_CHILD)
|
|
||||||
else
|
|
||||||
Result := 0;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCEFWindowParent.Resize;
|
|
||||||
begin
|
|
||||||
inherited Resize;
|
|
||||||
|
|
||||||
UpdateSize;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCEFWindowParent.CreateHandle;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCEFWindowParent.UpdateSize;
|
|
||||||
var
|
|
||||||
TempRect : TRect;
|
|
||||||
hdwp: THandle;
|
|
||||||
TempHandle : THandle;
|
|
||||||
begin
|
|
||||||
TempHandle := ChildWindowHandle;
|
|
||||||
if (TempHandle = 0) then Exit;
|
|
||||||
|
|
||||||
TempRect := GetClientRect;
|
|
||||||
hdwp := BeginDeferWindowPos(1);
|
|
||||||
|
|
||||||
try
|
|
||||||
hdwp := DeferWindowPos(hdwp, TempHandle, HWND_TOP,
|
|
||||||
TempRect.left, TempRect.top, TempRect.right - TempRect.left, TempRect.bottom - TempRect.top,
|
|
||||||
SWP_NOZORDER);
|
|
||||||
finally
|
|
||||||
EndDeferWindowPos(hdwp);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCEFWindowParent.WndProc(var aMessage: TMessage);
|
procedure TCEFWindowParent.WndProc(var aMessage: TMessage);
|
||||||
var
|
var
|
||||||
TempHandle : THandle;
|
TempHandle : THandle;
|
||||||
@ -159,10 +91,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
WM_ERASEBKGND:
|
WM_ERASEBKGND:
|
||||||
begin
|
if (ChildWindowHandle = 0) then inherited WndProc(aMessage);
|
||||||
TempHandle := ChildWindowHandle;
|
|
||||||
if (TempHandle = 0) then inherited WndProc(aMessage);
|
|
||||||
end;
|
|
||||||
|
|
||||||
CM_WANTSPECIALKEY:
|
CM_WANTSPECIALKEY:
|
||||||
if not(TWMKey(aMessage).CharCode in [VK_LEFT .. VK_DOWN, VK_RETURN, VK_ESCAPE]) then
|
if not(TWMKey(aMessage).CharCode in [VK_LEFT .. VK_DOWN, VK_RETURN, VK_ESCAPE]) then
|
||||||
@ -176,43 +105,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCEFWindowParent.TakeSnapshot(var aBitmap : TBitmap) : boolean;
|
|
||||||
var
|
|
||||||
TempHWND : HWND;
|
|
||||||
TempDC : HDC;
|
|
||||||
TempRect : TRect;
|
|
||||||
TempWidth : Integer;
|
|
||||||
TempHeight : Integer;
|
|
||||||
begin
|
|
||||||
Result := False;
|
|
||||||
TempHWND := ChildWindowHandle;
|
|
||||||
|
|
||||||
if (TempHWND <> 0) then
|
|
||||||
begin
|
|
||||||
{$IFDEF DELPHI16_UP}Winapi.{$ENDIF}Windows.GetClientRect(TempHWND, TempRect);
|
|
||||||
TempDC := GetDC(TempHWND);
|
|
||||||
TempWidth := TempRect.Right - TempRect.Left;
|
|
||||||
TempHeight := TempRect.Bottom - TempRect.Top;
|
|
||||||
|
|
||||||
aBitmap := TBitmap.Create;
|
|
||||||
aBitmap.Height := TempHeight;
|
|
||||||
aBitmap.Width := TempWidth;
|
|
||||||
|
|
||||||
Result := BitBlt(aBitmap.Canvas.Handle, 0, 0, TempWidth, TempHeight,
|
|
||||||
TempDC, 0, 0, SRCCOPY);
|
|
||||||
|
|
||||||
ReleaseDC(TempHWND, TempDC);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TCEFWindowParent.DestroyChildWindow : boolean;
|
|
||||||
var
|
|
||||||
TempHWND : HWND;
|
|
||||||
begin
|
|
||||||
TempHWND := ChildWindowHandle;
|
|
||||||
Result := (TempHWND <> 0) and DestroyWindow(TempHWND);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
procedure Register;
|
procedure Register;
|
||||||
begin
|
begin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user