introduce WebkitGtkSharp

This commit is contained in:
lytico 2021-07-19 18:11:04 +02:00
parent aa1095a02d
commit 4790ecaa9b
7 changed files with 11234 additions and 2 deletions

View file

@ -36,9 +36,13 @@ class Settings
ExtraArgs = "--abi-cs-usings=Gtk,GLib"
},
new GAssembly("GtkSourceSharp")
{
Deps = new[] { "GLibSharp", "GtkSharp", "GioSharp", "CairoSharp", "PangoSharp", "GdkSharp" },
},
new GAssembly("WebkitGtkSharp")
{
Deps = new[] { "GLibSharp", "GtkSharp", "GioSharp", "CairoSharp", "PangoSharp", "GdkSharp" },
}
};
}
}
}

View file

@ -22,6 +22,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples", "Samples\Samples.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GtkSourceSharp", "Libs\GtkSourceSharp\GtkSourceSharp.csproj", "{2BD3D08E-0FDD-4DC3-A063-58B10B525DA8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebkitGtkSharp", "Libs\WebkitGtkSharp\WebkitGtkSharp.csproj", "{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -140,6 +142,18 @@ Global
{2BD3D08E-0FDD-4DC3-A063-58B10B525DA8}.Release|x64.Build.0 = Release|Any CPU
{2BD3D08E-0FDD-4DC3-A063-58B10B525DA8}.Release|x86.ActiveCfg = Release|Any CPU
{2BD3D08E-0FDD-4DC3-A063-58B10B525DA8}.Release|x86.Build.0 = Release|Any CPU
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}.Debug|x64.ActiveCfg = Debug|Any CPU
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}.Debug|x64.Build.0 = Debug|Any CPU
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}.Debug|x86.ActiveCfg = Debug|Any CPU
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}.Debug|x86.Build.0 = Debug|Any CPU
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}.Release|Any CPU.Build.0 = Release|Any CPU
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}.Release|x64.ActiveCfg = Release|Any CPU
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}.Release|x64.Build.0 = Release|Any CPU
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}.Release|x86.ActiveCfg = Release|Any CPU
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -153,6 +167,7 @@ Global
{B4B26375-BED5-4000-A38F-899FF1672B47} = {CCEA1235-D75F-4919-83F6-16793B11BEF5}
{04597E0B-375D-4E08-A16C-EE5FF3937B73} = {CCEA1235-D75F-4919-83F6-16793B11BEF5}
{2BD3D08E-0FDD-4DC3-A063-58B10B525DA8} = {CCEA1235-D75F-4919-83F6-16793B11BEF5}
{60E31DAD-B6E8-4074-B2ED-53FCDFCB0F4D} = {CCEA1235-D75F-4919-83F6-16793B11BEF5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DA4DD75D-B6C8-4836-AF84-B5FF538D9D86}

View file

@ -28,6 +28,8 @@ class GLibrary
_libraryDefinitions[Library.Gtk] = new[] { "libgtk-3-0.dll", "libgtk-3.so.0", "libgtk-3.0.dylib", "gtk-3.dll" };
_libraryDefinitions[Library.PangoCairo] = new[] { "libpangocairo-1.0-0.dll", "libpangocairo-1.0.so.0", "libpangocairo-1.0.0.dylib", "pangocairo-1.dll" };
_libraryDefinitions[Library.GtkSource] = new[] { "libgtksourceview-4-0.dll", "libgtksourceview-4.so.0", "libgtksourceview-4.0.dylib", "gtksourceview-4.dll" };
_libraryDefinitions[Library.Webkit] = new[] { "libwebkitgtk-3.0.dll", "libwebkitgtk-3.0.so.0", "libwebkitgtk-3.0.dylib", "libwebkitgtk-3.0.dll" };
}
public static IntPtr Load(Library library)

View file

@ -11,5 +11,6 @@ enum Library
Gdk,
GdkPixbuf,
Gtk,
GtkSource
GtkSource,
Webkit
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<PackageProjectUrl>https://github.com/GtkSharp/GtkSharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/GtkSharp/GtkSharp</RepositoryUrl>
<Description>GtkWebkitSharp is a C# wrapper for the Gtk-Webkit library.</Description>
<PackageTags>webkitgtk;webkitgtksharp;webkit-sharp;wrapper</PackageTags>
<RootNamespace>GtkWebkitSharp</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>..\..\..\BuildOutput\Debug</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>..\..\..\BuildOutput\Release</OutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Shared\*.cs">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GtkSharp\GtkSharp.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,355 @@
<?xml version="1.0"?>
<metadata>
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/virtual_method[@cname='create_web_view']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/virtual_method[@cname='web_view_ready']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/virtual_method[@cname='close_web_view']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/virtual_method[@cname='navigation_requested']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/virtual_method[@cname='window_object_cleared']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/virtual_method[@cname='script_alert']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/virtual_method[@cname='script_confirm']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/virtual_method[@cname='script_prompt']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/virtual_method[@cname='console_message']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/class_struct[@cname='WebKitWebViewClass']/method[@vm='create_web_view']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/class_struct[@cname='WebKitWebViewClass']/method[@vm='web_view_ready']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/class_struct[@cname='WebKitWebViewClass']/method[@vm='close_web_view']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/class_struct[@cname='WebKitWebViewClass']/method[@vm='navigation_requested']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/class_struct[@cname='WebKitWebViewClass']/method[@vm='window_object_cleared']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/class_struct[@cname='WebKitWebViewClass']/method[@vm='script_alert']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/class_struct[@cname='WebKitWebViewClass']/method[@vm='script_confirm']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/class_struct[@cname='WebKitWebViewClass']/method[@vm='script_prompt']" />
<remove-node path="/api/namespace/object[@cname='WebKitWebView']/class_struct[@cname='WebKitWebViewClass']/method[@vm='console_message']" />
<!-- Add missing signal in WebFrame -->
<add-node path="/api/namespace/object[@cname='WebKitWebFrame']">
<signal name="Cleared" cname="cleared" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
</parameters>
</signal>
<signal name="LoadCommitted" cname="load-committed" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
</parameters>
</signal>
<signal name="LoadDone" cname="load-done" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="gboolean" name="done" />
</parameters>
</signal>
<signal name="TitleChanged" cname="title-changed" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="const-gchar*" name="title" />
</parameters>
</signal>
<signal name="HoveringOverLink" cname="hovering-over-link" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="const-gchar*" name="link" />
<parameter type="const-gchar*" name="url" />
</parameters>
</signal>
</add-node>
<!-- Add missing signal in WebView -->
<add-node path="/api/namespace/object[@cname='WebKitWebView']">
<!-- Since: 1.10 -->
<signal name="ContextMenu" cname="context-menu" when="LAST">
<return-type type="gboolean" />
<parameters>
<parameter type="GtkWidget*" name="default_menu" />
<parameter type="WebKitHitTestResult*" name="hit_test_result" />
<parameter type="gboolean" name="triggered_with_keyboard" />
</parameters>
</signal>
<!-- Since: 1.1.23 -->
<signal name="GeolocationPolicyDecisionCancelled" cname="geolocation-policy-decision-cancelled" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
</parameters>
</signal>
<signal name="GeolocationPolicyDecisionRequested" cname="geolocation-policy-decision-requested" when="LAST">
<return-type type="gboolean" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="WebKitGeolocationPolicyDecision*" name="policy_decision" />
</parameters>
</signal>
<!-- Since: 1.1.18 -->
<signal name="IconLoaded" cname="icon-loaded" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="const-gchar*" name="icon_uri" />
</parameters>
</signal>
<!-- Since: 1.1.14
* Undo and Redo Signals are internal
-->
<signal name="DatabaseQuotaExceeded" cname="database-quota-exceeded" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="GObject*" name="frame" />
<parameter type="GObject*" name="database" />
</parameters>
</signal>
<signal name="ResourceRequestStarting" cname="resource-request-starting" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="WebKitWebFrame*" name="web_frame" />
<parameter type="WebKitWebResource*" name="web_resource" />
<parameter type="WebKitNetworkRequest*" name="request" />
<parameter type="WebKitNetworkResponse*" name="response" />
</parameters>
</signal>
<!-- Since: 1.1.11 -->
<signal name="CloseWebView" cname="close-web-view" when="LAST">
<return-type type="gboolean" />
</signal>
<!-- Since: 1.1.8 -->
<signal name="CreatePluginWidget" cname="create-plugin-widget" when="LAST">
<return-type type="GtkWidget*" />
<parameters>
<parameter type="const-gchar*" name="mime_type" />
<parameter type="const-gchar*" name="uri" />
<parameter type="GHashTable*" name="param" />
</parameters>
</signal>
<!-- Since: 1.1.6 -->
<signal name="LoadError" cname="load-error" when="LAST">
<return-type type="gboolean" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="const-gchar*" name="uri" />
<parameter type="gchar**" name="web_error" />
</parameters>
</signal>
<!-- Since: 1.1.5 -->
<signal name="PrintRequested" cname="print-requested" when="LAST">
<return-type type="gboolean" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
</parameters>
</signal>
<!-- Since: 1.1.4 -->
<signal name="NewWindowPolicyDecisionRequested" cname="new-window-policy-decision-requested" when="LAST">
<return-type type="gboolean" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="WebKitNetworkRequest*" name="request" />
<parameter type="WebKitWebNavigationAction*" name="navigation" />
<parameter type="WebKitWebPolicyDecision*" name="policy" />
</parameters>
</signal>
<signal name="MovedCursor" cname="move-cursor" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="GtkMovementStep*" name="step" />
<parameter type="gint" name="count" />
</parameters>
</signal>
<!-- Since: 1.1.2 -->
<signal name="DownloadRequested" cname="download-requested" when="LAST">
<return-type type="gboolean" />
<parameters>
<parameter type="WebKitDownload*" name="download" />
</parameters>
</signal>
<!-- Since: 1.0.3 -->
<signal name="NavigationPolicyDecisionRequested" cname="navigation-policy-decision-requested" when="LAST">
<return-type type="gboolean" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="WebKitNetworkRequest*" name="request" />
<parameter type="WebKitWebNavigationAction*" name="navigation" />
<parameter type="WebKitWebPolicyDecision*" name="policy" />
</parameters>
</signal>
<signal name="MimeTypePolicyDecisionRequested" cname="mime-type-policy-decision-requested" when="LAST">
<return-type type="gboolean" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="WebKitNetworkRequest*" name="request" />
<parameter type="const-gchar*" name="mimetype" />
<parameter type="WebKitWebPolicyDecision*" name="policy" />
</parameters>
</signal>
<signal name="CreateWebView" cname="create-web-view" when="LAST">
<return-type type="WebKitWebView*" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
</parameters>
</signal>
<signal name="WebViewReady" cname="web-view-ready" when="LAST">
<return-type type="gboolean" />
</signal>
<!-- From 0.2 -->
<signal name="UserChangedContents" cname="user-changed-contents" when="FIRST">
<return-type type="void" />
</signal>
<signal name="NavigationRequested" cname="navigation-requested" when="LAST">
<return-type type="gint" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="WebKitNetworkRequest" name="request" />
</parameters>
</signal>
<signal name="WindowObjectCleared" cname="window-object-cleared" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="gpointer" name="context" /> <!-- TODO: check the right type -->
<parameter type="gpointer" name="window_object" /> <!-- TODO: check the right type -->
</parameters>
</signal>
<signal name="LoadStarted" cname="load-started" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
</parameters>
</signal>
<signal name="LoadCommitted" cname="load-committed" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
</parameters>
</signal>
<signal name="LoadProgressChanged" cname="load-progress-changed" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="gint" name="progress" />
</parameters>
</signal>
<signal name="LoadFinished" cname="load-finished" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
</parameters>
</signal>
<signal name="TitleChanged" cname="title-changed" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="const-gchar*" name="title" />
</parameters>
</signal>
<signal name="HoveringOverLink" cname="hovering-over-link" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="const-gchar*" name="title" />
<parameter type="const-gchar*" name="link" />
</parameters>
</signal>
<signal name="PopulatePopup" cname="populate-popup" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="GtkMenu" name="menu" />
</parameters>
</signal>
<signal name="StatusBarTextChanged" cname="status-bar-text-changed" when="LAST">
<return-type type="void" />
<parameters>
<parameter type="const-gchar*" name="value" />
</parameters>
</signal>
<signal name="SelectionChanged" cname="selection-changed" when="LAST">
<return-type type="void" />
</signal>
<signal name="ConsoleMessage" cname="console-message" when="LAST">
<return-type type="gboolean" />
<parameters>
<parameter type="const-gchar*" name="message" />
<parameter type="gint" name="line" />
<parameter type="const-gchar*" name="source_id" />
</parameters>
</signal>
<signal name="ScriptAlert" cname="script-alert" when="LAST">
<return-type type="gboolean" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="const-gchar*" name="message" />
</parameters>
</signal>
<signal name="ScriptConfirm" cname="script-confirm" when="LAST">
<return-type type="gboolean" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="const-gchar*" name="message" />
<parameter type="gboolean" name="confirmed" />
</parameters>
</signal>
<signal name="ScriptPrompt" cname="script-prompt" when="LAST">
<return-type type="gboolean" />
<parameters>
<parameter type="WebKitWebFrame*" name="frame" />
<parameter type="const-gchar*" name="message" />
<parameter type="const-gchar*" name="default_value" />
<parameter type="gchar**" name="text" />
</parameters>
</signal>
<signal name="SelectedAll" cname="select-all" when="LAST">
<return-type type="void" />
</signal>
<signal name="ClipboardCut" cname="cut-clipboard" when="LAST">
<return-type type="void" />
</signal>
<signal name="ClipboardCopy" cname="copy-clipboard" when="LAST">
<return-type type="void" />
</signal>
<signal name="PastedClipboard" cname="paste-clipboard" when="LAST">
<return-type type="void" />
</signal>
</add-node>
</metadata>