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 645978 - Should use g-i annotations for signal
Should use g-i annotations for signal
Status: RESOLVED OBSOLETE
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
: 657328 (view as bug list)
Depends on:
Blocks: 653941
 
 
Reported: 2011-03-28 17:10 UTC by Guillaume Desmottes
Modified: 2018-01-27 11:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use GISignalInfo to marshal signal arguments (9.28 KB, patch)
2011-08-26 09:08 UTC, Xavier Claessens
none Details | Review
object.c: Use GISignalInfo to marshal signal arguments (10.79 KB, patch)
2011-08-26 14:58 UTC, Xavier Claessens
none Details | Review
object.c: Use GISignalInfo to marshal signal arguments (16.85 KB, patch)
2011-08-30 11:52 UTC, Xavier Claessens
none Details | Review
GICallableInfo: Special case for signals (3.43 KB, patch)
2011-08-30 12:15 UTC, Xavier Claessens
none Details | Review

Description Guillaume Desmottes 2011-03-28 17:10:32 UTC
I tried to use a C signal having a GList of GObject as one of his argument and failed. I've been told that's because gjs doesn't use g-i annotations for signals; it should.
Comment 1 Colin Walters 2011-08-25 13:35:02 UTC
*** Bug 657328 has been marked as a duplicate of this bug. ***
Comment 2 Xavier Claessens 2011-08-26 09:08:51 UTC
Created attachment 194798 [details] [review]
Use GISignalInfo to marshal signal arguments

Fixes bug #645978
Comment 3 Xavier Claessens 2011-08-26 09:11:12 UTC
This patch fails for "notify" signal because it's not found on the GIObjectInfo here... Any idea why?
Comment 4 Xavier Claessens 2011-08-26 09:14:30 UTC
For gjs_g_value_to_g_argument() had the idea of something like

GValue *gval = ...;
GArgument arg;

g_memmove(&arg, &gval->data[0], sizeof(GArgument));

That would in theory cover all types magically, but seems big hack to me...
Comment 5 Xavier Claessens 2011-08-26 09:37:09 UTC
Or even just GArgument *arg = (GArgument*) gvalue->data;

but it's playing with the ABI, dunno if we want that to avoid going through all known GType :)
Comment 6 Xavier Claessens 2011-08-26 14:58:48 UTC
Created attachment 194845 [details] [review]
object.c: Use GISignalInfo to marshal signal arguments

Keeps the GValue-based marshaller as fallback because GI info
does not exists for GObject::notify signal (bug #657446).
Comment 7 Xavier Claessens 2011-08-30 11:52:37 UTC
Created attachment 195185 [details] [review]
object.c: Use GISignalInfo to marshal signal arguments
Comment 8 Xavier Claessens 2011-08-30 11:54:06 UTC
This 2nd patch reuse the code for callbacks in function.c with libffi candy. But unit tests fails because of leaks and gnome-shell crash... I don't understand why and I probably won't have much time to investigate.
Comment 9 Xavier Claessens 2011-08-30 12:15:25 UTC
Created attachment 195186 [details] [review]
GICallableInfo: Special case for signals

g_callable_info_prepare_closure() should add an extra arg for self
object if callable is a signal.
Comment 10 Colin Walters 2011-09-09 22:09:07 UTC
(In reply to comment #3)
> This patch fails for "notify" signal because it's not found on the GIObjectInfo
> here... Any idea why?

This is now fixed:

commit c3da3d46ffa9c3b53e7f7132eaa9c9c722ebc859
Author: Colin Walters <walters@verbum.org>
Date:   Fri Sep 9 18:07:19 2011 -0400

    scanner: Add "notify" signal to GObject
    
    For gjs we want to switch to using introspection data for signals, and
    the "notify" signal being missing from GObject was a problem.
Comment 11 Jasper St. Pierre (not reading bugmail) 2012-04-09 23:15:37 UTC
Do we need introspection data for a GList of GObject? Now that we have custom classes, we can't be guaranteed introspection data for every object. I've been hacking on this today, and boy is it more complicated now.

  WIP patch stack in:

     http://github.com/magcius/gobject-introspection
     http://github.com/magcius/gjs

     GDBus tests requires bug #673803
Comment 12 Jasper St. Pierre (not reading bugmail) 2012-04-09 23:22:35 UTC
gobject-introspection patches filed as bug #673804 and bug #673805
Comment 13 GNOME Infrastructure Team 2018-01-27 11:46:51 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gjs/issues/57.