qulogic/libgnt

Add an accessor for GntWidget->parent.
release-2.x.y
2019-04-11, Elliott Sales de Andrade
b1d6cdff79d5
Parents abe8010bbae0
Children e59cae5434a0
Add an accessor for GntWidget->parent.
  • +8 -0
    gntwidget.c
  • +13 -1
    gntwidget.h
  • --- a/gntwidget.c Thu Apr 11 04:34:59 2019 -0400
    +++ b/gntwidget.c Thu Apr 11 04:39:24 2019 -0400
    @@ -447,6 +447,14 @@
    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;
    +}
    +
    void
    gnt_widget_set_position(GntWidget *wid, int x, int y)
    {
    --- a/gntwidget.h Thu Apr 11 04:34:59 2019 -0400
    +++ b/gntwidget.h Thu Apr 11 04:39:24 2019 -0400
    @@ -162,7 +162,7 @@
    {
    GntBindable inherit;
    - GntWidget *GNTSEAL(parent);
    + GntWidget *GNTSEAL(parent); /* Deprecated. Use gnt_widget_get_parent. */
    GntWidgetPriv GNTSEAL(priv);
    WINDOW *GNTSEAL(window);
    @@ -257,6 +257,18 @@
    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_position:
    * @widget: The widget.
    * @x: Location to store the x-coordinate of the widget.