From 28e01c5a887c3575eea700005e0eab7ae8a6fcae Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Mon, 31 Jul 2017 22:55:55 +0200 Subject: [PATCH] added namespace and licence --- CMakeLists.txt | 1 - src/Application.vala | 2 +- src/DesktopFile.vala | 215 +++--- src/InfoDialog.vala | 31 +- src/UrlEntry.vala | 50 +- src/WebApp.vala | 286 ++++---- src/Widgets/ApplicationIcon.vala | 234 +++--- src/Widgets/ApplicationsView.vala | 162 +++-- vapi/CMakeLists.txt | 2 - vapi/cmake/GSettings.cmake | 42 -- vapi/cmake/Makefile | 286 -------- vapi/cmake/README | 10 - vapi/cmake/README.Vala.rst | 173 ----- vapi/cmake/Translations.cmake | 41 -- vapi/cmake/uninstall.cmake | 21 - vapi/cmake/vala/FindVala.cmake | 65 -- vapi/cmake/vala/ParseArguments.cmake | 36 - vapi/cmake/vala/ValaPrecompile.cmake | 175 ----- vapi/cmake/vala/ValaVersion.cmake | 96 --- vapi/config.vapi | 9 - vapi/webkit2gtk-3.0.deps | 7 - vapi/webkit2gtk-3.0.vapi | 1003 -------------------------- 22 files changed, 578 insertions(+), 2369 deletions(-) delete mode 100644 vapi/CMakeLists.txt delete mode 100644 vapi/cmake/GSettings.cmake delete mode 100644 vapi/cmake/Makefile delete mode 100644 vapi/cmake/README delete mode 100644 vapi/cmake/README.Vala.rst delete mode 100644 vapi/cmake/Translations.cmake delete mode 100644 vapi/cmake/uninstall.cmake delete mode 100644 vapi/cmake/vala/FindVala.cmake delete mode 100644 vapi/cmake/vala/ParseArguments.cmake delete mode 100644 vapi/cmake/vala/ValaPrecompile.cmake delete mode 100644 vapi/cmake/vala/ValaVersion.cmake delete mode 100644 vapi/config.vapi delete mode 100644 vapi/webkit2gtk-3.0.deps delete mode 100644 vapi/webkit2gtk-3.0.vapi diff --git a/CMakeLists.txt b/CMakeLists.txt index 44a4051..e628822 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,6 @@ pkg_check_modules(DEPS REQUIRED ) # -add_subdirectory(vapi) add_subdirectory(po) add_definitions(${DEPS_CFLAGS}) diff --git a/src/Application.vala b/src/Application.vala index aa4d2aa..ce030a6 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -67,7 +67,7 @@ static int main (string[] args) { var app = Webpin.WebpinApp.instance; return app.run (args); } else { - var app_info = DesktopFile.get_app_by_url (args[1]); + var app_info = Webpin.DesktopFile.get_app_by_url (args[1]); var app = new Webpin.WebAppWindow(app_info.get_display_name (), args[1]); app.show_all (); } diff --git a/src/DesktopFile.vala b/src/DesktopFile.vala index 4cde104..cc3c198 100644 --- a/src/DesktopFile.vala +++ b/src/DesktopFile.vala @@ -1,120 +1,151 @@ -public class DesktopFile : GLib.Object { +/*- + * Copyright (c) 2015 Erasmo Marín + * Copyright (c) 2017-2017 Artem Anufrij + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * The Noise authors hereby grant permission for non-GPL compatible + * GStreamer plugins to be used and distributed together with GStreamer + * and Noise. This permission is above and beyond the permissions granted + * by the GPL license by which Noise is covered. If you modify this code + * you may extend this exception to your version of the code, but you are not + * obligated to do so. If you do not wish to do so, delete this exception + * statement from your version. + * + * Authored by: Artem Anufrij + */ - private string template = """ - [Desktop Entry] - Version=1.0 - Name=Webpin - GenericName=Web app - Comment=Webpin web app - Exec=com.github.artemanufrij.webpin - Keywords=webpin;webapp;internet; - Icon=application-default-icon - Terminal=false - Type=Application - Categories=Network; - X-GNOME-FullName=webpin - WebbyThemeColor=none"""; +namespace Webpin { + public class DesktopFile : GLib.Object { + + private string template = """ + [Desktop Entry] + Name=Webpin + GenericName=Web app + Comment=Webpin web app + Exec=com.github.artemanufrij.webpin + Keywords=webpin;webapp;internet; + Icon=application-default-icon + Terminal=false + Type=Application + Categories=Network; + X-GNOME-FullName=webpin + WebpinThemeColor=none"""; - private GLib.KeyFile file; + private GLib.KeyFile file; - public string name { get; private set; } - public string url { get; private set; } - public string icon { get; private set; } + public string name { get; private set; } + public string url { get; private set; } + public string icon { get; private set; } - public DesktopFile (string name, string url, string icon) { - this.name = name; - this.url = url; - this.icon = icon; + public DesktopFile (string name, string url, string icon) { + this.name = name; + this.url = url; + this.icon = icon; - file = new GLib.KeyFile(); - file.load_from_data (template, -1, GLib.KeyFileFlags.NONE); - //TODO: Category - file.set_string ("Desktop Entry", "Name", name); - file.set_string ("Desktop Entry", "GenericName", name); - file.set_string ("Desktop Entry", "X-GNOME-FullName", name); - file.set_string ("Desktop Entry", "Exec", "com.github.artemanufrij.webpin " + url); - file.set_string ("Desktop Entry", "Icon", icon); - file.set_string ("Desktop Entry", "StartupWMClass", url); - } + file = new GLib.KeyFile(); + file.load_from_data (template, -1, GLib.KeyFileFlags.NONE); + //TODO: Category + file.set_string ("Desktop Entry", "Name", name); + file.set_string ("Desktop Entry", "GenericName", name); + file.set_string ("Desktop Entry", "X-GNOME-FullName", name); + file.set_string ("Desktop Entry", "Exec", "com.github.artemanufrij.webpin " + url); + file.set_string ("Desktop Entry", "Icon", icon); + file.set_string ("Desktop Entry", "StartupWMClass", url); + } - public DesktopFile.from_desktopappinfo(GLib.DesktopAppInfo info) { - file = new GLib.KeyFile(); - file.load_from_file (info.filename, KeyFileFlags.NONE); - this.name = info.get_display_name (); - this.icon = info.get_icon ().to_string (); - this.url = file.get_string ("Desktop Entry", "Exec").substring (31); - } + public DesktopFile.from_desktopappinfo(GLib.DesktopAppInfo info) { + file = new GLib.KeyFile(); + file.load_from_file (info.filename, KeyFileFlags.NONE); + this.name = info.get_display_name (); + this.icon = info.get_icon ().to_string (); + this.url = file.get_string ("Desktop Entry", "Exec").substring (31); + } - public bool edit_propertie (string propertie, string val) { - string filename = GLib.Environment.get_user_data_dir () + "/applications/" +file.get_string("Desktop Entry", "Name") + "-webpin.desktop"; - file = new GLib.KeyFile(); - file.load_from_file (filename, KeyFileFlags.NONE); - file.set_string ("Desktop Entry", propertie, val); - return file.save_to_file (filename); - } + public bool edit_propertie (string propertie, string val) { + string filename = GLib.Environment.get_user_data_dir () + "/applications/" +file.get_string("Desktop Entry", "Name") + "-webpin.desktop"; + file = new GLib.KeyFile(); + file.load_from_file (filename, KeyFileFlags.NONE); + file.set_string ("Desktop Entry", propertie, val); + return file.save_to_file (filename); + } - public GLib.DesktopAppInfo save_to_file () { - string filename = GLib.Environment.get_user_data_dir () + "/applications/" +file.get_string("Desktop Entry", "Name") + "-webpin.desktop"; - print("Desktop file created: " + filename); - file.save_to_file (filename); - return new GLib.DesktopAppInfo.from_filename (filename); - } + public GLib.DesktopAppInfo save_to_file () { + string filename = GLib.Environment.get_user_data_dir () + "/applications/" +file.get_string("Desktop Entry", "Name") + "-webpin.desktop"; + print("Desktop file created: " + filename); + file.save_to_file (filename); + return new GLib.DesktopAppInfo.from_filename (filename); + } - public bool delete_file () { - string filename = GLib.Environment.get_user_data_dir () + "/applications/" +file.get_string("Desktop Entry", "Name") + "-webpin.desktop"; - File file = File.new_for_path (filename); - try { - file.delete (); - } catch (Error e) { - print(e.message + "\n"); - return false; - } - return true; - } + public bool delete_file () { + string filename = GLib.Environment.get_user_data_dir () + "/applications/" +file.get_string("Desktop Entry", "Name") + "-webpin.desktop"; + File file = File.new_for_path (filename); + try { + file.delete (); + } catch (Error e) { + print(e.message + "\n"); + return false; + } + return true; + } - public static Gee.HashMap get_webby_applications () { + public static Gee.HashMap get_webby_applications () { - var list = new Gee.HashMap(); + var list = new Gee.HashMap(); - foreach (GLib.AppInfo app in GLib.AppInfo.get_all()) { + foreach (GLib.AppInfo app in GLib.AppInfo.get_all()) { - var desktop_app = new GLib.DesktopAppInfo(app.get_id ()); + var desktop_app = new GLib.DesktopAppInfo(app.get_id ()); - //FIXME: This is not working, vala problem? - //var keywords = desktop_app.get_keywords (); + //FIXME: This is not working, vala problem? + //var keywords = desktop_app.get_keywords (); - string keywords = desktop_app.get_string ("Keywords"); + string keywords = desktop_app.get_string ("Keywords"); - if (keywords != null && keywords.contains ("webpin")) { - list.set(desktop_app.get_name(), desktop_app); + if (keywords != null && keywords.contains ("webpin")) { + debug (desktop_app.get_name()); + list.set(desktop_app.get_name(), desktop_app); + } } + return list; } - return list; - } - public static GLib.DesktopAppInfo? get_app_by_url (string url) { - foreach (GLib.AppInfo app in GLib.AppInfo.get_all()) { + public static GLib.DesktopAppInfo? get_app_by_url (string url) { + foreach (GLib.AppInfo app in GLib.AppInfo.get_all()) { - var desktop_app = new GLib.DesktopAppInfo(app.get_id ()); + var desktop_app = new GLib.DesktopAppInfo(app.get_id ()); - var exec = desktop_app.get_string ("Exec"); + var exec = desktop_app.get_string ("Exec"); - if (exec != null && exec.contains (url)) { - return desktop_app; + if (exec != null && exec.contains (url)) { + return desktop_app; + } } - } - return null; - } - - public static Gee.HashMap get_applications() { - - var list = new Gee.HashMap(); - - foreach (GLib.AppInfo app in GLib.AppInfo.get_all()) { - list.set(app.get_name(), app); + return null; } - return list; + public static Gee.HashMap get_applications() { + + var list = new Gee.HashMap(); + + foreach (GLib.AppInfo app in GLib.AppInfo.get_all()) { + debug (app.get_name()); + list.set(app.get_name(), app); + } + + return list; + } } } diff --git a/src/InfoDialog.vala b/src/InfoDialog.vala index 905d52d..596ae38 100644 --- a/src/InfoDialog.vala +++ b/src/InfoDialog.vala @@ -1,5 +1,33 @@ -public class InfoDialog : Gtk.Dialog { +/*- + * Copyright (c) 2015 Erasmo Marín + * Copyright (c) 2017-2017 Artem Anufrij + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * The Noise authors hereby grant permission for non-GPL compatible + * GStreamer plugins to be used and distributed together with GStreamer + * and Noise. This permission is above and beyond the permissions granted + * by the GPL license by which Noise is covered. If you modify this code + * you may extend this exception to your version of the code, but you are not + * obligated to do so. If you do not wish to do so, delete this exception + * statement from your version. + * + * Authored by: Artem Anufrij + */ +namespace Webpin { + public class InfoDialog : Gtk.Dialog { public InfoDialog (string title, string label, string icon_name) { this.title = title; @@ -15,4 +43,5 @@ public class InfoDialog : Gtk.Dialog { add_button (_("Accept"), Gtk.ResponseType.ACCEPT); } + } } diff --git a/src/UrlEntry.vala b/src/UrlEntry.vala index f60e59c..c0fa3d8 100644 --- a/src/UrlEntry.vala +++ b/src/UrlEntry.vala @@ -1,15 +1,41 @@ -public class UrlEntry : Gtk.Entry { +/*- + * Copyright (c) 2015 Erasmo Marín + * Copyright (c) 2017-2017 Artem Anufrij + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * The Noise authors hereby grant permission for non-GPL compatible + * GStreamer plugins to be used and distributed together with GStreamer + * and Noise. This permission is above and beyond the permissions granted + * by the GPL license by which Noise is covered. If you modify this code + * you may extend this exception to your version of the code, but you are not + * obligated to do so. If you do not wish to do so, delete this exception + * statement from your version. + * + * Authored by: Artem Anufrij + */ - - public UrlEntry () { - editable = false; - set_icon_from_icon_name (Gtk.EntryIconPosition.SECONDARY, "view-refresh-symbolic"); - set_icon_from_icon_name (Gtk.EntryIconPosition.PRIMARY, "text-html-symbolic"); +namespace Webpin { + public class UrlEntry : Gtk.Entry { + public UrlEntry () { + editable = false; + set_icon_from_icon_name (Gtk.EntryIconPosition.SECONDARY, "view-refresh-symbolic"); + set_icon_from_icon_name (Gtk.EntryIconPosition.PRIMARY, "text-html-symbolic"); + } + public override void get_preferred_width (out int minimum_width, out int natural_width) { + minimum_width = -1; + natural_width = 3000; + } } - - public override void get_preferred_width (out int minimum_width, out int natural_width) { - minimum_width = -1; - natural_width = 3000; - } - } diff --git a/src/WebApp.vala b/src/WebApp.vala index 40f9ac2..36cacfb 100644 --- a/src/WebApp.vala +++ b/src/WebApp.vala @@ -1,152 +1,182 @@ -public class WebApp : Gtk.Stack { +/*- + * Copyright (c) 2015 Erasmo Marín + * Copyright (c) 2017-2017 Artem Anufrij + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * The Noise authors hereby grant permission for non-GPL compatible + * GStreamer plugins to be used and distributed together with GStreamer + * and Noise. This permission is above and beyond the permissions granted + * by the GPL license by which Noise is covered. If you modify this code + * you may extend this exception to your version of the code, but you are not + * obligated to do so. If you do not wish to do so, delete this exception + * statement from your version. + * + * Authored by: Artem Anufrij + */ - public WebKit.WebView app_view; - public WebKit.WebView external_view; - public string ui_color = "none"; - private string app_url; - private GLib.DesktopAppInfo info; - private DesktopFile file; - private WebKit.CookieManager cookie_manager; - private Gtk.Box container; //the spinner container +namespace Webpin { + public class WebApp : Gtk.Stack { - public signal void external_request (); - public signal void theme_color_changed(string color); + public WebKit.WebView app_view; + public WebKit.WebView external_view; + public string ui_color = "none"; + private string app_url; + private GLib.DesktopAppInfo info; + private DesktopFile file; + private WebKit.CookieManager cookie_manager; + private Gtk.Box container; //the spinner container - public WebApp (string webapp_name, string app_url) { + public signal void external_request (); + public signal void theme_color_changed(string color); - this.app_url = app_url; - set_transition_duration (1000); + public WebApp (string webapp_name, string app_url) { - //configure cookies settings - cookie_manager = WebKit.WebContext.get_default ().get_cookie_manager (); - cookie_manager.set_accept_policy (WebKit.CookieAcceptPolicy.ALWAYS); + this.app_url = app_url; + set_transition_duration (1000); - string cookie_db = Environment.get_user_cache_dir () + "/webby/cookies/"; + //configure cookies settings + cookie_manager = WebKit.WebContext.get_default ().get_cookie_manager (); + cookie_manager.set_accept_policy (WebKit.CookieAcceptPolicy.ALWAYS); - var dir = GLib.File.new_for_path (cookie_db); + string cookie_db = Environment.get_user_cache_dir () + "/webby/cookies/"; - if (!dir.query_exists (null)) { - try { - dir.make_directory_with_parents (null); - GLib.debug ("Directory '%s' created", dir.get_path ()); - } catch (Error e) { - GLib.error ("Could not create caching directory."); + var dir = GLib.File.new_for_path (cookie_db); + + if (!dir.query_exists (null)) { + try { + dir.make_directory_with_parents (null); + GLib.debug ("Directory '%s' created", dir.get_path ()); + } catch (Error e) { + GLib.error ("Could not create caching directory."); + } } - } - cookie_manager.set_persistent_storage (cookie_db + "cookies.db", WebKit.CookiePersistentStorage.SQLITE); + cookie_manager.set_persistent_storage (cookie_db + "cookies.db", WebKit.CookiePersistentStorage.SQLITE); - //load app viewer - app_view = new WebKit.WebView.with_context (WebKit.WebContext.get_default ()); - app_view.load_uri (app_url); + //load app viewer + app_view = new WebKit.WebView.with_context (WebKit.WebContext.get_default ()); + app_view.load_uri (app_url); - //create external viewer - this.external_view = new WebKit.WebView (); + //create external viewer + this.external_view = new WebKit.WebView (); - //loading view - var spinner = new Gtk.Spinner(); - spinner.active = true; - spinner.halign = Gtk.Align.CENTER; - spinner.valign = Gtk.Align.CENTER; - spinner.set_size_request (24, 24); - container = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); - container.halign = Gtk.Align.FILL; - container.valign = Gtk.Align.FILL; - container.pack_start(spinner, true, true, 0); + //loading view + var spinner = new Gtk.Spinner(); + spinner.active = true; + spinner.halign = Gtk.Align.CENTER; + spinner.valign = Gtk.Align.CENTER; + spinner.set_size_request (24, 24); + container = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); + container.halign = Gtk.Align.FILL; + container.valign = Gtk.Align.FILL; + container.pack_start(spinner, true, true, 0); - //overlay trick to make snapshot work even with the spinner - var overlay = new Gtk.Overlay (); - overlay.add(app_view); - overlay.add_overlay(container); + //overlay trick to make snapshot work even with the spinner + var overlay = new Gtk.Overlay (); + overlay.add(app_view); + overlay.add_overlay(container); - add_titled(overlay, "app", "app"); - add_titled(external_view, "external", "external"); - set_visible_child_name ("app"); + add_titled(overlay, "app", "app"); + add_titled(external_view, "external", "external"); + set_visible_child_name ("app"); - app_view.create.connect ( () => { - print("external request"); - external_request (); - return external_view; - }); - external_view.create.connect ( () => { - print("external request"); - set_visible_child_name ("external"); - return external_view; - }); + app_view.create.connect ( () => { + print("external request"); + external_request (); + return external_view; + }); + external_view.create.connect ( () => { + print("external request"); + set_visible_child_name ("external"); + return external_view; + }); - info = DesktopFile.get_app_by_url(app_url); - file = new DesktopFile.from_desktopappinfo(info); - //load theme color saved in desktop file - if (info != null && info.has_key("WebpinThemeColor")) { - var color = info.get_string("WebpinThemeColor"); - print("COLOR: " + color+"\n"); - if(color != "none") { - ui_color = color; + info = DesktopFile.get_app_by_url(app_url); + file = new DesktopFile.from_desktopappinfo(info); + //load theme color saved in desktop file + if (info != null && info.has_key("WebpinThemeColor")) { + var color = info.get_string("WebpinThemeColor"); + print("COLOR: " + color+"\n"); + if(color != "none") { + ui_color = color; + } } - } - Gdk.RGBA background = {}; - if (!background.parse (ui_color)){ - background = {1,1,1,1}; - } - container.override_background_color (Gtk.StateFlags.NORMAL, background); - - //update theme color if changed - app_view.load_changed.connect ( (load_event) => { - if (load_event == WebKit.LoadEvent.FINISHED) { - print("determine color"); - determine_theme_color.begin(); - } else { - container.set_visible(true); - } - }); - } - - public DesktopFile get_desktop_file () { - return this.file; - } - - /**Taken from WebView.vala in lp:midori - * Check for the theme-color meta tag in the page and if that one can't be - * found grabs the color from the current page and uses the first 3 rows - * of pixels to get a good representative color of the page - */ - public async void determine_theme_color () { - - //FIXME: This is useless without JSCore - /*string script = "var t = document.getElementsByTagName('meta').filter(function(e){return e.name == 'theme-color';)[0]; t ? t.value : null;"; - app_view.run_javascript.begin (script, null, (obj, res)=> { - - });*/ - - var snap = (Cairo.ImageSurface) yield app_view.get_snapshot (WebKit.SnapshotRegion.VISIBLE, - WebKit.SnapshotOptions.NONE, null); - - // data ist in BGRA apparently (according to testing). Docs said ARGB, but that - // appears not to be the case - unowned uint8[] data = snap.get_data (); - uint8 r = data[2]; - uint8 g = data[1]; - uint8 b = data[0]; - - for (var i = 4; i < snap.get_width () * 3 * 4; i += 4) { - r = (r + data[i + 2]) / 2; - g = (g + data[i + 1]) / 2; - b = (b + data[i + 0]) / 2; - } - - var color = "#%02x%02x%02x".printf (r, g, b); - - if (color != ui_color) { - ui_color = color; Gdk.RGBA background = {}; - background.parse (ui_color); + if (!background.parse (ui_color)){ + background = {1,1,1,1}; + } container.override_background_color (Gtk.StateFlags.NORMAL, background); - theme_color_changed(ui_color); - if (file != null) - file.edit_propertie ("WebpinThemeColor", ui_color); + + //update theme color if changed + app_view.load_changed.connect ( (load_event) => { + if (load_event == WebKit.LoadEvent.FINISHED) { + print("determine color"); + determine_theme_color.begin(); + } else { + container.set_visible(true); + } + }); } - container.set_visible(false); - } + + public DesktopFile get_desktop_file () { + return this.file; + } + + /**Taken from WebView.vala in lp:midori + * Check for the theme-color meta tag in the page and if that one can't be + * found grabs the color from the current page and uses the first 3 rows + * of pixels to get a good representative color of the page + */ + public async void determine_theme_color () { + + //FIXME: This is useless without JSCore + /*string script = "var t = document.getElementsByTagName('meta').filter(function(e){return e.name == 'theme-color';)[0]; t ? t.value : null;"; + app_view.run_javascript.begin (script, null, (obj, res)=> { + + });*/ + + var snap = (Cairo.ImageSurface) yield app_view.get_snapshot (WebKit.SnapshotRegion.VISIBLE, + WebKit.SnapshotOptions.NONE, null); + + // data ist in BGRA apparently (according to testing). Docs said ARGB, but that + // appears not to be the case + unowned uint8[] data = snap.get_data (); + uint8 r = data[2]; + uint8 g = data[1]; + uint8 b = data[0]; + + for (var i = 4; i < snap.get_width () * 3 * 4; i += 4) { + r = (r + data[i + 2]) / 2; + g = (g + data[i + 1]) / 2; + b = (b + data[i + 0]) / 2; + } + + var color = "#%02x%02x%02x".printf (r, g, b); + + if (color != ui_color) { + ui_color = color; + Gdk.RGBA background = {}; + background.parse (ui_color); + container.override_background_color (Gtk.StateFlags.NORMAL, background); + theme_color_changed(ui_color); + if (file != null) + file.edit_propertie ("WebpinThemeColor", ui_color); + } + container.set_visible(false); + } + } } diff --git a/src/Widgets/ApplicationIcon.vala b/src/Widgets/ApplicationIcon.vala index c29ab2a..cd139eb 100644 --- a/src/Widgets/ApplicationIcon.vala +++ b/src/Widgets/ApplicationIcon.vala @@ -1,129 +1,159 @@ -public class ApplicationIcon : Gtk.Overlay { +/*- + * Copyright (c) 2015 Erasmo Marín + * Copyright (c) 2017-2017 Artem Anufrij + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * The Noise authors hereby grant permission for non-GPL compatible + * GStreamer plugins to be used and distributed together with GStreamer + * and Noise. This permission is above and beyond the permissions granted + * by the GPL license by which Noise is covered. If you modify this code + * you may extend this exception to your version of the code, but you are not + * obligated to do so. If you do not wish to do so, delete this exception + * statement from your version. + * + * Authored by: Artem Anufrij + */ - Gtk.Image image; - Gtk.Label label; - Gtk.MenuButton conf_btn; - Gtk.Box box; - Gtk.ActionGroup action_group; +namespace Webpin { + public class ApplicationIcon : Gtk.Overlay { - internal DesktopFile desktop_file { get; private set; } + Gtk.Image image; + Gtk.Label label; + Gtk.MenuButton conf_btn; + Gtk.Box box; + Gtk.ActionGroup action_group; - public signal void deleted (Gtk.Container? parent); - public signal void edit_request (DesktopFile desktop_file); + internal DesktopFile desktop_file { get; private set; } - public ApplicationIcon (GLib.DesktopAppInfo app) { - this.desktop_file = new DesktopFile.from_desktopappinfo (app); + public signal void deleted (Gtk.Container? parent); + public signal void edit_request (DesktopFile desktop_file); - hexpand = false; - vexpand = false; + public ApplicationIcon (GLib.DesktopAppInfo app) { + this.desktop_file = new DesktopFile.from_desktopappinfo (app); - label = new Gtk.Label (this.desktop_file.name); + hexpand = false; + vexpand = false; - set_icon (this.desktop_file.icon); + label = new Gtk.Label (this.desktop_file.name); - this.margin = 6; - this.margin_start = 20; - this.margin_end = 20; + set_icon (this.desktop_file.icon); - var menu = new ActionMenu (); - menu.halign = Gtk.Align.CENTER; - menu.delete_clicked.connect (() => { remove_application (); }); - menu.edit_clicked.connect (() => { edit_request (desktop_file); }); + this.margin = 6; + this.margin_start = 20; + this.margin_end = 20; - box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); - box.pack_start (image, false, false, 0); - box.pack_start (label, false, false, 0); - box.pack_start (menu, false, false, 0); + var menu = new ActionMenu (); + menu.halign = Gtk.Align.CENTER; + menu.delete_clicked.connect (() => { remove_application (); }); + menu.edit_clicked.connect (() => { edit_request (desktop_file); }); - box.hexpand = false; - box.vexpand = false; + box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); + box.pack_start (image, false, false, 0); + box.pack_start (label, false, false, 0); + box.pack_start (menu, false, false, 0); - var event_box = new Gtk.EventBox (); - event_box.add (box); - event_box.events |= Gdk.EventMask.ENTER_NOTIFY_MASK|Gdk.EventMask.LEAVE_NOTIFY_MASK; + box.hexpand = false; + box.vexpand = false; - event_box.enter_notify_event.connect ((event) => { - menu.set_reveal_child (true); - return false; - }); + var event_box = new Gtk.EventBox (); + event_box.add (box); + event_box.events |= Gdk.EventMask.ENTER_NOTIFY_MASK|Gdk.EventMask.LEAVE_NOTIFY_MASK; - event_box.leave_notify_event.connect ((event) => { - if (event.detail == Gdk.NotifyType.INFERIOR) + event_box.enter_notify_event.connect ((event) => { + menu.set_reveal_child (true); return false; - menu.set_reveal_child (false); - return false; - }); + }); - this.add (event_box); - } + event_box.leave_notify_event.connect ((event) => { + if (event.detail == Gdk.NotifyType.INFERIOR) + return false; + menu.set_reveal_child (false); + return false; + }); - public void set_new_desktopfile (DesktopFile desktop_file) { - this.desktop_file = desktop_file; - set_icon (this.desktop_file.icon); - } + this.add (event_box); + } - private void set_icon (string icon) { - if (File.new_for_path (icon).query_exists ()) { - var pix = new Gdk.Pixbuf.from_file (icon); + public void set_new_desktopfile (DesktopFile desktop_file) { + this.desktop_file = desktop_file; + set_icon (this.desktop_file.icon); + } - int new_height = 64; - int new_width = 64; - int margin_vertical = 0; - int margin_horizontal = 0; + private void set_icon (string icon) { + if (File.new_for_path (icon).query_exists ()) { + var pix = new Gdk.Pixbuf.from_file (icon); - if (pix.height > pix.width) { - new_width = new_width * pix.width / pix.height; - margin_horizontal = (new_height - new_width) / 2; - } else if (pix.height < pix.width) { - new_height = new_height * pix.height / pix.width; - margin_vertical = (new_width - new_height) / 2; + int new_height = 64; + int new_width = 64; + int margin_vertical = 0; + int margin_horizontal = 0; + + if (pix.height > pix.width) { + new_width = new_width * pix.width / pix.height; + margin_horizontal = (new_height - new_width) / 2; + } else if (pix.height < pix.width) { + new_height = new_height * pix.height / pix.width; + margin_vertical = (new_width - new_height) / 2; + } + if (image == null) + image = new Gtk.Image.from_pixbuf (pix.scale_simple (new_width, new_height, Gdk.InterpType.BILINEAR)); + else + image.set_from_pixbuf (pix.scale_simple (new_width, new_height, Gdk.InterpType.BILINEAR)); + + image.margin_top = margin_vertical; + image.margin_bottom = margin_vertical; + image.margin_right = margin_horizontal; + image.margin_left = margin_horizontal; + } else { + image = new Gtk.Image (); + image.icon_name = icon; + image.pixel_size = 64; } - if (image == null) - image = new Gtk.Image.from_pixbuf (pix.scale_simple (new_width, new_height, Gdk.InterpType.BILINEAR)); - else - image.set_from_pixbuf (pix.scale_simple (new_width, new_height, Gdk.InterpType.BILINEAR)); + } - image.margin_top = margin_vertical; - image.margin_bottom = margin_vertical; - image.margin_right = margin_horizontal; - image.margin_left = margin_horizontal; - } else { - image = new Gtk.Image (); - image.icon_name = icon; - image.pixel_size = 64; + private void remove_application () { + desktop_file.delete_file (); + deleted (this.get_parent()); + this.destroy (); } } - private void remove_application () { - desktop_file.delete_file (); - deleted (this.get_parent()); - this.destroy (); - } -} - -public class ActionMenu : Gtk.Revealer { - - public signal void delete_clicked (); - public signal void edit_clicked (); - - public ActionMenu () { - var delete_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic", Gtk.IconSize.BUTTON); - delete_button.tooltip_text = _("Delete Webapp"); - delete_button.relief = Gtk.ReliefStyle.NONE; - delete_button.clicked.connect (() => { delete_clicked (); }); - - var edit_button = new Gtk.Button.from_icon_name ("edit-symbolic", Gtk.IconSize.BUTTON); - edit_button.tooltip_text = _("Edit Webapp Properties"); - edit_button.relief = Gtk.ReliefStyle.NONE; - edit_button.clicked.connect (() => { edit_clicked (); }); - - var buttons = new Gtk.Grid (); - buttons.orientation = Gtk.Orientation.HORIZONTAL; - buttons.add (edit_button); - buttons.add (delete_button); - buttons.opacity = 0.5; - - this.transition_type = Gtk.RevealerTransitionType.CROSSFADE; - this.add (buttons); + public class ActionMenu : Gtk.Revealer { + + public signal void delete_clicked (); + public signal void edit_clicked (); + + public ActionMenu () { + var delete_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic", Gtk.IconSize.BUTTON); + delete_button.tooltip_text = _("Delete Webapp"); + delete_button.relief = Gtk.ReliefStyle.NONE; + delete_button.clicked.connect (() => { delete_clicked (); }); + + var edit_button = new Gtk.Button.from_icon_name ("edit-symbolic", Gtk.IconSize.BUTTON); + edit_button.tooltip_text = _("Edit Webapp Properties"); + edit_button.relief = Gtk.ReliefStyle.NONE; + edit_button.clicked.connect (() => { edit_clicked (); }); + + var buttons = new Gtk.Grid (); + buttons.orientation = Gtk.Orientation.HORIZONTAL; + buttons.add (edit_button); + buttons.add (delete_button); + buttons.opacity = 0.5; + + this.transition_type = Gtk.RevealerTransitionType.CROSSFADE; + this.add (buttons); + } } } diff --git a/src/Widgets/ApplicationsView.vala b/src/Widgets/ApplicationsView.vala index c28246a..a2172f8 100644 --- a/src/Widgets/ApplicationsView.vala +++ b/src/Widgets/ApplicationsView.vala @@ -1,84 +1,114 @@ -public class ApplicationsView : Gtk.Box { +/*- + * Copyright (c) 2015 Erasmo Marín + * Copyright (c) 2017-2017 Artem Anufrij + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * The Noise authors hereby grant permission for non-GPL compatible + * GStreamer plugins to be used and distributed together with GStreamer + * and Noise. This permission is above and beyond the permissions granted + * by the GPL license by which Noise is covered. If you modify this code + * you may extend this exception to your version of the code, but you are not + * obligated to do so. If you do not wish to do so, delete this exception + * statement from your version. + * + * Authored by: Artem Anufrij + */ - public signal void add_request(); - public signal void edit_request(DesktopFile desktop_file); - public signal void app_deleted (); +namespace Webpin { + public class ApplicationsView : Gtk.Box { - private Gtk.FlowBox icon_view; - private Gee.HashMap applications; + public signal void add_request(); + public signal void edit_request(DesktopFile desktop_file); + public signal void app_deleted (); - public bool has_items { get { return icon_view.get_children ().length () > 0; } } + private Gtk.FlowBox icon_view; + private Gee.HashMap applications; - public ApplicationsView () { + public bool has_items { get { return icon_view.get_children ().length () > 0; } } - GLib.Object (orientation: Gtk.Orientation.VERTICAL); - var scrolled = new Gtk.ScrolledWindow (null, null); - scrolled.hscrollbar_policy = Gtk.PolicyType.NEVER; + public ApplicationsView () { - icon_view = new Gtk.FlowBox(); - icon_view.valign = Gtk.Align.START; - icon_view.vexpand = false; - icon_view.homogeneous = true; - icon_view.column_spacing = 15; - icon_view.row_spacing = 15; - icon_view.margin = 15; - icon_view.activate_on_single_click = false; - icon_view.child_activated.connect ((child) => { - if ((child as Gtk.FlowBoxChild).get_child () is ApplicationIcon) { - var app_icon = (child as Gtk.FlowBoxChild).get_child () as ApplicationIcon; - try { - Process.spawn_command_line_async ("webby " + app_icon.desktop_file.url); - } catch (SpawnError e) { - debug ("Error: %s\n", e.message); + GLib.Object (orientation: Gtk.Orientation.VERTICAL); + var scrolled = new Gtk.ScrolledWindow (null, null); + scrolled.hscrollbar_policy = Gtk.PolicyType.NEVER; + + icon_view = new Gtk.FlowBox(); + icon_view.valign = Gtk.Align.START; + icon_view.vexpand = false; + icon_view.homogeneous = true; + icon_view.column_spacing = 15; + icon_view.row_spacing = 15; + icon_view.margin = 15; + icon_view.activate_on_single_click = false; + icon_view.child_activated.connect ((child) => { + if ((child as Gtk.FlowBoxChild).get_child () is ApplicationIcon) { + var app_icon = (child as Gtk.FlowBoxChild).get_child () as ApplicationIcon; + try { + Process.spawn_command_line_async ("com.github.artemanufrij.webpin " + app_icon.desktop_file.url); + } catch (SpawnError e) { + debug ("Error: %s\n", e.message); + } } - } - }); - load_applications (); + }); + load_applications (); - scrolled.add(icon_view); - this.pack_start(scrolled, true, true, 0); + scrolled.add(icon_view); + this.pack_start(scrolled, true, true, 0); - } - - public void load_applications () { - applications = DesktopFile.get_webby_applications(); - - foreach (GLib.DesktopAppInfo app in applications.values) { - this.add_button (app); } - } - public void add_button (GLib.DesktopAppInfo app) { - var image = new ApplicationIcon (app); - image.edit_request.connect ((desktop_file) => { - edit_request (desktop_file); - icon_view.unselect_all (); - }); - image.deleted.connect ((parent) => { - this.icon_view.remove (parent); - app_deleted (); - }); - icon_view.add (image); - icon_view.show_all (); - } + public void load_applications () { + applications = DesktopFile.get_webby_applications(); - public void select_last_item () { - icon_view.select_child (icon_view.get_child_at_index ((int)icon_view.get_children ().length () - 1)); - } + foreach (GLib.DesktopAppInfo app in applications.values) { + this.add_button (app); + } + } - public void select_first_item () { - icon_view.select_child (icon_view.get_child_at_index (0)); - } + public void add_button (GLib.DesktopAppInfo app) { + var image = new ApplicationIcon (app); + image.edit_request.connect ((desktop_file) => { + edit_request (desktop_file); + icon_view.unselect_all (); + }); + image.deleted.connect ((parent) => { + this.icon_view.remove (parent); + app_deleted (); + }); + icon_view.add (image); + icon_view.show_all (); + } - public void update_button (GLib.DesktopAppInfo app) { - foreach (var item in icon_view.get_children ()) { - if ((item as Gtk.FlowBoxChild).get_child () is ApplicationIcon) { - var app_icon = (item as Gtk.FlowBoxChild).get_child () as ApplicationIcon; + public void select_last_item () { + icon_view.select_child (icon_view.get_child_at_index ((int)icon_view.get_children ().length () - 1)); + } - if (app_icon.desktop_file.name == app.get_display_name ()) { - app_icon.set_new_desktopfile (new DesktopFile.from_desktopappinfo (app)); - icon_view.select_child (item as Gtk.FlowBoxChild); - break; + public void select_first_item () { + icon_view.select_child (icon_view.get_child_at_index (0)); + } + + public void update_button (GLib.DesktopAppInfo app) { + foreach (var item in icon_view.get_children ()) { + if ((item as Gtk.FlowBoxChild).get_child () is ApplicationIcon) { + var app_icon = (item as Gtk.FlowBoxChild).get_child () as ApplicationIcon; + + if (app_icon.desktop_file.name == app.get_display_name ()) { + app_icon.set_new_desktopfile (new DesktopFile.from_desktopappinfo (app)); + icon_view.select_child (item as Gtk.FlowBoxChild); + break; + } } } } diff --git a/vapi/CMakeLists.txt b/vapi/CMakeLists.txt deleted file mode 100644 index a9469da..0000000 --- a/vapi/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -install(FILES webkit2gtk-3.0.deps webkit2gtk-3.0.vapi DESTINATION share/vala-0.26/vapi) - diff --git a/vapi/cmake/GSettings.cmake b/vapi/cmake/GSettings.cmake deleted file mode 100644 index 8fd745c..0000000 --- a/vapi/cmake/GSettings.cmake +++ /dev/null @@ -1,42 +0,0 @@ -# GSettings.cmake, CMake macros written for Marlin, feel free to re-use them. - -option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" ON) - -option (GSETTINGS_COMPILE "Compile GSettings Schemas after installation" ${GSETTINGS_LOCALINSTALL}) - -if(GSETTINGS_LOCALINSTALL) - message(STATUS "GSettings schemas will be installed locally.") -endif() - -if(GSETTINGS_COMPILE) - message(STATUS "GSettings shemas will be compiled.") -endif() - -macro(add_schema SCHEMA_NAME) - - set(PKG_CONFIG_EXECUTABLE pkg-config) - # Have an option to not install the schema into where GLib is - if (GSETTINGS_LOCALINSTALL) - SET (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/") - else (GSETTINGS_LOCALINSTALL) - execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE) - SET (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/") - endif (GSETTINGS_LOCALINSTALL) - - # Run the validator and error if it fails - execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE) - - if (_schemas_invalid) - message (SEND_ERROR "Schema validation error: ${_schemas_invalid}") - endif (_schemas_invalid) - - # Actually install and recomple schemas - message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}") - install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL) - - if (GSETTINGS_COMPILE) - install (CODE "message (STATUS \"Compiling GSettings schemas\")") - install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})") - endif () -endmacro() diff --git a/vapi/cmake/Makefile b/vapi/cmake/Makefile deleted file mode 100644 index aee34c9..0000000 --- a/vapi/cmake/Makefile +++ /dev/null @@ -1,286 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canoncical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/bin/cmake - -# The command to remove a file. -RM = /usr/bin/cmake -E remove -f - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/mefrio/Scrivania/cmake - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/mefrio/Scrivania/cmake/cmake - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..." - /usr/bin/cmake -i . -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /usr/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /usr/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles /home/mefrio/Scrivania/cmake/cmake/CMakeFiles/progress.marks - $(MAKE) -f CMakeFiles/Makefile2 all - $(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - $(MAKE) -f CMakeFiles/Makefile2 clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -#============================================================================= -# Target rules for targets named scratch - -# Build rule for target. -scratch: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 scratch -.PHONY : scratch - -# fast build rule for target. -scratch/fast: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/build -.PHONY : scratch/fast - -src/entry.o: src/entry.c.o -.PHONY : src/entry.o - -# target to build an object file -src/entry.c.o: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.o -.PHONY : src/entry.c.o - -src/entry.i: src/entry.c.i -.PHONY : src/entry.i - -# target to preprocess a source file -src/entry.c.i: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.i -.PHONY : src/entry.c.i - -src/entry.s: src/entry.c.s -.PHONY : src/entry.s - -# target to generate assembly for a file -src/entry.c.s: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.s -.PHONY : src/entry.c.s - -src/main_window.o: src/main_window.c.o -.PHONY : src/main_window.o - -# target to build an object file -src/main_window.c.o: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.o -.PHONY : src/main_window.c.o - -src/main_window.i: src/main_window.c.i -.PHONY : src/main_window.i - -# target to preprocess a source file -src/main_window.c.i: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.i -.PHONY : src/main_window.c.i - -src/main_window.s: src/main_window.c.s -.PHONY : src/main_window.s - -# target to generate assembly for a file -src/main_window.c.s: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.s -.PHONY : src/main_window.c.s - -src/menu.o: src/menu.c.o -.PHONY : src/menu.o - -# target to build an object file -src/menu.c.o: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.o -.PHONY : src/menu.c.o - -src/menu.i: src/menu.c.i -.PHONY : src/menu.i - -# target to preprocess a source file -src/menu.c.i: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.i -.PHONY : src/menu.c.i - -src/menu.s: src/menu.c.s -.PHONY : src/menu.s - -# target to generate assembly for a file -src/menu.c.s: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.s -.PHONY : src/menu.c.s - -src/notebook.o: src/notebook.c.o -.PHONY : src/notebook.o - -# target to build an object file -src/notebook.c.o: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.o -.PHONY : src/notebook.c.o - -src/notebook.i: src/notebook.c.i -.PHONY : src/notebook.i - -# target to preprocess a source file -src/notebook.c.i: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.i -.PHONY : src/notebook.c.i - -src/notebook.s: src/notebook.c.s -.PHONY : src/notebook.s - -# target to generate assembly for a file -src/notebook.c.s: - $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.s -.PHONY : src/notebook.c.s - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" - @echo "... scratch" - @echo "... src/entry.o" - @echo "... src/entry.i" - @echo "... src/entry.s" - @echo "... src/main_window.o" - @echo "... src/main_window.i" - @echo "... src/main_window.s" - @echo "... src/menu.o" - @echo "... src/menu.i" - @echo "... src/menu.s" - @echo "... src/notebook.o" - @echo "... src/notebook.i" - @echo "... src/notebook.s" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/vapi/cmake/README b/vapi/cmake/README deleted file mode 100644 index 9d45b32..0000000 --- a/vapi/cmake/README +++ /dev/null @@ -1,10 +0,0 @@ - Elementary CMake modules - -This is a set of CMake modules: Translations, GSettings, and Vala modules. - -For all the Vala related modules see README.Vala.rst: - - ParseArguments.cmake - - ValaPrecompile.cmake - - ValaVersion.cmake - - FindVala.cmake - diff --git a/vapi/cmake/README.Vala.rst b/vapi/cmake/README.Vala.rst deleted file mode 100644 index bcc59b7..0000000 --- a/vapi/cmake/README.Vala.rst +++ /dev/null @@ -1,173 +0,0 @@ -========== -Vala CMake -========== -:Author: - Jakob Westhoff -:Version: - Draft - - -Overview -======== - -Vala CMake is a collection of macros for the CMake_ build system to allow the -creation and management of projects developed using the Vala_ programming -language or its "Genie" flavor (less tested). - - -Installation -============ - -To use the Vala macros in your own project you need to copy the macro files to -an arbitrary folder in your projects directory and reference them in your -``CMakeLists.txt`` file. - -Assuming the macros are stored under ``cmake/vala`` in your projects folder you -need to add the following information to your base ``CMakeLists.txt``:: - - list(APPEND CMAKE_MODULE_PATH - ${CMAKE_SOURCE_DIR}/cmake/vala - ) - -After the new module path as been added you can simply include the provided -modules or use the provided find routines. - - -Finding Vala -============ - -The find module for vala works like any other Find module in CMake. -You can use it by simply calling the usual ``find_package`` function. Default -parameters like ``REQUIRED`` and ``QUIETLY`` are supported. - -:: - - find_package(Vala REQUIRED) - -After a successful call to the find_package function the following variables -will be set: - -VALA_FOUND - Whether the vala compiler has been found or not - -VALA_EXECUTABLE - Full path to the valac executable if it has been found - -VALA_VERSION - Version number of the available valac - - -Precompiling Vala sources -========================= - -CMake is mainly supposed to handle c or c++ based projects. Luckily every vala -program is translated into plain c code using the vala compiler, followed by -normal compilation of the generated c program using gcc. - -The macro ``vala_precompile`` uses that fact to create c files from your .vala -sources for further CMake processing. - -The first parameter provided is a variable, which will be filled with a list of -c files outputted by the vala compiler. This list can than be used in -conjunction with functions like ``add_executable`` or others to create the -necessary compile rules with CMake. - -The initial variable is followed by a list of .vala files to be compiled. -Please take care to add every vala file belonging to the currently compiled -project or library as Vala will otherwise not be able to resolve all -dependencies. - -The following sections may be specified afterwards to provide certain options -to the vala compiler: - -PACKAGES - A list of vala packages/libraries to be used during the compile cycle. The - package names are exactly the same, as they would be passed to the valac - "--pkg=" option. - -OPTIONS - A list of optional options to be passed to the valac executable. This can be - used to pass "--thread" for example to enable multi-threading support. - -DIRECTORY - Specify the directory where the output source files will be stored. If - ommitted, the source files will be stored in CMAKE_CURRENT_BINARY_DIR. - -CUSTOM_VAPIS - A list of custom vapi files to be included for compilation. This can be - useful to include freshly created vala libraries without having to install - them in the system. - -GENERATE_VAPI - Pass all the needed flags to the compiler to create an internal vapi for - the compiled library. The provided name will be used for this and a - .vapi file will be created. - -GENERATE_HEADER - Let the compiler generate a header file for the compiled code. There will - be a header file as well as an internal header file being generated called - .h and _internal.h - -The following call is a simple example to the vala_precompile macro showing an -example to every of the optional sections:: - - vala_precompile(VALA_C - source1.vala - source2.vala - source3.vala - PACKAGES - gtk+-2.0 - gio-1.0 - posix - OPTIONS - --thread - CUSTOM_VAPIS - some_vapi.vapi - GENERATE_VAPI - myvapi - GENERATE_HEADER - myheader - ) - -Most important is the variable VALA_C which will contain all the generated c -file names after the call. The easiest way to use this information is to tell -CMake to create an executable out of it. - -:: - - add_executable(myexecutable ${VALA_C}) - - -Further reading -=============== - -The `Pdf Presenter Console`__ , which is a vala based project of mine, makes -heavy usage of the here described macros. To look at a real world example of -these macros the mentioned project is the right place to take a look. The svn -trunk of it can be found at:: - - svn://pureenergy.cc/pdf_presenter_console/trunk - - -__ http://westhoffswelt.de/projects/pdf_presenter_console.html - - -Acknowledgments -=============== - -Thanks go out to Florian Sowade, a fellow local PHP-Usergroupie, who helped me -a lot with the initial version of this macros and always answered my mostly -dumb CMake questions. - -.. _CMake: http://cmake.org -.. _Vala: http://live.gnome.org/Vala -.. _Genie: http://live.gnome.org/Genie - - - -.. - Local Variables: - mode: rst - fill-column: 79 - End: - vim: et syn=rst tw=79 diff --git a/vapi/cmake/Translations.cmake b/vapi/cmake/Translations.cmake deleted file mode 100644 index be53b74..0000000 --- a/vapi/cmake/Translations.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# Translations.cmake, CMake macros written for Marlin, feel free to re-use them - -macro(add_translations_directory NLS_PACKAGE) - add_custom_target (i18n ALL COMMENT “Building i18n messages.”) - find_program (MSGFMT_EXECUTABLE msgfmt) - file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po) - foreach (PO_INPUT ${PO_FILES}) - get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE) - set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo) - add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT}) - - install (FILES ${MO_OUTPUT} DESTINATION - share/locale/${PO_INPUT_BASE}/LC_MESSAGES - RENAME ${NLS_PACKAGE}.mo) - endforeach (PO_INPUT ${PO_FILES}) -endmacro(add_translations_directory) - - -macro(add_translations_catalog NLS_PACKAGE) - add_custom_target (pot COMMENT “Building translation catalog.”) - find_program (XGETTEXT_EXECUTABLE xgettext) - - - set(C_SOURCE "") - - foreach(FILES_INPUT ${ARGN}) - file (GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c) - foreach(C_FILE ${SOURCE_FILES}) - set(C_SOURCE ${C_SOURCE} ${C_FILE}) - endforeach() - file (GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.vala) - foreach(C_FILE ${SOURCE_FILES}) - set(C_SOURCE ${C_SOURCE} ${C_FILE}) - endforeach() - endforeach() - - add_custom_command (TARGET pot COMMAND - ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot - ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --from-code=UTF-8 - ) -endmacro() diff --git a/vapi/cmake/uninstall.cmake b/vapi/cmake/uninstall.cmake deleted file mode 100644 index 0785ac8..0000000 --- a/vapi/cmake/uninstall.cmake +++ /dev/null @@ -1,21 +0,0 @@ -if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") -endif() - -file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) -string(REGEX REPLACE "\n" ";" files "${files}") -foreach(file ${files}) - message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") - if(EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" - OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval - ) - if(NOT "${rm_retval}" STREQUAL 0) - message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") - endif() - else(EXISTS "$ENV{DESTDIR}${file}") - message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") - endif() -endforeach() diff --git a/vapi/cmake/vala/FindVala.cmake b/vapi/cmake/vala/FindVala.cmake deleted file mode 100644 index aa3a6e7..0000000 --- a/vapi/cmake/vala/FindVala.cmake +++ /dev/null @@ -1,65 +0,0 @@ -## -# Copyright 2009-2010 Jakob Westhoff. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# The views and conclusions contained in the software and documentation are those -# of the authors and should not be interpreted as representing official policies, -# either expressed or implied, of Jakob Westhoff -## - -## -# Find module for the Vala compiler (valac) -# -# This module determines wheter a Vala compiler is installed on the current -# system and where its executable is. -# -# Call the module using "find_package(Vala) from within your CMakeLists.txt. -# -# The following variables will be set after an invocation: -# -# VALA_FOUND Whether the vala compiler has been found or not -# VALA_EXECUTABLE Full path to the valac executable if it has been found -# VALA_VERSION Version number of the available valac -## - - -# Search for the valac executable in the usual system paths. -find_program(VALA_EXECUTABLE - NAMES valac) - -# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call. -# Furthermore set VALA_FOUND to TRUE if Vala has been found (aka. -# VALA_EXECUTABLE is set) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Vala DEFAULT_MSG VALA_EXECUTABLE) - -mark_as_advanced(VALA_EXECUTABLE) - -# Determine the valac version -if(VALA_FOUND) - execute_process(COMMAND ${VALA_EXECUTABLE} "--version" - OUTPUT_VARIABLE "VALA_VERSION") - string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION}) - string(STRIP ${VALA_VERSION} "VALA_VERSION") -endif(VALA_FOUND) diff --git a/vapi/cmake/vala/ParseArguments.cmake b/vapi/cmake/vala/ParseArguments.cmake deleted file mode 100644 index 717c0f5..0000000 --- a/vapi/cmake/vala/ParseArguments.cmake +++ /dev/null @@ -1,36 +0,0 @@ -## -# This is a helper Macro to parse optional arguments in Macros/Functions -# It has been taken from the public CMake wiki. -# See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and -# licensing. -## -macro(parse_arguments prefix arg_names option_names) - set(DEFAULT_ARGS) - foreach(arg_name ${arg_names}) - set(${prefix}_${arg_name}) - endforeach(arg_name) - foreach(option ${option_names}) - set(${prefix}_${option} FALSE) - endforeach(option) - - set(current_arg_name DEFAULT_ARGS) - set(current_arg_list) - foreach(arg ${ARGN}) - set(larg_names ${arg_names}) - list(FIND larg_names "${arg}" is_arg_name) - if(is_arg_name GREATER -1) - set(${prefix}_${current_arg_name} ${current_arg_list}) - set(current_arg_name ${arg}) - set(current_arg_list) - else(is_arg_name GREATER -1) - set(loption_names ${option_names}) - list(FIND loption_names "${arg}" is_option) - if(is_option GREATER -1) - set(${prefix}_${arg} TRUE) - else(is_option GREATER -1) - set(current_arg_list ${current_arg_list} ${arg}) - endif(is_option GREATER -1) - endif(is_arg_name GREATER -1) - endforeach(arg) - set(${prefix}_${current_arg_name} ${current_arg_list}) -endmacro(parse_arguments) diff --git a/vapi/cmake/vala/ValaPrecompile.cmake b/vapi/cmake/vala/ValaPrecompile.cmake deleted file mode 100644 index 19c4739..0000000 --- a/vapi/cmake/vala/ValaPrecompile.cmake +++ /dev/null @@ -1,175 +0,0 @@ -## -# Copyright 2009-2010 Jakob Westhoff. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# The views and conclusions contained in the software and documentation are those -# of the authors and should not be interpreted as representing official policies, -# either expressed or implied, of Jakob Westhoff -## - -include(ParseArguments) -find_package(Vala REQUIRED) - -## -# Compile vala files to their c equivalents for further processing. -# -# The "vala_precompile" macro takes care of calling the valac executable on the -# given source to produce c files which can then be processed further using -# default cmake functions. -# -# The first parameter provided is a variable, which will be filled with a list -# of c files outputted by the vala compiler. This list can than be used in -# conjuction with functions like "add_executable" or others to create the -# neccessary compile rules with CMake. -# -# The initial variable is followed by a list of .vala files to be compiled. -# Please take care to add every vala file belonging to the currently compiled -# project or library as Vala will otherwise not be able to resolve all -# dependencies. -# -# The following sections may be specified afterwards to provide certain options -# to the vala compiler: -# -# PACKAGES -# A list of vala packages/libraries to be used during the compile cycle. The -# package names are exactly the same, as they would be passed to the valac -# "--pkg=" option. -# -# OPTIONS -# A list of optional options to be passed to the valac executable. This can be -# used to pass "--thread" for example to enable multi-threading support. -# -# CUSTOM_VAPIS -# A list of custom vapi files to be included for compilation. This can be -# useful to include freshly created vala libraries without having to install -# them in the system. -# -# GENERATE_VAPI -# Pass all the needed flags to the compiler to create an internal vapi for -# the compiled library. The provided name will be used for this and a -# .vapi file will be created. -# -# GENERATE_HEADER -# Let the compiler generate a header file for the compiled code. There will -# be a header file as well as an internal header file being generated called -# .h and _internal.h -# -# The following call is a simple example to the vala_precompile macro showing -# an example to every of the optional sections: -# -# vala_precompile(VALA_C -# source1.vala -# source2.vala -# source3.vala -# PACKAGES -# gtk+-2.0 -# gio-1.0 -# posix -# DIRECTORY -# gen -# OPTIONS -# --thread -# CUSTOM_VAPIS -# some_vapi.vapi -# GENERATE_VAPI -# myvapi -# GENERATE_HEADER -# myheader -# ) -# -# Most important is the variable VALA_C which will contain all the generated c -# file names after the call. -## - -macro(vala_precompile output) - parse_arguments(ARGS "PACKAGES;OPTIONS;DIRECTORY;GENERATE_HEADER;GENERATE_VAPI;CUSTOM_VAPIS" "" ${ARGN}) - if(ARGS_DIRECTORY) - set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_DIRECTORY}) - else(ARGS_DIRECTORY) - set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - endif(ARGS_DIRECTORY) - include_directories(${DIRECTORY}) - set(vala_pkg_opts "") - foreach(pkg ${ARGS_PACKAGES}) - list(APPEND vala_pkg_opts "--pkg=${pkg}") - endforeach(pkg ${ARGS_PACKAGES}) - set(in_files "") - set(out_files "") - set(${output} "") - foreach(src ${ARGS_DEFAULT_ARGS}) - list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}") - string(REPLACE ".vala" ".c" src ${src}) - string(REPLACE ".gs" ".c" src ${src}) - set(out_file "${DIRECTORY}/${src}") - list(APPEND out_files "${DIRECTORY}/${src}") - list(APPEND ${output} ${out_file}) - endforeach(src ${ARGS_DEFAULT_ARGS}) - - set(custom_vapi_arguments "") - if(ARGS_CUSTOM_VAPIS) - foreach(vapi ${ARGS_CUSTOM_VAPIS}) - if(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) - list(APPEND custom_vapi_arguments ${vapi}) - else (${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) - list(APPEND custom_vapi_arguments ${CMAKE_CURRENT_SOURCE_DIR}/${vapi}) - endif(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) - endforeach(vapi ${ARGS_CUSTOM_VAPIS}) - endif(ARGS_CUSTOM_VAPIS) - - set(vapi_arguments "") - if(ARGS_GENERATE_VAPI) - list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi") - set(vapi_arguments "--internal-vapi=${ARGS_GENERATE_VAPI}.vapi") - - # Header and internal header is needed to generate internal vapi - if (NOT ARGS_GENERATE_HEADER) - set(ARGS_GENERATE_HEADER ${ARGS_GENERATE_VAPI}) - endif(NOT ARGS_GENERATE_HEADER) - endif(ARGS_GENERATE_VAPI) - - set(header_arguments "") - if(ARGS_GENERATE_HEADER) - list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h") - list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h") - list(APPEND header_arguments "--header=${DIRECTORY}/${ARGS_GENERATE_HEADER}.h") - list(APPEND header_arguments "--internal-header=${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h") - endif(ARGS_GENERATE_HEADER) - - add_custom_command(OUTPUT ${out_files} - COMMAND - ${VALA_EXECUTABLE} - ARGS - "-C" - ${header_arguments} - ${vapi_arguments} - "-b" ${CMAKE_CURRENT_SOURCE_DIR} - "-d" ${DIRECTORY} - ${vala_pkg_opts} - ${ARGS_OPTIONS} - ${in_files} - ${custom_vapi_arguments} - DEPENDS - ${in_files} - ${ARGS_CUSTOM_VAPIS} - ) -endmacro(vala_precompile) diff --git a/vapi/cmake/vala/ValaVersion.cmake b/vapi/cmake/vala/ValaVersion.cmake deleted file mode 100644 index 3fff193..0000000 --- a/vapi/cmake/vala/ValaVersion.cmake +++ /dev/null @@ -1,96 +0,0 @@ -## -# Copyright 2009-2010 Jakob Westhoff. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# The views and conclusions contained in the software and documentation are those -# of the authors and should not be interpreted as representing official policies, -# either expressed or implied, of Jakob Westhoff -## - -include(ParseArguments) -find_package(Vala REQUIRED) - -## -# Ensure a certain valac version is available -# -# The initial argument is the version to check for -# -# It may be followed by a optional parameter to specifiy a version range. The -# following options are valid: -# -# EXACT -# Vala needs to be available in the exact version given -# -# MINIMUM -# The provided version is the minimum version. Therefore Vala needs to be -# available in the given version or any higher version -# -# MAXIMUM -# The provided version is the maximum. Therefore Vala needs to be available -# in the given version or any version older than this -# -# If no option is specified the version will be treated as a minimal version. -## -macro(ensure_vala_version version) - parse_arguments(ARGS "" "MINIMUM;MAXIMUM;EXACT" ${ARGN}) - set(compare_message "") - set(error_message "") - if(ARGS_MINIMUM) - set(compare_message "a minimum ") - set(error_message "or greater ") - elseif(ARGS_MAXIMUM) - set(compare_message "a maximum ") - set(error_message "or less ") - endif(ARGS_MINIMUM) - - message(STATUS - "checking for ${compare_message}Vala version of ${version}" - ) - - unset(version_accepted) - - # MINIMUM is the default if no option is specified - if(ARGS_EXACT) - if(${VALA_VERSION} VERSION_EQUAL ${version} ) - set(version_accepted TRUE) - endif(${VALA_VERSION} VERSION_EQUAL ${version}) - elseif(ARGS_MAXIMUM) - if(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) - set(version_accepted TRUE) - endif(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) - else(ARGS_MAXIMUM) - if(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) - set(version_accepted TRUE) - endif(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) - endif(ARGS_EXACT) - - if (NOT version_accepted) - message(FATAL_ERROR - "Vala version ${version} ${error_message}is required." - ) - endif(NOT version_accepted) - - message(STATUS - " found Vala, version ${VALA_VERSION}" - ) -endmacro(ensure_vala_version) diff --git a/vapi/config.vapi b/vapi/config.vapi deleted file mode 100644 index 1f03a0b..0000000 --- a/vapi/config.vapi +++ /dev/null @@ -1,9 +0,0 @@ -[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")] -namespace Build { - public const string DATADIR; - public const string PKGDATADIR; - public const string GETTEXT_PACKAGE; - public const string RELEASE_NAME; - public const string VERSION; - public const string VERSION_INFO; -} diff --git a/vapi/webkit2gtk-3.0.deps b/vapi/webkit2gtk-3.0.deps deleted file mode 100644 index dd7efb1..0000000 --- a/vapi/webkit2gtk-3.0.deps +++ /dev/null @@ -1,7 +0,0 @@ -atk -gio-2.0 -cairo -pango -gdk-pixbuf-2.0 -libsoup-2.4 -gtk+-3.0 diff --git a/vapi/webkit2gtk-3.0.vapi b/vapi/webkit2gtk-3.0.vapi deleted file mode 100644 index a1bc5cb..0000000 --- a/vapi/webkit2gtk-3.0.vapi +++ /dev/null @@ -1,1003 +0,0 @@ -/* webkit2gtk-4.0.vapi generated by vapigen, do not modify. */ - -[CCode (cprefix = "WebKit", gir_namespace = "WebKit2", gir_version = "4.0", lower_case_cprefix = "webkit_")] -namespace WebKit { - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_authentication_request_get_type ()")] - public class AuthenticationRequest : GLib.Object { - [CCode (has_construct_function = false)] - protected AuthenticationRequest (); - public void authenticate (WebKit.Credential? credential); - public bool can_save_credentials (); - public void cancel (); - public unowned string get_host (); - public uint get_port (); - public WebKit.Credential get_proposed_credential (); - public unowned string get_realm (); - public WebKit.AuthenticationScheme get_scheme (); - public bool is_for_proxy (); - public bool is_retry (); - public signal void cancelled (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_back_forward_list_get_type ()")] - public class BackForwardList : GLib.Object { - [CCode (has_construct_function = false)] - protected BackForwardList (); - public unowned WebKit.BackForwardListItem get_back_item (); - public GLib.List get_back_list (); - public GLib.List get_back_list_with_limit (uint limit); - public unowned WebKit.BackForwardListItem get_current_item (); - public unowned WebKit.BackForwardListItem get_forward_item (); - public GLib.List get_forward_list (); - public GLib.List get_forward_list_with_limit (uint limit); - public uint get_length (); - public unowned WebKit.BackForwardListItem get_nth_item (int index); - public signal void changed (WebKit.BackForwardListItem? item_added, void* items_removed); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_back_forward_list_item_get_type ()")] - public class BackForwardListItem : GLib.InitiallyUnowned { - [CCode (has_construct_function = false)] - protected BackForwardListItem (); - public unowned string get_original_uri (); - public unowned string get_title (); - public unowned string get_uri (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_context_menu_get_type ()")] - public class ContextMenu : GLib.Object { - [CCode (has_construct_function = false)] - public ContextMenu (); - public void append (WebKit.ContextMenuItem item); - public unowned WebKit.ContextMenuItem first (); - public unowned WebKit.ContextMenuItem get_item_at_position (uint position); - public unowned GLib.List get_items (); - public uint get_n_items (); - public void insert (WebKit.ContextMenuItem item, int position); - public unowned WebKit.ContextMenuItem last (); - public void move_item (WebKit.ContextMenuItem item, int position); - public void prepend (WebKit.ContextMenuItem item); - public void remove (WebKit.ContextMenuItem item); - public void remove_all (); - [CCode (has_construct_function = false)] - public ContextMenu.with_items (GLib.List items); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_context_menu_item_get_type ()")] - public class ContextMenuItem : GLib.InitiallyUnowned { - [CCode (has_construct_function = false)] - public ContextMenuItem (Gtk.Action action); - [CCode (has_construct_function = false)] - public ContextMenuItem.from_stock_action (WebKit.ContextMenuAction action); - [CCode (has_construct_function = false)] - public ContextMenuItem.from_stock_action_with_label (WebKit.ContextMenuAction action, string label); - public unowned Gtk.Action get_action (); - public WebKit.ContextMenuAction get_stock_action (); - public unowned WebKit.ContextMenu get_submenu (); - public bool is_separator (); - [CCode (has_construct_function = false)] - public ContextMenuItem.separator (); - public void set_submenu (WebKit.ContextMenu? submenu); - [CCode (has_construct_function = false)] - public ContextMenuItem.with_submenu (string label, WebKit.ContextMenu submenu); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_cookie_manager_get_type ()")] - public class CookieManager : GLib.Object { - [CCode (has_construct_function = false)] - protected CookieManager (); - public void delete_all_cookies (); - public void delete_cookies_for_domain (string domain); - public async WebKit.CookieAcceptPolicy get_accept_policy (GLib.Cancellable? cancellable) throws GLib.Error; - [CCode (array_length = false, array_null_terminated = true)] - public async string[] get_domains_with_cookies (GLib.Cancellable? cancellable) throws GLib.Error; - public void set_accept_policy (WebKit.CookieAcceptPolicy policy); - public void set_persistent_storage (string filename, WebKit.CookiePersistentStorage storage); - public signal void changed (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "webkit_credential_get_type ()")] - [Compact] - public class Credential { - [CCode (has_construct_function = false)] - public Credential (string username, string password, WebKit.CredentialPersistence persistence); - public WebKit.Credential copy (); - public void free (); - public unowned string get_password (); - public WebKit.CredentialPersistence get_persistence (); - public unowned string get_username (); - public bool has_password (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_download_get_type ()")] - public class Download : GLib.Object { - [CCode (has_construct_function = false)] - protected Download (); - public void cancel (); - public bool get_allow_overwrite (); - public unowned string get_destination (); - public double get_elapsed_time (); - public double get_estimated_progress (); - public uint64 get_received_data_length (); - public unowned WebKit.URIRequest get_request (); - public unowned WebKit.URIResponse get_response (); - public unowned WebKit.WebView get_web_view (); - public void set_allow_overwrite (bool allowed); - public void set_destination (string uri); - public bool allow_overwrite { get; set; } - public string destination { get; } - public double estimated_progress { get; } - public WebKit.URIResponse response { get; } - public signal void created_destination (string destination); - public virtual signal bool decide_destination (string suggested_filename); - public signal void failed (void* error); - public signal void finished (); - public signal void received_data (uint64 data_length); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_favicon_database_get_type ()")] - public class FaviconDatabase : GLib.Object { - [CCode (has_construct_function = false)] - protected FaviconDatabase (); - public void clear (); - public async Cairo.Surface get_favicon (string page_uri, GLib.Cancellable? cancellable) throws GLib.Error; - public string get_favicon_uri (string page_uri); - public signal void favicon_changed (string page_uri, string favicon_uri); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_file_chooser_request_get_type ()")] - public class FileChooserRequest : GLib.Object { - [CCode (has_construct_function = false)] - protected FileChooserRequest (); - public void cancel (); - [CCode (array_length = false, array_null_terminated = true)] - public unowned string[] get_mime_types (); - public unowned Gtk.FileFilter get_mime_types_filter (); - public bool get_select_multiple (); - [CCode (array_length = false, array_null_terminated = true)] - public unowned string[] get_selected_files (); - public void select_files ([CCode (array_length = false, array_null_terminated = true)] string[] files); - [NoAccessorMethod] - public Gtk.FileFilter filter { owned get; } - [CCode (array_length = false, array_null_terminated = true)] - public string[] mime_types { get; } - public bool select_multiple { get; } - [CCode (array_length = false, array_null_terminated = true)] - public string[] selected_files { get; } - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_find_controller_get_type ()")] - public class FindController : GLib.Object { - [CCode (has_construct_function = false)] - protected FindController (); - public void count_matches (string search_text, uint32 find_options, uint max_match_count); - public uint get_max_match_count (); - public uint32 get_options (); - public unowned string get_search_text (); - public unowned WebKit.WebView get_web_view (); - public void search (string search_text, uint32 find_options, uint max_match_count); - public void search_finish (); - public void search_next (); - public void search_previous (); - public uint max_match_count { get; } - public WebKit.FindOptions options { get; } - [NoAccessorMethod] - public string text { owned get; } - public WebKit.WebView web_view { get; construct; } - public signal void counted_matches (uint match_count); - public signal void failed_to_find_text (); - public signal void found_text (uint match_count); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_form_submission_request_get_type ()")] - public class FormSubmissionRequest : GLib.Object { - [CCode (has_construct_function = false)] - protected FormSubmissionRequest (); - public unowned GLib.HashTable get_text_fields (); - public void submit (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_geolocation_permission_request_get_type ()")] - public class GeolocationPermissionRequest : GLib.Object, WebKit.PermissionRequest { - [CCode (has_construct_function = false)] - protected GeolocationPermissionRequest (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_hit_test_result_get_type ()")] - public class HitTestResult : GLib.Object { - [CCode (has_construct_function = false)] - protected HitTestResult (); - public bool context_is_editable (); - public bool context_is_image (); - public bool context_is_link (); - public bool context_is_media (); - public bool context_is_scrollbar (); - public uint get_context (); - public unowned string get_image_uri (); - public unowned string get_link_label (); - public unowned string get_link_title (); - public unowned string get_link_uri (); - public unowned string get_media_uri (); - public uint context { get; construct; } - public string image_uri { get; construct; } - public string link_label { get; construct; } - public string link_title { get; construct; } - public string link_uri { get; construct; } - public string media_uri { get; construct; } - } - [CCode (cheader_filename = "webkit2/webkit2.h", ref_function = "webkit_javascript_result_ref", type_id = "webkit_javascript_result_get_type ()", unref_function = "webkit_javascript_result_unref")] - [Compact] - public class JavascriptResult { - public WebKit.JavascriptResult @ref (); - public void unref (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", ref_function = "webkit_mime_info_ref", type_id = "webkit_mime_info_get_type ()", unref_function = "webkit_mime_info_unref")] - [Compact] - public class MimeInfo { - public unowned string get_description (); - [CCode (array_length = false, array_null_terminated = true)] - public unowned string[] get_extensions (); - public unowned string get_mime_type (); - public WebKit.MimeInfo @ref (); - public void unref (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "webkit_navigation_action_get_type ()")] - [Compact] - public class NavigationAction { - public WebKit.NavigationAction copy (); - public void free (); - public uint get_modifiers (); - public uint get_mouse_button (); - public WebKit.NavigationType get_navigation_type (); - public unowned WebKit.URIRequest get_request (); - public bool is_user_gesture (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_navigation_policy_decision_get_type ()")] - public class NavigationPolicyDecision : WebKit.PolicyDecision { - [CCode (has_construct_function = false)] - protected NavigationPolicyDecision (); - public unowned string get_frame_name (); - [Deprecated (since = "2.6")] - public uint get_modifiers (); - [Deprecated (since = "2.6")] - public uint get_mouse_button (); - public unowned WebKit.NavigationAction get_navigation_action (); - [Deprecated (since = "2.6")] - public WebKit.NavigationType get_navigation_type (); - [Deprecated (since = "2.6")] - public unowned WebKit.URIRequest get_request (); - public string frame_name { get; } - [Deprecated (since = "2.6")] - public uint modifiers { get; } - [Deprecated (since = "2.6")] - public uint mouse_button { get; } - public WebKit.NavigationAction navigation_action { get; } - [Deprecated (since = "2.6")] - public WebKit.NavigationType navigation_type { get; } - [Deprecated (since = "2.6")] - public WebKit.URIRequest request { get; } - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_plugin_get_type ()")] - public class Plugin : GLib.Object { - [CCode (has_construct_function = false)] - protected Plugin (); - public unowned string get_description (); - public unowned GLib.List get_mime_info_list (); - public unowned string get_name (); - public unowned string get_path (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_policy_decision_get_type ()")] - public abstract class PolicyDecision : GLib.Object { - [CCode (has_construct_function = false)] - protected PolicyDecision (); - public void download (); - public void ignore (); - public void use (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_print_operation_get_type ()")] - public class PrintOperation : GLib.Object { - [CCode (has_construct_function = false)] - public PrintOperation (WebKit.WebView web_view); - public unowned Gtk.PageSetup get_page_setup (); - public unowned Gtk.PrintSettings get_print_settings (); - public void print (); - public WebKit.PrintOperationResponse run_dialog (Gtk.Window? parent); - public void set_page_setup (Gtk.PageSetup page_setup); - public void set_print_settings (Gtk.PrintSettings print_settings); - public Gtk.PageSetup page_setup { get; set; } - public Gtk.PrintSettings print_settings { get; set; } - [NoAccessorMethod] - public WebKit.WebView web_view { owned get; construct; } - public signal void failed (void* error); - public signal void finished (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_response_policy_decision_get_type ()")] - public class ResponsePolicyDecision : WebKit.PolicyDecision { - [CCode (has_construct_function = false)] - protected ResponsePolicyDecision (); - public unowned WebKit.URIRequest get_request (); - public unowned WebKit.URIResponse get_response (); - public bool is_mime_type_supported (); - public WebKit.URIRequest request { get; } - public WebKit.URIResponse response { get; } - } - [CCode (cheader_filename = "webkit2/webkit2.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "webkit_script_dialog_get_type ()")] - [Compact] - public class ScriptDialog { - public void confirm_set_confirmed (bool confirmed); - public WebKit.ScriptDialogType get_dialog_type (); - public unowned string get_message (); - public unowned string prompt_get_default_text (); - public void prompt_set_text (string text); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_security_manager_get_type ()")] - public class SecurityManager : GLib.Object { - [CCode (has_construct_function = false)] - protected SecurityManager (); - public void register_uri_scheme_as_cors_enabled (string scheme); - public void register_uri_scheme_as_display_isolated (string scheme); - public void register_uri_scheme_as_empty_document (string scheme); - public void register_uri_scheme_as_local (string scheme); - public void register_uri_scheme_as_no_access (string scheme); - public void register_uri_scheme_as_secure (string scheme); - public bool uri_scheme_is_cors_enabled (string scheme); - public bool uri_scheme_is_display_isolated (string scheme); - public bool uri_scheme_is_empty_document (string scheme); - public bool uri_scheme_is_local (string scheme); - public bool uri_scheme_is_no_access (string scheme); - public bool uri_scheme_is_secure (string scheme); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_settings_get_type ()")] - public class Settings : GLib.Object { - [CCode (has_construct_function = false)] - public Settings (); - public bool get_allow_modal_dialogs (); - public bool get_auto_load_images (); - public unowned string get_cursive_font_family (); - public unowned string get_default_charset (); - public unowned string get_default_font_family (); - public uint32 get_default_font_size (); - public uint32 get_default_monospace_font_size (); - public bool get_draw_compositing_indicators (); - public bool get_enable_accelerated_2d_canvas (); - public bool get_enable_caret_browsing (); - public bool get_enable_developer_extras (); - public bool get_enable_dns_prefetching (); - public bool get_enable_frame_flattening (); - public bool get_enable_fullscreen (); - public bool get_enable_html5_database (); - public bool get_enable_html5_local_storage (); - public bool get_enable_hyperlink_auditing (); - public bool get_enable_java (); - public bool get_enable_javascript (); - public bool get_enable_media_stream (); - public bool get_enable_mediasource (); - public bool get_enable_offline_web_application_cache (); - public bool get_enable_page_cache (); - public bool get_enable_plugins (); - public bool get_enable_private_browsing (); - public bool get_enable_resizable_text_areas (); - public bool get_enable_site_specific_quirks (); - public bool get_enable_smooth_scrolling (); - public bool get_enable_spatial_navigation (); - public bool get_enable_tabs_to_links (); - public bool get_enable_webaudio (); - public bool get_enable_webgl (); - public bool get_enable_write_console_messages_to_stdout (); - public bool get_enable_xss_auditor (); - public unowned string get_fantasy_font_family (); - public bool get_javascript_can_access_clipboard (); - public bool get_javascript_can_open_windows_automatically (); - public bool get_load_icons_ignoring_image_load_setting (); - public bool get_media_playback_allows_inline (); - public bool get_media_playback_requires_user_gesture (); - public uint32 get_minimum_font_size (); - public unowned string get_monospace_font_family (); - public unowned string get_pictograph_font_family (); - public bool get_print_backgrounds (); - public unowned string get_sans_serif_font_family (); - public unowned string get_serif_font_family (); - public unowned string get_user_agent (); - public bool get_zoom_text_only (); - public void set_allow_modal_dialogs (bool allowed); - public void set_auto_load_images (bool enabled); - public void set_cursive_font_family (string cursive_font_family); - public void set_default_charset (string default_charset); - public void set_default_font_family (string default_font_family); - public void set_default_font_size (uint32 font_size); - public void set_default_monospace_font_size (uint32 font_size); - public void set_draw_compositing_indicators (bool enabled); - public void set_enable_accelerated_2d_canvas (bool enabled); - public void set_enable_caret_browsing (bool enabled); - public void set_enable_developer_extras (bool enabled); - public void set_enable_dns_prefetching (bool enabled); - public void set_enable_frame_flattening (bool enabled); - public void set_enable_fullscreen (bool enabled); - public void set_enable_html5_database (bool enabled); - public void set_enable_html5_local_storage (bool enabled); - public void set_enable_hyperlink_auditing (bool enabled); - public void set_enable_java (bool enabled); - public void set_enable_javascript (bool enabled); - public void set_enable_media_stream (bool enabled); - public void set_enable_mediasource (bool enabled); - public void set_enable_offline_web_application_cache (bool enabled); - public void set_enable_page_cache (bool enabled); - public void set_enable_plugins (bool enabled); - public void set_enable_private_browsing (bool enabled); - public void set_enable_resizable_text_areas (bool enabled); - public void set_enable_site_specific_quirks (bool enabled); - public void set_enable_smooth_scrolling (bool enabled); - public void set_enable_spatial_navigation (bool enabled); - public void set_enable_tabs_to_links (bool enabled); - public void set_enable_webaudio (bool enabled); - public void set_enable_webgl (bool enabled); - public void set_enable_write_console_messages_to_stdout (bool enabled); - public void set_enable_xss_auditor (bool enabled); - public void set_fantasy_font_family (string fantasy_font_family); - public void set_javascript_can_access_clipboard (bool enabled); - public void set_javascript_can_open_windows_automatically (bool enabled); - public void set_load_icons_ignoring_image_load_setting (bool enabled); - public void set_media_playback_allows_inline (bool enabled); - public void set_media_playback_requires_user_gesture (bool enabled); - public void set_minimum_font_size (uint32 font_size); - public void set_monospace_font_family (string monospace_font_family); - public void set_pictograph_font_family (string pictograph_font_family); - public void set_print_backgrounds (bool print_backgrounds); - public void set_sans_serif_font_family (string sans_serif_font_family); - public void set_serif_font_family (string serif_font_family); - public void set_user_agent (string? user_agent); - public void set_user_agent_with_application_details (string? application_name, string? application_version); - public void set_zoom_text_only (bool zoom_text_only); - public bool allow_modal_dialogs { get; set construct; } - public bool auto_load_images { get; set construct; } - public string cursive_font_family { get; set construct; } - public string default_charset { get; set construct; } - public string default_font_family { get; set construct; } - public uint default_font_size { get; set construct; } - public uint default_monospace_font_size { get; set construct; } - public bool draw_compositing_indicators { get; set construct; } - public bool enable_accelerated_2d_canvas { get; set construct; } - public bool enable_caret_browsing { get; set construct; } - public bool enable_developer_extras { get; set construct; } - public bool enable_dns_prefetching { get; set construct; } - public bool enable_frame_flattening { get; set construct; } - public bool enable_fullscreen { get; set construct; } - public bool enable_html5_database { get; set construct; } - public bool enable_html5_local_storage { get; set construct; } - public bool enable_hyperlink_auditing { get; set construct; } - public bool enable_java { get; set construct; } - public bool enable_javascript { get; set construct; } - public bool enable_media_stream { get; set construct; } - public bool enable_mediasource { get; set construct; } - public bool enable_offline_web_application_cache { get; set construct; } - public bool enable_page_cache { get; set construct; } - public bool enable_plugins { get; set construct; } - public bool enable_private_browsing { get; set construct; } - public bool enable_resizable_text_areas { get; set construct; } - public bool enable_site_specific_quirks { get; set construct; } - public bool enable_smooth_scrolling { get; set construct; } - public bool enable_spatial_navigation { get; set construct; } - public bool enable_tabs_to_links { get; set construct; } - public bool enable_webaudio { get; set construct; } - public bool enable_webgl { get; set construct; } - public bool enable_write_console_messages_to_stdout { get; set construct; } - public bool enable_xss_auditor { get; set construct; } - public string fantasy_font_family { get; set construct; } - public bool javascript_can_access_clipboard { get; set construct; } - public bool javascript_can_open_windows_automatically { get; set construct; } - public bool load_icons_ignoring_image_load_setting { get; set construct; } - public bool media_playback_allows_inline { get; set construct; } - public bool media_playback_requires_user_gesture { get; set construct; } - public uint minimum_font_size { get; set construct; } - public string monospace_font_family { get; set construct; } - public string pictograph_font_family { get; set construct; } - public bool print_backgrounds { get; set construct; } - public string sans_serif_font_family { get; set construct; } - public string serif_font_family { get; set construct; } - public string user_agent { get; set construct; } - public bool zoom_text_only { get; set construct; } - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_uri_request_get_type ()")] - public class URIRequest : GLib.Object { - [CCode (has_construct_function = false)] - public URIRequest (string uri); - public unowned Soup.MessageHeaders get_http_headers (); - public unowned string get_uri (); - public void set_uri (string uri); - public string uri { get; set construct; } - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_uri_response_get_type ()")] - public class URIResponse : GLib.Object { - [CCode (has_construct_function = false)] - protected URIResponse (); - public uint64 get_content_length (); - public unowned Soup.MessageHeaders get_http_headers (); - public unowned string get_mime_type (); - public uint get_status_code (); - public unowned string get_suggested_filename (); - public unowned string get_uri (); - public uint64 content_length { get; } - public Soup.MessageHeaders http_headers { get; } - public string mime_type { get; } - public uint status_code { get; } - public string suggested_filename { get; } - public string uri { get; } - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_uri_scheme_request_get_type ()")] - public class URISchemeRequest : GLib.Object { - [CCode (has_construct_function = false)] - protected URISchemeRequest (); - public void finish (GLib.InputStream stream, int64 stream_length, string? mime_type); - public void finish_error (GLib.Error error); - public unowned string get_path (); - public unowned string get_scheme (); - public unowned string get_uri (); - public unowned WebKit.WebView get_web_view (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_user_content_manager_get_type ()")] - public class UserContentManager : GLib.Object { - [CCode (has_construct_function = false)] - public UserContentManager (); - public void add_script (WebKit.UserScript script); - public void add_style_sheet (WebKit.UserStyleSheet stylesheet); - public void remove_all_scripts (); - public void remove_all_style_sheets (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", ref_function = "webkit_user_script_ref", type_id = "webkit_user_script_get_type ()", unref_function = "webkit_user_script_unref")] - [Compact] - public class UserScript { - [CCode (has_construct_function = false)] - public UserScript (string source, WebKit.UserContentInjectedFrames injected_frames, WebKit.UserScriptInjectionTime injection_time, [CCode (array_length = false, array_null_terminated = true)] string[]? whitelist, [CCode (array_length = false, array_null_terminated = true)] string[]? blacklist); - public WebKit.UserScript @ref (); - public void unref (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", ref_function = "webkit_user_style_sheet_ref", type_id = "webkit_user_style_sheet_get_type ()", unref_function = "webkit_user_style_sheet_unref")] - [Compact] - public class UserStyleSheet { - [CCode (has_construct_function = false)] - public UserStyleSheet (string source, WebKit.UserContentInjectedFrames injected_frames, WebKit.UserStyleLevel level, [CCode (array_length = false, array_null_terminated = true)] string[]? whitelist, [CCode (array_length = false, array_null_terminated = true)] string[]? blacklist); - public WebKit.UserStyleSheet @ref (); - public void unref (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_web_context_get_type ()")] - public class WebContext : GLib.Object { - [CCode (has_construct_function = false)] - protected WebContext (); - public void allow_tls_certificate_for_host (GLib.TlsCertificate certificate, string host); - public void clear_cache (); - public WebKit.Download download_uri (string uri); - public WebKit.CacheModel get_cache_model (); - public unowned WebKit.CookieManager get_cookie_manager (); - public static unowned WebKit.WebContext get_default (); - public unowned WebKit.FaviconDatabase get_favicon_database (); - public unowned string get_favicon_database_directory (); - public async GLib.List get_plugins (GLib.Cancellable? cancellable) throws GLib.Error; - public WebKit.ProcessModel get_process_model (); - public unowned WebKit.SecurityManager get_security_manager (); - public bool get_spell_checking_enabled (); - [CCode (array_length = false, array_null_terminated = true)] - public unowned string[] get_spell_checking_languages (); - public WebKit.TLSErrorsPolicy get_tls_errors_policy (); - public void prefetch_dns (string hostname); - public void register_uri_scheme (string scheme, owned WebKit.URISchemeRequestCallback callback); - public void set_additional_plugins_directory (string directory); - public void set_cache_model (WebKit.CacheModel cache_model); - public void set_disk_cache_directory (string directory); - public void set_favicon_database_directory (string? path); - public void set_preferred_languages ([CCode (array_length = false, array_null_terminated = true)] string[]? languages); - public void set_process_model (WebKit.ProcessModel process_model); - public void set_spell_checking_enabled (bool enabled); - public void set_spell_checking_languages ([CCode (array_length = false, array_null_terminated = true)] string[] languages); - public void set_tls_errors_policy (WebKit.TLSErrorsPolicy policy); - public void set_web_extensions_directory (string directory); - public void set_web_extensions_initialization_user_data (GLib.Variant user_data); - public signal void download_started (WebKit.Download download); - public signal void initialize_web_extensions (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_web_inspector_get_type ()")] - public class WebInspector : GLib.Object { - [CCode (has_construct_function = false)] - protected WebInspector (); - public void close (); - public uint get_attached_height (); - public unowned string get_inspected_uri (); - public unowned WebKit.WebViewBase get_web_view (); - public bool is_attached (); - public void show (); - public uint attached_height { get; } - public string inspected_uri { get; } - [HasEmitter] - public signal bool attach (); - public signal bool bring_to_front (); - public signal void closed (); - [HasEmitter] - public signal bool detach (); - public signal bool open_window (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_web_resource_get_type ()")] - public class WebResource : GLib.Object { - [CCode (has_construct_function = false)] - protected WebResource (); - public async uint8[] get_data (GLib.Cancellable? cancellable) throws GLib.Error; - public unowned WebKit.URIResponse get_response (); - public unowned string get_uri (); - public WebKit.URIResponse response { get; } - public string uri { get; } - public signal void failed (void* error); - public signal void finished (); - public signal void received_data (uint64 data_length); - public signal void sent_request (WebKit.URIRequest request, WebKit.URIResponse redirected_response); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_web_view_get_type ()")] - public class WebView : WebKit.WebViewBase, Atk.Implementor, Gtk.Buildable { - [CCode (has_construct_function = false, type = "GtkWidget*")] - public WebView (); - public async bool can_execute_editing_command (string command, GLib.Cancellable? cancellable) throws GLib.Error; - public bool can_go_back (); - public bool can_go_forward (); - public bool can_show_mime_type (string mime_type); - public WebKit.Download download_uri (string uri); - public void execute_editing_command (string command); - public unowned WebKit.BackForwardList get_back_forward_list (); - public unowned WebKit.WebContext get_context (); - public unowned string get_custom_charset (); - public double get_estimated_load_progress (); - public unowned Cairo.Surface get_favicon (); - public unowned WebKit.FindController get_find_controller (); - public unowned WebKit.WebInspector get_inspector (); - public unowned WebKit.WebResource get_main_resource (); - public uint64 get_page_id (); - public unowned WebKit.Settings get_settings (); - public async Cairo.Surface get_snapshot (WebKit.SnapshotRegion region, WebKit.SnapshotOptions options, GLib.Cancellable? cancellable) throws GLib.Error; - public unowned string get_title (); - public bool get_tls_info (out unowned GLib.TlsCertificate certificate, out GLib.TlsCertificateFlags errors); - public unowned string get_uri (); - public unowned WebKit.UserContentManager get_user_content_manager (); - public unowned WebKit.WindowProperties get_window_properties (); - public double get_zoom_level (); - public void go_back (); - public void go_forward (); - public void go_to_back_forward_list_item (WebKit.BackForwardListItem list_item); - public void load_alternate_html (string content, string content_uri, string? base_uri); - public void load_bytes (GLib.Bytes bytes, string? mime_type, string? encoding, string? base_uri); - public void load_html (string content, string? base_uri); - public void load_plain_text (string plain_text); - public void load_request (WebKit.URIRequest request); - public void load_uri (string uri); - public Gtk.Widget new_with_related_view (); - public void reload (); - public void reload_bypass_cache (); - public async WebKit.JavascriptResult run_javascript (string script, GLib.Cancellable? cancellable) throws GLib.Error; - public async WebKit.JavascriptResult run_javascript_from_gresource (string resource, GLib.Cancellable? cancellable) throws GLib.Error; - public async GLib.InputStream save (WebKit.SaveMode save_mode, GLib.Cancellable? cancellable) throws GLib.Error; - public async bool save_to_file (GLib.File file, WebKit.SaveMode save_mode, GLib.Cancellable? cancellable) throws GLib.Error; - public void set_custom_charset (string? charset); - public void set_settings (WebKit.Settings settings); - public void set_zoom_level (double zoom_level); - public void stop_loading (); - [CCode (has_construct_function = false, type = "GtkWidget*")] - public WebView.with_context (WebKit.WebContext context); - [CCode (has_construct_function = false, type = "GtkWidget*")] - public WebView.with_settings (WebKit.Settings settings); - [CCode (has_construct_function = false, type = "GtkWidget*")] - public WebView.with_user_content_manager (WebKit.UserContentManager user_content_manager); - public double estimated_load_progress { get; } - public void* favicon { get; } - [NoAccessorMethod] - public bool is_loading { get; } - public WebKit.WebView related_view { construct; } - public WebKit.Settings settings { set construct; } - public string title { get; } - public string uri { get; } - public WebKit.UserContentManager user_content_manager { get; construct; } - [NoAccessorMethod] - public WebKit.WebContext web_context { owned get; construct; } - public double zoom_level { get; set; } - public virtual signal bool authenticate (WebKit.AuthenticationRequest request); - public virtual signal void close (); - public virtual signal bool context_menu (WebKit.ContextMenu context_menu, Gdk.Event event, WebKit.HitTestResult hit_test_result); - public virtual signal void context_menu_dismissed (); - public signal Gtk.Widget create (); - public virtual signal bool decide_policy (WebKit.PolicyDecision decision, WebKit.PolicyDecisionType type); - public virtual signal bool enter_fullscreen (); - public virtual signal void insecure_content_detected (WebKit.InsecureContentEvent event); - public virtual signal bool leave_fullscreen (); - public virtual signal void load_changed (WebKit.LoadEvent load_event); - public virtual signal bool load_failed (WebKit.LoadEvent load_event, string failing_uri, void* error); - public virtual signal bool load_failed_with_tls_errors (string failing_uri, GLib.TlsCertificate certificate, GLib.TlsCertificateFlags errors); - public virtual signal void mouse_target_changed (WebKit.HitTestResult hit_test_result, uint modifiers); - public virtual signal bool permission_request (WebKit.PermissionRequest permission_request); - public virtual signal bool print (WebKit.PrintOperation print_operation); - public virtual signal void ready_to_show (); - public virtual signal void resource_load_started (WebKit.WebResource resource, WebKit.URIRequest request); - public virtual signal void run_as_modal (); - public virtual signal bool run_file_chooser (WebKit.FileChooserRequest request); - public virtual signal bool script_dialog (WebKit.ScriptDialog dialog); - public virtual signal void submit_form (WebKit.FormSubmissionRequest request); - public virtual signal bool web_process_crashed (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_web_view_base_get_type ()")] - public class WebViewBase : Gtk.Container, Atk.Implementor, Gtk.Buildable { - [CCode (has_construct_function = false)] - protected WebViewBase (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_window_properties_get_type ()")] - public class WindowProperties : GLib.Object { - [CCode (has_construct_function = false)] - protected WindowProperties (); - public bool get_fullscreen (); - public Gdk.Rectangle get_geometry (); - public bool get_locationbar_visible (); - public bool get_menubar_visible (); - public bool get_resizable (); - public bool get_scrollbars_visible (); - public bool get_statusbar_visible (); - public bool get_toolbar_visible (); - public bool fullscreen { get; construct; } - public Cairo.RectangleInt geometry { get; construct; } - public bool locationbar_visible { get; construct; } - public bool menubar_visible { get; construct; } - public bool resizable { get; construct; } - public bool scrollbars_visible { get; construct; } - public bool statusbar_visible { get; construct; } - public bool toolbar_visible { get; construct; } - } - [CCode (cheader_filename = "webkit2/webkit2.h", type_id = "webkit_permission_request_get_type ()")] - public interface PermissionRequest : GLib.Object { - public abstract void allow (); - public abstract void deny (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_AUTHENTICATION_SCHEME_", type_id = "webkit_authentication_scheme_get_type ()")] - public enum AuthenticationScheme { - DEFAULT, - HTTP_BASIC, - HTTP_DIGEST, - HTML_FORM, - NTLM, - NEGOTIATE, - CLIENT_CERTIFICATE_REQUESTED, - SERVER_TRUST_EVALUATION_REQUESTED, - UNKNOWN - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_CACHE_MODEL_", type_id = "webkit_cache_model_get_type ()")] - public enum CacheModel { - DOCUMENT_VIEWER, - WEB_BROWSER, - DOCUMENT_BROWSER - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_CONTEXT_MENU_ACTION_", type_id = "webkit_context_menu_action_get_type ()")] - public enum ContextMenuAction { - NO_ACTION, - OPEN_LINK, - OPEN_LINK_IN_NEW_WINDOW, - DOWNLOAD_LINK_TO_DISK, - COPY_LINK_TO_CLIPBOARD, - OPEN_IMAGE_IN_NEW_WINDOW, - DOWNLOAD_IMAGE_TO_DISK, - COPY_IMAGE_TO_CLIPBOARD, - COPY_IMAGE_URL_TO_CLIPBOARD, - OPEN_FRAME_IN_NEW_WINDOW, - GO_BACK, - GO_FORWARD, - STOP, - RELOAD, - COPY, - CUT, - PASTE, - DELETE, - SELECT_ALL, - INPUT_METHODS, - UNICODE, - SPELLING_GUESS, - NO_GUESSES_FOUND, - IGNORE_SPELLING, - LEARN_SPELLING, - IGNORE_GRAMMAR, - FONT_MENU, - BOLD, - ITALIC, - UNDERLINE, - OUTLINE, - INSPECT_ELEMENT, - OPEN_VIDEO_IN_NEW_WINDOW, - OPEN_AUDIO_IN_NEW_WINDOW, - COPY_VIDEO_LINK_TO_CLIPBOARD, - COPY_AUDIO_LINK_TO_CLIPBOARD, - TOGGLE_MEDIA_CONTROLS, - TOGGLE_MEDIA_LOOP, - ENTER_VIDEO_FULLSCREEN, - MEDIA_PLAY, - MEDIA_PAUSE, - MEDIA_MUTE, - DOWNLOAD_VIDEO_TO_DISK, - DOWNLOAD_AUDIO_TO_DISK, - CUSTOM - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_COOKIE_POLICY_ACCEPT_", type_id = "webkit_cookie_accept_policy_get_type ()")] - public enum CookieAcceptPolicy { - ALWAYS, - NEVER, - NO_THIRD_PARTY - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_COOKIE_PERSISTENT_STORAGE_", type_id = "webkit_cookie_persistent_storage_get_type ()")] - public enum CookiePersistentStorage { - TEXT, - SQLITE - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_CREDENTIAL_PERSISTENCE_", type_id = "webkit_credential_persistence_get_type ()")] - public enum CredentialPersistence { - NONE, - FOR_SESSION, - PERMANENT - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_FIND_OPTIONS_", type_id = "webkit_find_options_get_type ()")] - [Flags] - public enum FindOptions { - NONE, - CASE_INSENSITIVE, - AT_WORD_STARTS, - TREAT_MEDIAL_CAPITAL_AS_WORD_START, - BACKWARDS, - WRAP_AROUND - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_HIT_TEST_RESULT_CONTEXT_", type_id = "webkit_hit_test_result_context_get_type ()")] - [Flags] - public enum HitTestResultContext { - DOCUMENT, - LINK, - IMAGE, - MEDIA, - EDITABLE, - SCROLLBAR - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_INSECURE_CONTENT_", type_id = "webkit_insecure_content_event_get_type ()")] - public enum InsecureContentEvent { - RUN, - DISPLAYED - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_LOAD_", type_id = "webkit_load_event_get_type ()")] - public enum LoadEvent { - STARTED, - REDIRECTED, - COMMITTED, - FINISHED - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_NAVIGATION_TYPE_", type_id = "webkit_navigation_type_get_type ()")] - public enum NavigationType { - LINK_CLICKED, - FORM_SUBMITTED, - BACK_FORWARD, - RELOAD, - FORM_RESUBMITTED, - OTHER - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_POLICY_DECISION_TYPE_", type_id = "webkit_policy_decision_type_get_type ()")] - public enum PolicyDecisionType { - NAVIGATION_ACTION, - NEW_WINDOW_ACTION, - RESPONSE - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_PRINT_OPERATION_RESPONSE_", type_id = "webkit_print_operation_response_get_type ()")] - public enum PrintOperationResponse { - PRINT, - CANCEL - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_PROCESS_MODEL_", type_id = "webkit_process_model_get_type ()")] - public enum ProcessModel { - SHARED_SECONDARY_PROCESS, - MULTIPLE_SECONDARY_PROCESSES - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_SAVE_MODE_", type_id = "webkit_save_mode_get_type ()")] - public enum SaveMode { - MHTML - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_SCRIPT_DIALOG_", type_id = "webkit_script_dialog_type_get_type ()")] - public enum ScriptDialogType { - ALERT, - CONFIRM, - PROMPT - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_SNAPSHOT_OPTIONS_", type_id = "webkit_snapshot_options_get_type ()")] - [Flags] - public enum SnapshotOptions { - NONE, - INCLUDE_SELECTION_HIGHLIGHTING - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_SNAPSHOT_REGION_", type_id = "webkit_snapshot_region_get_type ()")] - public enum SnapshotRegion { - VISIBLE, - FULL_DOCUMENT - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_TLS_ERRORS_POLICY_", type_id = "webkit_tls_errors_policy_get_type ()")] - public enum TLSErrorsPolicy { - IGNORE, - FAIL - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_USER_CONTENT_INJECT_", type_id = "webkit_user_content_injected_frames_get_type ()")] - public enum UserContentInjectedFrames { - ALL_FRAMES, - TOP_FRAME - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_", type_id = "webkit_user_script_injection_time_get_type ()")] - public enum UserScriptInjectionTime { - START, - END - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_USER_STYLE_LEVEL_", type_id = "webkit_user_style_level_get_type ()")] - public enum UserStyleLevel { - USER, - AUTHOR - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_DOWNLOAD_ERROR_")] - public errordomain DownloadError { - NETWORK, - CANCELLED_BY_USER, - DESTINATION; - public static GLib.Quark quark (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_FAVICON_DATABASE_ERROR_")] - public errordomain FaviconDatabaseError { - NOT_INITIALIZED, - FAVICON_NOT_FOUND, - FAVICON_UNKNOWN; - public static GLib.Quark quark (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_JAVASCRIPT_ERROR_SCRIPT_")] - public errordomain JavascriptError { - FAILED; - public static GLib.Quark quark (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_NETWORK_ERROR_")] - public errordomain NetworkError { - FAILED, - TRANSPORT, - UNKNOWN_PROTOCOL, - CANCELLED, - FILE_DOES_NOT_EXIST; - public static GLib.Quark quark (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_PLUGIN_ERROR_")] - public errordomain PluginError { - FAILED, - CANNOT_FIND_PLUGIN, - CANNOT_LOAD_PLUGIN, - JAVA_UNAVAILABLE, - CONNECTION_CANCELLED, - WILL_HANDLE_LOAD; - public static GLib.Quark quark (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_POLICY_ERROR_")] - public errordomain PolicyError { - FAILED, - CANNOT_SHOW_MIME_TYPE, - CANNOT_SHOW_URI, - FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE, - CANNOT_USE_RESTRICTED_PORT; - public static GLib.Quark quark (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_PRINT_ERROR_")] - public errordomain PrintError { - GENERAL, - PRINTER_NOT_FOUND, - INVALID_PAGE_RANGE; - public static GLib.Quark quark (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", cprefix = "WEBKIT_SNAPSHOT_ERROR_FAILED_TO_")] - public errordomain SnapshotError { - CREATE; - public static GLib.Quark quark (); - } - [CCode (cheader_filename = "webkit2/webkit2.h", instance_pos = 1.9)] - public delegate void URISchemeRequestCallback (WebKit.URISchemeRequest request); - [CCode (cheader_filename = "webkit2/webkit2.h", cname = "WEBKIT_EDITING_COMMAND_COPY")] - public const string EDITING_COMMAND_COPY; - [CCode (cheader_filename = "webkit2/webkit2.h", cname = "WEBKIT_EDITING_COMMAND_CUT")] - public const string EDITING_COMMAND_CUT; - [CCode (cheader_filename = "webkit2/webkit2.h", cname = "WEBKIT_EDITING_COMMAND_PASTE")] - public const string EDITING_COMMAND_PASTE; - [CCode (cheader_filename = "webkit2/webkit2.h", cname = "WEBKIT_EDITING_COMMAND_REDO")] - public const string EDITING_COMMAND_REDO; - [CCode (cheader_filename = "webkit2/webkit2.h", cname = "WEBKIT_EDITING_COMMAND_SELECT_ALL")] - public const string EDITING_COMMAND_SELECT_ALL; - [CCode (cheader_filename = "webkit2/webkit2.h", cname = "WEBKIT_EDITING_COMMAND_UNDO")] - public const string EDITING_COMMAND_UNDO; - [CCode (cheader_filename = "webkit2/webkit2.h", cname = "WEBKIT_MAJOR_VERSION")] - public const int MAJOR_VERSION; - [CCode (cheader_filename = "webkit2/webkit2.h", cname = "WEBKIT_MICRO_VERSION")] - public const int MICRO_VERSION; - [CCode (cheader_filename = "webkit2/webkit2.h", cname = "WEBKIT_MINOR_VERSION")] - public const int MINOR_VERSION; - [CCode (cheader_filename = "webkit2/webkit2.h")] - public static uint get_major_version (); - [CCode (cheader_filename = "webkit2/webkit2.h")] - public static uint get_micro_version (); - [CCode (cheader_filename = "webkit2/webkit2.h")] - public static uint get_minor_version (); -}