Re: GObject Introspection and GrlKeyIDs



On Thu, 15 Jul 2010 00:10:18 +0200, Simón Pena <spenap gmail com> wrote:
> 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?

So you mean having something like grl_metadata_key_<insert-metadata-key-name-here>() 
that would return the actual GParamSpec for that metadata-key? I guess that 
dos not fit very well, Juan?

Iago


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