GObject Introspection and GrlKeyIDs



Hi,

Today I finished replacing the defines with actual functions so they
would get exposed with GObject Introspection. After that, I tried to
test the results using Edu's javascript test.

It lacked a grl_init call (I guess that has been introduced recently),
so I added the tags it needed to support introspection. And then, found
a more severe issue: GrlKeyIDs

After navigating through git's history, I saw that, initially, GrlKeyIDs
were defines, getting exposed via GObject Introspection, but then [1]
were changed to extern variables pointing to GParamSpec structures.

The thing is that they don't appear in the introspection info. Tipical
#defines storing strings or integers get represented in the .gir file,
for example, as

<constant name="METADATA_KEY_CHILDCOUNT_UNKNOWN" value="-1">
      <type name="int"/>
</constant>

GParamSpec aren't supported as constants (from what I've been told at
#introspection, again), so we need a workaround for it.

The option which comes to my mind is to provide functions to access
those keys. But I don't know how that option fits with the goal Juan
mentioned in the commit log:

"One of the initial goals of Grilo was that metadata keys should be
dynamic: besides having a pre-defined set of keys, both users and
plugin's developers should be able to add their own keys."

What do you suggest to handle this?

Cheers,

Simon

[1]
http://git.gnome.org/browse/grilo/commit/?id=7cae09b7683555d9718fbed13edc241758581643


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]