vala r1418 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1418 - in trunk: . gobject
- Date: Sat, 24 May 2008 07:19:28 +0000 (UTC)
Author: juergbi
Date: Sat May 24 07:19:27 2008
New Revision: 1418
URL: http://svn.gnome.org/viewvc/vala?rev=1418&view=rev
Log:
2008-05-24 Juerg Billeter <j bitron ch>
* gobject/valaccodedynamicsignalbinding.vala:
Add get_dynamic_cname method to CCodeDynamicSignalBinding class,
based on patch by Yu Feng
Modified:
trunk/ChangeLog
trunk/gobject/valaccodedynamicsignalbinding.vala
Modified: trunk/gobject/valaccodedynamicsignalbinding.vala
==============================================================================
--- trunk/gobject/valaccodedynamicsignalbinding.vala (original)
+++ trunk/gobject/valaccodedynamicsignalbinding.vala Sat May 24 07:19:27 2008
@@ -29,8 +29,6 @@
public class Vala.CCodeDynamicSignalBinding : CCodeBinding {
public Signal node { get; set; }
- private static int signal_wrapper_id;
-
public CCodeDynamicSignalBinding (CCodeGenerator codegen, DynamicSignal node) {
this.node = node;
this.codegen = codegen;
@@ -39,11 +37,22 @@
string? connect_wrapper_name;
string? disconnect_wrapper_name;
+ string? dynamic_cname;
+
+ private static int signal_wrapper_id;
+
+ public string get_dynamic_cname () {
+ if (dynamic_cname == null) {
+ dynamic_cname = "dynamic_%s%d_".printf (node.name, signal_wrapper_id++);
+ }
+ return dynamic_cname;
+ }
+
public string get_connect_wrapper_name () {
var dynamic_signal = (DynamicSignal) node;
if (connect_wrapper_name == null) {
- connect_wrapper_name = "_dynamic_%s%d_connect".printf (node.name, signal_wrapper_id++);
+ connect_wrapper_name = "_%sconnect".printf (get_dynamic_cname ());
var func = new CCodeFunction (connect_wrapper_name, "void");
func.add_parameter (new CCodeFormalParameter ("obj", "gpointer"));
func.add_parameter (new CCodeFormalParameter ("signal_name", "const char *"));
@@ -70,7 +79,7 @@
var dynamic_signal = (DynamicSignal) node;
if (disconnect_wrapper_name == null) {
- disconnect_wrapper_name = "_dynamic_%s%d_disconnect".printf (node.name, signal_wrapper_id++);
+ disconnect_wrapper_name = "_%sdisconnect".printf (get_dynamic_cname ());
var func = new CCodeFunction (disconnect_wrapper_name, "void");
func.add_parameter (new CCodeFormalParameter ("obj", "gpointer"));
func.add_parameter (new CCodeFormalParameter ("signal_name", "const char *"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]