qulogic/libgnt

ef920322679a
gnt: Use default marshaller for GObject signals

Since 2.30 it's been possible to use a default c_marshaller by
passing NULL to g_signal_new(). It has since become the recommended
way of creating signals.
https://developer.gnome.org/gobject/stable/howto-signals.html

This patch ports libgnt to use this method instead of generating its
own marshallers with glib-genmarshal.
  • +1 -18
    Makefile.am
  • +0 -11
    genmarshal
  • +1 -2
    gntcheckbox.c
  • +1 -2
    gntclipboard.c
  • +1 -3
    gntcombobox.c
  • +2 -5
    gntentry.c
  • +1 -3
    gntfilesel.c
  • +1 -2
    gntmenuitem.c
  • +1 -2
    gntslider.c
  • +4 -9
    gnttree.c
  • +15 -31
    gntwidget.c
  • +2 -4
    gntwindow.c
  • +11 -23
    gntwm.c
  • --- a/Makefile.am Fri Mar 10 20:36:55 2017 -0600
    +++ b/Makefile.am Thu Jun 01 21:31:43 2017 -0500
    @@ -1,5 +1,3 @@
    -EXTRA_DIST=genmarshal
    -
    SUBDIRS = . wms
    pkgconfigdir = $(libdir)/pkgconfig
    pkgconfig_DATA = gnt.pc
    @@ -8,10 +6,7 @@
    noinst_HEADERS = gntinternal.h
    -BUILT_SOURCES = gntmarshal.h
    -
    libgnt_la_SOURCES = \
    - gntmarshal.c \
    gntwidget.c \
    gntbindable.c \
    gntbox.c \
    @@ -53,7 +48,6 @@
    gntkeys.h \
    gntlabel.h \
    gntline.h \
    - gntmarshal.h \
    gntmenu.h \
    gntmenuitem.h \
    gntmenuitemcheck.h \
    @@ -68,17 +62,6 @@
    gntws.h \
    gnt.h
    -CLEANFILES = \
    - gntmarshal.h \
    - gntmarshal.c
    -
    -gntmarshal.c: $(srcdir)/genmarshal gntmarshal.h
    - $(AM_V_GEN)echo "#include \"gntmarshal.h\"" > $@
    - $(AM_V_at)glib-genmarshal --prefix=gnt_closure_marshal --body $(srcdir)/genmarshal >> $@
    -
    -gntmarshal.h: $(srcdir)/genmarshal
    - $(AM_V_GEN)glib-genmarshal --prefix=gnt_closure_marshal --header $(srcdir)/genmarshal > $@
    -
    libgnt_laincludedir=$(includedir)/gnt
    libgnt_lainclude_HEADERS = \
    $(libgnt_la_headers)
    @@ -147,5 +130,5 @@
    $(INTROSPECTION_TYPELIBDIR)
    typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
    -CLEANFILES += $(gir_DATA) $(typelib_DATA)
    +CLEANFILES = $(gir_DATA) $(typelib_DATA)
    endif
    --- a/genmarshal Fri Mar 10 20:36:55 2017 -0600
    +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
    @@ -1,11 +0,0 @@
    -BOOLEAN:VOID
    -BOOLEAN:STRING
    -VOID:INT,INT,INT,INT
    -VOID:INT,INT
    -VOID:POINTER,POINTER
    -BOOLEAN:INT,INT
    -BOOLEAN:INT,INT,INT
    -BOOLEAN:POINTER,POINTER,POINTER
    -BOOLEAN:INT,INT,INT,POINTER
    -VOID:STRING,STRING
    -VOID:POINTER,BOOLEAN
    --- a/gntcheckbox.c Fri Mar 10 20:36:55 2017 -0600
    +++ b/gntcheckbox.c Thu Jun 01 21:31:43 2017 -0500
    @@ -105,8 +105,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntCheckBoxClass, toggled),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    GNTDEBUG;
    }
    --- a/gntclipboard.c Fri Mar 10 20:36:55 2017 -0600
    +++ b/gntclipboard.c Thu Jun 01 21:31:43 2017 -0500
    @@ -37,8 +37,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    0,
    - NULL, NULL,
    - g_cclosure_marshal_VOID__POINTER,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 1, G_TYPE_POINTER);
    }
    --- a/gntcombobox.c Fri Mar 10 20:36:55 2017 -0600
    +++ b/gntcombobox.c Thu Jun 01 21:31:43 2017 -0500
    @@ -24,7 +24,6 @@
    #include "gntbox.h"
    #include "gntcombobox.h"
    #include "gnttree.h"
    -#include "gntmarshal.h"
    #include "gntstyle.h"
    #include "gntutils.h"
    @@ -283,8 +282,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    0,
    - NULL, NULL,
    - gnt_closure_marshal_VOID__POINTER_POINTER,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
    gnt_bindable_class_register_action(bindable, "dropdown", dropdown_menu,
    --- a/gntentry.c Fri Mar 10 20:36:55 2017 -0600
    +++ b/gntentry.c Thu Jun 01 21:31:43 2017 -0500
    @@ -26,7 +26,6 @@
    #include "gntinternal.h"
    #include "gntbox.h"
    #include "gntentry.h"
    -#include "gntmarshal.h"
    #include "gntstyle.h"
    #include "gnttree.h"
    #include "gntutils.h"
    @@ -951,16 +950,14 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntEntryClass, text_changed),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    signals[SIG_COMPLETION] =
    g_signal_new("completion",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    - 0, NULL, NULL,
    - gnt_closure_marshal_VOID__POINTER_POINTER,
    + 0, NULL, NULL, NULL,
    G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
    gnt_bindable_class_register_action(bindable, "cursor-home", move_start,
    --- a/gntfilesel.c Fri Mar 10 20:36:55 2017 -0600
    +++ b/gntfilesel.c Thu Jun 01 21:31:43 2017 -0500
    @@ -28,7 +28,6 @@
    #include "gntentry.h"
    #include "gntfilesel.h"
    #include "gntlabel.h"
    -#include "gntmarshal.h"
    #include "gntstyle.h"
    #include "gnttree.h"
    @@ -506,8 +505,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntFileSelClass, file_selected),
    - NULL, NULL,
    - gnt_closure_marshal_VOID__STRING_STRING,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
    gnt_bindable_class_register_action(bindable, "toggle-tag", toggle_tag_selection, "t", NULL);
    --- a/gntmenuitem.c Fri Mar 10 20:36:55 2017 -0600
    +++ b/gntmenuitem.c Thu Jun 01 21:31:43 2017 -0500
    @@ -57,8 +57,7 @@
    g_signal_new("activate",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    - 0, NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + 0, NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    }
    --- a/gntslider.c Fri Mar 10 20:36:55 2017 -0600
    +++ b/gntslider.c Thu Jun 01 21:31:43 2017 -0500
    @@ -202,8 +202,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntSliderClass, changed),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__INT,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 1, G_TYPE_INT);
    gnt_bindable_class_register_action(bindable, "step-backward", step_back, GNT_KEY_LEFT, NULL);
    --- a/gnttree.c Fri Mar 10 20:36:55 2017 -0600
    +++ b/gnttree.c Thu Jun 01 21:31:43 2017 -0500
    @@ -21,7 +21,6 @@
    */
    #include "gntinternal.h"
    -#include "gntmarshal.h"
    #include "gntstyle.h"
    #include "gnttree.h"
    #include "gntutils.h"
    @@ -1072,32 +1071,28 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntTreeClass, selection_changed),
    - NULL, NULL,
    - gnt_closure_marshal_VOID__POINTER_POINTER,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
    signals[SIG_SCROLLED] =
    g_signal_new("scrolled",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    0,
    - NULL, NULL,
    - g_cclosure_marshal_VOID__INT,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 1, G_TYPE_INT);
    signals[SIG_TOGGLED] =
    g_signal_new("toggled",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntTreeClass, toggled),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__POINTER,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 1, G_TYPE_POINTER);
    signals[SIG_COLLAPSED] =
    g_signal_new("collapse-toggled",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    0,
    - NULL, NULL,
    - gnt_closure_marshal_VOID__POINTER_BOOLEAN,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_BOOLEAN);
    gnt_bindable_class_register_action(bindable, "move-up", action_up,
    --- a/gntwidget.c Fri Mar 10 20:36:55 2017 -0600
    +++ b/gntwidget.c Thu Jun 01 21:31:43 2017 -0500
    @@ -25,7 +25,6 @@
    #include "gntinternal.h"
    #include "gntwidget.h"
    #include "gntstyle.h"
    -#include "gntmarshal.h"
    #include "gntutils.h"
    enum
    @@ -135,104 +134,91 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, destroy),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    signals[SIG_GIVE_FOCUS] =
    g_signal_new("gained-focus",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, gained_focus),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    signals[SIG_LOST_FOCUS] =
    g_signal_new("lost-focus",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, lost_focus),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    signals[SIG_ACTIVATE] =
    g_signal_new("activate",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, activate),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    signals[SIG_MAP] =
    g_signal_new("map",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, map),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    signals[SIG_DRAW] =
    g_signal_new("draw",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, draw),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    signals[SIG_HIDE] =
    g_signal_new("hide",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, hide),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    signals[SIG_EXPOSE] =
    g_signal_new("expose",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, expose),
    - NULL, NULL,
    - gnt_closure_marshal_VOID__INT_INT_INT_INT,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 4, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
    signals[SIG_POSITION] =
    g_signal_new("position-set",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, set_position),
    - NULL, NULL,
    - gnt_closure_marshal_VOID__INT_INT,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
    signals[SIG_SIZE_REQUEST] =
    g_signal_new("size_request",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, size_request),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    signals[SIG_SIZE_CHANGED] =
    g_signal_new("size_changed",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, size_changed),
    - NULL, NULL,
    - gnt_closure_marshal_VOID__INT_INT,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
    signals[SIG_CONFIRM_SIZE] =
    g_signal_new("confirm_size",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, confirm_size),
    - NULL, NULL,
    - gnt_closure_marshal_BOOLEAN__INT_INT,
    + NULL, NULL, NULL,
    G_TYPE_BOOLEAN, 2, G_TYPE_INT, G_TYPE_INT);
    signals[SIG_KEY_PRESSED] =
    g_signal_new("key_pressed",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, key_pressed),
    - gnt_boolean_handled_accumulator, NULL,
    - gnt_closure_marshal_BOOLEAN__STRING,
    + gnt_boolean_handled_accumulator, NULL, NULL,
    G_TYPE_BOOLEAN, 1, G_TYPE_STRING);
    signals[SIG_CLICKED] =
    @@ -240,8 +226,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWidgetClass, clicked),
    - gnt_boolean_handled_accumulator, NULL,
    - gnt_closure_marshal_BOOLEAN__INT_INT_INT,
    + gnt_boolean_handled_accumulator, NULL, NULL,
    G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
    signals[SIG_CONTEXT_MENU] =
    @@ -249,8 +234,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    0,
    - gnt_boolean_handled_accumulator, NULL,
    - gnt_closure_marshal_BOOLEAN__VOID,
    + gnt_boolean_handled_accumulator, NULL, NULL,
    G_TYPE_BOOLEAN, 0);
    /* This is relevant for all widgets */
    --- a/gntwindow.c Fri Mar 10 20:36:55 2017 -0600
    +++ b/gntwindow.c Thu Jun 01 21:31:43 2017 -0500
    @@ -94,8 +94,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    0,
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    signals[SIG_WORKSPACE_SHOW] =
    @@ -103,8 +102,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    0,
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    gnt_bindable_class_register_action(bindable, "show-menu", show_menu,
    --- a/gntwm.c Fri Mar 10 20:36:55 2017 -0600
    +++ b/gntwm.c Thu Jun 01 21:31:43 2017 -0500
    @@ -50,7 +50,6 @@
    #include "gntwm.h"
    #include "gntstyle.h"
    -#include "gntmarshal.h"
    #include "gnt.h"
    #include "gntbox.h"
    #include "gntbutton.h"
    @@ -1421,32 +1420,28 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWMClass, new_window),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__POINTER,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 1, G_TYPE_POINTER);
    signals[SIG_DECORATE_WIN] =
    g_signal_new("decorate_win",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWMClass, decorate_window),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__POINTER,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 1, G_TYPE_POINTER);
    signals[SIG_CLOSE_WIN] =
    g_signal_new("close_win",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWMClass, close_window),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__POINTER,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 1, G_TYPE_POINTER);
    signals[SIG_CONFIRM_RESIZE] =
    g_signal_new("confirm_resize",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWMClass, window_resize_confirm),
    - gnt_boolean_handled_accumulator, NULL,
    - gnt_closure_marshal_BOOLEAN__POINTER_POINTER_POINTER,
    + gnt_boolean_handled_accumulator, NULL, NULL,
    G_TYPE_BOOLEAN, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
    signals[SIG_CONFIRM_MOVE] =
    @@ -1454,8 +1449,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWMClass, window_move_confirm),
    - gnt_boolean_handled_accumulator, NULL,
    - gnt_closure_marshal_BOOLEAN__POINTER_POINTER_POINTER,
    + gnt_boolean_handled_accumulator, NULL, NULL,
    G_TYPE_BOOLEAN, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
    signals[SIG_RESIZED] =
    @@ -1463,24 +1457,21 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWMClass, window_resized),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__POINTER,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 1, G_TYPE_POINTER);
    signals[SIG_MOVED] =
    g_signal_new("window_moved",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWMClass, window_moved),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__POINTER,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 1, G_TYPE_POINTER);
    signals[SIG_UPDATE_WIN] =
    g_signal_new("window_update",
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWMClass, window_update),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__POINTER,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 1, G_TYPE_POINTER);
    signals[SIG_GIVE_FOCUS] =
    @@ -1488,8 +1479,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWMClass, give_focus),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__POINTER,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 1, G_TYPE_POINTER);
    signals[SIG_MOUSE_CLICK] =
    @@ -1497,8 +1487,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWMClass, mouse_clicked),
    - gnt_boolean_handled_accumulator, NULL,
    - gnt_closure_marshal_BOOLEAN__INT_INT_INT_POINTER,
    + gnt_boolean_handled_accumulator, NULL, NULL,
    G_TYPE_BOOLEAN, 4, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_POINTER);
    signals[SIG_TERMINAL_REFRESH] =
    @@ -1506,8 +1495,7 @@
    G_TYPE_FROM_CLASS(klass),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET(GntWMClass, terminal_refresh),
    - NULL, NULL,
    - g_cclosure_marshal_VOID__VOID,
    + NULL, NULL, NULL,
    G_TYPE_NONE, 0);
    gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-next", window_next,