vala r1974 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1974 - in trunk: . gobject
- Date: Tue, 4 Nov 2008 16:58:28 +0000 (UTC)
Author: juergbi
Date: Tue Nov 4 16:58:27 2008
New Revision: 1974
URL: http://svn.gnome.org/viewvc/vala?rev=1974&view=rev
Log:
2008-11-04 JÃrg Billeter <j bitron ch>
* gobject/valaccodearraymodule.vala:
* gobject/valagsignalmodule.vala:
Move detailed signal emission to GSignalModule
Modified:
trunk/ChangeLog
trunk/gobject/valaccodearraymodule.vala
trunk/gobject/valagsignalmodule.vala
Modified: trunk/gobject/valaccodearraymodule.vala
==============================================================================
--- trunk/gobject/valaccodearraymodule.vala (original)
+++ trunk/gobject/valaccodearraymodule.vala Tue Nov 4 16:58:27 2008
@@ -280,26 +280,6 @@
get_ccall.add_argument (cindex);
expr.ccodenode = convert_from_generic_pointer (get_ccall, expr.value_type);
- } else if (expr.container is MemberAccess && expr.container.symbol_reference is Signal) {
- // should be moved to the GSignal module
-
- // detailed signal emission
- var sig = (Signal) expr.symbol_reference;
- var ma = (MemberAccess) expr.container;
-
- var detail_expr = expr.get_indices ().get (0) as StringLiteral;
- string signal_detail = detail_expr.eval ();
-
- 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 ((CCodeExpression) ma.inner.ccodenode);
- ccall.add_argument (ccast);
-
- ccall.add_argument (sig.get_canonical_cconstant (signal_detail));
-
- expr.ccodenode = ccall;
} else {
// access to element in an array
for (int i = 1; i < rank; i++) {
Modified: trunk/gobject/valagsignalmodule.vala
==============================================================================
--- trunk/gobject/valagsignalmodule.vala (original)
+++ trunk/gobject/valagsignalmodule.vala Tue Nov 4 16:58:27 2008
@@ -378,5 +378,31 @@
return csignew;
}
+
+ public override void visit_element_access (ElementAccess expr) {
+ if (expr.container is MemberAccess && expr.container.symbol_reference is Signal) {
+ // detailed signal emission
+ var sig = (Signal) expr.symbol_reference;
+ var ma = (MemberAccess) expr.container;
+
+ expr.accept_children (codegen);
+
+ var detail_expr = expr.get_indices ().get (0) as StringLiteral;
+ string signal_detail = detail_expr.eval ();
+
+ 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 ((CCodeExpression) ma.inner.ccodenode);
+ ccall.add_argument (ccast);
+
+ ccall.add_argument (sig.get_canonical_cconstant (signal_detail));
+
+ expr.ccodenode = ccall;
+ } else {
+ base.visit_element_access (expr);
+ }
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]