]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Add has_type_id=false for structs without registered GType
authorLuca Bruno <lucabru@src.gnome.org>
Sun, 9 Oct 2011 09:04:54 +0000 (11:04 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 30 Nov 2011 13:28:12 +0000 (14:28 +0100)
Fixes regressions introduced by the switch to gir.

Fixes bug 661291.

vala/valagirparser.vala
vapi/clutter-1.0.vapi
vapi/gdk-3.0.vapi
vapi/gdk-pixbuf-2.0.vapi
vapi/libgdata.vapi
vapi/libsoup-2.4.vapi
vapi/mx-1.0.vapi
vapi/vte-2.90.vapi

index be3d241e906c1aa3fd6bc1f6147a46d5c1a2ab76..3597b2673eb849d2ab96647aaab4c17218ff56e2 100644 (file)
@@ -2306,6 +2306,12 @@ public class Vala.GirParser : CodeVisitor {
                if (current.new_symbol) {
                        st = new Struct (element_get_name (), current.source_reference);
                        current.symbol = st;
+                       var type_id = reader.get_attribute ("glib:get-type");
+                       if (type_id == null) {
+                               st.set_attribute_bool ("CCode", "has_type_id", false);
+                       } else {
+                               st.set_attribute_string ("CCode", "type_id", "%s ()".printf (type_id));
+                       }
                } else {
                        st = (Struct) current.symbol;
                }
index 0ca8f1a582d51601c1194b0b70787b9e248e72fd..cbe69afdde35546fc81d345334f265798351a2bf 100644 (file)
@@ -1965,7 +1965,7 @@ namespace Clutter {
                public void set_size (float width, float height);
                public Clutter.ActorBox union (Clutter.ActorBox b);
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", has_type_id = false)]
        public struct AnyEvent {
                public Clutter.EventType type;
                public uint32 time;
@@ -1973,7 +1973,7 @@ namespace Clutter {
                public weak Clutter.Stage stage;
                public weak Clutter.Actor source;
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", has_type_id = false)]
        public struct ButtonEvent {
                public Clutter.EventType type;
                public uint32 time;
@@ -2017,7 +2017,7 @@ namespace Clutter {
                public uint32 to_pixel ();
                public string to_string ();
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", has_type_id = false)]
        public struct CrossingEvent {
                public Clutter.EventType type;
                public uint32 time;
@@ -2029,12 +2029,12 @@ namespace Clutter {
                public weak Clutter.InputDevice device;
                public weak Clutter.Actor related;
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_fog_get_type ()")]
        public struct Fog {
                public float z_near;
                public float z_far;
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_geometry_get_type ()")]
        public struct Geometry {
                public int x;
                public int y;
@@ -2043,7 +2043,7 @@ namespace Clutter {
                public bool intersects (Clutter.Geometry geometry1);
                public Clutter.Geometry union (Clutter.Geometry geometry_b);
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", has_type_id = false)]
        public struct KeyEvent {
                public Clutter.EventType type;
                public uint32 time;
@@ -2056,7 +2056,7 @@ namespace Clutter {
                public unichar unicode_value;
                public weak Clutter.InputDevice device;
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_knot_get_type ()")]
        public struct Knot {
                public int x;
                public int y;
@@ -2064,7 +2064,7 @@ namespace Clutter {
                public bool equal (Clutter.Knot knot_b);
                public void free ();
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", has_type_id = false)]
        public struct MotionEvent {
                public Clutter.EventType type;
                public uint32 time;
@@ -2077,7 +2077,7 @@ namespace Clutter {
                public double axes;
                public weak Clutter.InputDevice device;
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_path_node_get_type ()")]
        public struct PathNode {
                public Clutter.PathNodeType type;
                [CCode (array_length = false, array_null_terminated = true)]
@@ -2086,14 +2086,14 @@ namespace Clutter {
                public bool equal (Clutter.PathNode node_b);
                public void free ();
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_perspective_get_type ()")]
        public struct Perspective {
                public float fovy;
                public float aspect;
                public float z_near;
                public float z_far;
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", has_type_id = false)]
        public struct ScrollEvent {
                public Clutter.EventType type;
                public uint32 time;
@@ -2107,7 +2107,7 @@ namespace Clutter {
                public double axes;
                public weak Clutter.InputDevice device;
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", has_type_id = false)]
        public struct StageStateEvent {
                public Clutter.EventType type;
                public uint32 time;
@@ -2138,7 +2138,7 @@ namespace Clutter {
                public float to_pixels ();
                public string to_string ();
        }
-       [CCode (cheader_filename = "clutter/clutter.h")]
+       [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_vertex_get_type ()")]
        public struct Vertex {
                public float x;
                public float y;
index bb71989b70bb6c2c0cbf5b96a215c61e0486ca93..3ca98577214e46e6f7423195be71c48402b5c418 100644 (file)
@@ -176,7 +176,7 @@ namespace Gdk {
                public unowned GLib.List list_targets ();
                public void set_device (Gdk.Device device);
        }
-       [CCode (cheader_filename = "gdk/gdk.h", copy_function = "gdk_event_copy")]
+       [CCode (cheader_filename = "gdk/gdk.h", copy_function = "gdk_event_copy", type_id = "gdk_event_get_type ()")]
        [Compact]
        public class Event {
                public Gdk.EventAny any;
index 523c156d76599b5c597b4b4a8046f3ee26e78bfb..b4d0d90c2bff535c1afe0bbdce983650cd17397d 100644 (file)
@@ -93,7 +93,7 @@ namespace Gdk {
                public unowned Gdk.Pixbuf get_pixbuf ();
                public bool on_currently_loading_frame ();
        }
-       [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h", copy_function = "gdk_pixbuf_format_copy")]
+       [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h", copy_function = "gdk_pixbuf_format_copy", type_id = "gdk_pixbuf_format_get_type ()")]
        [Compact]
        public class PixbufFormat {
                public unowned Gdk.PixbufFormat copy ();
index 6eee125baef40158acb08da5a256a6bafac21001..c9066decf6faa7970dc98ff55b9a8c6ea6fe83ee 100644 (file)
@@ -1537,7 +1537,7 @@ namespace GData {
                [NoWrapper]
                public abstract int compare_with (GData.Comparable other);
        }
-       [CCode (cheader_filename = "gdata/gdata.h")]
+       [CCode (cheader_filename = "gdata/gdata.h", type_id = "gdata_color_get_type ()")]
        public struct Color {
                public uint16 red;
                public uint16 green;
index cfcf1197699019e80e28c58f9975a5762d479eb8..6ae2581c09fede711526355567eb4f10a140e1fe 100644 (file)
@@ -671,14 +671,14 @@ namespace Soup {
                [NoWrapper]
                public abstract void request_unqueued (Soup.Session session, Soup.Message msg);
        }
-       [CCode (cheader_filename = "libsoup/soup.h")]
+       [CCode (cheader_filename = "libsoup/soup.h", has_type_id = false)]
        public struct MessageHeadersIter {
                [CCode (array_length = false, array_null_terminated = true)]
                public weak void*[] dummy;
                public void init (Soup.MessageHeaders hdrs);
                public bool next (out unowned string name, out unowned string value);
        }
-       [CCode (cheader_filename = "libsoup/soup.h")]
+       [CCode (cheader_filename = "libsoup/soup.h", has_type_id = false)]
        public struct Range {
                public int64 start;
                public int64 end;
index 9565d1da1254ef67b119529ba2e0c7b6b1dabdd4..84544519640b9fd2a7e211562db1ddc24befdd84 100644 (file)
@@ -1165,14 +1165,14 @@ namespace Mx {
                [HasEmitter]
                public virtual signal void style_changed (Mx.StyleChangedFlags flags);
        }
-       [CCode (cheader_filename = "mx/mx.h")]
+       [CCode (cheader_filename = "mx/mx.h", type_id = "mx_padding_get_type ()")]
        public struct Padding {
                public float top;
                public float right;
                public float bottom;
                public float left;
        }
-       [CCode (cheader_filename = "mx/mx.h")]
+       [CCode (cheader_filename = "mx/mx.h", has_type_id = false)]
        public struct SettingsProviderIface {
        }
        [CCode (cheader_filename = "mx/mx.h", cprefix = "MX_ACTOR_MANAGER_")]
index 449d02417192271d3c4341dc23f99133ccaa89df..14816e27f2ceed8643052db4c8ed3670db8a74ca 100644 (file)
@@ -179,7 +179,7 @@ namespace Vte {
                public virtual signal void text_scrolled (int delta);
                public virtual signal void window_title_changed ();
        }
-       [CCode (cheader_filename = "vte/vte.h", cname = "_VteCharAttributes")]
+       [CCode (cheader_filename = "vte/vte.h", cname = "_VteCharAttributes", has_type_id = false)]
        public struct _CharAttributes {
        }
        [CCode (cheader_filename = "vte/vte.h", cprefix = "VTE_PTY_ERROR_")]