vala r2426 - in trunk: . vala vapigen



Author: juergbi
Date: Wed Feb 11 00:43:44 2009
New Revision: 2426
URL: http://svn.gnome.org/viewvc/vala?rev=2426&view=rev

Log:
2009-02-11  JÃrg Billeter  <j bitron ch>

	* vala/valaenum.vala:
	* vala/valainterface.vala:
	* vala/valastruct.vala:
	* vapigen/valagirparser.vala:

	Recognize c:type attributes in .gir


Modified:
   trunk/ChangeLog
   trunk/vala/valaenum.vala
   trunk/vala/valainterface.vala
   trunk/vala/valastruct.vala
   trunk/vapigen/valagirparser.vala

Modified: trunk/vala/valaenum.vala
==============================================================================
--- trunk/vala/valaenum.vala	(original)
+++ trunk/vala/valaenum.vala	Wed Feb 11 00:43:44 2009
@@ -132,6 +132,10 @@
 		return cname;
 	}
 
+	public void set_cname (string cname) {
+		this.cname = cname;
+	}
+
 	public override string get_lower_case_cprefix () {
 		if (lower_case_cprefix == null) {
 			lower_case_cprefix = "%s_".printf (get_lower_case_cname (null));

Modified: trunk/vala/valainterface.vala
==============================================================================
--- trunk/vala/valainterface.vala	(original)
+++ trunk/vala/valainterface.vala	Wed Feb 11 00:43:44 2009
@@ -1,6 +1,6 @@
 /* valainterface.vala
  *
- * Copyright (C) 2006-2008  JÃrg Billeter
+ * Copyright (C) 2006-2009  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
@@ -263,6 +263,10 @@
 		}
 		return cname;
 	}
+
+	public void set_cname (string cname) {
+		this.cname = cname;
+	}
 	
 	/**
 	 * Returns the string to be prepended to the name of members of this

Modified: trunk/vala/valastruct.vala
==============================================================================
--- trunk/vala/valastruct.vala	(original)
+++ trunk/vala/valastruct.vala	Wed Feb 11 00:43:44 2009
@@ -229,6 +229,10 @@
 		return cname;
 	}
 
+	public void set_cname (string cname) {
+		this.cname = cname;
+	}
+
 	/**
 	 * Returns the default name of this struct as it is used in C code.
 	 *

Modified: trunk/vapigen/valagirparser.vala
==============================================================================
--- trunk/vapigen/valagirparser.vala	(original)
+++ trunk/vapigen/valagirparser.vala	Wed Feb 11 00:43:44 2009
@@ -242,6 +242,12 @@
 		start_element ("enumeration");
 		var en = new Enum (reader.get_attribute ("name"), get_current_src ());
 		en.access = SymbolAccessibility.PUBLIC;
+
+		string enum_cname = reader.get_attribute ("c:type");
+		if (enum_cname != null) {
+			en.set_cname (enum_cname);
+		}
+
 		next ();
 
 		string common_prefix = null;
@@ -476,6 +482,11 @@
 		var cl = new Class (reader.get_attribute ("name"), get_current_src ());
 		cl.access = SymbolAccessibility.PUBLIC;
 
+		string cname = reader.get_attribute ("c:type");
+		if (cname != null) {
+			cl.set_cname (cname);
+		}
+
 		string parent = reader.get_attribute ("parent");
 		if (parent != null) {
 			cl.add_base_type (parse_type_from_name (parent));
@@ -573,6 +584,12 @@
 		start_element ("interface");
 		var iface = new Interface (reader.get_attribute ("name"), get_current_src ());
 		iface.access = SymbolAccessibility.PUBLIC;
+
+		string cname = reader.get_attribute ("c:type");
+		if (cname != null) {
+			iface.set_cname (cname);
+		}
+
 		next ();
 		var methods = new ArrayList<Method> ();
 		var vmethods = new ArrayList<Method> ();
@@ -811,6 +828,12 @@
 		start_element ("glib:boxed");
 		var st = new Struct (reader.get_attribute ("glib:name"));
 		st.access = SymbolAccessibility.PUBLIC;
+
+		string cname = reader.get_attribute ("c:type");
+		if (cname != null) {
+			st.set_cname (cname);
+		}
+
 		next ();
 
 		while (current_token == MarkupTokenType.START_ELEMENT) {



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