=== modified file 'plugins/devhelp/CMakeLists.txt' --- plugins/devhelp/CMakeLists.txt 2012-07-26 19:26:21 +0000 +++ plugins/devhelp/CMakeLists.txt 2012-09-16 19:13:52 +0000 @@ -7,6 +7,12 @@ link_libraries (${DEVHELP_LIBRARIES}) link_directories (${DEVHELP_LIBRARY_DIRS}) +set (VALAFLAGS "") +pkg_check_modules(DEVHELP36 QUIET libdevhelp-3.0>=3.5) +if (DEVHELP36_FOUND) + set (VALAFLAGS "--define=HAS_DEVHELP36") +endif (DEVHELP36_FOUND) + vala_precompile(VALA_C devhelp.vala PACKAGES @@ -23,6 +29,7 @@ --vapidir=${CMAKE_BINARY_DIR} --vapidir=${CMAKE_SOURCE_DIR}/vapi/ --vapidir=${CMAKE_BINARY_DIR}/scratchcore/ + ${VALAFLAGS} ) add_library(scratchdevhelp MODULE ${VALA_C}) add_dependencies(scratchdevhelp scratchcore scratch) === modified file 'plugins/devhelp/devhelp.vala' --- plugins/devhelp/devhelp.vala 2012-09-16 06:44:56 +0000 +++ plugins/devhelp/devhelp.vala 2012-09-16 19:35:15 +0000 @@ -21,7 +21,11 @@ public class Scratch.Plugins.DevHelp : Peas.ExtensionBase, Peas.Activatable { Interface plugins; +#if HAS_DEVHELP36 + private Dh.App? dhbase = null; +#else private Dh.Base? dhbase = null; +#endif private Gtk.Widget? window = null; private Gtk.Widget widget; public Object object { owned get; construct; } @@ -44,14 +48,16 @@ var aw = new Dh.AssistantView (); - if (plugins.dhbase != null) - dhbase = plugins.dhbase as Dh.Base; - else { + if (plugins.dhbase == null) +#if HAS_DEVHELP36 + plugins.dhbase = new Dh.App (); + dhbase = plugins.dhbase as Dh.App; + aw.set_app (dhbase); +#else plugins.dhbase = new Dh.Base (); - dhbase = plugins.dhbase as Dh.Base; - } - + dhbase = plugins.dhbase as Dh.Base; aw.set_base (dhbase); +#endif window = new Dh.Window (dhbase); === modified file 'vapi/libdevhelp-3.0.vapi' --- vapi/libdevhelp-3.0.vapi 2012-07-26 19:26:21 +0000 +++ vapi/libdevhelp-3.0.vapi 2012-09-16 19:27:33 +0000 @@ -1,22 +1,53 @@ -/* libdevhelp-2.0.vapi generated by vapigen, do not modify. */ +/* libdevhelp-3.0.vapi generated by vapigen, do not modify. */ -[CCode (cprefix = "Dh", lower_case_cprefix = "dh_")] namespace Dh { +#if HAS_DEVHELP36 + [CCode (cheader_filename = "devhelp/dh-app.h")] + public class App : Gtk.Application, GLib.ActionGroup, GLib.ActionMap { + [CCode (has_construct_function = false)] + public App (); + public void focus_search (); + public unowned Gtk.Window peek_assistant (); + public unowned Dh.BookManager peek_book_manager (); + public unowned Gtk.Window peek_first_window (); + public void quit (); + public void raise (); + public void search (string keyword); + public void search_assistant (string keyword); + [CCode (has_construct_function = false, type = "void")] + public App.window (Dh.App self); + } +#endif [CCode (cheader_filename = "devhelp/dh-assistant.h")] +#if HAS_DEVHELP36 + public class Assistant : Gtk.ApplicationWindow, Atk.Implementor, Gtk.Buildable, GLib.ActionGroup, GLib.ActionMap { + [CCode (has_construct_function = false, type = "GtkWidget*")] + public Assistant (Dh.App application); +#else public class Assistant : Gtk.Window, Atk.Implementor, Gtk.Buildable { - [CCode (type = "GtkWidget*", has_construct_function = false)] + [CCode (has_construct_function = false, type = "GtkWidget*")] public Assistant (Dh.Base @base); +#endif public bool search (string str); } [CCode (cheader_filename = "devhelp/dh-assistant-view.h")] - public class AssistantView : WebKit.WebView, Atk.Implementor, Gtk.Buildable { - [CCode (type = "GtkWidget*", has_construct_function = false)] + public class AssistantView : WebKit.WebView, Atk.Implementor, Gtk.Buildable, Gtk.Scrollable { + [CCode (has_construct_function = false, type = "GtkWidget*")] public AssistantView (); +#if HAS_DEVHELP36 + public unowned Dh.App peek_app (); +#else public unowned Dh.Base get_base (); +#endif public bool search (string str); +#if HAS_DEVHELP36 + public void set_app (Dh.App application); +#else public void set_base (Dh.Base @base); +#endif public bool set_link (Dh.Link link); } +#if !HAS_DEVHELP36 [CCode (cheader_filename = "devhelp/dh-base.h")] public class Base : GLib.Object { [CCode (has_construct_function = false)] @@ -31,33 +62,50 @@ [CCode (type = "GtkWidget*", has_construct_function = false)] public Base.window (Dh.Base @base); } +#endif [CCode (cheader_filename = "devhelp/dh-book.h")] public class Book : GLib.Object { [CCode (has_construct_function = false)] public Book (string book_path); public int cmp_by_name (Dh.Book b); + public int cmp_by_name_str (string b_name); public int cmp_by_path (Dh.Book b); + public int cmp_by_path_str (string b_path); public int cmp_by_title (Dh.Book b); + public unowned GLib.List get_completions (); public bool get_enabled (); public unowned GLib.List get_keywords (); + public unowned string get_language (); public unowned string get_name (); + public unowned string get_path (); public unowned string get_title (); public unowned GLib.Node get_tree (); public void set_enabled (bool enabled); + public virtual signal void deleted (); + public virtual signal void disabled (); + public virtual signal void enabled (); + public virtual signal void updated (); } [CCode (cheader_filename = "devhelp/dh-book-manager.h")] public class BookManager : GLib.Object { [CCode (has_construct_function = false)] public BookManager (); - public unowned Dh.Book get_book_by_name (string name); public unowned GLib.List get_books (); + public bool get_group_by_language (); + public unowned GLib.List get_languages (); public void populate (); - public void update (); - public virtual signal void disabled_book_list_updated (); + public void set_group_by_language (bool group_by_language); + public bool group_by_language { get; set; } + public virtual signal void book_created (GLib.Object p0); + public virtual signal void book_deleted (GLib.Object p0); + public virtual signal void book_disabled (GLib.Object p0); + public virtual signal void book_enabled (GLib.Object p0); + public virtual signal void language_disabled (string p0); + public virtual signal void language_enabled (string p0); } [CCode (cheader_filename = "devhelp/dh-book-tree.h")] - public class BookTree : Gtk.TreeView, Atk.Implementor, Gtk.Buildable { - [CCode (type = "GtkWidget*", has_construct_function = false)] + public class BookTree : Gtk.TreeView, Atk.Implementor, Gtk.Buildable, Gtk.Scrollable { + [CCode (has_construct_function = false, type = "GtkWidget*")] public BookTree (Dh.BookManager book_manager); public unowned string get_selected_book_title (); public void select_uri (string uri); @@ -67,15 +115,29 @@ public class KeywordModel : GLib.Object, Gtk.TreeModel { [CCode (has_construct_function = false)] public KeywordModel (); +#if HAS_DEVHELP36 + public unowned Dh.Link filter (string str, string book_id, string language); +#else public unowned Dh.Link filter (string str, string book_id); +#endif public void set_words (Dh.BookManager book_manager); } +#if HAS_DEVHELP36 + [CCode (cheader_filename = "devhelp/dh-language.h")] [Compact] - [CCode (cheader_filename = "devhelp/dh-keyword-model.h")] - public class KeywordModelPriv { + public class Language { + [CCode (has_construct_function = false)] + public Language (string name); + public int compare (Dh.Language language_b); + public int compare_by_name (string language_name_b); + public bool dec_n_books_enabled (); + public int get_n_books_enabled (); + public unowned string get_name (); + public void inc_n_books_enabled (); } +#endif + [CCode (cheader_filename = "devhelp/dh-link.h", ref_function = "dh_link_ref", type_id = "dh_link_get_type ()", unref_function = "dh_link_unref")] [Compact] - [CCode (ref_function = "dh_link_ref", unref_function = "dh_link_unref", type_id = "DH_TYPE_LINK", cheader_filename = "devhelp/dh-link.h")] public class Link { [CCode (has_construct_function = false)] public Link (Dh.LinkType type, string @base, string id, string name, Dh.Link book, Dh.Link page, string filename); @@ -93,36 +155,42 @@ } [CCode (cheader_filename = "devhelp/dh-search.h")] public class Search : Gtk.VBox, Atk.Implementor, Gtk.Buildable, Gtk.Orientable { - [CCode (type = "GtkWidget*", has_construct_function = false)] + [CCode (has_construct_function = false, type = "GtkWidget*")] public Search (Dh.BookManager book_manager); - public void set_search_string (string str, string book_id); + public void set_search_string (string str, string unused); public virtual signal void link_selected (void* link); } [CCode (cheader_filename = "devhelp/dh-window.h")] +#if HAS_DEVHELP36 + public class Window : Gtk.ApplicationWindow, Atk.Implementor, Gtk.Buildable, GLib.ActionGroup, GLib.ActionMap { + [CCode (has_construct_function = false, type = "GtkWidget*")] + public Window (Dh.App application); +#else public class Window : Gtk.Window, Atk.Implementor, Gtk.Buildable { - [CCode (type = "GtkWidget*", has_construct_function = false)] + [CCode (has_construct_function = false, type = "GtkWidget*")] public Window (Dh.Base @base); +#endif public void focus_search (); +#if HAS_DEVHELP36 + public void search (string str); +#else public void search (string str, string book_id); +#endif public virtual signal void open_link (string location, Dh.OpenLinkFlags flags); } - [Compact] - [CCode (cheader_filename = "devhelp/dh-window.h")] - public class WindowPriv { - } - [CCode (cprefix = "DH_ERROR_", has_type_id = false, cheader_filename = "devhelp/dh-error.h")] + [CCode (cheader_filename = "devhelp/dh-error.h", cprefix = "DH_ERROR_", has_type_id = false)] public enum Error { FILE_NOT_FOUND, MALFORMED_BOOK, INVALID_BOOK_TYPE, INTERNAL_ERROR } - [CCode (cprefix = "DH_LINK_FLAGS_", has_type_id = false, cheader_filename = "devhelp/dh-link.h")] + [CCode (cheader_filename = "devhelp/dh-link.h", cprefix = "DH_LINK_FLAGS_", has_type_id = false)] public enum LinkFlags { NONE, DEPRECATED } - [CCode (cprefix = "DH_LINK_TYPE_", has_type_id = false, cheader_filename = "devhelp/dh-link.h")] + [CCode (cheader_filename = "devhelp/dh-link.h", cprefix = "DH_LINK_TYPE_", has_type_id = false)] public enum LinkType { BOOK, PAGE, @@ -133,11 +201,13 @@ ENUM, TYPEDEF } - [CCode (cprefix = "DH_OPEN_LINK_NEW_", has_type_id = false, cheader_filename = "devhelp/dh-window.h")] + [CCode (cheader_filename = "devhelp/dh-link.h", cprefix = "DH_OPEN_LINK_NEW_", has_type_id = false)] public enum OpenLinkFlags { WINDOW, TAB } - [CCode (cheader_filename = "dl-error.h")] + [CCode (cheader_filename = "devhelp/dh-error.h")] public static GLib.Quark error_quark (); + [CCode (cheader_filename = "devhelp/devhelp.h")] + public static void init (); }