g_signal_emitv -- where is it used in application code?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

g_signal_emitv -- where is it used in application code?

Stefan Salewski-2
https://developer.gnome.org/gobject/stable/gobject-Signals.html#g-signal-emitv

For the most recent issue

https://github.com/StefanSalewski/gintro/issues/8

I have absolutely no idea currently.

Is g_signal_emitv() generally used in applications code, or is it used
for library development (creation of new widgets for example) only.

I have never emitted any signals by myself, not in C, not in Ruby and
not in Nim.

And I can find no examples of use of g_signal_emitv and other
g_signal_emit functions currently -- outside of the GTK library code.

Do you know an example application?



_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|

Re: g_signal_emitv -- where is it used in application code?

Emmanuele Bassi
The g_signal_emitv() function is the vector-based function for
emitting signals in language bindings.

The variadic argument version is a C convenience function, as
functions with variadic arguments are not introspectable.

This is a typical pattern for any GObject-based library; for every
variadic argument function there should be a vector-based one that can
be used by language bindings.

Ciao,
 Emmanuele.


On 15 September 2017 at 12:16, Stefan Salewski <[hidden email]> wrote:

> https://developer.gnome.org/gobject/stable/gobject-Signals.html#g-signal-emitv
>
> For the most recent issue
>
> https://github.com/StefanSalewski/gintro/issues/8
>
> I have absolutely no idea currently.
>
> Is g_signal_emitv() generally used in applications code, or is it used
> for library development (creation of new widgets for example) only.
>
> I have never emitted any signals by myself, not in C, not in Ruby and
> not in Nim.
>
> And I can find no examples of use of g_signal_emitv and other
> g_signal_emit functions currently -- outside of the GTK library code.
>
> Do you know an example application?
>
>
>
> _______________________________________________
> gtk-list mailing list
> [hidden email]
> https://mail.gnome.org/mailman/listinfo/gtk-list



--
https://www.bassi.io
[@] ebassi [@gmail.com]
_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|

Re: g_signal_emitv -- where is it used in application code?

Stefan Salewski-2
On Fri, 2017-09-15 at 12:25 +0100, Emmanuele Bassi wrote:

> The g_signal_emitv() function is the vector-based function for
> emitting signals in language bindings.
>
> The variadic argument version is a C convenience function, as
> functions with variadic arguments are not introspectable.
>
> This is a typical pattern for any GObject-based library; for every
> variadic argument function there should be a vector-based one that
> can
> be used by language bindings.
>
> Ciao,
>  Emmanuele.

When I provide a Nim version of g_signal_emitv() -- how could I test
it? I am still not aware of a (small) example in any language (C,
Python, Ruby, ...) where it is used.

With Google I found the Perl glue code, but still no test.

https://github.com/GNOME/perl-Glib/blob/master/GSignal.xs
_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|

Re: g_signal_emitv -- where is it used in application code?

Emmanuele Bassi
On 15 September 2017 at 13:18, Stefan Salewski <[hidden email]> wrote:

> On Fri, 2017-09-15 at 12:25 +0100, Emmanuele Bassi wrote:
>> The g_signal_emitv() function is the vector-based function for
>> emitting signals in language bindings.
>>
>> The variadic argument version is a C convenience function, as
>> functions with variadic arguments are not introspectable.
>>
>> This is a typical pattern for any GObject-based library; for every
>> variadic argument function there should be a vector-based one that
>> can
>> be used by language bindings.

> When I provide a Nim version of g_signal_emitv() -- how could I test
> it?

I'm puzzled by this question. How do you test signal emission *now*?
Actually: how do you even implement it, if you're not already using
g_signal_emitv()?

> I am still not aware of a (small) example in any language (C,
> Python, Ruby, ...) where it is used.
>
> With Google I found the Perl glue code, but still no test.
>
> https://github.com/GNOME/perl-Glib/blob/master/GSignal.xs

There's also Python:
https://git.gnome.org/browse/pygobject/tree/gi/pygobject-object.c#n1810

But I still don't understand the question. The g_signal_emitv()
function is what you use *internally* to provide signal emission to
your own language bindings. A Perl developer would see it as the
`emit()` method on a Glib::Object instance; a Python developer would
see it as the `emit()` method on a GObject.Object instance; and so on,
and so forth for any other language binding.

High level language typically do not expose this as a "GSignal"
function, but subsume it into the GObject bindings API; the fact that
any GTypeInstance can have signals is not a widely known, or used,
feature of the type system.

Ciao,
 Emmanuele.

--
https://www.bassi.io
[@] ebassi [@gmail.com]
_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|

Re: g_signal_emitv -- where is it used in application code?

Stefan Salewski-2
On Fri, 2017-09-15 at 13:26 +0100, Emmanuele Bassi wrote:
> I'm puzzled by this question. How do you test signal emission *now*?
> Actually: how do you even implement it, if you're not already using
> g_signal_emitv()?

I never needed it! In my C and Ruby applications. And I can not
remember that it was used in the Krause book, but I will ckeck again...

But there is at least one user who seems to need it, see

https://github.com/StefanSalewski/gintro/issues/8

But I do not have his source code, maybe it is proprietary.



_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list