[Gtk-sharp-list] Exposing class/signal name mapping
Mathias Hasselmann
mathias.hasselmann@gmx.de
Mon, 4 Nov 2002 16:31:03 +0100 (CET)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
--8323328-709909531-1036423698=:2270
Content-Type: TEXT/PLAIN; charset=US-ASCII
Content-ID: <Pine.LNX.4.44.0211041630341.2872@localhost.localdomain>
Hi,
Out of being bored I've hacked a tiny tool postprocessing glade output for
Gtk#: Signal handler names are camelizes, stubs for signal handlers are
generated. A problem occured on generating the stubs is that I haven't
found a reliable way to map Gtk+ class or signal names to Gtk#
class/signal names.
A solution that could work for me, would be a enhancing the interface of
GtkSharp.ObjectManager to expose mangled class names or type information
for Gtk+ class names (see the attached patch for details). Signal mappings
could be extracted then by scaning the events of the returned type for
matching GtkSharp.Signal attributes...
Unless there a better suggestion is made I'd like to see the patch merged
into the mainstream of Gtk#.
Ciao,
Mathias
--8323328-709909531-1036423698=:2270
Content-Type: TEXT/PLAIN; charset=us-ascii; name="ObjectManager.cs.diff"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0211041628180.2270@localhost.localdomain>
Content-Description: The patch
Content-Disposition: attachment; filename="ObjectManager.cs.diff"
SW5kZXg6IGdsaWIvT2JqZWN0TWFuYWdlci5jcw0KPT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PQ0KUkNTIGZpbGU6IC9tb25vL2d0ay1zaGFycC9nbGliL09iamVj
dE1hbmFnZXIuY3Msdg0KcmV0cmlldmluZyByZXZpc2lvbiAxLjYNCmRpZmYg
LXUgLXUgLXIxLjYgT2JqZWN0TWFuYWdlci5jcw0KLS0tIGdsaWIvT2JqZWN0
TWFuYWdlci5jcwk1IE9jdCAyMDAyIDA1OjExOjU5IC0wMDAwCTEuNg0KKysr
IGdsaWIvT2JqZWN0TWFuYWdlci5jcwk0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