[GSoC] GtkBuilder + GBinding: Connecting transformation functions


As you might know, I have created a GTK+ branch on git.gnome.org (named "gtkbuilder-gbinding") which adds a <binding> element to the GtkBuilder syntax for my GSoC project [1]. Now I would like to add support for specifying a transformation function from the source to the target property value for a binding. Like signal handlers currently, such tranformation functions should be automatically connectable by a GtkBuilder object.

The question now is where to put this connection logic. There are essentially two options:

* Do this in gtk_builder_connect_signals(). This lets me reuse the code that's already there, which, given that the needed operations are almost exactly the same, would be nice. However, this makes connect_signals() kind of a misnomer, as it would then connect signals *and* tranformation functions. (A gtk_builder_connect() alias could be introduced to alleviate this.)

* Introduce a new gtk_builder_connect_bindings() (or similarly named) function. This would have the advantage that connect_signals() would continue to do only what the name implies. However, this will probably mean some duplication of work and would require GTK+ users to call two instead of one connection function with the exact same arguments.

As I naturally would like to have my branch merged into GTK+ master eventually, I am asking you for your thoughts on this matter.


[1] http://live.gnome.org/DenisWashington_GtkBuilder

P.S.: The branch already contains support for reading simple <binding> elements without transformation functions and automatically creating the corresponding GBinding objects from them. I would be thankful if someone from the GTK+ developer team would review the branch and give his feedbacK; I have created a bug on b.g.o to track this. ( https://bugzilla.gnome.org/show_bug.cgi?id=654417 )

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]