Re: introspection
- From: Andrea Zagli <azagli libero it>
- To: Daniel Espinosa <esodan gmail com>
- Cc: gtk list <gtk-list gnome org>
- Subject: Re: introspection
- Date: Fri, 21 Nov 2014 14:06:32 +0000
Il giorno ven 21 nov 2014 14:13:33 CET, Daniel Espinosa ha scritto:
I've forgot you are using GI not Vala bindings, then no meta information
could be used. You should use GI Anottations.
Your library is internal or to be used by scripts written, for example, in
phython?
what do you mean with "internal"?
libconfi (and others libraries that i said) is a library that i used
with my softwares; as i do with gtk or libgda or ...
If it's internal not to be used in scripts, then you don't need to expose
its API to GObject Introspection (GI).
https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations
But that means to modify code in the library to add comments.
Because this libconfi is not fully introspectable (at least automatically)
library, you should use (rename-to) annotation, I think in all the API, in
order to add a name space. The problem here is may be GI doesn't support to
rename GObject definitions or class definitions.
https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations#Rename_to
If you aren't using lot of libconfi's API in your scripts, you can create a
wrapping library, fully introspectable one.
i'll try ASAP
You should use
Il giorno gio 20 nov 2014 22:06:15 CET, Daniel Espinosa ha scritto:
I found in your GIR file, it don't detect (for example) confi_new() as a
function of Confi object and it is not introspectable. Also, all functions
are "free" no related to any GObject. Then you haven't provided enough
information to detect namespace and its GObjects.
You should add a prefix, as a namespace, to your object and its functions.
If you have any problem, please let me check if your C code is GObject
compliant.
http://saetta.ns0.it/gitweb?p=solipa/confi/libconfi;a=tree;
h=refs/heads/libgda5;hb=refs/heads/libgda5
Prefix is not for instrospection, is a way allow GI to parse your C code
correctly and generate valid GIR files.
Another way is to use meta information, but I recommend to avoid that. Is
better to use annotations to fix things. But for you, if use metadata, you
should add lot of metainformation.
where can i find a sample? or documentation
in this library it is fairly simple to change functions name because i
don't use the library
but i have some other libraries with, i think, the same namespace/prefix
problem; and these are heavily used in my software, so i cannot change
functions name
[...]
thanks again
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]