After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 616961 - Grilo's introspection data is incomplete/incorrect
Grilo's introspection data is incomplete/incorrect
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: core
git master
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2010-04-27 16:37 UTC by Chris Lord
Modified: 2010-12-01 12:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix gir namespace (3.06 KB, patch)
2010-04-29 13:36 UTC, Eduardo Lima Mitev
none Details | Review
Patch replacing GParamSpec annotations with uints. (11.71 KB, patch)
2010-08-18 20:20 UTC, Simon Pena
none Details | Review
Patch updating the JavaScript example (2.16 KB, patch)
2010-08-18 20:22 UTC, Simon Pena
none Details | Review

Description Chris Lord 2010-04-27 16:37:00 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.
Comment 1 Iago Toral 2010-04-28 06:26:31 UTC
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.
Comment 2 Víctor Manuel Jáquez Leal 2010-04-28 14:38:52 UTC
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.
Comment 3 Eduardo Lima Mitev 2010-04-29 13:36:08 UTC
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.
Comment 4 Juan A. Suarez Romero 2010-05-28 14:46:12 UTC
(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.
Comment 5 Juan A. Suarez Romero 2010-08-18 19:47:21 UTC
We are working on improving introspection in Grilo. Stay tuned!
Comment 6 Simon Pena 2010-08-18 20:20:23 UTC
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.
Comment 7 Simon Pena 2010-08-18 20:22:46 UTC
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.
Comment 8 Simon Pena 2010-12-01 12:00:46 UTC
Please refer to the Experimental Gjs branch at http://git.gnome.org/browse/grilo/log/?h=experimental_gjs
Comment 9 Iago Toral 2010-12-01 12:17:16 UTC
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.