GNOME Bugzilla – Bug 577898
Port ExoBinding to Evolution
Last modified: 2009-04-23 20:54:49 UTC
Trying to merge some pieces of the kill-bonobo branch early. This patch is basically a direct port of Xfce's ExoBinding API [1]. This has also been proposed for GObject itself [2], but I'm not willing to wait. What this does is allow you to bind two GObject properties together such that their values are automatically kept in sync. The API also supports transformation functions, such as boolean inversion. Property bindings allow you to express relationships between objects very cleanly. The classic example is a preferences dialog where some section is enabled or disabled by a check button. Without bindings you have to listen for a "toggled" signal from the check button and then write a callback function to manually set the sensitivity of the container widget for the section based on the check button state. With bindings, you can configure the same behavior with one call: e_binding_new ( G_OBJECT (check_button), "active", G_OBJECT (vbox), "sensitive); I use properties bindings all over the place in the kill-bonobo branch -- including the attachment UI rewrite (bug #516933) -- and have come to regard this API as essential for writing GObject code. The patch adds two files: e-util/e-binding.h e-util/e-binding.c The proposed API for GObject is nearly identical to ours (both are carbon copies of ExoBinding), and if accepted the porting effort on our end would literally take about 10 minutes. [1] http://www.xfce.org/documentation/4.2/api/libexo/exo-Binding-Properties-Functions.html [2] http://bugzilla.gnome.org/show_bug.cgi?id=348080
Created attachment 132056 [details] [review] Proposed patch Already using this in kill-bonobo, and it works fine.
Sure. Take it. Lets merge KB in bits :-)
Committed to master branch. http://git.gnome.org/cgit/evolution/commit/?id=0006bfb58ac91bac0768590827bd3dabba72c638