[vala/staging] girparser: Support new gir format (deprecated, doc-version, doc-deprecated)



commit aa6c377fc4ce99db76db24c9eaf7db493c561b70
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun Oct 20 12:37:05 2013 +0200

    girparser: Support new gir format (deprecated, doc-version, doc-deprecated)

 vala/valagirparser.vala |   20 +++++++++++++++++++-
 vapi/atk.vapi           |   17 +++++++++++++++++
 vapi/gdl-3.0.vapi       |    4 ++++
 vapi/gio-2.0.vapi       |    5 +++++
 vapi/gtk+-3.0.vapi      |    2 +-
 vapi/libsoup-2.4.vapi   |   12 ++++++++++++
 vapi/libwnck-3.0.vapi   |    3 +++
 vapi/poppler-glib.vapi  |    1 +
 8 files changed, 62 insertions(+), 2 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 8413e9e..e685706 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1041,7 +1041,11 @@ public class Vala.GirParser : CodeVisitor {
                                } else if (girdata["deprecated-version"] != null) {
                                        symbol.set_attribute_string ("Deprecated", "since", girdata.get 
("deprecated-version"));
                                }
-                               if (metadata.get_bool (ArgumentType.DEPRECATED)) {
+                               if (metadata.has_argument (ArgumentType.DEPRECATED)) {
+                                       if (metadata.get_bool (ArgumentType.DEPRECATED)) {                    
                          
+                                               symbol.set_attribute ("Deprecated", true);
+                                       }
+                               } else if (girdata["deprecated"] != null) {
                                        symbol.set_attribute ("Deprecated", true);
                                }
 
@@ -2025,7 +2029,15 @@ public class Vala.GirParser : CodeVisitor {
                }
        }
 
+       void skip_other_docs () {
+               while (current_token == MarkupTokenType.START_ELEMENT && (reader.name == "doc-deprecated" || 
reader.name == "doc-version")) {
+                       skip_element ();
+               }
+       }
+
        GirComment? parse_symbol_doc () {
+               skip_other_docs ();
+
                if (reader.name != "doc") {
                        return null;
                }
@@ -2041,10 +2053,14 @@ public class Vala.GirParser : CodeVisitor {
                }
 
                end_element ("doc");
+
+               skip_other_docs ();
                return comment;
        }
 
        Comment? parse_doc () {
+               skip_other_docs ();
+
                if (reader.name != "doc") {
                        return null;
                }
@@ -2060,6 +2076,8 @@ public class Vala.GirParser : CodeVisitor {
                }
 
                end_element ("doc");
+
+               skip_other_docs ();
                return comment;
        }
 
diff --git a/vapi/atk.vapi b/vapi/atk.vapi
index 4050c03..6614b4b 100644
--- a/vapi/atk.vapi
+++ b/vapi/atk.vapi
@@ -23,6 +23,7 @@ namespace Atk {
                public virtual int get_start_index ();
                public virtual string get_uri (int i);
                public bool is_inline ();
+               [Deprecated]
                public virtual bool is_selected_link ();
                public virtual bool is_valid ();
                [NoWrapper]
@@ -30,6 +31,7 @@ namespace Atk {
                public int end_index { get; }
                [NoAccessorMethod]
                public int number_of_anchors { get; }
+               [Deprecated]
                [NoAccessorMethod]
                public bool selected_link { get; }
                public int start_index { get; }
@@ -67,7 +69,9 @@ namespace Atk {
                public virtual Atk.AttributeSet get_attributes ();
                public virtual unowned string get_description ();
                public virtual int get_index_in_parent ();
+               [Deprecated]
                public virtual Atk.Layer get_layer ();
+               [Deprecated]
                public virtual int get_mdi_zorder ();
                public int get_n_accessible_children ();
                [NoWrapper]
@@ -119,6 +123,7 @@ namespace Atk {
                public double accessible_value { get; set; }
                public virtual signal void active_descendant_changed (void* child);
                public virtual signal void children_changed (uint change_index, void* changed_child);
+               [Deprecated]
                public virtual signal void focus_event (bool focus_in);
                public signal void property_change (void* arg1);
                public virtual signal void state_change (string name, bool state_set);
@@ -226,14 +231,17 @@ namespace Atk {
                [CCode (has_construct_function = false)]
                protected Util ();
                [CCode (cheader_filename = "atk/atk.h", cname = "atk_add_focus_tracker")]
+               [Deprecated]
                public static uint add_focus_tracker (Atk.EventListener focus_tracker);
                [CCode (cheader_filename = "atk/atk.h", cname = "atk_add_global_event_listener")]
                public static uint add_global_event_listener ([CCode (type = "GSignalEmissionHook")] 
Atk.SignalEmissionHook listener, string event_type);
                [CCode (cheader_filename = "atk/atk.h", cname = "atk_add_key_event_listener")]
                public static uint add_key_event_listener (Atk.KeySnoopFunc listener);
                [CCode (cheader_filename = "atk/atk.h", cname = "atk_focus_tracker_init")]
+               [Deprecated]
                public static void focus_tracker_init (Atk.EventListenerInit init);
                [CCode (cheader_filename = "atk/atk.h", cname = "atk_focus_tracker_notify")]
+               [Deprecated]
                public static void focus_tracker_notify (Atk.Object object);
                [CCode (cheader_filename = "atk/atk.h", cname = "atk_get_focus_object")]
                public static unowned Atk.Object get_focus_object ();
@@ -246,6 +254,7 @@ namespace Atk {
                [CCode (cheader_filename = "atk/atk.h", cname = "atk_get_version")]
                public static unowned string get_version ();
                [CCode (cheader_filename = "atk/atk.h", cname = "atk_remove_focus_tracker")]
+               [Deprecated]
                public static void remove_focus_tracker (uint tracker_id);
                [CCode (cheader_filename = "atk/atk.h", cname = "atk_remove_global_event_listener")]
                public static void remove_global_event_listener (uint listener_id);
@@ -264,6 +273,7 @@ namespace Atk {
        }
        [CCode (cheader_filename = "atk/atk.h", type_id = "atk_component_get_type ()")]
        public interface Component : GLib.Object {
+               [Deprecated]
                public abstract uint add_focus_handler (Atk.FocusHandler handler);
                public abstract bool contains (int x, int y, Atk.CoordType coord_type);
                public abstract double get_alpha ();
@@ -274,6 +284,7 @@ namespace Atk {
                public abstract void get_size (int width, int height);
                public abstract bool grab_focus ();
                public abstract Atk.Object ref_accessible_at_point (int x, int y, Atk.CoordType coord_type);
+               [Deprecated]
                public abstract void remove_focus_handler (uint handler_id);
                public abstract bool set_extents (int x, int y, int width, int height, Atk.CoordType 
coord_type);
                public abstract bool set_position (int x, int y, Atk.CoordType coord_type);
@@ -291,6 +302,7 @@ namespace Atk {
                public virtual unowned string get_document_locale ();
                public virtual unowned string get_document_type ();
                [CCode (vfunc_name = "get_document_locale")]
+               [Deprecated]
                public virtual unowned string get_locale ();
                [CCode (vfunc_name = "set_document_attribute")]
                public virtual bool set_attribute_value (string attribute_name, string attribute_value);
@@ -414,14 +426,18 @@ namespace Atk {
                public abstract string get_selection (int selection_num, out int start_offset, out int 
end_offset);
                public abstract string get_string_at_offset (int offset, Atk.TextGranularity granularity, out 
int start_offset, out int end_offset);
                public abstract string get_text (int start_offset, int end_offset);
+               [Deprecated]
                public abstract string get_text_after_offset (int offset, Atk.TextBoundary boundary_type, out 
int start_offset, out int end_offset);
+               [Deprecated]
                public abstract string get_text_at_offset (int offset, Atk.TextBoundary boundary_type, out 
int start_offset, out int end_offset);
+               [Deprecated]
                public abstract string get_text_before_offset (int offset, Atk.TextBoundary boundary_type, 
out int start_offset, out int end_offset);
                public abstract bool remove_selection (int selection_num);
                public abstract bool set_caret_offset (int offset);
                public abstract bool set_selection (int selection_num, int start_offset, int end_offset);
                public virtual signal void text_attributes_changed ();
                public virtual signal void text_caret_moved (int location);
+               [Deprecated]
                public virtual signal void text_changed (int position, int length);
                public signal void text_insert (int arg1, int arg2, string arg3);
                public signal void text_remove (int arg1, int arg2, string arg3);
@@ -784,6 +800,7 @@ namespace Atk {
        [CCode (cheader_filename = "atk/atk.h", has_target = false)]
        public delegate void EventListenerInit ();
        [CCode (cheader_filename = "atk/atk.h", has_target = false)]
+       [Deprecated]
        public delegate void FocusHandler (Atk.Object object, bool focus_in);
        [CCode (cheader_filename = "atk/atk.h", instance_pos = 0.9)]
        public delegate bool Function ();
diff --git a/vapi/gdl-3.0.vapi b/vapi/gdl-3.0.vapi
index 8488adb..7fbf9d0 100644
--- a/vapi/gdl-3.0.vapi
+++ b/vapi/gdl-3.0.vapi
@@ -241,7 +241,9 @@ namespace Gdl {
        [CCode (cheader_filename = "gdl/gdl.h", type_id = "gdl_dock_placeholder_get_type ()")]
        public class DockPlaceholder : Gdl.DockObject, Atk.Implementor, Gtk.Buildable {
                [CCode (has_construct_function = false, type = "GtkWidget*")]
+               [Deprecated]
                public DockPlaceholder (string name, Gdl.DockObject object, Gdl.DockPlacement position, bool 
sticky);
+               [Deprecated]
                public void attach (Gdl.DockObject object);
                [NoAccessorMethod]
                public bool floating { get; construct; }
@@ -270,7 +272,9 @@ namespace Gdl {
                [CCode (has_construct_function = false, type = "GtkWidget*")]
                [Deprecated (since = "3.6")]
                public DockTablabel (Gdl.DockItem item);
+               [Deprecated]
                public void activate ();
+               [Deprecated]
                public void deactivate ();
                [NoAccessorMethod]
                public Gdl.DockItem item { owned get; set; }
diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi
index 51581e9..2846c1c 100644
--- a/vapi/gio-2.0.vapi
+++ b/vapi/gio-2.0.vapi
@@ -1227,10 +1227,14 @@ namespace GLib {
        [Compact]
        public class IOSchedulerJob {
                [CCode (cheader_filename = "gio/gio.h", cname = "g_io_scheduler_cancel_all_jobs")]
+               [Deprecated]
                public static void cancel_all ();
                [CCode (cheader_filename = "gio/gio.h", cname = "g_io_scheduler_push_job")]
+               [Deprecated]
                public static void push ([CCode (delegate_target_pos = 1.33333, destroy_notify_pos = 
1.66667)] owned GLib.IOSchedulerJobFunc job_func, int io_priority, GLib.Cancellable? cancellable = null);
+               [Deprecated]
                public bool send_to_mainloop (owned GLib.SourceFunc func);
+               [Deprecated]
                public void send_to_mainloop_async (owned GLib.SourceFunc func);
        }
        [CCode (cheader_filename = "gio/gio.h")]
@@ -1734,6 +1738,7 @@ namespace GLib {
                public bool has_unapplied { get; }
                [NoAccessorMethod]
                public string path { owned get; construct; }
+               [Deprecated]
                [NoAccessorMethod]
                public string schema { owned get; construct; }
                [NoAccessorMethod]
diff --git a/vapi/gtk+-3.0.vapi b/vapi/gtk+-3.0.vapi
index b49257c..b792ccf 100644
--- a/vapi/gtk+-3.0.vapi
+++ b/vapi/gtk+-3.0.vapi
@@ -1,4 +1,4 @@
-/* gtk+-3.0.vapi generated by lt-vapigen, do not modify. */
+/* gtk+-3.0.vapi generated by vapigen, do not modify. */
 
 [CCode (gir_namespace = "Gtk", gir_version = "3.0")]
 namespace Gtk {
diff --git a/vapi/libsoup-2.4.vapi b/vapi/libsoup-2.4.vapi
index a0dff08..78c0dbe 100644
--- a/vapi/libsoup-2.4.vapi
+++ b/vapi/libsoup-2.4.vapi
@@ -314,6 +314,7 @@ namespace Soup {
                public GLib.SList<Soup.Cookie> get_cookie_list (Soup.URI uri, bool for_http);
                public string get_cookies (Soup.URI uri, bool for_http);
                public virtual bool is_persistent ();
+               [Deprecated]
                public virtual void save ();
                public void set_accept_policy (Soup.CookieJarAcceptPolicy policy);
                public void set_cookie (Soup.URI uri, string cookie);
@@ -401,6 +402,7 @@ namespace Soup {
                public unowned Soup.Request get_soup_request ();
                public unowned Soup.URI get_uri ();
                public bool is_keepalive ();
+               [Deprecated]
                public void set_chunk_allocator (owned Soup.ChunkAllocator allocator);
                public void set_first_party (Soup.URI first_party);
                public void set_flags (Soup.MessageFlags flags);
@@ -487,6 +489,7 @@ namespace Soup {
                public void @foreach (Soup.MessageHeadersForeachFunc func);
                public void free ();
                public void free_ranges (Soup.Range ranges);
+               [Deprecated]
                public unowned string @get (string name);
                public bool get_content_disposition (out string disposition, out 
GLib.HashTable<string,string> @params);
                public int64 get_content_length ();
@@ -693,6 +696,7 @@ namespace Soup {
                public GLib.ProxyResolver proxy_resolver { owned get; set; }
                [NoAccessorMethod]
                public Soup.URI proxy_uri { owned get; set; }
+               [Deprecated]
                [NoAccessorMethod]
                public string ssl_ca_file { owned get; set; }
                [NoAccessorMethod]
@@ -703,6 +707,7 @@ namespace Soup {
                public uint timeout { get; set; }
                [NoAccessorMethod]
                public GLib.TlsDatabase tls_database { owned get; set; }
+               [Deprecated]
                [NoAccessorMethod]
                public bool use_ntlm { get; set; }
                [NoAccessorMethod]
@@ -719,15 +724,19 @@ namespace Soup {
        [CCode (cheader_filename = "libsoup/soup.h", type_id = "soup_session_async_get_type ()")]
        public class SessionAsync : Soup.Session {
                [CCode (has_construct_function = false, type = "SoupSession*")]
+               [Deprecated]
                public SessionAsync ();
                [CCode (has_construct_function = false, type = "SoupSession*")]
+               [Deprecated]
                public SessionAsync.with_options (string optname1, ...);
        }
        [CCode (cheader_filename = "libsoup/soup.h", type_id = "soup_session_sync_get_type ()")]
        public class SessionSync : Soup.Session {
                [CCode (has_construct_function = false, type = "SoupSession*")]
+               [Deprecated]
                public SessionSync ();
                [CCode (has_construct_function = false, type = "SoupSession*")]
+               [Deprecated]
                public SessionSync.with_options (string optname1, ...);
        }
        [CCode (cheader_filename = "libsoup/soup.h", type_id = "soup_socket_get_type ()")]
@@ -839,7 +848,9 @@ namespace Soup {
        }
        [CCode (cheader_filename = "libsoup/soup.h", type_cname = "SoupProxyURIResolverInterface", type_id = 
"soup_proxy_uri_resolver_get_type ()")]
        public interface ProxyURIResolver : Soup.SessionFeature, GLib.Object {
+               [Deprecated]
                public abstract void get_proxy_uri_async (Soup.URI uri, GLib.MainContext? async_context, 
GLib.Cancellable? cancellable, [CCode (scope = "async")] owned Soup.ProxyURIResolverCallback callback);
+               [Deprecated]
                public abstract uint get_proxy_uri_sync (Soup.URI uri, GLib.Cancellable? cancellable, out 
Soup.URI proxy_uri);
        }
        [CCode (cheader_filename = "libsoup/soup.h", type_cname = "SoupSessionFeatureInterface", type_id = 
"soup_session_feature_get_type ()")]
@@ -1158,6 +1169,7 @@ namespace Soup {
        [CCode (cheader_filename = "libsoup/soup.h", instance_pos = 3.9)]
        public delegate bool AuthDomainGenericAuthCallback (Soup.AuthDomain domain, Soup.Message msg, string 
username);
        [CCode (cheader_filename = "libsoup/soup.h", instance_pos = 2.9)]
+       [Deprecated]
        public delegate Soup.Buffer ChunkAllocator (Soup.Message msg, size_t max_len);
        [CCode (cheader_filename = "libsoup/soup.h", instance_pos = 2.9)]
        public delegate Soup.LoggerLogLevel LoggerFilter (Soup.Logger logger, Soup.Message msg);
diff --git a/vapi/libwnck-3.0.vapi b/vapi/libwnck-3.0.vapi
index b2cd760..286fab1 100644
--- a/vapi/libwnck-3.0.vapi
+++ b/vapi/libwnck-3.0.vapi
@@ -64,9 +64,11 @@ namespace Wnck {
        public class Screen : GLib.Object {
                [CCode (has_construct_function = false)]
                protected Screen ();
+               [Deprecated]
                public void calc_workspace_layout (int num_workspaces, int space_index, Wnck.WorkspaceLayout 
layout);
                public void change_workspace_count (int count);
                public void force_update ();
+               [Deprecated]
                public static void free_workspace_layout (Wnck.WorkspaceLayout layout);
                public static unowned Wnck.Screen @get (int index);
                public unowned Wnck.Window get_active_window ();
@@ -254,6 +256,7 @@ namespace Wnck {
                public static Wnck.ResourceUsage xid_read (Gdk.Display gdk_display, ulong xid);
        }
        [CCode (cheader_filename = "libwnck/libwnck.h", has_type_id = false)]
+       [Deprecated]
        public struct WorkspaceLayout {
                public int rows;
                public int cols;
diff --git a/vapi/poppler-glib.vapi b/vapi/poppler-glib.vapi
index 48df6db..bd7de1b 100644
--- a/vapi/poppler-glib.vapi
+++ b/vapi/poppler-glib.vapi
@@ -425,6 +425,7 @@ namespace Poppler {
                public void render_for_printing_with_options ([CCode (type = "cairo_t*")] Cairo.Context 
cairo, Poppler.PrintFlags options);
                public void render_selection ([CCode (type = "cairo_t*")] Cairo.Context cairo, 
Poppler.Rectangle selection, Poppler.Rectangle old_selection, Poppler.SelectionStyle style, Poppler.Color 
glyph_color, Poppler.Color background_color);
                public void render_to_ps (Poppler.PSFile ps_file);
+               [Deprecated]
                public static void selection_region_free (GLib.List<Poppler.Rectangle> region);
                public string label { owned get; }
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]