GNOME Bugzilla – Bug 383035
GtkBuilder patches (continued saga)
Last modified: 2009-01-19 19:16:44 UTC
Hi, as per Johan's request I am moving my work into a separate bug. Before people start some explosive thread of confusion, I think its important that I state my motivations behind this patch. While the patch does meet my initial standards of quality (I wouldn't have proposed a patch that I didn't think was worthy of review) It was intended to be a demonstration - thats why I chose to support older glade files as the objective of my work, I think that if alot of people can see that using the builder framework it was in fact quite easy to support all the glade files in circulation, this will help to build trust on the builder framework and its potential. So one particular point (hehe or "disclaimer"), is that I have no strong opinion about supporting deprecated widgets in glade files using the builder - the patches I wrote against those deprecated widgets are safe to include and provided as part of this demo, if people argue that it sends a better message to not support these widgets, I wont argue against that :) This patch is also a statement of intent, I want there to be rocking builder support in gtk+ 2.12 and I'm throwing a patch on the table to say "hey I'm with you on this", if this patch doesnt fit with the gtk+ game plan please lets discuss what is best for everyone and get this ball rolling... on that note.. rock on ! Pasting my basic changelog here from bug 172535 ================================================================== - Implemented accelerators (work should be done on making sure accelerators dont conflict with those created by uimanager). - Implemented versioning: <glade-interface version="1"> - Parse adjustments and pixbufs the old fashioned way for version 1 glade files. - Handle unsupported atk property tags so that they are not mistaken for custom tags (preemptively building the object and the constructor ignoring any trailing properties, such as accelerators). - Ported BOOL macros to the private header from libglade (this fixes non 0 integer values, case insensitive yes/true as valid truth strings from the xml, formerly it was only "yes" that was supported, but libglade supports more). - Handle packing properties in the builder parser proper, added buildable->child_set_property() method and implemented it in GtkContainer, this allows non-gtkcontainers to have packing properties without doing that complex parsing jargon and also allows GtkContainer subclasses to handle buildable->child_set_property() in thier own way and chain up. - Allow virtual properties (packing or otherwise), properties listed in the glade file that dont have coresponding pspecs installed will be delivered to the buildable's set_property()/child_set_property() method as G_TYPE_STRING. The rationale behind this change is that it allows us to port in all the special-case code from libglade without opening up the can-of-worms attached to making these special-case properties "real" object properties, this also made it rediculously easy to port all the support code from libglade in a safe manner. - Icky special case code added for GtkDialog --> GtkButton relationships (wrt response-id), added in the buildable code strictly for version 1 glade files. - Dealt with digging out "type" packing properties in the case of version 1 glade files. (the new style is <child type="tab">, older glade files store "tab" in a packing property). (will attatch my patch storm to this bug momentarily)
Created attachment 77825 [details] [review] typeutils portion
Created attachment 77826 [details] [review] patch against widgets to implement GtkBuildable
Created attachment 77827 [details] [review] Modifications to the builder framework/iface/parser
Created attachment 77828 [details] [review] A fullblown test glade file This file contains menus and toolbars both in traditional form and also using the UIManager code, it also includes most deprecated widgets and demonstrates that notebooks and frames can work using the old fashioned "type" packing property.
Created attachment 77829 [details] A png file for the tests/ directory
Created attachment 77830 [details] [review] An all-in-one patch This patch is against current cvs, if you want to try this out; you can simply apply this patch against gtk+ cvs HEAD and compile.
Just for clarity, these patches depend on Johan's patches on bug 172535, only the complete.diff can be applied to your tree directly.
(In reply to comment #3) > Created an attachment (id=77827) [edit] > Modifications to the builder framework/iface/parser > Can you update this to trunk and factor out: * toplevel -> bug 447998 * accelerator/accel group to a new bug (remember GtkWidget implements the <accelerator> tag, do not duplicate that code) * pixbuf to 447966, path handling needs plenty of improvements over this * adjustment should go into conversion script I think, we support GObject properties now. * atk properties -> new bug, preferably without adding new tags, if possible * child properties -> new bug * tooltips -> new bug Don't forget to write tests!
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!