[vala/0.14] girparser: Add has_type_id=false for structs without registered GType



commit 29b2d5b1f632a9fb689ee01a902c39a08184751a
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun Oct 9 11:04:54 2011 +0200

    girparser: Add has_type_id=false for structs without registered GType
    
    Fixes regressions introduced by the switch to gir.
    
    Fixes bug 661291.

 vala/valagirparser.vala  |    6 ++++++
 vapi/clutter-1.0.vapi    |   26 +++++++++++++-------------
 vapi/gdk-3.0.vapi        |    2 +-
 vapi/gdk-pixbuf-2.0.vapi |    2 +-
 vapi/libgdata.vapi       |    2 +-
 vapi/libsoup-2.4.vapi    |    4 ++--
 vapi/mx-1.0.vapi         |    4 ++--
 vapi/vte-2.90.vapi       |    2 +-
 8 files changed, 27 insertions(+), 21 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index be3d241..3597b26 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -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;
 		}
diff --git a/vapi/clutter-1.0.vapi b/vapi/clutter-1.0.vapi
index 0ca8f1a..cbe69af 100644
--- a/vapi/clutter-1.0.vapi
+++ b/vapi/clutter-1.0.vapi
@@ -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;
diff --git a/vapi/gdk-3.0.vapi b/vapi/gdk-3.0.vapi
index bb71989..3ca9857 100644
--- a/vapi/gdk-3.0.vapi
+++ b/vapi/gdk-3.0.vapi
@@ -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;
diff --git a/vapi/gdk-pixbuf-2.0.vapi b/vapi/gdk-pixbuf-2.0.vapi
index 523c156..b4d0d90 100644
--- a/vapi/gdk-pixbuf-2.0.vapi
+++ b/vapi/gdk-pixbuf-2.0.vapi
@@ -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 ();
diff --git a/vapi/libgdata.vapi b/vapi/libgdata.vapi
index 6eee125..c9066de 100644
--- a/vapi/libgdata.vapi
+++ b/vapi/libgdata.vapi
@@ -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;
diff --git a/vapi/libsoup-2.4.vapi b/vapi/libsoup-2.4.vapi
index cfcf119..6ae2581 100644
--- a/vapi/libsoup-2.4.vapi
+++ b/vapi/libsoup-2.4.vapi
@@ -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;
diff --git a/vapi/mx-1.0.vapi b/vapi/mx-1.0.vapi
index 9565d1d..8454451 100644
--- a/vapi/mx-1.0.vapi
+++ b/vapi/mx-1.0.vapi
@@ -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_")]
diff --git a/vapi/vte-2.90.vapi b/vapi/vte-2.90.vapi
index 449d024..14816e2 100644
--- a/vapi/vte-2.90.vapi
+++ b/vapi/vte-2.90.vapi
@@ -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_")]



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