[gtk/grid-api] grid layout: Rename some properties




commit 1e6654e91d9c2b59b3541b21d392fa7b662a39a4
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Aug 2 14:13:14 2020 -0400

    grid layout: Rename some properties
    
    Rename GtkGridLayoutChild:left-attach/top-attach to
    GtkGridLayoutChild:column/row. Update all users.
    
    Fixes: #2967

 docs/reference/gtk/gtk4-sections.txt |   8 +--
 gtk/gtkgrid.c                        | 112 +++++++++++++++++------------------
 gtk/gtkgrid.h                        |  12 ++--
 gtk/gtkgridlayout.c                  |  94 ++++++++++++++---------------
 gtk/gtkgridlayout.h                  |  12 ++--
 testsuite/gtk/grid-layout.c          |  56 +++++++++---------
 6 files changed, 146 insertions(+), 148 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index cb4fced509..c6ef42f3e8 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -7247,10 +7247,10 @@ gtk_grid_layout_get_baseline_row
 <SUBSECTION>
 GtkGridLayoutChild
 
-gtk_grid_layout_child_set_top_attach
-gtk_grid_layout_child_get_top_attach
-gtk_grid_layout_child_set_left_attach
-gtk_grid_layout_child_get_left_attach
+gtk_grid_layout_child_set_column
+gtk_grid_layout_child_get_column
+gtk_grid_layout_child_set_row
+gtk_grid_layout_child_get_row
 gtk_grid_layout_child_set_column_span
 gtk_grid_layout_child_get_column_span
 gtk_grid_layout_child_set_row_span
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c
index d1a951ab15..3a5b6a7a95 100644
--- a/gtk/gtkgrid.c
+++ b/gtk/gtkgrid.c
@@ -185,8 +185,8 @@ gtk_grid_set_property (GObject      *object,
 static void
 grid_attach (GtkGrid   *grid,
              GtkWidget *widget,
-             int        left,
-             int        top,
+             int        column,
+             int        row,
              int        width,
              int        height)
 {
@@ -196,8 +196,8 @@ grid_attach (GtkGrid   *grid,
   gtk_widget_set_parent (widget, GTK_WIDGET (grid));
 
   grid_child = GTK_GRID_LAYOUT_CHILD (gtk_layout_manager_get_layout_child (priv->layout_manager, widget));
-  gtk_grid_layout_child_set_left_attach (grid_child, left);
-  gtk_grid_layout_child_set_top_attach (grid_child, top);
+  gtk_grid_layout_child_set_column (grid_child, column);
+  gtk_grid_layout_child_set_row (grid_child, row);
   gtk_grid_layout_child_set_column_span (grid_child, width);
   gtk_grid_layout_child_set_row_span (grid_child, height);
 }
@@ -241,16 +241,16 @@ find_attach_position (GtkGrid         *grid,
       switch (orientation)
         {
         case GTK_ORIENTATION_HORIZONTAL:
-          attach_pos = gtk_grid_layout_child_get_left_attach (grid_child);
+          attach_pos = gtk_grid_layout_child_get_column (grid_child);
           attach_span = gtk_grid_layout_child_get_column_span (grid_child);
-          opposite_pos = gtk_grid_layout_child_get_top_attach (grid_child);
+          opposite_pos = gtk_grid_layout_child_get_row (grid_child);
           opposite_span = gtk_grid_layout_child_get_row_span (grid_child);
           break;
 
         case GTK_ORIENTATION_VERTICAL:
-          attach_pos = gtk_grid_layout_child_get_top_attach (grid_child);
+          attach_pos = gtk_grid_layout_child_get_row (grid_child);
           attach_span = gtk_grid_layout_child_get_row_span (grid_child);
-          opposite_pos = gtk_grid_layout_child_get_left_attach (grid_child);
+          opposite_pos = gtk_grid_layout_child_get_column (grid_child);
           opposite_span = gtk_grid_layout_child_get_column_span (grid_child);
           break;
 
@@ -456,22 +456,22 @@ gtk_grid_new (void)
  * gtk_grid_attach:
  * @grid: a #GtkGrid
  * @child: the widget to add
- * @left: the column number to attach the left side of @child to
- * @top: the row number to attach the top side of @child to
+ * @column: the column number to attach the left side of @child to
+ * @row: the row number to attach the top side of @child to
  * @width: the number of columns that @child will span
  * @height: the number of rows that @child will span
  *
  * Adds a widget to the grid.
  *
- * The position of @child is determined by @left and @top. The
- * number of “cells” that @child will occupy is determined by
- * @width and @height.
+ * The position of @child is determined by @column and @row.
+ * The number of “cells” that @child will occupy is determined
+ * by @width and @height.
  */
 void
 gtk_grid_attach (GtkGrid   *grid,
                  GtkWidget *child,
-                 int        left,
-                 int        top,
+                 int        column,
+                 int        row,
                  int        width,
                  int        height)
 {
@@ -481,7 +481,7 @@ gtk_grid_attach (GtkGrid   *grid,
   g_return_if_fail (width > 0);
   g_return_if_fail (height > 0);
 
-  grid_attach (grid, child, left, top, width, height);
+  grid_attach (grid, child, column, row, width, height);
 }
 
 /**
@@ -530,21 +530,21 @@ gtk_grid_attach_next_to (GtkGrid         *grid,
       switch (side)
         {
         case GTK_POS_LEFT:
-          left = gtk_grid_layout_child_get_left_attach (grid_sibling) - width;
-          top = gtk_grid_layout_child_get_top_attach (grid_sibling);
+          left = gtk_grid_layout_child_get_column (grid_sibling) - width;
+          top = gtk_grid_layout_child_get_row (grid_sibling);
           break;
         case GTK_POS_RIGHT:
-          left = gtk_grid_layout_child_get_left_attach (grid_sibling) +
+          left = gtk_grid_layout_child_get_column (grid_sibling) +
                  gtk_grid_layout_child_get_column_span (grid_sibling);
-          top = gtk_grid_layout_child_get_top_attach (grid_sibling);
+          top = gtk_grid_layout_child_get_row (grid_sibling);
           break;
         case GTK_POS_TOP:
-          left = gtk_grid_layout_child_get_left_attach (grid_sibling);
-          top = gtk_grid_layout_child_get_top_attach (grid_sibling) - height;
+          left = gtk_grid_layout_child_get_column (grid_sibling);
+          top = gtk_grid_layout_child_get_row (grid_sibling) - height;
           break;
         case GTK_POS_BOTTOM:
-          left = gtk_grid_layout_child_get_left_attach (grid_sibling);
-          top = gtk_grid_layout_child_get_top_attach (grid_sibling) +
+          left = gtk_grid_layout_child_get_column (grid_sibling);
+          top = gtk_grid_layout_child_get_row (grid_sibling) +
                 gtk_grid_layout_child_get_row_span (grid_sibling);
           break;
         default:
@@ -584,18 +584,18 @@ gtk_grid_attach_next_to (GtkGrid         *grid,
 /**
  * gtk_grid_get_child_at:
  * @grid: a #GtkGrid
- * @left: the left edge of the cell
- * @top: the top edge of the cell
+ * @column: the left edge of the cell
+ * @row: the top edge of the cell
  *
  * Gets the child of @grid whose area covers the grid
- * cell whose upper left corner is at @left, @top.
+ * cell at @column, @row.
  *
  * Returns: (transfer none) (nullable): the child at the given position, or %NULL
  */
 GtkWidget *
 gtk_grid_get_child_at (GtkGrid *grid,
-                       int      left,
-                       int      top)
+                       int      column,
+                       int      row)
 {
   GtkGridPrivate *priv = gtk_grid_get_instance_private (grid);
   GtkWidget *child;
@@ -607,18 +607,16 @@ gtk_grid_get_child_at (GtkGrid *grid,
        child = gtk_widget_get_next_sibling (child))
     {
       GtkGridLayoutChild *grid_child;
-      int child_left, child_top, child_width, child_height;
-      
+      int child_column, child_row, child_width, child_height;
+
       grid_child = GTK_GRID_LAYOUT_CHILD (gtk_layout_manager_get_layout_child (priv->layout_manager, child));
-      child_left = gtk_grid_layout_child_get_left_attach (grid_child);
-      child_top = gtk_grid_layout_child_get_top_attach (grid_child);
+      child_column = gtk_grid_layout_child_get_column (grid_child);
+      child_row = gtk_grid_layout_child_get_row (grid_child);
       child_width = gtk_grid_layout_child_get_column_span (grid_child);
       child_height = gtk_grid_layout_child_get_row_span (grid_child);
 
-      if (child_left <= left &&
-          child_left + child_width > left &&
-          child_top <= top &&
-          child_top + child_height > top)
+      if (child_column <= column && child_column + child_width > column &&
+          child_row <= row && child_row + child_height > row)
         return child;
     }
 
@@ -672,11 +670,11 @@ gtk_grid_insert_row (GtkGrid *grid,
       GtkGridLayoutChild *grid_child;
       
       grid_child = GTK_GRID_LAYOUT_CHILD (gtk_layout_manager_get_layout_child (priv->layout_manager, child));
-      top = gtk_grid_layout_child_get_top_attach (grid_child);
+      top = gtk_grid_layout_child_get_row (grid_child);
       height = gtk_grid_layout_child_get_row_span (grid_child);
 
       if (top >= position)
-        gtk_grid_layout_child_set_top_attach (grid_child, top + 1);
+        gtk_grid_layout_child_set_row (grid_child, top + 1);
       else if (top + height > position)
         gtk_grid_layout_child_set_row_span (grid_child, height + 1);
     }
@@ -711,7 +709,7 @@ gtk_grid_remove_row (GtkGrid *grid,
       int top, height;
 
       grid_child = GTK_GRID_LAYOUT_CHILD (gtk_layout_manager_get_layout_child (priv->layout_manager, child));
-      top = gtk_grid_layout_child_get_top_attach (grid_child);
+      top = gtk_grid_layout_child_get_row (grid_child);
       height = gtk_grid_layout_child_get_row_span (grid_child);
 
       if (top <= position && top + height > position)
@@ -726,7 +724,7 @@ gtk_grid_remove_row (GtkGrid *grid,
       else
         {
           gtk_grid_layout_child_set_row_span (grid_child, height);
-          gtk_grid_layout_child_set_top_attach (grid_child, top);
+          gtk_grid_layout_child_set_row (grid_child, top);
         }
 
       child = next;
@@ -761,11 +759,11 @@ gtk_grid_insert_column (GtkGrid *grid,
       int left, width;
 
       grid_child = GTK_GRID_LAYOUT_CHILD (gtk_layout_manager_get_layout_child (priv->layout_manager, child));
-      left = gtk_grid_layout_child_get_left_attach (grid_child);
+      left = gtk_grid_layout_child_get_column (grid_child);
       width = gtk_grid_layout_child_get_column_span (grid_child);
 
       if (left >= position)
-        gtk_grid_layout_child_set_left_attach (grid_child, left + 1);
+        gtk_grid_layout_child_set_column (grid_child, left + 1);
       else if (left + width > position)
         gtk_grid_layout_child_set_column_span (grid_child, width + 1);
     }
@@ -801,7 +799,7 @@ gtk_grid_remove_column (GtkGrid *grid,
 
       grid_child = GTK_GRID_LAYOUT_CHILD (gtk_layout_manager_get_layout_child (priv->layout_manager, child));
 
-      left = gtk_grid_layout_child_get_left_attach (grid_child);
+      left = gtk_grid_layout_child_get_column (grid_child);
       width = gtk_grid_layout_child_get_column_span (grid_child);
 
       if (left <= position && left + width > position)
@@ -816,7 +814,7 @@ gtk_grid_remove_column (GtkGrid *grid,
       else
         {
           gtk_grid_layout_child_set_column_span (grid_child, width);
-          gtk_grid_layout_child_set_left_attach (grid_child, left);
+          gtk_grid_layout_child_set_column (grid_child, left);
         }
 
       child = next;
@@ -854,21 +852,21 @@ gtk_grid_insert_next_to (GtkGrid         *grid,
   switch (side)
     {
     case GTK_POS_LEFT:
-      gtk_grid_insert_column (grid, gtk_grid_layout_child_get_left_attach (child));
+      gtk_grid_insert_column (grid, gtk_grid_layout_child_get_column (child));
       break;
     case GTK_POS_RIGHT:
       {
-        int col = gtk_grid_layout_child_get_left_attach (child) +
+        int col = gtk_grid_layout_child_get_column (child) +
                   gtk_grid_layout_child_get_column_span (child);
         gtk_grid_insert_column (grid, col);
       }
       break;
     case GTK_POS_TOP:
-      gtk_grid_insert_row (grid, gtk_grid_layout_child_get_top_attach (child));
+      gtk_grid_insert_row (grid, gtk_grid_layout_child_get_row (child));
       break;
     case GTK_POS_BOTTOM:
       {
-        int row = gtk_grid_layout_child_get_top_attach (child) +
+        int row = gtk_grid_layout_child_get_row (child) +
                   gtk_grid_layout_child_get_row_span (child);
         gtk_grid_insert_row (grid, row);
       }
@@ -1142,8 +1140,8 @@ gtk_grid_get_baseline_row (GtkGrid *grid)
  * gtk_grid_query_child:
  * @grid: a #GtkGrid
  * @child: a #GtkWidget child of @grid
- * @left: (out) (optional): the column used to attach the left side of @child
- * @top: (out) (optional): the row used to attach the top side of @child
+ * @column: (out) (optional): the column used to attach the left side of @child
+ * @row: (out) (optional): the row used to attach the top side of @child
  * @width: (out) (optional): the number of columns @child spans
  * @height: (out) (optional): the number of rows @child spans
  *
@@ -1152,8 +1150,8 @@ gtk_grid_get_baseline_row (GtkGrid *grid)
 void
 gtk_grid_query_child (GtkGrid   *grid,
                       GtkWidget *child,
-                      int       *left,
-                      int       *top,
+                      int       *column,
+                      int       *row,
                       int       *width,
                       int       *height)
 {
@@ -1166,10 +1164,10 @@ gtk_grid_query_child (GtkGrid   *grid,
 
   grid_child = GTK_GRID_LAYOUT_CHILD (gtk_layout_manager_get_layout_child (priv->layout_manager, child));
 
-  if (left != NULL)
-    *left = gtk_grid_layout_child_get_left_attach (grid_child);
-  if (top != NULL)
-    *top = gtk_grid_layout_child_get_top_attach (grid_child);
+  if (column != NULL)
+    *column = gtk_grid_layout_child_get_column (grid_child);
+  if (row != NULL)
+    *row = gtk_grid_layout_child_get_row (grid_child);
   if (width != NULL)
     *width = gtk_grid_layout_child_get_column_span (grid_child);
   if (height != NULL)
diff --git a/gtk/gtkgrid.h b/gtk/gtkgrid.h
index 7c0bbb4ac0..c482a3b898 100644
--- a/gtk/gtkgrid.h
+++ b/gtk/gtkgrid.h
@@ -66,8 +66,8 @@ GtkWidget* gtk_grid_new                    (void);
 GDK_AVAILABLE_IN_ALL
 void       gtk_grid_attach                 (GtkGrid         *grid,
                                             GtkWidget       *child,
-                                            int              left,
-                                            int              top,
+                                            int              column,
+                                            int              row,
                                             int              width,
                                             int              height);
 GDK_AVAILABLE_IN_ALL
@@ -79,8 +79,8 @@ void       gtk_grid_attach_next_to         (GtkGrid         *grid,
                                             int              height);
 GDK_AVAILABLE_IN_ALL
 GtkWidget *gtk_grid_get_child_at           (GtkGrid         *grid,
-                                            int              left,
-                                            int              top);
+                                            int              column,
+                                            int              row);
 GDK_AVAILABLE_IN_ALL
 void       gtk_grid_remove                 (GtkGrid         *grid,
                                             GtkWidget       *child);
@@ -137,8 +137,8 @@ int        gtk_grid_get_baseline_row       (GtkGrid         *grid);
 GDK_AVAILABLE_IN_ALL
 void       gtk_grid_query_child            (GtkGrid         *grid,
                                             GtkWidget       *child,
-                                            int             *left,
-                                            int             *top,
+                                            int             *column,
+                                            int             *row,
                                             int             *width,
                                             int             *height);
 
diff --git a/gtk/gtkgridlayout.c b/gtk/gtkgridlayout.c
index 77904f80b2..420b08d0ed 100644
--- a/gtk/gtkgridlayout.c
+++ b/gtk/gtkgridlayout.c
@@ -67,14 +67,14 @@ struct _GtkGridLayoutChild
   GridChildAttach attach[2];
 };
 
-#define CHILD_LEFT_ATTACH(child)        ((child)->attach[GTK_ORIENTATION_HORIZONTAL].pos)
-#define CHILD_COL_SPAN(child)           ((child)->attach[GTK_ORIENTATION_HORIZONTAL].span)
-#define CHILD_TOP_ATTACH(child)         ((child)->attach[GTK_ORIENTATION_VERTICAL].pos)
-#define CHILD_ROW_SPAN(child)           ((child)->attach[GTK_ORIENTATION_VERTICAL].span)
+#define CHILD_COLUMN(child)     ((child)->attach[GTK_ORIENTATION_HORIZONTAL].pos)
+#define CHILD_COL_SPAN(child)   ((child)->attach[GTK_ORIENTATION_HORIZONTAL].span)
+#define CHILD_ROW(child)        ((child)->attach[GTK_ORIENTATION_VERTICAL].pos)
+#define CHILD_ROW_SPAN(child)   ((child)->attach[GTK_ORIENTATION_VERTICAL].span)
 
 enum {
-  PROP_CHILD_LEFT_ATTACH = 1,
-  PROP_CHILD_TOP_ATTACH,
+  PROP_CHILD_COLUMN = 1,
+  PROP_CHILD_ROW,
   PROP_CHILD_COLUMN_SPAN,
   PROP_CHILD_ROW_SPAN,
 
@@ -95,12 +95,12 @@ gtk_grid_layout_child_set_property (GObject      *gobject,
 
   switch (prop_id)
     {
-    case PROP_CHILD_LEFT_ATTACH:
-      gtk_grid_layout_child_set_left_attach (self, g_value_get_int (value));
+    case PROP_CHILD_COLUMN:
+      gtk_grid_layout_child_set_column (self, g_value_get_int (value));
       break;
 
-    case PROP_CHILD_TOP_ATTACH:
-      gtk_grid_layout_child_set_top_attach (self, g_value_get_int (value));
+    case PROP_CHILD_ROW :
+      gtk_grid_layout_child_set_row (self, g_value_get_int (value));
       break;
 
     case PROP_CHILD_COLUMN_SPAN:
@@ -127,12 +127,12 @@ gtk_grid_layout_child_get_property (GObject    *gobject,
 
   switch (prop_id)
     {
-    case PROP_CHILD_LEFT_ATTACH:
-      g_value_set_int (value, CHILD_LEFT_ATTACH (self));
+    case PROP_CHILD_COLUMN:
+      g_value_set_int (value, CHILD_COLUMN (self));
       break;
 
-    case PROP_CHILD_TOP_ATTACH:
-      g_value_set_int (value, CHILD_TOP_ATTACH (self));
+    case PROP_CHILD_ROW:
+      g_value_set_int (value, CHILD_ROW (self));
       break;
 
     case PROP_CHILD_COLUMN_SPAN:
@@ -158,26 +158,26 @@ gtk_grid_layout_child_class_init (GtkGridLayoutChildClass *klass)
   gobject_class->get_property = gtk_grid_layout_child_get_property;
 
   /**
-   * GtkGridLayoutChild:left-attach:
+   * GtkGridLayoutChild:column:
    *
-   * The column number to attach the left side of the child to.
+   * The column to place the child in.
    */
-  child_props[PROP_CHILD_LEFT_ATTACH] =
-    g_param_spec_int ("left-attach",
-                      P_("Left attachment"),
-                      P_("The column number to attach the left side of the child to"),
+  child_props[PROP_CHILD_COLUMN] =
+    g_param_spec_int ("column",
+                      P_("Column"),
+                      P_("The column place the child in"),
                       G_MININT, G_MAXINT, 0,
                       GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
-   * GtkGridLayoutChild:top-attach:
+   * GtkGridLayoutChild:row:
    *
-   * The row number to attach the top side of the child to.
+   * The row to place the child in.
    */
-  child_props[PROP_CHILD_TOP_ATTACH] =
-    g_param_spec_int ("top-attach",
-                      P_("Top attachment"),
-                      P_("The row number to attach the top side of a child widget to"),
+  child_props[PROP_CHILD_ROW] =
+    g_param_spec_int ("row",
+                      P_("Row"),
+                      P_("The row to place the child in"),
                       G_MININT, G_MAXINT, 0,
                       GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
@@ -216,30 +216,30 @@ gtk_grid_layout_child_init (GtkGridLayoutChild *self)
 }
 
 /**
- * gtk_grid_layout_child_set_top_attach:
+ * gtk_grid_layout_child_set_row:
  * @child: a #GtkGridLayoutChild
- * @attach: the attach point for @child
+ * @row: the row for @child
  *
- * Sets the row number to attach the top side of @child.
+ * Sets the row to place @child in.
  */
 void
-gtk_grid_layout_child_set_top_attach (GtkGridLayoutChild *child,
-                                      int                 attach)
+gtk_grid_layout_child_set_row (GtkGridLayoutChild *child,
+                               int                 row)
 {
   g_return_if_fail (GTK_IS_GRID_LAYOUT_CHILD (child));
 
-  if (CHILD_TOP_ATTACH (child) == attach)
+  if (CHILD_ROW (child) == row)
     return;
 
-  CHILD_TOP_ATTACH (child) = attach;
+  CHILD_ROW (child) = row;
 
   gtk_layout_manager_layout_changed (gtk_layout_child_get_layout_manager (GTK_LAYOUT_CHILD (child)));
 
-  g_object_notify_by_pspec (G_OBJECT (child), child_props[PROP_CHILD_TOP_ATTACH]);
+  g_object_notify_by_pspec (G_OBJECT (child), child_props[PROP_CHILD_ROW]);
 }
 
 /**
- * gtk_grid_layout_child_get_top_attach:
+ * gtk_grid_layout_child_get_row:
  * @child: a #GtkGridLayoutChild
  *
  * Retrieves the row number to which @child attaches its top side.
@@ -247,38 +247,38 @@ gtk_grid_layout_child_set_top_attach (GtkGridLayoutChild *child,
  * Returns: the row number
  */
 int
-gtk_grid_layout_child_get_top_attach (GtkGridLayoutChild *child)
+gtk_grid_layout_child_get_row (GtkGridLayoutChild *child)
 {
   g_return_val_if_fail (GTK_IS_GRID_LAYOUT_CHILD (child), 0);
 
-  return CHILD_TOP_ATTACH (child);
+  return CHILD_ROW (child);
 }
 
 /**
- * gtk_grid_layout_child_set_left_attach:
+ * gtk_grid_layout_child_set_column:
  * @child: a #GtkGridLayoutChild
- * @attach: the attach point for @child
+ * @column: the attach point for @child
  *
  * Sets the column number to attach the left side of @child.
  */
 void
-gtk_grid_layout_child_set_left_attach (GtkGridLayoutChild *child,
-                                       int                 attach)
+gtk_grid_layout_child_set_column (GtkGridLayoutChild *child,
+                                  int                 column)
 {
   g_return_if_fail (GTK_IS_GRID_LAYOUT_CHILD (child));
 
-  if (CHILD_LEFT_ATTACH (child) == attach)
+  if (CHILD_COLUMN (child) == column)
     return;
 
-  CHILD_LEFT_ATTACH (child) = attach;
+  CHILD_COLUMN (child) = column;
 
   gtk_layout_manager_layout_changed (gtk_layout_child_get_layout_manager (GTK_LAYOUT_CHILD (child)));
 
-  g_object_notify_by_pspec (G_OBJECT (child), child_props[PROP_CHILD_LEFT_ATTACH]);
+  g_object_notify_by_pspec (G_OBJECT (child), child_props[PROP_CHILD_COLUMN]);
 }
 
 /**
- * gtk_grid_layout_child_get_left_attach:
+ * gtk_grid_layout_child_get_column:
  * @child: a #GtkGridLayoutChild
  *
  * Retrieves the column number to which @child attaches its left side.
@@ -286,11 +286,11 @@ gtk_grid_layout_child_set_left_attach (GtkGridLayoutChild *child,
  * Returns: the column number
  */
 int
-gtk_grid_layout_child_get_left_attach (GtkGridLayoutChild *child)
+gtk_grid_layout_child_get_column (GtkGridLayoutChild *child)
 {
   g_return_val_if_fail (GTK_IS_GRID_LAYOUT_CHILD (child), 0);
 
-  return CHILD_LEFT_ATTACH (child);
+  return CHILD_COLUMN (child);
 }
 
 /**
diff --git a/gtk/gtkgridlayout.h b/gtk/gtkgridlayout.h
index a0bd9e4717..4ea8869f08 100644
--- a/gtk/gtkgridlayout.h
+++ b/gtk/gtkgridlayout.h
@@ -78,15 +78,15 @@ GDK_AVAILABLE_IN_ALL
 G_DECLARE_FINAL_TYPE (GtkGridLayoutChild, gtk_grid_layout_child, GTK, GRID_LAYOUT_CHILD, GtkLayoutChild)
 
 GDK_AVAILABLE_IN_ALL
-void                    gtk_grid_layout_child_set_top_attach            (GtkGridLayoutChild  *child,
-                                                                         int                  attach);
+void                    gtk_grid_layout_child_set_row                   (GtkGridLayoutChild  *child,
+                                                                         int                  row);
 GDK_AVAILABLE_IN_ALL
-int                     gtk_grid_layout_child_get_top_attach            (GtkGridLayoutChild  *child);
+int                     gtk_grid_layout_child_get_row                   (GtkGridLayoutChild  *child);
 GDK_AVAILABLE_IN_ALL
-void                    gtk_grid_layout_child_set_left_attach           (GtkGridLayoutChild  *child,
-                                                                         int                  attach);
+void                    gtk_grid_layout_child_set_column                (GtkGridLayoutChild  *child,
+                                                                         int                  column);
 GDK_AVAILABLE_IN_ALL
-int                     gtk_grid_layout_child_get_left_attach           (GtkGridLayoutChild  *child);
+int                     gtk_grid_layout_child_get_column                (GtkGridLayoutChild  *child);
 GDK_AVAILABLE_IN_ALL
 void                    gtk_grid_layout_child_set_column_span           (GtkGridLayoutChild  *child,
                                                                          int                  span);
diff --git a/testsuite/gtk/grid-layout.c b/testsuite/gtk/grid-layout.c
index b926c3193b..2ac35553b2 100644
--- a/testsuite/gtk/grid-layout.c
+++ b/testsuite/gtk/grid-layout.c
@@ -144,11 +144,11 @@ test_simple_row (void)
   gtk_widget_set_parent (GTK_WIDGET (child3), parent);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child1));
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 0);
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child2));
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 1);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 1);
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child3));
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 2);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 2);
 
   gtk_layout_manager_measure (layout,
                               parent,
@@ -237,11 +237,11 @@ test_simple_column (void)
   gtk_widget_set_parent (GTK_WIDGET (child3), parent);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child1));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 0);
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child2));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 1);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 1);
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child3));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 2);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 2);
 
   gtk_layout_manager_measure (layout,
                               parent,
@@ -348,22 +348,22 @@ test_spans (void)
   gtk_widget_set_parent (GTK_WIDGET (child4), parent);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child1));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 0);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child2));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 1);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 1);
   gtk_grid_layout_child_set_column_span (GTK_GRID_LAYOUT_CHILD (lc), 2);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child3));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 1);
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 1);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 0);
   gtk_grid_layout_child_set_column_span (GTK_GRID_LAYOUT_CHILD (lc), 2);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child4));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 1);
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 2);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 1);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 2);
 
   gtk_layout_manager_measure (layout,
                               parent,
@@ -466,20 +466,20 @@ test_homogeneous (void)
   gtk_widget_set_parent (GTK_WIDGET (child4), parent);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child1));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 0);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child2));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 1);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 1);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child3));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 1);
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 1);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 0);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child4));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 1);
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 1);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 1);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 1);
 
   gtk_layout_manager_measure (layout,
                               parent,
@@ -584,16 +584,16 @@ test_simple_layout (void)
   gtk_widget_set_parent (GTK_WIDGET (child3), parent);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child1));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 0);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child2));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 1);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 1);
 
   lc = gtk_layout_manager_get_layout_child (layout, GTK_WIDGET (child3));
-  gtk_grid_layout_child_set_top_attach (GTK_GRID_LAYOUT_CHILD (lc), 1);
-  gtk_grid_layout_child_set_left_attach (GTK_GRID_LAYOUT_CHILD (lc), 0);
+  gtk_grid_layout_child_set_row (GTK_GRID_LAYOUT_CHILD (lc), 1);
+  gtk_grid_layout_child_set_column (GTK_GRID_LAYOUT_CHILD (lc), 0);
   gtk_grid_layout_child_set_column_span (GTK_GRID_LAYOUT_CHILD (lc), 2);
 
   gtk_layout_manager_measure (layout,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]