]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Add CCodeMethodModule and DBusModule
authorJürg Billeter <j@bitron.ch>
Fri, 24 Oct 2008 11:44:25 +0000 (11:44 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 24 Oct 2008 11:44:25 +0000 (11:44 +0000)
2008-10-24  Jürg Billeter  <j@bitron.ch>

* vala/valacodegenerator.vala:
* vala/valacreationmethod.vala:
* vala/valadynamicmethod.vala:
* vala/valamethod.vala:
* gobject/Makefile.am:
* gobject/valaccodeassignmentbinding.vala:
* gobject/valaccodebasemodule.vala:
* gobject/valaccodebinding.vala:
* gobject/valaccodeclassbinding.vala:
* gobject/valaccodegenerator.vala:
* gobject/valaccodeinvocationexpressionbinding.vala:
* gobject/valaccodememberaccessbinding.vala:
* gobject/valaccodemethodmodule.vala:
* gobject/valaccodemodule.vala:
* gobject/valadbusmodule.vala:

Add CCodeMethodModule and DBusModule

svn path=/trunk/; revision=1885

17 files changed:
ChangeLog
gobject/Makefile.am
gobject/valaccodeassignmentbinding.vala
gobject/valaccodebasemodule.vala
gobject/valaccodebinding.vala
gobject/valaccodeclassbinding.vala
gobject/valaccodecreationmethodbinding.vala [deleted file]
gobject/valaccodegenerator.vala
gobject/valaccodeinvocationexpressionbinding.vala
gobject/valaccodememberaccessbinding.vala
gobject/valaccodemethodmodule.vala [moved from gobject/valaccodemethodbinding.vala with 95% similarity]
gobject/valaccodemodule.vala
gobject/valadbusmodule.vala [moved from gobject/valaccodedynamicmethodbinding.vala with 98% similarity]
vala/valacodegenerator.vala
vala/valacreationmethod.vala
vala/valadynamicmethod.vala
vala/valamethod.vala

index 1d02e62dd12e2cfcc465805743765d7f42802f07..6fc406f9079ceb39d065ab6f7bb0f65d1ee9f69f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2008-10-24  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valacodegenerator.vala:
+       * vala/valacreationmethod.vala:
+       * vala/valadynamicmethod.vala:
+       * vala/valamethod.vala:
+       * gobject/Makefile.am:
+       * gobject/valaccodeassignmentbinding.vala:
+       * gobject/valaccodebasemodule.vala:
+       * gobject/valaccodebinding.vala:
+       * gobject/valaccodeclassbinding.vala:
+       * gobject/valaccodegenerator.vala:
+       * gobject/valaccodeinvocationexpressionbinding.vala:
+       * gobject/valaccodememberaccessbinding.vala:
+       * gobject/valaccodemethodmodule.vala:
+       * gobject/valaccodemodule.vala:
+       * gobject/valadbusmodule.vala:
+
+       Add CCodeMethodModule and DBusModule
+
 2008-10-24  Jürg Billeter  <j@bitron.ch>
 
        * gobject/valaccodebasemodule.vala:
index 8193b6c6958e9734b394699693101d1ee1051cd2..e5b6e6e9ab22566ba39d1217a1da31fb0dc60096 100644 (file)
@@ -18,8 +18,6 @@ libvala_la_VALASOURCES = \
        valaccodebinding.vala \
        valaccodeclassbinding.vala \
        valaccodecompiler.vala \
-       valaccodecreationmethodbinding.vala \
-       valaccodedynamicmethodbinding.vala \
        valaccodedynamicpropertybinding.vala \
        valaccodedynamicsignalbinding.vala \
        valaccodeelementaccessbinding.vala \
@@ -31,11 +29,12 @@ libvala_la_VALASOURCES = \
        valaccodeinterfacebinding.vala \
        valaccodeinvocationexpressionbinding.vala \
        valaccodememberaccessbinding.vala \
-       valaccodemethodbinding.vala \
+       valaccodemethodmodule.vala \
        valaccodemodule.vala \
        valaccodeobjecttypesymbolbinding.vala \
        valaccodetypesymbolbinding.vala \
        valaclassregisterfunction.vala \
+       valadbusmodule.vala \
        valagirwriter.vala \
        valainterfaceregisterfunction.vala \
        valatyperegisterfunction.vala \
index 12ce8e340f8116b1fe8fd925e7945b714b33d246..4e2fd9e6d9c288c53ccaffda41277a85e51dab2c 100644 (file)
@@ -41,7 +41,7 @@ public class Vala.CCodeAssignmentBinding : CCodeExpressionBinding {
                var prop = (Property) assignment.left.symbol_reference;
 
                if (prop.set_accessor.construction && codegen.current_type_symbol is Class && codegen.current_class.is_subtype_of (codegen.gobject_type) && codegen.in_creation_method) {
-                       codenode = get_construct_property_assignment (prop.get_canonical_cconstant (), prop.property_type, (CCodeExpression) assignment.right.ccodenode);
+                       codenode = head.get_construct_property_assignment (prop.get_canonical_cconstant (), prop.property_type, (CCodeExpression) assignment.right.ccodenode);
                } else {
                        CCodeExpression cexpr = (CCodeExpression) assignment.right.ccodenode;
 
index 43b9aa215040b4437abfdbaa55344fbf797e4615..0c0ac264de49c4ee17a1348b81d3b7c3b46bba7c 100644 (file)
@@ -27,4 +27,45 @@ public class Vala.CCodeBaseModule : CCodeModule {
        public CCodeBaseModule (CCodeGenerator codegen, CCodeModule? next) {
                base (codegen, next);
        }
+
+       public override void emit (CodeContext context) {
+       }
+
+       public override CCodeIdentifier get_value_setter_function (DataType type_reference) {
+               if (type_reference.data_type != null) {
+                       return new CCodeIdentifier (type_reference.data_type.get_set_value_function ());
+               } else {
+                       return new CCodeIdentifier ("g_value_set_pointer");
+               }
+       }
+
+       public override CCodeExpression get_construct_property_assignment (CCodeConstant canonical_cconstant, DataType property_type, CCodeExpression value) {
+               // this property is used as a construction parameter
+               var cpointer = new CCodeIdentifier ("__params_it");
+               
+               var ccomma = new CCodeCommaExpression ();
+               // set name in array for current parameter
+               var cnamemember = new CCodeMemberAccess.pointer (cpointer, "name");
+               var cnameassign = new CCodeAssignment (cnamemember, canonical_cconstant);
+               ccomma.append_expression (cnameassign);
+               
+               var gvaluearg = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeMemberAccess.pointer (cpointer, "value"));
+               
+               // initialize GValue in array for current parameter
+               var cvalueinit = new CCodeFunctionCall (new CCodeIdentifier ("g_value_init"));
+               cvalueinit.add_argument (gvaluearg);
+               cvalueinit.add_argument (new CCodeIdentifier (property_type.get_type_id ()));
+               ccomma.append_expression (cvalueinit);
+               
+               // set GValue for current parameter
+               var cvalueset = new CCodeFunctionCall (get_value_setter_function (property_type));
+               cvalueset.add_argument (gvaluearg);
+               cvalueset.add_argument (value);
+               ccomma.append_expression (cvalueset);
+               
+               // move pointer to next parameter in array
+               ccomma.append_expression (new CCodeUnaryExpression (CCodeUnaryOperator.POSTFIX_INCREMENT, cpointer));
+
+               return ccomma;
+       }
 }
index 525ad7641ae8802150db833f5c01aaaa640ea25d..9a424272bbb7be047b0658dbec430123726fa965 100644 (file)
@@ -31,58 +31,20 @@ public abstract class Vala.CCodeBinding : CodeBinding {
         */
        public CCodeGenerator codegen { get; set; }
 
+       public CCodeModule head {
+               get { return codegen.head; }
+       }
+
        /**
         * Generate code for this source code node.
         */
        public virtual void emit () {
        }
 
-       public CCodeIdentifier get_value_setter_function (DataType type_reference) {
-               if (type_reference.data_type != null) {
-                       return new CCodeIdentifier (type_reference.data_type.get_set_value_function ());
-               } else {
-                       return new CCodeIdentifier ("g_value_set_pointer");
-               }
-       }
-
-       public CCodeExpression get_construct_property_assignment (CCodeConstant canonical_cconstant, DataType property_type, CCodeExpression value) {
-               // this property is used as a construction parameter
-               var cpointer = new CCodeIdentifier ("__params_it");
-               
-               var ccomma = new CCodeCommaExpression ();
-               // set name in array for current parameter
-               var cnamemember = new CCodeMemberAccess.pointer (cpointer, "name");
-               var cnameassign = new CCodeAssignment (cnamemember, canonical_cconstant);
-               ccomma.append_expression (cnameassign);
-               
-               var gvaluearg = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeMemberAccess.pointer (cpointer, "value"));
-               
-               // initialize GValue in array for current parameter
-               var cvalueinit = new CCodeFunctionCall (new CCodeIdentifier ("g_value_init"));
-               cvalueinit.add_argument (gvaluearg);
-               cvalueinit.add_argument (new CCodeIdentifier (property_type.get_type_id ()));
-               ccomma.append_expression (cvalueinit);
-               
-               // set GValue for current parameter
-               var cvalueset = new CCodeFunctionCall (get_value_setter_function (property_type));
-               cvalueset.add_argument (gvaluearg);
-               cvalueset.add_argument (value);
-               ccomma.append_expression (cvalueset);
-               
-               // move pointer to next parameter in array
-               ccomma.append_expression (new CCodeUnaryExpression (CCodeUnaryOperator.POSTFIX_INCREMENT, cpointer));
-
-               return ccomma;
-       }
-
        public CCodeBinding? code_binding (CodeNode node) {
                return (CCodeBinding) node.get_code_binding (codegen);
        }
 
-       public CCodeMethodBinding method_binding (Method node) {
-               return (CCodeMethodBinding) node.get_code_binding (codegen);
-       }
-
        public CCodeArrayCreationExpressionBinding array_creation_expression_binding (ArrayCreationExpression node) {
                return (CCodeArrayCreationExpressionBinding) node.get_code_binding (codegen);
        }
index 585f4ece3b37197441a19175a112e091886b4de3..6535a4bcb1699ce896db4d7d80dc85538de7253f 100644 (file)
@@ -1162,7 +1162,7 @@ public class Vala.CCodeClassBinding : CCodeObjectTypeSymbolBinding {
                        var ccall = new CCodeFunctionCall (new CCodeIdentifier ("%s_get_%s".printf (prefix, prop.name)));
                        ccall.add_argument (cself);
                        var csetcall = new CCodeFunctionCall ();
-                       csetcall.call = get_value_setter_function (prop.property_type);
+                       csetcall.call = head.get_value_setter_function (prop.property_type);
                        csetcall.add_argument (new CCodeIdentifier ("value"));
                        csetcall.add_argument (ccall);
                        ccase.add_statement (new CCodeExpressionStatement (csetcall));
diff --git a/gobject/valaccodecreationmethodbinding.vala b/gobject/valaccodecreationmethodbinding.vala
deleted file mode 100644 (file)
index 9c85145..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* valaccodecreationmethodbinding.vala
- *
- * Copyright (C) 2007-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
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
-
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
- *
- * Author:
- *     Jürg Billeter <j@bitron.ch>
- */
-
-using GLib;
-using Gee;
-
-/**
- * The link between a creation method and generated code.
- */
-public class Vala.CCodeCreationMethodBinding : CCodeMethodBinding {
-       public CreationMethod creation_method { get; set; }
-
-       public CCodeCreationMethodBinding (CCodeGenerator codegen, CreationMethod creation_method) {
-               this.creation_method = creation_method;
-               this.method = creation_method;
-               this.codegen = codegen;
-       }
-
-       public override void emit () {
-               var m = creation_method;
-
-               if (m.body != null && codegen.current_type_symbol is Class && codegen.current_class.is_subtype_of (codegen.gobject_type)) {
-                       int n_params = 0;
-                       foreach (Statement stmt in m.body.get_statements ()) {
-                               var expr_stmt = stmt as ExpressionStatement;
-                               if (expr_stmt != null) {
-                                       Property prop = expr_stmt.assigned_property ();
-                                       if (prop != null && prop.set_accessor.construction) {
-                                               n_params++;
-                                       }
-                               }
-                       }
-                       m.n_construction_params = n_params;
-               }
-
-               base.emit ();
-       }
-}
index 19db446a1be8731c87902ec08b6414d64ee0e0ed..8a122093d8ce76e603fcc38dd55fcb64016bfdbd 100644 (file)
@@ -28,7 +28,7 @@ using Gee;
  * Code visitor generating C Code.
  */
 public class Vala.CCodeGenerator : CodeGenerator {
-       CCodeModule head;
+       public CCodeModule head;
 
        public CodeContext context;
        
@@ -141,7 +141,9 @@ public class Vala.CCodeGenerator : CodeGenerator {
        private Set<string> wrappers;
 
        public CCodeGenerator () {
-               this.head = new CCodeBaseModule (this, null);
+               head = new CCodeBaseModule (this, head);
+               head = new CCodeMethodModule (this, head);
+               head = new DBusModule (this, head);
 
                predefined_marshal_set = new HashSet<string> (str_hash, str_equal);
                predefined_marshal_set.add ("VOID:VOID");
@@ -741,11 +743,11 @@ public class Vala.CCodeGenerator : CodeGenerator {
        }
 
        public override void visit_method (Method m) {
-               code_binding (m).emit ();
+               head.visit_method (m);
        }
 
        public override void visit_creation_method (CreationMethod m) {
-               code_binding (m).emit ();
+               head.visit_creation_method (m);
        }
 
        public override void visit_formal_parameter (FormalParameter p) {
@@ -3416,7 +3418,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
 
                        // cast the return value of the creation method back to the intended type if
                        // it requested a special C return type
-                       if (method_binding (m).get_custom_creturn_type () != null) {
+                       if (head.get_custom_creturn_type (m) != null) {
                                creation_expr = new CCodeCastExpression (creation_expr, expr.type_reference.get_cname ());
                        }
                } else if (expr.symbol_reference is ErrorCode) {
@@ -4367,19 +4369,6 @@ public class Vala.CCodeGenerator : CodeGenerator {
                return new CCodeInterfaceBinding (this, node);
        }
 
-
-       public override CodeBinding? create_method_binding (Method node) {
-               return new CCodeMethodBinding (this, node);
-       }
-
-       public override CodeBinding? create_dynamic_method_binding (DynamicMethod node) {
-               return new CCodeDynamicMethodBinding (this, node);
-       }
-
-       public override CodeBinding? create_creation_method_binding (CreationMethod node) {
-               return new CCodeCreationMethodBinding (this, node);
-       }
-
        public override CodeBinding? create_dynamic_property_binding (DynamicProperty node) {
                return new CCodeDynamicPropertyBinding (this, node);
        }
@@ -4412,14 +4401,6 @@ public class Vala.CCodeGenerator : CodeGenerator {
                return (CCodeBinding) node.get_code_binding (this);
        }
 
-       public CCodeMethodBinding method_binding (Method node) {
-               return (CCodeMethodBinding) node.get_code_binding (this);
-       }
-
-       public CCodeDynamicMethodBinding dynamic_method_binding (DynamicMethod node) {
-               return (CCodeDynamicMethodBinding) node.get_code_binding (this);
-       }
-
        public CCodeDynamicPropertyBinding dynamic_property_binding (DynamicProperty node) {
                return (CCodeDynamicPropertyBinding) node.get_code_binding (this);
        }
index 4b1d5ec21225042e6f13a53f484911017363b3e4..0c9592a1ca6a894487a6f21482c472a1eabe43be 100644 (file)
@@ -157,7 +157,7 @@ public class Vala.CCodeInvocationExpressionBinding : CCodeExpressionBinding {
                        foreach (FormalParameter param in m.get_parameters ()) {
                                param.accept (codegen);
                        }
-                       codegen.dynamic_method_binding ((DynamicMethod) m).generate_wrapper ();
+                       head.generate_dynamic_method_wrapper ((DynamicMethod) m);
                } else if (m is CreationMethod) {
                        ccall_expr = new CCodeAssignment (new CCodeIdentifier ("self"), new CCodeCastExpression (ccall, codegen.current_class.get_cname () + "*"));
                }
index 6eae9ce5ed920eadad7a14f698c3acb65e8628a2..ff438a1ff5d0e3059312d04d325ade38e40cd4e7 100644 (file)
@@ -53,8 +53,7 @@ public class Vala.CCodeMemberAccessBinding : CCodeExpressionBinding {
                        }
 
                        if (m.base_method != null) {
-                               var binding = method_binding (m.base_method);
-                               if (!binding.has_wrapper) {
+                               if (!head.method_has_wrapper (m.base_method)) {
                                        var inst = pub_inst;
                                        if (expr.inner != null && !expr.inner.is_pure ()) {
                                                // instance expression has side-effects
similarity index 95%
rename from gobject/valaccodemethodbinding.vala
rename to gobject/valaccodemethodmodule.vala
index 0deef082b63003a336668f25d7d89b923e297971..14cb9b16c70f6b961e262fb92a38c79df92b0278 100644 (file)
@@ -27,15 +27,17 @@ using Gee;
 /**
  * The link between a method and generated code.
  */
-public class Vala.CCodeMethodBinding : CCodeBinding {
-       public Method method { get; set; }
+public class Vala.CCodeMethodModule : CCodeModule {
+       public CCodeMethodModule (CCodeGenerator codegen, CCodeModule? next) {
+               base (codegen, next);
+       }
 
-       public bool has_wrapper {
-               get { return (method.get_attribute ("NoWrapper") == null); }
+       public override bool method_has_wrapper (Method method) {
+               return (method.get_attribute ("NoWrapper") == null);
        }
 
-       public string? get_custom_creturn_type () {\r
-               var attr = method.get_attribute ("CCode");\r
+       public override string? get_custom_creturn_type (Method m) {\r
+               var attr = m.get_attribute ("CCode");\r
                if (attr != null) {\r
                        string type = attr.get_string ("type");\r
                        if (type != null) {\r
@@ -45,22 +47,15 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
                return null;\r
        }\r
 \r
-       string get_creturn_type (string default_value) {\r
-               string type = get_custom_creturn_type ();\r
+       string get_creturn_type (Method m, string default_value) {\r
+               string type = get_custom_creturn_type (m);\r
                if (type == null) {\r
                        return default_value;\r
                }\r
                return type;\r
        }
 
-       public CCodeMethodBinding (CCodeGenerator codegen, Method method) {
-               this.method = method;
-               this.codegen = codegen;
-       }
-
-       public override void emit () {
-               var m = method;
-
+       public override void visit_method (Method m) {
                Method old_method = codegen.current_method;
                DataType old_return_type = codegen.current_return_type;
                bool old_method_inner_error = codegen.current_method_inner_error;
@@ -165,7 +160,7 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
                        }
                }
 
-               codegen.function = new CCodeFunction (m.get_real_cname (), get_creturn_type (creturn_type.get_cname ()));
+               codegen.function = new CCodeFunction (m.get_real_cname (), get_creturn_type (m, creturn_type.get_cname ()));
                m.ccodenode = codegen.function;
 
                if (m.is_inline) {
@@ -209,7 +204,7 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
                        cparam_map.set (codegen.get_param_pos (m.cinstance_parameter_position), instance_param);
 
                        if (m.is_abstract || m.is_virtual) {
-                               var vdecl = new CCodeDeclaration (get_creturn_type (creturn_type.get_cname ()));
+                               var vdecl = new CCodeDeclaration (get_creturn_type (m, creturn_type.get_cname ()));
                                vdeclarator = new CCodeFunctionDeclarator (m.vfunc_name);
                                vdecl.add_declarator (vdeclarator);
                                codegen.type_struct.add_declaration (vdecl);
@@ -486,7 +481,7 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
                                cstmt = new CCodeReturnStatement (vcall);
                        } else {
                                /* store method return value for postconditions */
-                               var cdecl = new CCodeDeclaration (get_creturn_type (creturn_type.get_cname ()));
+                               var cdecl = new CCodeDeclaration (get_creturn_type (m, creturn_type.get_cname ()));
                                cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("result", vcall));
                                cstmt = cdecl;
                        }
@@ -569,8 +564,8 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
 
                        if (codegen.current_type_symbol is Class) {
                                CCodeExpression cresult = new CCodeIdentifier ("self");\r
-                               if (get_custom_creturn_type () != null) {\r
-                                       cresult = new CCodeCastExpression (cresult, get_custom_creturn_type ());\r
+                               if (get_custom_creturn_type (m) != null) {\r
+                                       cresult = new CCodeCastExpression (cresult, get_custom_creturn_type (m));\r
                                }\r
 
                                var creturn = new CCodeReturnStatement ();
@@ -623,7 +618,7 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
                }
        }
 
-       public void generate_cparameters (Method m, DataType creturn_type, bool in_gtypeinstance_creation_method, Map<int,CCodeFormalParameter> cparam_map, CCodeFunction func, CCodeFunctionDeclarator? vdeclarator = null, Map<int,CCodeExpression>? carg_map = null, CCodeFunctionCall? vcall = null) {
+       public override void generate_cparameters (Method m, DataType creturn_type, bool in_gtypeinstance_creation_method, Map<int,CCodeFormalParameter> cparam_map, CCodeFunction func, CCodeFunctionDeclarator? vdeclarator = null, Map<int,CCodeExpression>? carg_map = null, CCodeFunctionCall? vcall = null) {
                if (in_gtypeinstance_creation_method) {
                        // memory management for generic types
                        int type_param_index = 0;
@@ -896,4 +891,22 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
                }
                return fundamental_class;
        }
+
+       public override void visit_creation_method (CreationMethod m) {
+               if (m.body != null && codegen.current_type_symbol is Class && codegen.current_class.is_subtype_of (codegen.gobject_type)) {
+                       int n_params = 0;
+                       foreach (Statement stmt in m.body.get_statements ()) {
+                               var expr_stmt = stmt as ExpressionStatement;
+                               if (expr_stmt != null) {
+                                       Property prop = expr_stmt.assigned_property ();
+                                       if (prop != null && prop.set_accessor.construction) {
+                                               n_params++;
+                                       }
+                               }
+                       }
+                       m.n_construction_params = n_params;
+               }
+
+               head.visit_method (m);
+       }
 }
index 847c5fe434210d82b1826167f1cd95b83c82aa9c..8918adfddf7dceb8e6749c424fbae00485173d78 100644 (file)
@@ -49,8 +49,38 @@ public abstract class Vala.CCodeModule {
        }
 
        public virtual void emit (CodeContext context) {
-               if (next != null) {
-                       next.emit (context);
-               }
+               next.emit (context);
+       }
+
+       public virtual void visit_method (Method m) {
+               next.visit_method (m);
+       }
+
+       public virtual void visit_creation_method (CreationMethod m) {
+               next.visit_creation_method (m);
+       }
+
+       public virtual void generate_cparameters (Method m, DataType creturn_type, bool in_gtypeinstance_creation_method, Map<int,CCodeFormalParameter> cparam_map, CCodeFunction func, CCodeFunctionDeclarator? vdeclarator = null, Map<int,CCodeExpression>? carg_map = null, CCodeFunctionCall? vcall = null) {
+               next.generate_cparameters (m, creturn_type, in_gtypeinstance_creation_method, cparam_map, func, vdeclarator, carg_map, vcall);
+       }
+
+       public virtual string? get_custom_creturn_type (Method m) {
+               return next.get_custom_creturn_type (m);
+       }
+
+       public virtual void generate_dynamic_method_wrapper (DynamicMethod method) {
+               next.generate_dynamic_method_wrapper (method);
+       }
+
+       public virtual bool method_has_wrapper (Method method) {
+               return next.method_has_wrapper (method);
+       }
+
+       public virtual CCodeIdentifier get_value_setter_function (DataType type_reference) {
+               return next.get_value_setter_function (type_reference);
+       }
+
+       public virtual CCodeExpression get_construct_property_assignment (CCodeConstant canonical_cconstant, DataType property_type, CCodeExpression value) {
+               return next.get_construct_property_assignment (canonical_cconstant, property_type, value);
        }
 }
similarity index 98%
rename from gobject/valaccodedynamicmethodbinding.vala
rename to gobject/valadbusmodule.vala
index 81ccc6a23466b3144b995df89fb58cf5efea8d6f..af7871f5532087a4e00a9280aa3073c886602252 100644 (file)
@@ -1,4 +1,4 @@
-/* valaccodedynamicmethodbinding.vala
+/* valadbusmodule.vala
  *
  * Copyright (C) 2007-2008  Jürg Billeter
  *
@@ -26,13 +26,12 @@ using Gee;
 /**
  * The link between a dynamic method and generated code.
  */
-public class Vala.CCodeDynamicMethodBinding : CCodeMethodBinding {
-       public CCodeDynamicMethodBinding (CCodeGenerator codegen, DynamicMethod method) {
-               this.method = method;
-               this.codegen = codegen;
+public class Vala.DBusModule : CCodeModule {
+       public DBusModule (CCodeGenerator codegen, CCodeModule? next) {
+               base (codegen, next);
        }
 
-       public void generate_wrapper () {
+       public override void generate_dynamic_method_wrapper (DynamicMethod method) {
                var dynamic_method = (DynamicMethod) method;
 
                var func = new CCodeFunction (method.get_cname (), method.return_type.get_cname ());
@@ -46,7 +45,7 @@ public class Vala.CCodeDynamicMethodBinding : CCodeMethodBinding {
 
                var block = new CCodeBlock ();
                if (dynamic_method.dynamic_type.data_type == codegen.dbus_object_type) {
-                       generate_dbus_method_wrapper (block);
+                       generate_dbus_method_wrapper (method, block);
                } else {
                        Report.error (method.source_reference, "dynamic methods are not supported for `%s'".printf (dynamic_method.dynamic_type.to_string ()));
                }
@@ -58,7 +57,7 @@ public class Vala.CCodeDynamicMethodBinding : CCodeMethodBinding {
                codegen.source_type_member_definition.append (func);
        }
 
-       void generate_dbus_method_wrapper (CCodeBlock block) {
+       void generate_dbus_method_wrapper (Method method, CCodeBlock block) {
                var dynamic_method = (DynamicMethod) method;
 
                var expr = dynamic_method.invocation;
index 1c2b9c10852681d1a5d80f6c635056a67d6782d3..b37340ad02d7863908d3f30b0583e4238ce2687c 100644 (file)
@@ -42,18 +42,6 @@ public class Vala.CodeGenerator : CodeVisitor {
                return null;
        }
 
-       public virtual CodeBinding? create_method_binding (Method node) {
-               return null;
-       }
-
-       public virtual CodeBinding? create_dynamic_method_binding (DynamicMethod node) {
-               return null;
-       }
-
-       public virtual CodeBinding? create_creation_method_binding (CreationMethod node) {
-               return null;
-       }
-
        public virtual CodeBinding? create_dynamic_property_binding (DynamicProperty node) {
                return null;
        }
index 8336e96c93094386f6dae02ebc95a203c39a51f2..9fcbc72a52e180c86b79703f463c16a230cda6fa 100644 (file)
@@ -102,10 +102,6 @@ public class Vala.CreationMethod : Method {
                }
        }
 
-       public override CodeBinding? create_code_binding (CodeGenerator codegen) {
-               return codegen.create_creation_method_binding (this);
-       }
-
        public override string get_real_cname () {
                var parent = parent_symbol as Class;
 
index 6b175872f273f1f155d02a041225262716e97559..94ed2e31c43ca88652c03126d90d769a75cad791 100644 (file)
@@ -53,8 +53,4 @@ public class Vala.DynamicMethod : Method {
                }
                return cname;
        }
-
-       public override CodeBinding? create_code_binding (CodeGenerator codegen) {
-               return codegen.create_dynamic_method_binding (this);
-       }
 }
index c0fa0fa4b210789080f34042ad123a595907f2f0..6cebf47448956521cf6c9627a33e5d31599b6551 100644 (file)
@@ -510,10 +510,6 @@ public class Vala.Method : Member {
                }
        }
 
-       public override CodeBinding? create_code_binding (CodeGenerator codegen) {
-               return codegen.create_method_binding (this);
-       }
-
        private void find_base_methods () {
                if (base_methods_valid) {
                        return;