add support for overriding the name and namespace of types
authorJuerg Billeter <j@bitron.ch>
Sat, 24 Nov 2007 15:09:51 +0000 (15:09 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 24 Nov 2007 15:09:51 +0000 (15:09 +0000)
2007-11-24  Juerg Billeter  <j@bitron.ch>

* vapigen/valagidlparser.vala: add support for overriding the name and
  namespace of types

svn path=/trunk/; revision=715

ChangeLog
vapigen/valagidlparser.vala

index dc7b6a8..2b009cd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2007-11-24  Jürg Billeter  <j@bitron.ch>
 
+       * vapigen/valagidlparser.vala: add support for overriding the name and
+         namespace of types
+
+2007-11-24  Jürg Billeter  <j@bitron.ch>
+
        * gobject-introspection/gen-introspect.c: avoid NULL function parameter
          names
 
index 489601b..3920c23 100644 (file)
@@ -927,11 +927,18 @@ public class Vala.GIdlParser : CodeVisitor {
 
                                if (nv[0] == "cprefix") {
                                        type.type_name = n.offset (eval (nv[1]).len ());
-                                       return;
+                               } else if (nv[0] == "name") {
+                                       type.type_name = eval (nv[1]);
+                               } else if (nv[0] == "namespace") {
+                                       type.namespace_name = eval (nv[1]);
                                }
                        }
                }
 
+               if (type.type_name != null) {
+                       return;
+               }
+
                if (n == "HFONT" || n == "HGLOBAL" || n == "GStaticRecMutex" || n.has_suffix ("Class") || n == "va_list" || n.has_prefix ("LOGFONT") || n.has_prefix ("xml") || n == "GdkNativeWindow" || n == "GdkXEvent" || n == "GtkTextLayout" || n == "GstClockID" || n.has_prefix ("GstXml")) {
                        // unsupported
                        type.type_name = "pointer";