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 598536 - Add introspection support
Add introspection support
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
git master
Other All
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
: 604840 626237 (view as bug list)
Depends on:
Blocks: 585444
 
 
Reported: 2009-10-15 11:47 UTC by Tomeu Vizoso
Modified: 2011-09-06 21:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
adds introspection support (3.09 KB, patch)
2009-10-15 11:47 UTC, Tomeu Vizoso
none Details | Review
Slightly modified patch to export GtkSource, rather than GtkSourceView (2.65 KB, patch)
2010-02-05 08:49 UTC, Alan Knowles
none Details | Review
Update introspection support (2.04 KB, patch)
2010-04-29 08:50 UTC, Tomeu Vizoso
none Details | Review
Update introspection support (2.60 KB, patch)
2010-04-29 14:20 UTC, Tomeu Vizoso
none Details | Review
Add introspection support to build (6.22 KB, patch)
2010-05-17 00:07 UTC, Garrett Regier
reviewed Details | Review
Add introspection support to build (2.82 KB, patch)
2010-05-23 10:42 UTC, Tomeu Vizoso
committed Details | Review

Description Tomeu Vizoso 2009-10-15 11:47:26 UTC
Created attachment 145506 [details] [review]
adds introspection support

This patch generates the .typelib that introspection-aware bindings can use.
Comment 1 Alan Knowles 2010-02-05 08:49:40 UTC
Created attachment 153062 [details] [review]
Slightly modified patch to export GtkSource, rather than GtkSourceView
Comment 2 Paolo Borelli 2010-02-06 17:11:01 UTC
I know gtk has merged GI so I am ok with merging it too in gtksourceview, however I'd like to know more about the current support this patch adds:

 - does the patch add all the needed things like in gtk? can it be enabled/disabled at compile time? do we have to add other files? I seem to recall talk about a .m4 file on gtk list...

 - I see no chamges to the code, while this is cool, it seems a bit surprising... do we have to add annotations for some specific functions/signals? How much of the API has been tested?

 - is there some small program that tests this?
Comment 3 Alan Knowles 2010-02-07 12:37:43 UTC
Thanks for having a look (I'm no expert on it) - so I can only give a rough idea of what I've understood so far..

- does the patch add all the needed things like in gtk?
*  It just adds the generates the gir/xml file (from the c comments/sources) and compiles it to a typelib file

- can it be enabled/disabled at compile time
* nope - if the infrastructre for Introspection is set up properly, ./configure reports that INTROSPECTION will be generated, otherwise it will not bother generating the code.

- I seem to recall talk about a .m4 file on gtk list...
Sorry no idea about that bit.

 - I see no chamges to the code, while this is cool, it seems a bit
surprising... do we have to add annotations for some specific
functions/signals?
Maybe - but usually it's just the edge cases (ownership transfer / inout parameters, and array's of C types) - As the bindings in theory will be the default way all language bind (hopefully) - you should get bug reports for specific issues.

How much of the API has been tested?
Not alot probably.. - 
- is there some small program that tests this?
I'm working with Seed on it. (very much part/spare time..) - I've got the basic editor up with highlighting.. Code is not amazingly clean though as I'm experimenting with coding/design methods.

These two are 'non-working'/'live-but-changing' - but could be used as a starting point for tests.
http://www.akbkhome.com/svn/seed/gtksourceview.js
http://www.akbkhome.com/svn/seed/Builder/RightEditor.js

Regards
Alan
Comment 4 Tomeu Vizoso 2010-04-29 08:50:35 UTC
Created attachment 159851 [details] [review]
Update introspection support

This patch uses what AFAICS is the recommended way of generating the typelib
Comment 5 Paolo Borelli 2010-04-29 09:03:28 UTC
Review of attachment 159851 [details] [review]:

Minor comments below, but what concerns me more is lack of annotations added to the api. I am ok if the api is exposed to introspection incrementally, but what I am not sure of are the backward compat implications: e.g. if we tomorrow we add an annotation that specifies the ownership of an output param, will we break programs that started using the introspection before the annotation was added?

::: configure.ac
@@ +14,3 @@
 AC_CONFIG_MACRO_DIR([m4])
 
+AM_INIT_AUTOMAKE([1.10.3 dist-bzip2 no-dist-gzip -Wno-portability])

Why is -Wno-portability needed? I do not like the idea of turning of portability warnings very much...

@@ +108,3 @@
 
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
+

if not support for explicit enable/disable I would at least like that a propery summary line is given at the end of configure, like we do for the compiler etc
Comment 6 Tomeu Vizoso 2010-04-29 14:19:38 UTC
(In reply to comment #5)
> Review of attachment 159851 [details] [review]:
> 
> Minor comments below, but what concerns me more is lack of annotations added to
> the api. I am ok if the api is exposed to introspection incrementally, but what
> I am not sure of are the backward compat implications: e.g. if we tomorrow we
> add an annotation that specifies the ownership of an output param, will we
> break programs that started using the introspection before the annotation was
> added?

I'm afraid we can only say that the introspected API is unstable for now and it will mature with time.

> ::: configure.ac
> @@ +14,3 @@
>  AC_CONFIG_MACRO_DIR([m4])
> 
> +AM_INIT_AUTOMAKE([1.10.3 dist-bzip2 no-dist-gzip -Wno-portability])
> 
> Why is -Wno-portability needed? I do not like the idea of turning of
> portability warnings very much...

This just hides some warnings about not being compatible with non-GNU Make, which GNOME doesn't try to support. Some background:

http://mail.gnome.org/archives/desktop-devel-list/2009-February/msg00111.html

> @@ +108,3 @@
> 
> +GOBJECT_INTROSPECTION_CHECK([0.6.7])
> +
> 
> if not support for explicit enable/disable I would at least like that a propery
> summary line is given at the end of configure, like we do for the compiler etc

Done.
Comment 7 Tomeu Vizoso 2010-04-29 14:20:43 UTC
Created attachment 159877 [details] [review]
Update introspection support
Comment 8 Ignacio Casal Quinteiro (nacho) 2010-04-29 15:30:42 UTC
Just putting that there is another bug about this in gedit and it is also for gtksourceview:

https://bugzilla.gnome.org/show_bug.cgi?id=604840
Comment 9 Tomeu Vizoso 2010-05-05 13:28:08 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Review of attachment 159851 [details] [review] [details]:
> > 
> > Minor comments below, but what concerns me more is lack of annotations added to
> > the api. I am ok if the api is exposed to introspection incrementally, but what
> > I am not sure of are the backward compat implications: e.g. if we tomorrow we
> > add an annotation that specifies the ownership of an output param, will we
> > break programs that started using the introspection before the annotation was
> > added?
> 
> I'm afraid we can only say that the introspected API is unstable for now and it
> will mature with time.

You can see here what telepathy-glib has done about it:

http://git.collabora.co.uk/?p=telepathy-glib.git;a=blob;f=NEWS;h=ac7ed8c4c9569b169bb40659a49ae7f327bd513c;hb=HEAD#l60

Is there anything else a module can do?
Comment 10 Paolo Borelli 2010-05-16 23:12:59 UTC
I think we should get introspection in on the unstable branch and work from there
Comment 11 Garrett Regier 2010-05-17 00:07:43 UTC
Created attachment 161191 [details] [review]
Add introspection support to build

This version includes introspection.m4 so the build will not fail when it is not installed, conditionally builds the introspection data and the output of configure is cleaner.
Comment 12 Ignacio Casal Quinteiro (nacho) 2010-05-17 14:19:02 UTC
Review of attachment 161191 [details] [review]:

Comments added bellow.

::: Makefile.am
@@ +61,3 @@
 	fi
 
+if HAVE_INTROSPECTION

what about indenting here?

::: configure.ac
@@ +14,3 @@
 AC_CONFIG_MACRO_DIR([m4])
 
+AM_INIT_AUTOMAKE([1.10.3 dist-bzip2 no-dist-gzip -Wno-portability])

-Wno-portability <- what's that for?
Comment 13 Paolo Borelli 2010-05-17 14:22:47 UTC
I'd say to skip the copy of introspection.m4, since I asked and also pango etc do not ship a copy so one needs it installed anyway.

Apart from the that and nacho's comment about indentation, it looks fine to me.

Tomeu already replied about no-portability
Comment 14 Tomeu Vizoso 2010-05-23 09:59:47 UTC
What is left to do here? If I update Garrett's patch to not include introspection.m4 and fix indentation, it could go in? Or is there any other possibility?
Comment 15 Paolo Borelli 2010-05-23 10:09:43 UTC
We discussed this on irc we were about to commit this (with the change you mention), but the g-i was not building for any of us, so we put this on hold.

Sure, go ahead
Comment 16 Tomeu Vizoso 2010-05-23 10:42:00 UTC
Created attachment 161767 [details] [review]
Add introspection support to build

Adds -Wno-portability because we don't presume to support
non-GNU make,
http://mail.gnome.org/archives/desktop-devel-list/2009-February/msg00111.html.
Comment 17 Tomeu Vizoso 2010-05-23 10:56:36 UTC
Attachment 161767 [details] pushed as 89279ac - Add introspection support to build
Comment 18 Ignacio Casal Quinteiro (nacho) 2010-06-20 09:57:09 UTC
*** Bug 604840 has been marked as a duplicate of this bug. ***
Comment 19 Javier Jardón (IRC: jjardon) 2011-09-06 21:40:02 UTC
*** Bug 626237 has been marked as a duplicate of this bug. ***