vala r1979 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1979 - in trunk: . gobject
- Date: Tue, 4 Nov 2008 19:17:12 +0000 (UTC)
Author: juergbi
Date: Tue Nov 4 19:17:11 2008
New Revision: 1979
URL: http://svn.gnome.org/viewvc/vala?rev=1979&view=rev
Log:
2008-11-04 JÃrg Billeter <j bitron ch>
* gobject/valaccodememberaccessmodule.vala:
* gobject/valagsignalmodule.vala:
Move signal emission to GSignalModule
Modified:
trunk/ChangeLog
trunk/gobject/valaccodememberaccessmodule.vala
trunk/gobject/valagsignalmodule.vala
Modified: trunk/gobject/valaccodememberaccessmodule.vala
==============================================================================
--- trunk/gobject/valaccodememberaccessmodule.vala (original)
+++ trunk/gobject/valaccodememberaccessmodule.vala Tue Nov 4 19:17:11 2008
@@ -28,7 +28,18 @@
base (codegen, next);
}
- private void process_cmember (MemberAccess expr, CCodeExpression? pub_inst, DataType? base_type) {
+ public override void visit_member_access (MemberAccess expr) {
+ CCodeExpression pub_inst = null;
+ DataType base_type = null;
+
+ if (expr.inner != null) {
+ pub_inst = (CCodeExpression) expr.inner.ccodenode;
+
+ if (expr.inner.value_type != null) {
+ base_type = expr.inner.value_type;
+ }
+ }
+
if (expr.symbol_reference is Method) {
var m = (Method) expr.symbol_reference;
@@ -259,53 +270,7 @@
}
}
}
- } else if (expr.symbol_reference is Signal) {
- 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 (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)));
-
- ccall.add_argument (pub_inst);
- expr.ccodenode = ccall;
- } else {
- var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_signal_emit_by_name"));
-
- // FIXME: use C cast if debugging disabled
- var ccast = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT"));
- ccast.add_argument (pub_inst);
- ccall.add_argument (ccast);
-
- ccall.add_argument (sig.get_canonical_cconstant ());
-
- expr.ccodenode = ccall;
- }
}
}
-
- public override void visit_member_access (MemberAccess expr) {
- CCodeExpression pub_inst = null;
- DataType base_type = null;
-
- if (expr.inner != null) {
- pub_inst = (CCodeExpression) expr.inner.ccodenode;
-
- if (expr.inner.value_type != null) {
- base_type = expr.inner.value_type;
- }
- }
-
- process_cmember (expr, pub_inst, base_type);
- }
}
Modified: trunk/gobject/valagsignalmodule.vala
==============================================================================
--- trunk/gobject/valagsignalmodule.vala (original)
+++ trunk/gobject/valagsignalmodule.vala Tue Nov 4 19:17:11 2008
@@ -558,5 +558,48 @@
base.visit_assignment (assignment);
}
}
+
+ public override void visit_member_access (MemberAccess expr) {
+ CCodeExpression pub_inst = null;
+
+ if (expr.inner != null) {
+ pub_inst = (CCodeExpression) expr.inner.ccodenode;
+ }
+
+ if (expr.symbol_reference is Signal) {
+ 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 (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)));
+
+ ccall.add_argument (pub_inst);
+ expr.ccodenode = ccall;
+ } else {
+ var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_signal_emit_by_name"));
+
+ // FIXME: use C cast if debugging disabled
+ var ccast = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT"));
+ ccast.add_argument (pub_inst);
+ ccall.add_argument (ccast);
+
+ ccall.add_argument (sig.get_canonical_cconstant ());
+
+ expr.ccodenode = ccall;
+ }
+ } else {
+ base.visit_member_access (expr);
+ }
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]