GNOME Bugzilla – Bug 616961
Grilo's introspection data is incomplete/incorrect
Last modified: 2010-12-01 12:17:16 UTC
The introspection data that is generated during Grilo build is a bit rough: 1- Objects still have the 'Grl' prefix 2- Functions still have the grl_ prefix 3- Various functions are missing (such as grl_media_get_title and others) The last point makes it pretty much impossible to use Grilo in gjs/seed. For convenience, it would be good if some of these things were accessible via GObject properties as well, where possible.
Hi Chris, thanks for the bug report! The introspection support in Grilo is totally experimental, we have not devoted any time to it since the first implementation that Edu wrote. We will work on fixing this though.
Taking aside the introspection problem, > 3- Various functions are missing (such as grl_media_get_title and others) > > The last point makes it pretty much impossible to use Grilo in gjs/seed. > > For convenience, it would be good if some of these things were accessible via > GObject properties as well, where possible. The GrlMedia attributes are not GObject properties strictly, because they could be defined by the sources dynamically. As a matter of fact they are stored in a hash table, and all the gobject properties paraphernalia is not needed right now.
Created attachment 159870 [details] [review] patch to fix gir namespace This patch changes the gir/typelib namespace and filenames to Grl instead of Grilo. gir-compiler has a problem with namespaces not matching filenames, so it was required to change the prefix of the gir/typelib files too. 'tools/js/testGrilo.js' test file was also updated to use the new GI namespace. About the missing APIs/annotations in GI info, we haven't really started working on that yet. I'm gonna look at it in the next free time slot.
(In reply to comment #3) > Created an attachment (id=159870) [details] [review] > patch to fix gir namespace > > This patch changes the gir/typelib namespace and filenames to Grl instead of > Grilo. gir-compiler has a problem with namespaces not matching filenames, so it > was required to change the prefix of the gir/typelib files too. > > 'tools/js/testGrilo.js' test file was also updated to use the new GI namespace. > > About the missing APIs/annotations in GI info, we haven't really started > working on that yet. I'm gonna look at it in the next free time slot. The patch solves first issue, and thus was commited (7e1a75). Regarding the second issue, I've notice that missed methods are those which are definitions. For instance, grl_media_get_title is defined as: #define grl_media_get_title(data) \ grl_data_get_string(GRL_DATA((data)), GRL_METADATA_KEY_TITLE) Maybe this helps you in order to fix the issue.
We are working on improving introspection in Grilo. Stay tuned!
Created attachment 168225 [details] [review] Patch replacing GParamSpec annotations with uints. The last patches pushed to master have improved introspection data: those functions previously accessible only via macros can be invoked using real functions now. Other annotations have been fixed, too, and a Python program, cloning the existing grilo-test-ui using introspection, is provided. However, GrlKeyID are annotated as GParamSpec, which JavaScript doesn't support yet (see bug #626047). This patch replaces the GParamSpec annotations with uints: it shouldn't be incorporated to the master branch (unless JavaScript's lack of support for GParamSpecs is permanent), but might allow JavaScript users to play with the bindings.
Created attachment 168226 [details] [review] Patch updating the JavaScript example This patch requires the previous one (with uint annotations) to work, and updates the JavaScript example to work with the current bindings.
Please refer to the Experimental Gjs branch at http://git.gnome.org/browse/grilo/log/?h=experimental_gjs
This bug is already fixed in master, right now Grilo has complete introspection support, at least for Python developers. Javscript support is missing a fix for bug #626047, but we have a work around for that in the experiemental_gjs branch for those who feel like giving it a try. If new issues with the introspection support pop up, please file new bugs.