qulogic/libgnt

Merge release-2.x.y into default.

2019-04-20, Elliott Sales de Andrade
9a81bdc71f40
Merge release-2.x.y into default.
  • +8 -0
    doc/libgnt-docs.xml
  • +8 -0
    gnt.h.in
  • +8 -0
    gntbox.c
  • +27 -9
    gntbox.h
  • +1 -1
    gntcheckbox.h
  • +8 -1
    gntcombobox.c
  • +12 -0
    gntcombobox.h
  • +23 -18
    gntentry.h
  • +38 -0
    gntfilesel.c
  • +19 -13
    gntfilesel.h
  • +1 -1
    gntline.h
  • +11 -5
    gntmenu.h
  • +20 -10
    gntmenuitem.h
  • +11 -11
    gntslider.h
  • +0 -1
    gntstyle.c
  • +2 -2
    gntstyle.h
  • +8 -0
    gnttextview.c
  • +14 -2
    gnttextview.h
  • +33 -28
    gnttree.h
  • +1 -1
    gntutils.h
  • +20 -0
    gntwidget.c
  • +51 -8
    gntwidget.h
  • +19 -15
    gntwm.h
  • +25 -19
    gntws.h
  • --- a/doc/libgnt-docs.xml Tue Apr 16 21:10:29 2019 -0500
    +++ b/doc/libgnt-docs.xml Sat Apr 20 02:29:16 2019 -0400
    @@ -101,6 +101,10 @@
    <title>Index of new symbols in 2.8.0</title>
    <xi:include href="xml/api-index-2.8.0.xml"><xi:fallback /></xi:include>
    </index>
    + <index id="api-2.7.2">
    + <title>Index of new symbols in 2.7.2</title>
    + <xi:include href="xml/api-index-2.7.2.xml"><xi:fallback /></xi:include>
    + </index>
    <index id="api-2.4.0">
    <title>Index of new symbols in 2.4.0</title>
    <xi:include href="xml/api-index-2.4.0.xml"><xi:fallback /></xi:include>
    @@ -113,6 +117,10 @@
    <title>Index of new symbols in 2.2.0</title>
    <xi:include href="xml/api-index-2.2.0.xml"><xi:fallback /></xi:include>
    </index>
    + <index id="api-2.1.0">
    + <title>Index of new symbols in 2.1.0</title>
    + <xi:include href="xml/api-index-2.1.0.xml"><xi:fallback /></xi:include>
    + </index>
    <index id="api-2.0.0">
    <title>Index of new symbols in 2.0.0</title>
    <xi:include href="xml/api-index-2.0.0.xml"><xi:fallback /></xi:include>
    --- a/gnt.h.in Tue Apr 16 21:10:29 2019 -0500
    +++ b/gnt.h.in Sat Apr 20 02:29:16 2019 -0400
    @@ -37,6 +37,14 @@
    #define NCURSES_WIDECHAR @NCURSES_WIDECHAR@
    #include <@NCURSES_HEADER@>
    +#ifndef GNTSEAL
    +# if defined(GNTSEAL_ENABLE)
    +# define GNTSEAL(ident) _gnt_sealed__ ## ident
    +# else
    +# define GNTSEAL(ident) ident
    +# endif
    +#endif /* !GNTSEAL */
    +
    #include "gntwidget.h"
    #include "gntclipboard.h"
    #include "gntcolors.h"
    --- a/gntbox.c Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntbox.c Sat Apr 20 02:29:16 2019 -0400
    @@ -687,6 +687,14 @@
    gnt_widget_set_take_focus(widget, set);
    }
    +GList *
    +gnt_box_get_children(GntBox *box)
    +{
    + g_return_val_if_fail(GNT_IS_BOX(box), NULL);
    +
    + return g_list_copy(box->list);
    +}
    +
    void gnt_box_sync_children(GntBox *box)
    {
    GList *iter;
    --- a/gntbox.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntbox.h Sat Apr 20 02:29:16 2019 -0400
    @@ -55,21 +55,26 @@
    GNT_ALIGN_BOTTOM
    } GntAlignment;
    +/**
    + * GntBox:
    + *
    + * Access to any fields is deprecated. See inline comments for replacements.
    + */
    struct _GntBox
    {
    GntWidget parent;
    - gboolean vertical;
    - gboolean homogeneous;
    - gboolean fill;
    - GList *list; /* List of widgets */
    + gboolean GNTSEAL(vertical);
    + gboolean GNTSEAL(homogeneous);
    + gboolean GNTSEAL(fill);
    + GList *GNTSEAL(list); /* Deprecated. Use gnt_box_get_children. */
    - GntWidget *active;
    - int pad; /* Number of spaces to use between widgets */
    - GntAlignment alignment; /* How are the widgets going to be aligned? */
    + GntWidget *GNTSEAL(active);
    + int GNTSEAL(pad); /* Number of spaces to use between widgets */
    + GntAlignment GNTSEAL(alignment); /* How are the widgets going to be aligned? */
    - char *title;
    - GList *focus; /* List of widgets to cycle focus (only valid for parent boxes) */
    + char *GNTSEAL(title);
    + GList *GNTSEAL(focus); /* List of widgets to cycle focus (only valid for parent boxes) */
    /*< private >*/
    void *res1;
    @@ -116,6 +121,19 @@
    GntWidget * gnt_box_new(gboolean homo, gboolean vert);
    /**
    + * gnt_box_get_children:
    + * @box: The box
    + *
    + * Returns a list of the children of the widget.
    + *
    + * Returns: (element-type GntWidget) (transfer container): A new list
    + * containing the children of the box.
    + *
    + * Since: 2.14.0
    + */
    +GList *gnt_box_get_children(GntBox *box);
    +
    +/**
    * gnt_box_add_widget:
    * @box: The box
    * @widget: The widget to add
    --- a/gntcheckbox.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntcheckbox.h Sat Apr 20 02:29:16 2019 -0400
    @@ -30,8 +30,8 @@
    * @see_also: #GntButton
    */
    +#include "gnt.h"
    #include "gntbutton.h"
    -#include "gnt.h"
    #include "gntcolors.h"
    #include "gntkeys.h"
    --- a/gntcombobox.c Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntcombobox.c Sat Apr 20 02:29:16 2019 -0400
    @@ -335,6 +335,14 @@
    return widget;
    }
    +GntWidget *
    +gnt_combo_box_get_dropdown(GntComboBox *box)
    +{
    + g_return_val_if_fail(GNT_IS_BOX(box), NULL);
    +
    + return box->dropdown;
    +}
    +
    void gnt_combo_box_add_data(GntComboBox *box, gpointer key, const char *text)
    {
    gnt_tree_add_row_last(GNT_TREE(box->dropdown), key,
    @@ -365,4 +373,3 @@
    gnt_tree_remove_all(GNT_TREE(box->dropdown));
    set_selection(box, NULL);
    }
    -
    --- a/gntcombobox.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntcombobox.h Sat Apr 20 02:29:16 2019 -0400
    @@ -55,6 +55,18 @@
    GntWidget * gnt_combo_box_new(void);
    /**
    + * gnt_combo_box_get_dropdown:
    + * @box: The GntComboBox
    + *
    + * Get the dropdown GntTree that is shown when opened
    + *
    + * Returns: (transfer none): The dropdown for the combo box
    + *
    + * Since: 2.14.0
    + */
    +GntWidget *gnt_combo_box_get_dropdown(GntComboBox *box);
    +
    +/**
    * gnt_combo_box_add_data:
    * @box: The GntComboBox
    * @key: The data
    --- a/gntentry.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntentry.h Sat Apr 20 02:29:16 2019 -0400
    @@ -29,10 +29,10 @@
    * @short_description: A widget for entering text
    */
    -#include "gntwidget.h"
    #include "gnt.h"
    #include "gntcolors.h"
    #include "gntkeys.h"
    +#include "gntwidget.h"
    #define GNT_TYPE_ENTRY (gnt_entry_get_type())
    #define GNT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_ENTRY, GntEntry))
    @@ -59,32 +59,37 @@
    #define GNT_ENTRY_FLAG_ALL (GNT_ENTRY_FLAG_ALPHA | GNT_ENTRY_FLAG_INT)
    +/**
    + * GntEntry:
    + *
    + * Access to any fields is deprecated. See inline comments for replacements.
    + */
    struct _GntEntry
    {
    GntWidget parent;
    - GntEntryFlag flag;
    + GntEntryFlag GNTSEAL(flag);
    - char *start;
    - char *end;
    - char *scroll; /* Current scrolling position */
    - char *cursor; /* Cursor location */
    - /* 0 <= cursor - scroll < widget-width */
    + char *GNTSEAL(start);
    + char *GNTSEAL(end);
    + char *GNTSEAL(scroll); /* Current scrolling position */
    + char *GNTSEAL(cursor); /* Cursor location */
    + /* 0 <= cursor - scroll < widget-width */
    - size_t buffer; /* Size of the buffer */
    + size_t GNTSEAL(buffer); /* Size of the buffer */
    - int max; /* 0 means infinite */
    - gboolean masked;
    + int GNTSEAL(max); /* 0 means infinite */
    + gboolean GNTSEAL(masked);
    - GList *history; /* History of the strings. User can use this by pressing ctrl+up/down */
    - int histlength; /* How long can the history be? */
    + GList *GNTSEAL(history); /* History of the strings. User can use this by pressing ctrl+up/down */
    + int GNTSEAL(histlength); /* How long can the history be? */
    - GList *suggests; /* List of suggestions */
    - gboolean word; /* Are the suggestions for only a word, or for the whole thing? */
    - gboolean always; /* Should the list of suggestions show at all times, or only on tab-press? */
    - GntWidget *ddown; /* The dropdown with the suggested list */
    - GntEntryKillRing *killring; /* Since: 2.3.0 */
    - GntEntrySearch *search; /* Since: 2.7.0 */
    + GList *GNTSEAL(suggests); /* List of suggestions */
    + gboolean GNTSEAL(word); /* Are the suggestions for only a word, or for the whole thing? */
    + gboolean GNTSEAL(always); /* Should the list of suggestions show at all times, or only on tab-press? */
    + GntWidget *GNTSEAL(ddown); /* The dropdown with the suggested list */
    + GntEntryKillRing *GNTSEAL(killring); /* Since: 2.3.0 */
    + GntEntrySearch *GNTSEAL(search); /* Since: 2.7.0 */
    };
    struct _GntEntryClass
    --- a/gntfilesel.c Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntfilesel.c Sat Apr 20 02:29:16 2019 -0400
    @@ -41,6 +41,7 @@
    enum
    {
    SIG_FILE_SELECTED,
    + SIG_CANCELLED,
    SIGS
    };
    @@ -49,6 +50,7 @@
    static void (*orig_size_request)(GntWidget *widget);
    static void select_activated_cb(GntWidget *button, GntFileSel *sel);
    +static void cancel_activated_cb(GntWidget *button, GntFileSel *sel);
    G_DEFINE_TYPE(GntFileSel, gnt_file_sel, GNT_TYPE_WINDOW)
    @@ -463,6 +465,16 @@
    orig_size_request = widget_class->size_request;
    widget_class->size_request = gnt_file_sel_size_request;
    + /**
    + * GntFileSel::file-selected
    + * @widget: The file selection window that received the signal
    + * @path: The full path to the selected file
    + * @file: The name of the file only
    + *
    + * The ::file-selected signal is emitted when the Select button or the
    + * file tree on a #GntFileSel is activated.
    + *
    + */
    signals[SIG_FILE_SELECTED] =
    g_signal_new("file_selected",
    G_TYPE_FROM_CLASS(klass),
    @@ -471,6 +483,24 @@
    NULL, NULL, NULL,
    G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
    + /**
    + * GntFileSel::cancelled
    + * @widget: The file selection window that received the signal
    + *
    + * The ::cancelled signal is emitted when the Cancel button on a
    + * #GntFileSel is activated.
    + *
    + * Since: 2.14.0
    + */
    + signals[SIG_CANCELLED] =
    + g_signal_new("cancelled",
    + G_TYPE_FROM_CLASS(klass),
    + G_SIGNAL_RUN_LAST,
    + G_STRUCT_OFFSET(GntFileSelClass, cancelled),
    + NULL, NULL,
    + g_cclosure_marshal_VOID__VOID,
    + G_TYPE_NONE, 0);
    +
    gnt_bindable_class_register_action(bindable, "toggle-tag", toggle_tag_selection, "t", NULL);
    gnt_bindable_class_register_action(bindable, "clear-tags", clear_tags, "c", NULL);
    gnt_bindable_class_register_action(bindable, "up-directory", up_directory, GNT_KEY_BACKSPACE, NULL);
    @@ -505,6 +535,8 @@
    g_signal_connect(G_OBJECT(sel->location), "key_pressed", G_CALLBACK(location_key_pressed), sel);
    sel->cancel = gnt_button_new("Cancel");
    + g_signal_connect(G_OBJECT(sel->cancel), "activate", G_CALLBACK(cancel_activated_cb), sel);
    +
    sel->select = gnt_button_new("Select");
    g_signal_connect_swapped(G_OBJECT(sel->files), "activate", G_CALLBACK(gnt_widget_activate), sel->select);
    @@ -524,6 +556,12 @@
    g_free(path);
    }
    +static void
    +cancel_activated_cb(GntWidget *button, GntFileSel *sel)
    +{
    + g_signal_emit(sel, signals[SIG_CANCELLED], 0);
    +}
    +
    GntWidget *gnt_file_sel_new(void)
    {
    GntWidget *widget = g_object_new(GNT_TYPE_FILE_SEL, NULL);
    --- a/gntfilesel.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntfilesel.h Sat Apr 20 02:29:16 2019 -0400
    @@ -29,10 +29,10 @@
    * @short_description: A widget for selecting a file or directory
    */
    -#include "gntwindow.h"
    #include "gnt.h"
    #include "gntcolors.h"
    #include "gntkeys.h"
    +#include "gntwindow.h"
    #define GNT_TYPE_FILE_SEL (gnt_file_sel_get_type())
    #define GNT_FILE_SEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_FILE_SEL, GntFileSel))
    @@ -47,26 +47,31 @@
    typedef struct _GntFileSelClass GntFileSelClass;
    typedef struct _GntFile GntFile;
    +/**
    + * GntFileSel:
    + *
    + * Access to any fields is deprecated. See inline comments for replacements.
    + */
    struct _GntFileSel
    {
    GntWindow parent;
    - GntWidget *dirs; /* list of files */
    - GntWidget *files; /* list of directories */
    - GntWidget *location; /* location entry */
    + GntWidget *GNTSEAL(dirs); /* list of files */
    + GntWidget *GNTSEAL(files); /* list of directories */
    + GntWidget *GNTSEAL(location); /* location entry */
    - GntWidget *select; /* select button */
    - GntWidget *cancel; /* cancel button */
    + GntWidget *GNTSEAL(select); /* select button */
    + GntWidget *GNTSEAL(cancel); /* cancel button */
    - char *current; /* Full path of the current location */
    - char *suggest; /* Suggested filename */
    + char *GNTSEAL(current); /* Full path of the current location */
    + char *GNTSEAL(suggest); /* Suggested filename */
    /* XXX: someone should make these useful */
    - gboolean must_exist; /* Make sure the selected file (the name entered in 'location') exists */
    - gboolean dirsonly; /* Show only directories */
    - gboolean multiselect;
    - GList *tags; /* List of tagged files when multiselect is set */
    + gboolean GNTSEAL(must_exist); /* Make sure the selected file (the name entered in 'location') exists */
    + gboolean GNTSEAL(dirsonly); /* Show only directories */
    + gboolean GNTSEAL(multiselect);
    + GList *GNTSEAL(tags); /* List of tagged files when multiselect is set */
    - gboolean (*read_fn)(const char *path, GList **files, GError **error);
    + gboolean (*GNTSEAL(read_fn))(const char *path, GList **files, GError **error);
    };
    struct _GntFileSelClass
    @@ -74,6 +79,7 @@
    GntWindowClass parent;
    void (*file_selected)(GntFileSel *sel, const char *path, const char *filename);
    + void (*cancelled)(GntFileSel *sel);
    /*< private >*/
    void (*gnt_reserved1)(void);
    --- a/gntline.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntline.h Sat Apr 20 02:29:16 2019 -0400
    @@ -29,10 +29,10 @@
    * @short_description: A widget that draws a horizontal or vertical line
    */
    -#include "gntwidget.h"
    #include "gnt.h"
    #include "gntcolors.h"
    #include "gntkeys.h"
    +#include "gntwidget.h"
    #define GNT_TYPE_LINE gnt_line_get_type()
    --- a/gntmenu.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntmenu.h Sat Apr 20 02:29:16 2019 -0400
    @@ -30,6 +30,7 @@
    * @see_also: #GntMenuItem #GntMenuItemCheck
    */
    +#include "gnt.h"
    #include "gnttree.h"
    #include "gntcolors.h"
    #include "gntkeys.h"
    @@ -61,18 +62,23 @@
    GNT_MENU_POPUP,
    } GntMenuType;
    +/**
    + * GntMenu:
    + *
    + * Access to any fields is deprecated. See inline comments for replacements.
    + */
    struct _GntMenu
    {
    GntTree parent;
    - GntMenuType type;
    + GntMenuType GNTSEAL(type);
    - GList *list;
    - guint selected;
    + GList *GNTSEAL(list);
    + guint GNTSEAL(selected);
    /* This will keep track of its immediate submenu which is visible so that
    * keystrokes can be passed to it. */
    - GntMenu *submenu;
    - GntMenu *parentmenu;
    + GntMenu *GNTSEAL(submenu);
    + GntMenu *GNTSEAL(parentmenu);
    };
    struct _GntMenuClass
    --- a/gntmenuitem.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntmenuitem.h Sat Apr 20 02:29:16 2019 -0400
    @@ -46,34 +46,44 @@
    #include "gntmenu.h"
    +/**
    + * GntMenuItemPriv:
    + *
    + * Access to any fields is deprecated. See inline comments for replacements.
    + */
    struct _GntMenuItemPriv
    {
    /* These will be used to determine the position of the submenu */
    - int x;
    - int y;
    - char trigger;
    - char *id;
    + int GNTSEAL(x);
    + int GNTSEAL(y);
    + char GNTSEAL(trigger);
    + char *GNTSEAL(id);
    };
    typedef void (*GntMenuItemCallback)(GntMenuItem *item, gpointer data);
    +/**
    + * GntMenuItem:
    + *
    + * Access to any fields is deprecated. See inline comments for replacements.
    + */
    struct _GntMenuItem
    {
    GObject parent;
    - GntMenuItemPriv priv;
    + GntMenuItemPriv GNTSEAL(priv);
    - char *text;
    + char *GNTSEAL(text);
    /* A GntMenuItem can have a callback associated with it.
    * The callback will be activated whenever the suer selects it and presses enter (or clicks).
    * However, if the GntMenuItem has some child, then the callback and callbackdata will be ignored. */
    - gpointer callbackdata;
    - GntMenuItemCallback callback;
    + gpointer GNTSEAL(callbackdata);
    + GntMenuItemCallback GNTSEAL(callback);
    - GntMenu *submenu;
    + GntMenu *GNTSEAL(submenu);
    /*< private >*/
    - gboolean visible;
    + gboolean GNTSEAL(visible);
    };
    struct _GntMenuItemClass
    --- a/gntslider.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntslider.h Sat Apr 20 02:29:16 2019 -0400
    @@ -29,9 +29,9 @@
    * @short_description: A widget for selecting from a range of values
    */
    -#include "gntwidget.h"
    #include "gnt.h"
    #include "gntlabel.h"
    +#include "gntwidget.h"
    G_BEGIN_DECLS
    @@ -72,7 +72,7 @@
    *
    * Returns: The newly created slider
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    GntWidget * gnt_slider_new(gboolean orient, int max, int min);
    @@ -96,7 +96,7 @@
    *
    * Set the range of the slider.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_slider_set_range(GntSlider *slider, int max, int min);
    @@ -119,7 +119,7 @@
    *
    * Sets the amount of change at each step.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_slider_set_step(GntSlider *slider, int step);
    @@ -183,15 +183,15 @@
    /**
    * gnt_slider_advance_step:
    - * @slider: The slider
    - * @steps: The number of amounts to change, positive to change
    - * forward, negative to change backward
    + * @slider: The slider
    + * @steps: The number of amounts to change, positive to change forward,
    + * negative to change backward
    *
    * Advance the slider forward or backward.
    *
    * Returns: The value of the slider after the change
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    int gnt_slider_advance_step(GntSlider *slider, int steps);
    @@ -202,7 +202,7 @@
    *
    * Set the current value for the slider.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_slider_set_value(GntSlider *slider, int value);
    @@ -212,7 +212,7 @@
    *
    * Get the current value for the slider.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    int gnt_slider_get_value(GntSlider *slider);
    @@ -223,7 +223,7 @@
    *
    * Update a label with the value of the slider whenever the value changes.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_slider_reflect_label(GntSlider *slider, GntLabel *label);
    --- a/gntstyle.c Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntstyle.c Sat Apr 20 02:29:16 2019 -0400
    @@ -36,7 +36,6 @@
    #define MAX_WORKSPACES 99
    static GKeyFile *gkfile;
    -
    static char * str_styles[GNT_STYLES];
    static int int_styles[GNT_STYLES];
    static int bool_styles[GNT_STYLES];
    --- a/gntstyle.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntstyle.h Sat Apr 20 02:29:16 2019 -0400
    @@ -70,7 +70,7 @@
    *
    * Returns: The value of the setting as a string, or %NULL
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    char *gnt_style_get_from_name(const char *group, const char *key);
    @@ -113,7 +113,7 @@
    *
    * Returns: The boolean value
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    gboolean gnt_style_parse_bool(const char *value);
    --- a/gnttextview.c Tue Apr 16 21:10:29 2019 -0500
    +++ b/gnttextview.c Sat Apr 20 02:29:16 2019 -0400
    @@ -601,6 +601,14 @@
    gnt_widget_draw(widget);
    }
    +const gchar *
    +gnt_text_view_get_text(GntTextView *view)
    +{
    + g_return_val_if_fail(GNT_IS_TEXT_VIEW(view), NULL);
    +
    + return view->string->str;
    +}
    +
    void gnt_text_view_scroll(GntTextView *view, int scroll)
    {
    if (scroll == 0)
    --- a/gnttextview.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gnttextview.h Sat Apr 20 02:29:16 2019 -0400
    @@ -29,10 +29,10 @@
    * @short_description: A widget for displaying larger bodies of formatted text
    */
    -#include "gntwidget.h"
    #include "gnt.h"
    #include "gntcolors.h"
    #include "gntkeys.h"
    +#include "gntwidget.h"
    #define GNT_TYPE_TEXT_VIEW gnt_text_view_get_type()
    @@ -102,6 +102,18 @@
    void gnt_text_view_append_text_with_tag(GntTextView *view, const char *text, GntTextFormatFlags flags, const char *tag);
    /**
    + * gnt_text_view_get_text:
    + * @view: The textview.
    + *
    + * Get the text of the textview.
    + *
    + * Returns: The text.
    + *
    + * Since: 2.14.0
    + */
    +const gchar *gnt_text_view_get_text(GntTextView *view);
    +
    +/**
    * gnt_text_view_next_line:
    * @view: The textview.
    *
    @@ -219,7 +231,7 @@
    *
    * Set a GntTextViewFlag for the textview widget.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_text_view_set_flag(GntTextView *view, GntTextViewFlag flag);
    --- a/gnttree.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gnttree.h Sat Apr 20 02:29:16 2019 -0400
    @@ -29,11 +29,11 @@
    * @short_description: A widget that shows a tree of items
    */
    -#include "gntwidget.h"
    #include "gnt.h"
    #include "gntcolors.h"
    #include "gntkeys.h"
    #include "gnttextview.h"
    +#include "gntwidget.h"
    #define GNT_TYPE_TREE (gnt_tree_get_type())
    #define GNT_TREE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_TREE, GntTree))
    @@ -70,30 +70,35 @@
    GntTreeColumnFlag flags;
    };
    +/**
    + * GntTree:
    + *
    + * Access to any fields is deprecated. See inline comments for replacements.
    + */
    struct _GntTree
    {
    GntWidget parent;
    - GntTreeRow *current; /* current selection */
    + GntTreeRow *GNTSEAL(current); /* current selection */
    - GntTreeRow *top; /* The topmost visible item */
    - GntTreeRow *bottom; /* The bottommost visible item */
    + GntTreeRow *GNTSEAL(top); /* The topmost visible item */
    + GntTreeRow *GNTSEAL(bottom); /* The bottommost visible item */
    - GntTreeRow *root; /* The root of all evil */
    + GntTreeRow *GNTSEAL(root); /* The root of all evil */
    - GList *list; /* List of GntTreeRow s */
    - GHashTable *hash; /* We need this for quickly referencing the rows */
    - GntTreeHashFunc hash_func;
    - GntTreeHashEqualityFunc hash_eq_func;
    - GDestroyNotify key_destroy;
    - GDestroyNotify value_destroy;
    + GList *GNTSEAL(list); /* List of GntTreeRow s */
    + GHashTable *GNTSEAL(hash); /* We need this for quickly referencing the rows */
    + GntTreeHashFunc GNTSEAL(hash_func);
    + GntTreeHashEqualityFunc GNTSEAL(hash_eq_func);
    + GDestroyNotify GNTSEAL(key_destroy);
    + GDestroyNotify GNTSEAL(value_destroy);
    - int ncol; /* No. of columns */
    - GntTreeColInfo *columns; /* Would a GList be better? */
    - gboolean show_title;
    - gboolean show_separator; /* Whether to show column separators */
    + int GNTSEAL(ncol); /* No. of columns */
    + GntTreeColInfo *GNTSEAL(columns); /* Would a GList be better? */
    + gboolean GNTSEAL(show_title);
    + gboolean GNTSEAL(show_separator); /* Whether to show column separators */
    - GntTreePriv *priv;
    + GntTreePriv *GNTSEAL(priv);
    };
    struct _GntTreeClass
    @@ -261,7 +266,7 @@
    *
    * Returns: (transfer none): The key of the row.
    *
    - * Since: 2.8.0
    + * Since: 2.7.2
    */
    gpointer gnt_tree_row_get_key(GntTree *tree, GntTreeRow *row);
    @@ -274,7 +279,7 @@
    *
    * Returns: The next row.
    *
    - * Since: 2.8.0
    + * Since: 2.7.2
    */
    GntTreeRow * gnt_tree_row_get_next(GntTree *tree, GntTreeRow *row);
    @@ -287,7 +292,7 @@
    *
    * Returns: The previous row.
    *
    - * Since: 2.8.0
    + * Since: 2.7.2
    */
    GntTreeRow * gnt_tree_row_get_prev(GntTree *tree, GntTreeRow *row);
    @@ -300,7 +305,7 @@
    *
    * Returns: The child row.
    *
    - * Since: 2.8.0
    + * Since: 2.7.2
    */
    GntTreeRow * gnt_tree_row_get_child(GntTree *tree, GntTreeRow *row);
    @@ -313,7 +318,7 @@
    *
    * Returns: The parent row.
    *
    - * Since: 2.8.0
    + * Since: 2.7.2
    */
    GntTreeRow * gnt_tree_row_get_parent(GntTree *tree, GntTreeRow *row);
    @@ -503,7 +508,7 @@
    *
    * See gnt_tree_set_column_titles(), gnt_tree_set_show_title().
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_tree_set_column_title(GntTree *tree, int index, const char *title);
    @@ -615,7 +620,7 @@
    *
    * See gnt_tree_set_col_width(), gnt_tree_set_column_width_ratio().
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_tree_set_column_resizable(GntTree *tree, int col, gboolean res);
    @@ -638,7 +643,7 @@
    *
    * Set whether text in a column should be right-aligned.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_tree_set_column_is_right_aligned(GntTree *tree, int col, gboolean right);
    @@ -654,7 +659,7 @@
    *
    * See gnt_tree_set_col_width(), gnt_tree_set_column_resizable().
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_tree_set_column_width_ratio(GntTree *tree, int cols[]);
    @@ -665,7 +670,7 @@
    *
    * Set the column to use for typeahead searching.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_tree_set_search_column(GntTree *tree, int col);
    @@ -677,7 +682,7 @@
    *
    * Returns: %TRUE if the user is searching, %FALSE otherwise.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    gboolean gnt_tree_is_searching(GntTree *tree);
    @@ -692,7 +697,7 @@
    *
    * Set a custom search function.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_tree_set_search_function(GntTree *tree,
    gboolean (*func)(GntTree *tree, gpointer key, const char *search, const char *current));
    --- a/gntutils.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntutils.h Sat Apr 20 02:29:16 2019 -0400
    @@ -162,7 +162,7 @@
    *
    * Make some keypress activate a button when some key is pressed with 'wid' in focus.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_util_set_trigger_widget(GntWidget *widget, const char *key, GntWidget *button);
    --- a/gntwidget.c Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntwidget.c Sat Apr 20 02:29:16 2019 -0400
    @@ -374,6 +374,26 @@
    gnt_widget_set_mapped(widget, FALSE);
    }
    +GntWidget *
    +gnt_widget_get_parent(GntWidget *widget)
    +{
    + g_return_val_if_fail(GNT_IS_WIDGET(widget), NULL);
    +
    + return widget->parent;
    +}
    +
    +GntWidget *
    +gnt_widget_get_toplevel(GntWidget *widget)
    +{
    + g_return_val_if_fail(GNT_IS_WIDGET(widget), NULL);
    +
    + while (widget->parent) {
    + widget = widget->parent;
    + }
    +
    + return widget;
    +}
    +
    void
    gnt_widget_set_position(GntWidget *wid, int x, int y)
    {
    --- a/gntwidget.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntwidget.h Sat Apr 20 02:29:16 2019 -0400
    @@ -32,6 +32,14 @@
    #include <stdio.h>
    #include <glib.h>
    +#ifndef GNTSEAL
    +# if defined(GNTSEAL_ENABLE)
    +# define GNTSEAL(ident) _gnt_sealed__ ## ident
    +# else
    +# define GNTSEAL(ident) ident
    +# endif
    +#endif /* !GNTSEAL */
    +
    #include "gntbindable.h"
    #define GNT_TYPE_WIDGET (gnt_widget_get_type())
    @@ -139,24 +147,34 @@
    GNT_PARAM_SERIALIZABLE = 1 << G_PARAM_USER_SHIFT
    } GntParamFlags;
    +/**
    + * GntWidgetPriv:
    + *
    + * Access to any fields is deprecated. See inline comments for replacements.
    + */
    struct _GntWidgetPriv
    {
    - int x, y;
    - int width, height;
    - GntWidgetFlags flags;
    - char *name;
    + int GNTSEAL(x), GNTSEAL(y);
    + int GNTSEAL(width), GNTSEAL(height);
    + GntWidgetFlags GNTSEAL(flags);
    + char *GNTSEAL(name);
    - int minw, minh; /* Minimum size for the widget */
    + int GNTSEAL(minw), GNTSEAL(minh); /* Minimum size for the widget */
    };
    +/**
    + * GntWidget:
    + *
    + * Access to any fields is deprecated. See inline comments for replacements.
    + */
    struct _GntWidget
    {
    GntBindable inherit;
    - GntWidget *parent;
    + GntWidget *GNTSEAL(parent); /* Deprecated. Use gnt_widget_get_parent. */
    - GntWidgetPriv priv;
    - WINDOW *window;
    + GntWidgetPriv GNTSEAL(priv);
    + WINDOW *GNTSEAL(window);
    /*< private >*/
    void *res1;
    @@ -248,6 +266,31 @@
    void gnt_widget_hide(GntWidget *widget);
    /**
    + * gnt_widget_get_parent:
    + * @widget: The widget.
    + *
    + * Get the parent of a widget.
    + *
    + * Returns: (transfer none) (nullable): The parent widget.
    + *
    + * Since: 2.14.0
    + */
    +GntWidget *gnt_widget_get_parent(GntWidget *widget);
    +
    +/**
    + * gnt_widget_get_toplevel:
    + * @widget: The widget.
    + *
    + * Get the toplevel parent of a widget in the container hierarchy. If widget
    + * has no parent widgets, it will be returned as the topmost widget.
    + *
    + * Returns: (transfer none) (nullable): The toplevel parent widget.
    + *
    + * Since: 2.14.0
    + */
    +GntWidget *gnt_widget_get_toplevel(GntWidget *widget);
    +
    +/**
    * gnt_widget_get_position:
    * @widget: The widget.
    * @x: Location to store the x-coordinate of the widget.
    --- a/gntwm.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntwm.h Sat Apr 20 02:29:16 2019 -0400
    @@ -29,6 +29,7 @@
    * @short_description: A window manager
    */
    +#include "gnt.h"
    #include "gntwidget.h"
    #include "gntmenu.h"
    #include "gntws.h"
    @@ -97,35 +98,38 @@
    * @event_stack: Will be set to %TRUE when a user-event, ie. a mouse-click or a
    * key-press is being processed. This variable will be used to
    * determine whether to give focus to a new window.
    + *
    + * Access to any fields is deprecated. See inline comments for replacements.
    + *
    */
    struct _GntWM
    {
    GntBindable inherit;
    /*< public >*/
    - GMainLoop *loop;
    + GMainLoop *GNTSEAL(loop);
    - GList *workspaces;
    - GList *tagged; /* tagged windows */
    - GntWS *cws;
    + GList *GNTSEAL(workspaces);
    + GList *GNTSEAL(tagged); /* tagged windows */
    + GntWS *GNTSEAL(cws);
    - GntListWindow _list;
    - GntListWindow *windows; /* Window-list window */
    - GntListWindow *actions; /* Action-list window */
    + GntListWindow GNTSEAL(_list);
    + GntListWindow *GNTSEAL(windows); /* Window-list window */
    + GntListWindow *GNTSEAL(actions); /* Action-list window */
    - GHashTable *nodes; /* GntWidget -> GntNode */
    - GHashTable *name_places; /* window name -> ws*/
    - GHashTable *title_places; /* window title -> ws */
    + GHashTable *GNTSEAL(nodes); /* GntWidget -> GntNode */
    + GHashTable *GNTSEAL(name_places); /* window name -> ws*/
    + GHashTable *GNTSEAL(title_places); /* window title -> ws */
    - GList *acts;
    + GList *GNTSEAL(acts);
    - GntMenu *menu;
    + GntMenu *GNTSEAL(menu);
    - gboolean event_stack;
    + gboolean GNTSEAL(event_stack);
    - GntKeyPressMode mode;
    + GntKeyPressMode GNTSEAL(mode);
    - GHashTable *positions;
    + GHashTable *GNTSEAL(positions);
    /*< private >*/
    void *res1;
    --- a/gntws.h Tue Apr 16 21:10:29 2019 -0500
    +++ b/gntws.h Sat Apr 20 02:29:16 2019 -0400
    @@ -29,6 +29,7 @@
    * @short_description: Workspace API
    */
    +#include "gnt.h"
    #include "gntwidget.h"
    #include <panel.h>
    @@ -41,18 +42,23 @@
    typedef struct _GntWS GntWS;
    +/**
    + * GntWS:
    + *
    + * Access to any fields is deprecated. See inline comments for replacements.
    + */
    struct _GntWS
    {
    GntBindable inherit;
    - char *name;
    - GList *list;
    - GList *ordered;
    - gpointer ui_data;
    + char *GNTSEAL(name);
    + GList *GNTSEAL(list);
    + GList *GNTSEAL(ordered);
    + gpointer GNTSEAL(ui_data);
    - void *res1;
    - void *res2;
    - void *res3;
    - void *res4;
    + void *GNTSEAL(res1);
    + void *GNTSEAL(res2);
    + void *GNTSEAL(res3);
    + void *GNTSEAL(res4);
    };
    typedef struct _GntWSClass GntWSClass;
    @@ -76,7 +82,7 @@
    *
    * Returns: The GType for GntWS.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    GType gnt_ws_get_type(void);
    @@ -88,7 +94,7 @@
    *
    * Returns: The newly created workspace.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    GntWS *gnt_ws_new(const char *name);
    @@ -99,7 +105,7 @@
    *
    * Set the name of a workspace.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_ws_set_name(GntWS *ws, const gchar *name);
    @@ -110,7 +116,7 @@
    *
    * Add a widget to a workspace.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_ws_add_widget(GntWS *ws, GntWidget *widget);
    @@ -121,7 +127,7 @@
    *
    * Remove a widget from a workspace.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_ws_remove_widget(GntWS *ws, GntWidget *widget);
    @@ -132,7 +138,7 @@
    *
    * Hide a widget in a workspace.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_ws_widget_hide(GntWidget *widget, GHashTable *nodes);
    @@ -143,7 +149,7 @@
    *
    * Show a widget in a workspace.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_ws_widget_show(GntWidget *widget, GHashTable *nodes);
    @@ -154,7 +160,7 @@
    *
    * Draw the taskbar in a workspace.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_ws_draw_taskbar(GntWS *ws, gboolean reposition);
    @@ -165,7 +171,7 @@
    *
    * Hide a workspace.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_ws_hide(GntWS *ws, GHashTable *table);
    @@ -176,7 +182,7 @@
    *
    * Show a workspace.
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    void gnt_ws_show(GntWS *ws, GHashTable *table);
    @@ -188,7 +194,7 @@
    *
    * Returns: The name of the workspace (can be %NULL).
    *
    - * Since: 2.0.0
    + * Since: 2.1.0
    */
    const char * gnt_ws_get_name(GntWS *ws);