vala r1932 - in trunk: . gobject



Author: juergbi
Date: Sun Oct 26 07:39:30 2008
New Revision: 1932
URL: http://svn.gnome.org/viewvc/vala?rev=1932&view=rev

Log:
2008-10-26  JÃrg Billeter  <j bitron ch>

	* gobject/valaccodeinvocationexpressionmodule.vala:
	* gobject/valaccodememberaccessmodule.vala:

	Support calling base method of virtual signal handler,
	fixes bug 538901


Modified:
   trunk/ChangeLog
   trunk/gobject/valaccodeinvocationexpressionmodule.vala
   trunk/gobject/valaccodememberaccessmodule.vala

Modified: trunk/gobject/valaccodeinvocationexpressionmodule.vala
==============================================================================
--- trunk/gobject/valaccodeinvocationexpressionmodule.vala	(original)
+++ trunk/gobject/valaccodeinvocationexpressionmodule.vala	Sun Oct 26 07:39:30 2008
@@ -47,7 +47,12 @@
 			assert (ma != null);
 			m = ((MethodType) itype).method_symbol;
 		} else if (itype is SignalType) {
-			ccall = (CCodeFunctionCall) expr.call.ccodenode;
+			var sig_type = (SignalType) itype;
+			if (ma != null && ma.inner is BaseAccess && sig_type.signal_symbol.is_virtual) {
+				m = sig_type.signal_symbol.get_method_handler ();
+			} else {
+				ccall = (CCodeFunctionCall) expr.call.ccodenode;
+			}
 		} else if (itype is ObjectType) {
 			// constructor
 			var cl = (Class) ((ObjectType) itype).type_symbol;

Modified: trunk/gobject/valaccodememberaccessmodule.vala
==============================================================================
--- trunk/gobject/valaccodememberaccessmodule.vala	(original)
+++ trunk/gobject/valaccodememberaccessmodule.vala	Sun Oct 26 07:39:30 2008
@@ -263,6 +263,16 @@
 			var sig = (Signal) expr.symbol_reference;
 			var cl = (TypeSymbol) sig.parent_symbol;
 			
+			if (expr.inner is BaseAccess && sig.is_virtual) {
+				var m = sig.get_method_handler ();
+				var base_class = (Class) m.parent_symbol;
+				var vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (base_class.get_upper_case_cname (null))));
+				vcast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (codegen.current_class.get_lower_case_cname (null))));
+				
+				expr.ccodenode = new CCodeMemberAccess.pointer (vcast, m.name);
+				return;
+			}
+
 			if (sig.has_emitter) {
 				var ccall = new CCodeFunctionCall (new CCodeIdentifier ("%s_%s".printf (cl.get_lower_case_cname (null), sig.name)));
 



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