summaryrefslogtreecommitdiff
path: root/Tizen.WebView/Interop
diff options
context:
space:
mode:
Diffstat (limited to 'Tizen.WebView/Interop')
-rw-r--r--Tizen.WebView/Interop/Interop.ChromiumEwk.Context.cs41
-rw-r--r--Tizen.WebView/Interop/Interop.ChromiumEwk.CookieManager.cs46
-rw-r--r--Tizen.WebView/Interop/Interop.ChromiumEwk.Error.cs49
-rw-r--r--Tizen.WebView/Interop/Interop.ChromiumEwk.Settings.cs60
-rw-r--r--Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs127
-rw-r--r--Tizen.WebView/Interop/Interop.ChromiumEwk.cs29
-rw-r--r--Tizen.WebView/Interop/Interop.Elementary.cs37
-rw-r--r--Tizen.WebView/Interop/Interop.Evas.cs27
-rw-r--r--Tizen.WebView/Interop/Interop.Libraries.cs24
9 files changed, 440 insertions, 0 deletions
diff --git a/Tizen.WebView/Interop/Interop.ChromiumEwk.Context.cs b/Tizen.WebView/Interop/Interop.ChromiumEwk.Context.cs
new file mode 100644
index 0000000..e073823
--- /dev/null
+++ b/Tizen.WebView/Interop/Interop.ChromiumEwk.Context.cs
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class ChromiumEwk
+ {
+ public enum CacheModel
+ {
+ DocumentViewer,
+ DocumentBrowser,
+ PrimaryWebBrowser
+ }
+
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern IntPtr ewk_context_cookie_manager_get(IntPtr context);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_context_cache_model_set(IntPtr context, CacheModel model);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern CacheModel ewk_context_cache_model_get(IntPtr context);
+ }
+}
diff --git a/Tizen.WebView/Interop/Interop.ChromiumEwk.CookieManager.cs b/Tizen.WebView/Interop/Interop.ChromiumEwk.CookieManager.cs
new file mode 100644
index 0000000..2c90553
--- /dev/null
+++ b/Tizen.WebView/Interop/Interop.ChromiumEwk.CookieManager.cs
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class ChromiumEwk
+ {
+ public enum CookieAcceptPolicy
+ {
+ Always,
+ Never,
+ NoThirdParty
+ }
+
+ public enum CookiePersistentStorage
+ {
+ Text,
+ SqlLite
+ }
+
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern void ewk_cookie_manager_accept_policy_set(IntPtr manager, CookieAcceptPolicy policy);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern void ewk_cookie_manager_cookies_clear(IntPtr manager);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern void ewk_cookie_manager_persistent_storage_set(IntPtr manager, string path, CookiePersistentStorage storage);
+ }
+}
diff --git a/Tizen.WebView/Interop/Interop.ChromiumEwk.Error.cs b/Tizen.WebView/Interop/Interop.ChromiumEwk.Error.cs
new file mode 100644
index 0000000..9234dc6
--- /dev/null
+++ b/Tizen.WebView/Interop/Interop.ChromiumEwk.Error.cs
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class ChromiumEwk
+ {
+ [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_error_url_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _ewk_error_url_get(IntPtr error);
+
+ internal static string ewk_error_url_get(IntPtr error)
+ {
+ IntPtr ptr = _ewk_error_url_get(error);
+ return Marshal.PtrToStringAnsi(ptr);
+ }
+
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern int ewk_error_code_get(IntPtr error);
+
+ [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_error_description_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _ewk_error_description_get(IntPtr error);
+
+ internal static string ewk_error_description_get(IntPtr error)
+ {
+ IntPtr ptr = _ewk_error_description_get(error);
+ return Marshal.PtrToStringAnsi(ptr);
+ }
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_error_cancellation_get(IntPtr error);
+ }
+}
diff --git a/Tizen.WebView/Interop/Interop.ChromiumEwk.Settings.cs b/Tizen.WebView/Interop/Interop.ChromiumEwk.Settings.cs
new file mode 100644
index 0000000..2acd268
--- /dev/null
+++ b/Tizen.WebView/Interop/Interop.ChromiumEwk.Settings.cs
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class ChromiumEwk
+ {
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_settings_javascript_enabled_set(IntPtr settings, bool enable);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_settings_javascript_enabled_get(IntPtr settings);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_settings_loads_images_automatically_set(IntPtr settings, bool enable);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_settings_loads_images_automatically_get(IntPtr settings);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_settings_default_text_encoding_name_set(IntPtr settings, string encoding);
+
+ [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_settings_default_text_encoding_name_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _ewk_settings_default_text_encoding_name_get(IntPtr settings);
+
+ internal static string ewk_settings_default_text_encoding_name_get(IntPtr settings)
+ {
+ IntPtr ptr = _ewk_settings_default_text_encoding_name_get(settings);
+ return Marshal.PtrToStringAnsi(ptr);
+ }
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_settings_default_font_size_set(IntPtr settings, int size);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern int ewk_settings_default_font_size_get(IntPtr settings);
+ }
+}
diff --git a/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs b/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs
new file mode 100644
index 0000000..e507ca8
--- /dev/null
+++ b/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class ChromiumEwk
+ {
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern IntPtr ewk_view_add(IntPtr evas);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern IntPtr ewk_view_context_get(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern IntPtr ewk_view_settings_get(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_url_set(IntPtr obj, string url);
+
+ [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_view_url_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _ewk_view_url_get(IntPtr obj);
+
+ internal static string ewk_view_url_get(IntPtr obj)
+ {
+ IntPtr ptr = _ewk_view_url_get(obj);
+ return Marshal.PtrToStringAnsi(ptr);
+ }
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_html_string_load(IntPtr obj, string html, string baseUrl, string unreachableUrl);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_reload(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_stop(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_back(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_forward(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_back_possible(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_forward_possible(IntPtr obj);
+
+ internal delegate void ScriptExcuteCallback(IntPtr obj, IntPtr resultValue, IntPtr userData);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_script_execute(IntPtr obj, string script, ScriptExcuteCallback callback, IntPtr userData);
+
+ [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_view_title_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _ewk_view_title_get(IntPtr obj);
+
+ internal static string ewk_view_title_get(IntPtr obj)
+ {
+ IntPtr ptr = _ewk_view_url_get(obj);
+ return Marshal.PtrToStringAnsi(ptr);
+ }
+
+ [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_view_user_agent_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _ewk_view_user_agent_get(IntPtr obj);
+
+ internal static string ewk_view_user_agent_get(IntPtr obj)
+ {
+ IntPtr ptr = _ewk_view_user_agent_get(obj);
+ return Marshal.PtrToStringAnsi(ptr);
+ }
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_user_agent_set(IntPtr obj, string userAgent);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_focus_set(IntPtr obj, bool focused);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_focus_get(IntPtr obj);
+
+ [StructLayout(LayoutKind.Sequential, CharSet =CharSet.Ansi)]
+ internal struct ScriptMessage
+ {
+ public IntPtr name;
+ public IntPtr body;
+ }
+
+ internal delegate void ScriptMessageCallback(IntPtr obj, ScriptMessage message);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_javascript_message_handler_add(IntPtr obj, ScriptMessageCallback callback, string name);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_evaluate_javascript(IntPtr obj, string name, string result);
+ }
+}
diff --git a/Tizen.WebView/Interop/Interop.ChromiumEwk.cs b/Tizen.WebView/Interop/Interop.ChromiumEwk.cs
new file mode 100644
index 0000000..47ca039
--- /dev/null
+++ b/Tizen.WebView/Interop/Interop.ChromiumEwk.cs
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class ChromiumEwk
+ {
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern int ewk_init();
+
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern int ewk_shutdown();
+ }
+}
diff --git a/Tizen.WebView/Interop/Interop.Elementary.cs b/Tizen.WebView/Interop/Interop.Elementary.cs
new file mode 100644
index 0000000..09b9bc4
--- /dev/null
+++ b/Tizen.WebView/Interop/Interop.Elementary.cs
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_layout_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool elm_layout_theme_set(IntPtr obj, string klass, string group, string style);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_part_content_set(IntPtr obj, string part, IntPtr content);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_focus_allow_set(IntPtr obj, bool enable);
+ }
+} \ No newline at end of file
diff --git a/Tizen.WebView/Interop/Interop.Evas.cs b/Tizen.WebView/Interop/Interop.Evas.cs
new file mode 100644
index 0000000..a9e6d58
--- /dev/null
+++ b/Tizen.WebView/Interop/Interop.Evas.cs
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Evas
+ {
+ [DllImport(Libraries.Evas)]
+ internal static extern IntPtr evas_object_evas_get(IntPtr obj);
+ }
+}
diff --git a/Tizen.WebView/Interop/Interop.Libraries.cs b/Tizen.WebView/Interop/Interop.Libraries.cs
new file mode 100644
index 0000000..0d91a26
--- /dev/null
+++ b/Tizen.WebView/Interop/Interop.Libraries.cs
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+internal static partial class Interop
+{
+ private static class Libraries
+ {
+ internal const string ChromiumEwk = "libchromium-ewk.so";
+ internal const string Elementary = "libelementary.so.1";
+ internal const string Evas = "libevas.so.1";
+ }
+}