vala r808 - in trunk: . vala vapi vapi/packages/gdk-2.0 vapigen



Author: juergbi
Date: Tue Jan  8 17:26:45 2008
New Revision: 808
URL: http://svn.gnome.org/viewvc/vala?rev=808&view=rev

Log:
2008-01-08  Juerg Billeter  <j bitron ch>

	* vala/valainterfacewriter.vala, vala/valastruct.vala,
	  vapigen/valagidlparser.vala: support simple_type attribute in metadata

	* vapi/packages/gdk-2.0/gdk-2.0.metadata: mark GdkAtom as simple type

	* vapi/gdk-2.0.vapi: regenerated


Modified:
   trunk/ChangeLog
   trunk/vala/valainterfacewriter.vala
   trunk/vala/valastruct.vala
   trunk/vapi/gdk-2.0.vapi
   trunk/vapi/packages/gdk-2.0/gdk-2.0.metadata
   trunk/vapigen/valagidlparser.vala

Modified: trunk/vala/valainterfacewriter.vala
==============================================================================
--- trunk/vala/valainterfacewriter.vala	(original)
+++ trunk/vala/valainterfacewriter.vala	Tue Jan  8 17:26:45 2008
@@ -1,6 +1,6 @@
 /* valainterfacewriter.vala
  *
- * Copyright (C) 2006-2007  JÃrg Billeter, Raffaele Sandrini
+ * Copyright (C) 2006-2008  JÃrg Billeter, Raffaele Sandrini
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -201,6 +201,12 @@
 		write_string ("[CCode (cheader_filename = \"%s\")]".printf (cheaders));
 		write_newline ();
 
+		if (st.is_simple_type ()) {
+			write_indent ();
+			write_string ("[SimpleType]");
+			write_newline ();
+		}
+
 		write_indent ();
 		write_accessibility (st);
 		write_string ("struct ");

Modified: trunk/vala/valastruct.vala
==============================================================================
--- trunk/vala/valastruct.vala	(original)
+++ trunk/vala/valastruct.vala	Tue Jan  8 17:26:45 2008
@@ -1,6 +1,6 @@
 /* valastruct.vala
  *
- * Copyright (C) 2006-2007  JÃrg Billeter
+ * Copyright (C) 2006-2008  JÃrg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -402,6 +402,14 @@
 		return simple_type;
 	}
 
+	/**
+	 * Marks this struct as simple type, i.e. instances will be passed by
+	 * value.
+	 */
+	public void set_simple_type (bool simple_type) {
+		this.simple_type = simple_type;
+	}
+
 	public override void replace_type (DataType! old_type, DataType! new_type) {
 		for (int i = 0; i < base_types.size; i++) {
 			if (base_types[i] == old_type) {

Modified: trunk/vapi/gdk-2.0.vapi
==============================================================================
--- trunk/vapi/gdk-2.0.vapi	(original)
+++ trunk/vapi/gdk-2.0.vapi	Tue Jan  8 17:26:45 2008
@@ -1603,6 +1603,7 @@
 		public void withdraw ();
 	}
 	[CCode (cheader_filename = "gdk/gdk.h")]
+	[SimpleType]
 	public struct Atom {
 		public static Gdk.Atom intern (string atom_name, bool only_if_exists);
 		public static Gdk.Atom intern_static_string (string atom_name);

Modified: trunk/vapi/packages/gdk-2.0/gdk-2.0.metadata
==============================================================================
--- trunk/vapi/packages/gdk-2.0/gdk-2.0.metadata	(original)
+++ trunk/vapi/packages/gdk-2.0/gdk-2.0.metadata	Tue Jan  8 17:26:45 2008
@@ -1,5 +1,5 @@
 Gdk cheader_filename="gdk/gdk.h"
-GdkAtom is_value_type="1"
+GdkAtom is_value_type="1" simple_type="1"
 gdk_cairo_create transfer_ownership="1"
 GdkColor is_value_type="1"
 gdk_color_parse.color is_out="1"

Modified: trunk/vapigen/valagidlparser.vala
==============================================================================
--- trunk/vapigen/valagidlparser.vala	(original)
+++ trunk/vapigen/valagidlparser.vala	Tue Jan  8 17:26:45 2008
@@ -336,6 +336,10 @@
 							if (eval (nv[1]) == "1") {
 								return;
 							}
+						} else if (nv[0] == "simple_type") {
+							if (eval (nv[1]) == "1") {
+								st.set_simple_type (true);
+							}
 						}
 					}
 				}



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