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 551290 - Add gobject-introspection support
Add gobject-introspection support
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
Depends on: 572713
Blocks: 585444 622963
 
 
Reported: 2008-09-07 21:36 UTC by Colin Walters
Modified: 2010-06-30 18:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
create internal noinst libtool library (10.90 KB, patch)
2008-09-07 21:36 UTC, Colin Walters
rejected Details | Review
main.c, goes with previous patch (8.05 KB, patch)
2008-09-07 22:59 UTC, Colin Walters
none Details | Review

Description Colin Walters 2008-09-07 21:36:06 UTC
Hi, I was looking at turning gobject-introspection on totem.  As part of that work I needed to break totem's core into a shared library, so that at build time the scanner can load it and call the _get_type() functions.

This patch *almost* works but for some oddity with the existing Python support; it can't find some of those get_type functions and I don't know why.
Comment 1 Colin Walters 2008-09-07 21:36:44 UTC
Created attachment 118256 [details] [review]
create internal noinst libtool library
Comment 2 Bastien Nocera 2008-09-07 22:02:34 UTC
Would that be used to create plugins in other languages easily? Or am I missing something?

BTW, did you forget main.c in the patch?
Comment 3 Colin Walters 2008-09-07 22:58:58 UTC
Yeah, with this we should be able to eliminate the current internal vala and python binding infrastructure.
Comment 4 Colin Walters 2008-09-07 22:59:24 UTC
Created attachment 118262 [details] [review]
main.c, goes with previous patch
Comment 5 Bastien Nocera 2008-09-07 23:20:19 UTC
Just the bindings, or the plugins code specifically for Python and Vala altogether?
Comment 6 Bastien Nocera 2008-09-07 23:21:57 UTC
Also, you define HAVE_INTROSPECTION, but never use it?
Comment 7 Colin Walters 2008-09-07 23:30:57 UTC
We should be able to get rid of the bindings/ directory, but not the code to load the Python interpreter.  HAVE_INTROSPECTION is going to be used once the system works to load the Totem.typelib file.

We will be able to add a bit of Automake like this:
http://svn.gnome.org/svn/hippo-canvas/trunk/Makefile-introspection.am

Then we call g_irepository_require_private (NULL, "totem", "Totem", 0, &error) and after that Python code, using pybank, running in the process will be able to access all the functions in Totem without having to add them to the .defs files.
Comment 8 Bastien Nocera 2008-09-07 23:50:57 UTC
That looks fine to me, although I wonder where you have the prototypes for totem_video_widget_create() for example (those should be in totem-private.h).

You can commit to trunk if it still builds as expected.
Comment 9 Colin Walters 2008-09-09 20:56:31 UTC
Worked on this a little bit more; after talking to Owen we figured out that it's actually harder than this; if we want to avoid building all of Totem twice (once with -fPIC and once without) we need to basically have the introspection process go through the executable.  Going to try that, marking the patch as rejected.
Comment 10 Philip Withnall 2009-02-10 00:10:21 UTC
Note that the core of Totem's now been separated into a noinst library anyway, so that we can do gtk-doc API documentation.
Comment 11 Shixin Zeng 2009-02-21 23:01:46 UTC
Could you make the core of Totem be a shared library? 'cause on Windows, you can't build a dll (that's the format for the plugins) with unresolved symbols.
Comment 12 Philip Withnall 2009-02-21 23:35:49 UTC
There's no way to use noinst libraries when building for Windows?
Comment 13 Bastien Nocera 2009-02-22 00:13:54 UTC
(In reply to comment #12)
> There's no way to use noinst libraries when building for Windows?

This is the same problem Rhythmbox had when Jonathan tried to port to Windows, you can't have symbols in the library that'll only resolve at run-time. So if the plugin calls into totem_do_foo, this function needs to exist in the plugin itself, or in a library it'll link to, not in the binary itself.

This should be easy to fix. Shixin, could you please file a new bug?
Comment 14 Shixin Zeng 2009-02-22 06:31:33 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > There's no way to use noinst libraries when building for Windows?
> 
> This is the same problem Rhythmbox had when Jonathan tried to port to Windows,
> you can't have symbols in the library that'll only resolve at run-time. So if
> the plugin calls into totem_do_foo, this function needs to exist in the plugin
> itself, or in a library it'll link to, not in the binary itself.
> 
> This should be easy to fix. Shixin, could you please file a new bug?
> 

filed as:
http://bugzilla.gnome.org/show_bug.cgi?id=572713
Comment 15 Philip Withnall 2010-06-27 17:01:06 UTC
Done in http://git.gnome.org/browse/totem/log/?h=introspection.
Comment 16 Philip Withnall 2010-06-30 18:30:06 UTC
commit 92ae2c5426274ac39fc93748b81c38e03c8e8674
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sat Jun 26 22:54:59 2010 +0100

    Bug 551290 — Add gobject-introspection support
    
    Add gobject-introspection support to libtotem.la. For the time being,
    we're introspecting only the files which exposed API which was previously
    used by the Python bindings.
    
    This adds a hard dependency on gobject-introspection 0.6.7, as the
    introspection will be necessary for Python and Vala plugin support.
    
    Closes: bgo#551290

 Makefile.am     |    3 +--
 configure.in    |    1 +
 src/Makefile.am |   51 ++++++++++++++++++++++++++++++++++++++++++++-------
 3 files changed, 46 insertions(+), 9 deletions(-)

commit 418c93a910536cc679661b8c411a5dd2493f9d8b
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sat Jun 26 22:53:04 2010 +0100

    Fix nicknames for enum values

 src/totem-object.c |   62 ++++++++++++++++++++++++++--------------------------
 1 files changed, 31 insertions(+), 31 deletions(-)

commit 723cf28b588a1f7705ebdc21d9b6e5438bfeba96
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sat Jun 26 22:02:37 2010 +0100

    Move TotemDiscMediaType get_type() and quark() functions to totem-pl-parser
    
    The enum lives there, so the type functions should do too.

 docs/reference/totem-sections.txt |    4 ----
 src/totem-object.c                |   31 -------------------------------
 src/totem.h                       |    5 -----
 3 files changed, 0 insertions(+), 40 deletions(-)