On Mon, 2009-12-14 at 17:55 -0500, José Alburquerque wrote: > On Mon, 2009-12-14 at 23:35 +0100, Murray Cumming wrote: > > To automatically add emit_*_signal() methods? Maybe, but how would we > > know which signals should be emitted by applications instead of just > > handled? I can't believe that all signals should be emitted. > > What I was thinking is iterating through the signals and testing for the > G_SIGNAL_ACTION flag (from the GSignalFlags enum[1]). Methods can be > generated for the ones with the flag. Maybe the method names can be > adapted from the signal name. > > The g_signal_emit()[2] docs say that an optional final argument for the > return value can be included in the arglist. But in C++, I suppose it > can be the method return.
The attached patch modifies the plug-in generator to output lines when it encounters an action signal in a plug-in. It can clarify which signals might be wrapped as methods and which would not be. -- José
>From 670fbde5c55ca8eecb6985919431089a25459101 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Jos=C3=A9=20Alburquerque?= <[email protected]> Date: Tue, 15 Dec 2009 10:50:40 -0500 Subject: [PATCH] Test action signals in plug-in generator. --- .../extra_defs_gen/generate_plugin_gmmproc_file.cc | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc b/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc index e0192a3..ca93292 100644 --- a/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc +++ b/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc @@ -20,7 +20,6 @@ #include <glibmm.h> #include <algorithm> #include <iostream> -#include <sstream> namespace { @@ -369,6 +368,10 @@ static std::string get_signal_wrap_statements(std::string& includeMacroCalls, cClassSignalDeclarations += " " + returnCType + " (*" + signalMethodName + ") (" + cTypeName + "* element"; + if(signalQuery.signal_flags | G_SIGNAL_ACTION) + std::cerr << signalMethodName << " of " << cppTypeName << " is an " + "action signal." << std::endl; + //Loop through the list of parameters: const GType* pParameters = signalQuery.param_types; if(pParameters) -- 1.6.3.3
_______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
