GNOME Bugzilla – Bug 673618
Use glib resource framework for UI files
Last modified: 2013-07-07 10:15:13 UTC
GLib 2.32 includes support for bundling files as resource data in shared objects. I'd like to convert various UI files that are currently installed in /usr/share to resource data. This has the advantage of faster loading and cleaner installation. Attaching a patch for the starter plugin; if this looks fine, I'll convert the rest of the UI files in a similar manner.
Created attachment 211443 [details] [review] starter: Use glib resource framework for UI files
Created attachment 211444 [details] [review] starter: Remove unused starter_logo.png
Review of attachment 211443 [details] [review]: Some comments inline. ::: plugins/starter/Makefile.am @@ +12,3 @@ plugin_LTLIBRARIES = libanjuta-starter.la +starter-resources.c: starter.gresource.xml starter.ui Just one minor nitpick, let's use something like this here: $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/starter.gresource.xml @@ +40,3 @@ $(starter_pixmaps_DATA) \ + starter.gresource.xml \ + starter-resources.c \ this is wrong, it is a generated file, $(BUILT_SOURCES) should be in CLEANFILES
First thanks a lot for starting on this. Some comments: * We need to depend on glib 2.32 in configure.ac - fine but I'd like to wait until the major distros (fedora, ubuntu, opensuse) have released a stable version with the library - shouldn't block the work though. * I would like to keep the pngs in the source tree and generate the resource files at build time.
(In reply to comment #4) > * We need to depend on glib 2.32 in configure.ac - fine but I'd like to wait > until the major distros (fedora, ubuntu, opensuse) have released a stable > version with the library - shouldn't block the work though. Fair enough, I'll revisit this topic in 4 months or so when they are all released. Looks like openSUSE 12.2 is the last of these three to be released and is scheduled for July. By the way, Anjuta already depends on one module from GNOME 3.4 release: gladui 3.11, but I suppose it is different from glib as it's an optional dep. > * I would like to keep the pngs in the source tree and generate the resource > files at build time. Yes, agreed, that was my plan as well. Regarding the patch that removes starter_logo.png, it is just an unused file removed. Not really related to the resource framework at all, just an unrelated cleanup I noticed while poking at the resource stuff. Sorry, should have explained better what this commit does.
Created attachment 211467 [details] [review] starter: Use glib resource framework for UI files Thanks nacho, replaced 'starter.ui' with the magical autogenerated dep list and removed generated starter-resources.c from disted files.
Created attachment 211485 [details] [review] starter: Use glib resource framework for UI files One more revision, this time moved BUILT_SOURCES from libanjuta_starter_la_SOURCES to nodist_libanjuta_starter_la_SOURCES to make sure the generated files won't get disted.
Hi! > Fair enough, I'll revisit this topic in 4 months or so when they are all > released. Looks like openSUSE 12.2 is the last of these three to be released > and is scheduled for July. > > By the way, Anjuta already depends on one module from GNOME 3.4 release: gladui > 3.11, but I suppose it is different from glib as it's an optional dep. Well, lets ditch opensuse for now - but I don't want to merge it before fedora/ubuntu are released because I once messed up my system too much by updating glib. (yeah, I could use jhbuild but well...). But that doesn't mean you have to stop creating the patches, they are fairly non-intrusive so I should be hard to merge them later an. Thanks for the hint with the unused file - didn't notice that.
Can't this be added as an option in the Project Wizard instead of being used always? I think it should be disabled by default though until 2.32 becomes 'common'. Then after a year or shorter, make the option as enabled by default.
This will go in anjuta 3.6 which will be a whole cycle after glib 2.32 and as such I don't see that as a general problem.
Review of attachment 211485 [details] [review]: Thanks!
Review of attachment 211444 [details] [review]: Thanks!