qulogic/libgnt

Make GObject data into private GntBox data.

2019-04-24, Elliott Sales de Andrade
e997387955f7
Parents 6acd81c5c10a
Children 5bdaafe83d97
Make GObject data into private GntBox data.

We have a private struct now, so there's no need to go through
g_object_[gs]et_data.
  • +8 -8
    gntbox.c
  • --- a/gntbox.c Wed Apr 24 02:53:32 2019 -0400
    +++ b/gntbox.c Wed Apr 24 02:57:45 2019 -0400
    @@ -41,13 +41,13 @@
    char *title;
    GList *focus; /* List of widgets to cycle focus (only valid for parent
    boxes) */
    +
    + GntWidget *last_resize;
    + GntWidget *size_queued;
    } GntBoxPrivate;
    G_DEFINE_TYPE_WITH_PRIVATE(GntBox, gnt_box, GNT_TYPE_WIDGET)
    -#define PROP_LAST_RESIZE_S "last-resize"
    -#define PROP_SIZE_QUEUED_S "size-queued"
    -
    enum
    {
    PROP_0,
    @@ -441,7 +441,7 @@
    return TRUE; /* Quit playing games with my size */
    child = NULL;
    - last = g_object_get_data(G_OBJECT(box), PROP_LAST_RESIZE_S);
    + last = priv->last_resize;
    /* First, make sure all the widgets will fit into the box after resizing. */
    for (iter = priv->list; iter; iter = iter->next) {
    @@ -465,7 +465,7 @@
    child = NULL;
    }
    - g_object_set_data(G_OBJECT(box), PROP_SIZE_QUEUED_S, child);
    + priv->size_queued = child;
    if (child) {
    for (iter = priv->list; iter; iter = iter->next) {
    @@ -510,12 +510,12 @@
    wchange = widget->priv.width - oldw;
    hchange = widget->priv.height - oldh;
    - wid = g_object_get_data(G_OBJECT(box), PROP_SIZE_QUEUED_S);
    + wid = priv->size_queued;
    if (wid) {
    gnt_widget_get_size(wid, &tw, &th);
    gnt_widget_set_size(wid, tw + wchange, th + hchange);
    - g_object_set_data(G_OBJECT(box), PROP_SIZE_QUEUED_S, NULL);
    - g_object_set_data(G_OBJECT(box), PROP_LAST_RESIZE_S, wid);
    + priv->size_queued = NULL;
    + priv->last_resize = wid;
    }
    if (priv->vertical) {