Add accessors for nested types, patch by Florian Brosch, fixes bug 552958
authorJürg Billeter <j@bitron.ch>
Sat, 27 Sep 2008 09:12:16 +0000 (09:12 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 27 Sep 2008 09:12:16 +0000 (09:12 +0000)
2008-09-27  Jürg Billeter  <j@bitron.ch>

* vala/valaclass.vala:
* vala/valainterface.vala:
* vala/valastruct.vala:

Add accessors for nested types, patch by Florian Brosch,
fixes bug 552958

svn path=/trunk/; revision=1797

ChangeLog
vala/valaclass.vala
vala/valainterface.vala
vala/valastruct.vala

index a5b52ad..ff524bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2008-09-27  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valaclass.vala:
+       * vala/valainterface.vala:
+       * vala/valastruct.vala:
+
+       Add accessors for nested types, patch by Florian Brosch,
+       fixes bug 552958
+
+2008-09-27  Jürg Billeter  <j@bitron.ch>
+
        * vapi/glib-2.0.vapi:
 
        Fix GMarkupParser binding, patch by Matías De la Puente,
index cdff1ed..82681f3 100644 (file)
@@ -121,6 +121,42 @@ public class Vala.Class : ObjectTypeSymbol {
        private Gee.List<Delegate> delegates = new ArrayList<Delegate> ();
 
        /**
+        * Returns a copy of the list of classes.
+        *
+        * @return list of classes
+        */
+       public Gee.List<Class> get_classes () {
+               return new ReadOnlyList<Class> (classes);
+       }
+
+       /**
+        * Returns a copy of the list of structs.
+        *
+        * @return list of structs
+        */
+       public Gee.List<Struct> get_structs () {
+               return new ReadOnlyList<Struct> (structs);
+       }
+
+       /**
+        * Returns a copy of the list of enums.
+        *
+        * @return list of enums
+        */
+       public Gee.List<Enum> get_enums () {
+               return new ReadOnlyList<Enum> (enums);
+       }
+
+       /**
+        * Returns a copy of the list of delegates.
+        *
+        * @return list of delegates
+        */
+       public Gee.List<Delegate> get_delegates () {
+               return new ReadOnlyList<Delegate> (delegates);
+       }
+
+       /**
         * Specifies the default construction method.
         */
        public Method default_construction_method { get; set; }
@@ -248,7 +284,16 @@ public class Vala.Class : ObjectTypeSymbol {
        public Gee.List<Field> get_fields () {
                return new ReadOnlyList<Field> (fields);
        }
-       
+
+       /**
+        * Returns a copy of the list of constants.
+        *
+        * @return list of constants
+        */
+       public Gee.List<Constant> get_constants () {
+               return new ReadOnlyList<Constant> (constants);
+       }
+
        /**
         * Adds the specified method as a member to this class.
         *
index 954903f..83bc577 100644 (file)
@@ -52,7 +52,43 @@ public class Vala.Interface : ObjectTypeSymbol {
        private string lower_case_csuffix;
        private string type_cname;
        private string type_id;
-       
+
+       /**
+        * Returns a copy of the list of classes.
+        *
+        * @return list of classes
+        */
+       public Gee.List<Class> get_classes () {
+               return new ReadOnlyList<Class> (classes);
+       }
+
+       /**
+        * Returns a copy of the list of structs.
+        *
+        * @return list of structs
+        */
+       public Gee.List<Struct> get_structs () {
+               return new ReadOnlyList<Struct> (structs);
+       }
+
+       /**
+        * Returns a copy of the list of enums.
+        *
+        * @return list of enums
+        */
+       public Gee.List<Enum> get_enums () {
+               return new ReadOnlyList<Enum> (enums);
+       }
+
+       /**
+        * Returns a copy of the list of delegates.
+        *
+        * @return list of delegates
+        */
+       public Gee.List<Delegate> get_delegates () {
+               return new ReadOnlyList<Delegate> (delegates);
+       }
+
        /**
         * Creates a new interface.
         *
index 6e49ee5..0876429 100644 (file)
@@ -117,7 +117,16 @@ public class Vala.Struct : TypeSymbol {
        public Gee.List<Field> get_fields () {
                return new ReadOnlyList<Field> (fields);
        }
-       
+
+       /**
+        * Returns a copy of the list of constants.
+        *
+        * @return list of constants
+        */
+       public Gee.List<Constant> get_constants () {
+               return new ReadOnlyList<Constant> (constants);
+       }
+
        /**
         * Adds the specified method as a member to this struct.
         *