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 552069 - Signal elements have several issues
Signal elements have several issues
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2008-09-13 04:19 UTC by Mike Kestner
Modified: 2018-01-24 17:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mike Kestner 2008-09-13 04:19:23 UTC
Please describe the problem:
Signals are associated with class field offset by g_signal_new in many cases to associate default handlers for signals.  This association should be explicit in the GIR.  In recent GAPI, we add a field_name attribute to signals to indicate the association.  In addition to making this association, it would be desirable to provide meaningful names for the signal parameter elements instead of simply P0, P1, etc... since they can be determined from the corresponding callback parameter names.

It appears that signal parameter reporting has an off-by-one problem.  The "this" parameter is not included in the list, but the first parameter reported is always named "object" with P0 on the real P1, etc...  See AccelGroup::accel-activate and AccelGroup:accel-changed as examples of the off-by-one.  GtkObject::destroy is an example a signal without a "this" parameter, in case the real problem is that the this parameter is supposed to be in the list.

Since the class method entries include the "this" parameter, I'm guesing the signals probably should as well for consistency.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Mike Kestner 2010-12-27 02:38:24 UTC
With go-i 0.9.12, I am still seeing the off-by-one issue in the parameters.  For example, in Gio-2.0.gir from glib-2.27.4 I see the following signal in GMountOperation:

      <glib:signal name="ask-question" introspectable="0">
        <doc xml:whitespace="preserve">Emitted when asking the user a question and gives a list of
choices for the user to choose from.
If the message contains a line break, the first line should be
presented as a heading. For example, it may be used as the
primary text in a #GtkMessageDialog.</doc>
        <return-value transfer-ownership="none">
          <type name="none"/>
        </return-value>
        <parameters>
          <parameter name="object" transfer-ownership="none">
            <doc xml:whitespace="preserve">string containing a message to display to the user.</doc>
            <type name="utf8"/>
          </parameter>
          <parameter name="p0" transfer-ownership="none">
            <doc xml:whitespace="preserve">an array of strings for each possible choice.</doc>
            <type/>
          </parameter>
        </parameters>
      </glib:signal>

The doc element for the "object" param is really the p0 parameter, which is documented as name="message" on gtk.org instead of p0.  

Of larger concern, the real p1 parameter element is missing.  The docs for it are placed on p0, and the type element is empty, instead of GStrv, assuming it's really p1's data.  

This is probably a blocking issue for using gir for us.
Comment 2 Pavel Holejsovsky 2011-01-14 03:35:42 UTC
Can you please try goi-0.10.1? It produced following signal description:

      <glib:signal name="ask-question">
        <doc xml:whitespace="preserve">Emitted when asking the user a question and gives a list of
choices for the user to choose from.
If the message contains a line break, the first line should be
presented as a heading. For example, it may be used as the
primary text in a #GtkMessageDialog.</doc>
        <return-value transfer-ownership="none">
          <type name="none"/>
        </return-value>
        <parameters>
          <parameter name="message" transfer-ownership="none">
            <doc xml:whitespace="preserve">string containing a message to display to the user.</doc>
            <type name="utf8"/>
          </parameter>
          <parameter name="choices" transfer-ownership="none">
            <doc xml:whitespace="preserve">an array of strings for each possible choice.</doc>
            <array>
              <type name="utf8"/>
            </array>
          </parameter>
        </parameters>
      </glib:signal>

Which is IMHO correct.
Comment 3 Emmanuele Bassi (:ebassi) 2013-08-26 10:55:49 UTC
is this still relevant?
Comment 4 André Klapper 2015-02-07 17:15:56 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 5 Emmanuele Bassi (:ebassi) 2018-01-24 17:00:45 UTC
No answer in 4 years → OBSOLETE