GNOME Bugzilla – Bug 585351
GObject Introspection
Last modified: 2010-03-10 20:29:52 UTC
I want to change the name of virtual methods in GdaDataModel in order to allow Introspection detects automatically the default invoker. Today all Interface virtual methods have an 'i_*' prefix this makes Introspection not to detect the default invoker like in DataHandler, then then deprecates this prefix will fix this.
Created attachment 136538 [details] [review] Added Introspection to GDA This patch adds support to GObject Introspection to GDA. Tries to modify as less as possible, but in some cases like in GdaDataModel is better to change some virtual methods' names in order to allow instrospection's g-ir-scanner tool detects the correct default invoker. This patch also fix bug #585706.
Created attachment 136657 [details] [review] This patch reverts the change from GDA_TYPE_ERROR to G_TYPE_ERROR and GDA_TYPE_SLIST to G_TYPE_SLIST.l This just reverts the change on the macro, but the patch #136538 must be applied first. Even this I've filed bug #585707, to ask why GError, GSList and other GLib types doesn't have a G_TYPE_* macro.
It's not possible to rename the virtual methods because this would break the ABI which is something I don't/can't do now (it should have been done before the 4.0 was released). I really appreciate your work to make Libgda introspectable, but I'm afraid you'll have to find a workaround for this problem.
I have a patch to add basic GObjectInstrospection to GDA without modify virtual methods. This patch don't allows to detect the default invoker of such virtual methods, even that the scanner and compiller works. I'll trying to get help from GObjectIntrospection team on how add metadata to GDA source in order to tells the scanner how detects the default invoker.
Created attachment 143863 [details] [review] Patch to add GObjectInstrospection. No default invokers can't be detected for now. GObjectInstrospection's scanner don't detects the default invoker for some Classes, becouse virtual method's name. The works continues to investigate the way to add metadata, in order to tell scanner how locate the default invoker.
As much as I'd like to have introspection support in Libgda, I can't apply your patch because it fails with: libgda/Makefile.am:282: HAVE_INTROSPECTION does not appear in AM_CONDITIONAL
You must have GObjectIntrospection installed. Get it from git clone git://git.gnome.org/gobject-introspection I don't find how to add a directive to enable/desable gobject-introspection, but may be this *must* be installed allways in order to make it available for any language in the computer. I'm not really sure. I've tested using lastest version on master: autogen make and I have no problem.
Created attachment 149383 [details] [review] Add GObjectIntrospection to GDA This patch allows to add GObjectIntrospection to GDA. Even when some virtual methods invokers aren't detected it works on Seed (JavaScript). The JavaScript must be extensible tested and need to add annotations to the sources in order to make it work as spected.
Example JavaScript code to test under seed. Sustitud the DSN and query table with your own; at the en it dumps the table's contents. # JavaScript Gda Test using Seed Gda = imports.gi.Gda; cnn = Gda.Connection.open_from_dsn ("cash_test"); parser = cnn.create_parser(); stm = parser.parse_string ("SELECT * FROM transactions"); dataset = cnn.statement_execute_select (stm); print (dataset.dump_as_string());
Patch committed with some minor modifications. Thanks a lot for that work! Will you be doing it for Libgdaui as well?
Marking as resolved, as bug #604220 has been filled for the UI extension.
Exists some typo on libgda/Makefile.am, witch made not to include all *.c files, this will exclude any GOI annotations and some details are hiden like implemented interfaces and so on. But in order to fix this GOI must fix bug 612022. Some missing typedef for GError codes must be added or fixed its enum's name. This could be done easy on the way, including add annotations on *.c files for improve GOI support.
GDA has an initial support for GObject Introspection. It needs to be improved, but this will be track in Bug 612480.