Re: Patch for generator - allow compiling against multiple gtk versions
| From: | Andrei Zmievski | Date: | Sat, 27 Jan 2007 19:23:21 +0000 |
| Subject: | Re: Patch for generator - allow compiling against multiple gtk versions | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-3601@lists.php.net to get a copy of this message | ||
On Jan 25, 2007, at 12:45 PM, Elizabeth Smith wrote:
The attached patch adds 1. -v argument to generator.php and applies it to the defs_parser and override classes where appropriate. 2. a check against the gtkversion in includes in the def_parser class 3. a check against the gtkversion in includes in the overrides class and a restore option to un-ignore items (gtkplug and gtksocket come to mind)Sounds okay.
To actually build against 2.10 or 2.8 there will need to be some additional changes made, basically adding some arg_types and adding enums to generator.php, but this patch should make building against multiple versions of gtk+ possible. It might be a good idea to add a gtk_lib_version function/method somewhere - right now gtk::get_version returns the version of gtk+ that php-gtk2 was built against - but with the changes I've made you could build against 2.10 but only include features from 2.8 or 2.6 by passing that value via -v to the generator.I am trying to think of when this behavior might be useful, i.e. building against 2.10 but specifying a lower version to the generator. IMHO, if we build against 2.10, we want all the defs and overrides for 2.10. So the gtk::get_version() should be fine. As for the 'restore' keyword, it was probably not working because the includes for 2.8 happened before the ignores in the main file, so the check that restore was doing was against empty ignore tables. I think a better approach would be to maintain an 'unignore' table that 'restore' keyword fills in, and then any 'ignore' keywords check against that table. -Andrei