[libhandy] Rename HdyColumn to HdyClamp



commit e7ae6f3d1d8a18b8e6f1b58b8a3b5f3bd32e1978
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Fri Apr 3 10:07:37 2020 +0200

    Rename HdyColumn to HdyClamp
    
    Also marks it as present since in 1.0.
    
    Fixes https://gitlab.gnome.org/GNOME/libhandy/issues/222

 .gitlab/issue_templates/bug.md |   2 +-
 debian/libhandy-1-0.symbols    |  12 +--
 doc/handy-docs.xml             |   2 +-
 examples/hdy-demo-window.c     |   2 -
 examples/hdy-demo-window.ui    |  46 ++++-----
 glade/libhandy.xml             |   4 +-
 src/hdy-clamp.c                | 205 ++++++++++++++++++++++-------------------
 src/hdy-clamp.h                |  18 ++--
 src/hdy-preferences-page.ui    |   2 +-
 src/hdy-preferences-window.ui  |   4 +-
 src/hdy-search-bar.c           |   2 +-
 11 files changed, 156 insertions(+), 143 deletions(-)
---
diff --git a/.gitlab/issue_templates/bug.md b/.gitlab/issue_templates/bug.md
index 7b1a82ec..69b8185d 100644
--- a/.gitlab/issue_templates/bug.md
+++ b/.gitlab/issue_templates/bug.md
@@ -7,7 +7,7 @@
  - [ ] example application
  - [ ] HdyActionRow
  - [ ] HdyCarousel
- - [ ] HdyColumn
+ - [ ] HdyClamp
  - [ ] HdyComboRow
  - [ ] HdyEnumValueObject
  - [ ] HdyExpanderRow
diff --git a/debian/libhandy-1-0.symbols b/debian/libhandy-1-0.symbols
index 08965f0a..3cb4544f 100644
--- a/debian/libhandy-1-0.symbols
+++ b/debian/libhandy-1-0.symbols
@@ -74,12 +74,12 @@ libhandy-1.so.0 libhandy-1-0 #MINVER#
  hdy_carousel_set_reveal_duration@LIBHANDY_1_0 0.81.0
  hdy_carousel_set_spacing@LIBHANDY_1_0 0.80.0
  hdy_centering_policy_get_type@LIBHANDY_1_0 0.0.10
- hdy_column_get_linear_growth_width@LIBHANDY_1_0 0.0.3
- hdy_column_get_maximum_width@LIBHANDY_1_0 0.0.1
- hdy_column_get_type@LIBHANDY_1_0 0.0.1
- hdy_column_new@LIBHANDY_1_0 0.0.1
- hdy_column_set_linear_growth_width@LIBHANDY_1_0 0.0.3
- hdy_column_set_maximum_width@LIBHANDY_1_0 0.0.1
+ hdy_clamp_get_linear_growth_width@LIBHANDY_1_0 0.82.0
+ hdy_clamp_get_maximum_width@LIBHANDY_1_0 0.82.0
+ hdy_clamp_get_type@LIBHANDY_1_0 0.82.0
+ hdy_clamp_new@LIBHANDY_1_0 0.82.0
+ hdy_clamp_set_linear_growth_width@LIBHANDY_1_0 0.82.0
+ hdy_clamp_set_maximum_width@LIBHANDY_1_0 0.82.0
  hdy_combo_row_bind_model@LIBHANDY_1_0 0.0.6
  hdy_combo_row_bind_name_model@LIBHANDY_1_0 0.0.6
  hdy_combo_row_get_model@LIBHANDY_1_0 0.0.6
diff --git a/doc/handy-docs.xml b/doc/handy-docs.xml
index b31f5af8..6cfe9e31 100644
--- a/doc/handy-docs.xml
+++ b/doc/handy-docs.xml
@@ -40,7 +40,7 @@
     <xi:include href="xml/hdy-application-window.xml"/>
     <xi:include href="xml/hdy-avatar.xml"/>
     <xi:include href="xml/hdy-carousel.xml"/>
-    <xi:include href="xml/hdy-clamp.xml"/>
+    <xi:include href="xml/hdy-column.xml"/>
     <xi:include href="xml/hdy-combo-row.xml"/>
     <xi:include href="xml/hdy-deck.xml"/>
     <xi:include href="xml/hdy-enum-value-object.xml"/>
diff --git a/examples/hdy-demo-window.c b/examples/hdy-demo-window.c
index 2dcb7838..f7c51fcf 100644
--- a/examples/hdy-demo-window.c
+++ b/examples/hdy-demo-window.c
@@ -21,7 +21,6 @@ struct _HdyDemoWindow
   HdyKeypad *keypad;
   HdySearchBar *search_bar;
   GtkEntry *search_entry;
-  GtkListBox *column_listbox;
   GtkListBox *lists_listbox;
   HdyComboRow *combo_row;
   HdyComboRow *enum_combo_row;
@@ -399,7 +398,6 @@ hdy_demo_window_class_init (HdyDemoWindowClass *klass)
   gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, keypad);
   gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, search_bar);
   gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, search_entry);
-  gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, column_listbox);
   gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, lists_listbox);
   gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, combo_row);
   gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, enum_combo_row);
diff --git a/examples/hdy-demo-window.ui b/examples/hdy-demo-window.ui
index 21a7844b..0b5c839a 100644
--- a/examples/hdy-demo-window.ui
+++ b/examples/hdy-demo-window.ui
@@ -447,7 +447,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="HdyColumn">
+                      <object class="HdyClamp">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="halign">fill</property>
@@ -589,7 +589,7 @@
                         <property name="can-swipe-back">True</property>
                         <signal name="notify::visible-child" handler="notify_deck_visible_child_cb" 
after="yes" swapped="yes"/>
                         <child>
-                          <object class="HdyColumn">
+                          <object class="HdyClamp">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="halign">fill</property>
@@ -787,7 +787,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="HdyColumn">
+                      <object class="HdyClamp">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="halign">fill</property>
@@ -880,7 +880,7 @@
                               </object>
                             </child>
                             <child>
-                              <object class="HdyColumn">
+                              <object class="HdyClamp">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="maximum-width">300</property>
@@ -973,7 +973,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="HdyColumn">
+                      <object class="HdyClamp">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="halign">fill</property>
@@ -983,8 +983,8 @@
                         <property name="margin-end">12</property>
                         <property name="margin-top">32</property>
                         <property name="expand">True</property>
-                        <property name="maximum-width" bind-source="column_width_adjustment" 
bind-property="value" bind-flags="sync-create"/>
-                        <property name="linear-growth-width" bind-source="column_linear_width_adjustment" 
bind-property="value" bind-flags="sync-create"/>
+                        <property name="maximum-width" bind-source="clamp_width_adjustment" 
bind-property="value" bind-flags="sync-create"/>
+                        <property name="linear-growth-width" bind-source="clamp_linear_width_adjustment" 
bind-property="value" bind-flags="sync-create"/>
                         <child>
                           <object class="GtkBox">
                             <property name="visible">True</property>
@@ -1028,7 +1028,7 @@
                                         <property name="visible">True</property>
                                         <property name="opacity">0.5</property>
                                         <property name="can_focus">False</property>
-                                        <property name="label" translatable="yes">Column</property>
+                                        <property name="label" translatable="yes">Clamp</property>
                                         <property name="halign">center</property>
                                         <property name="xalign">0</property>
                                         <property name="margin-bottom">12</property>
@@ -1047,7 +1047,7 @@
                                         <property name="visible">True</property>
                                         <property name="opacity">0.5</property>
                                         <property name="can_focus">False</property>
-                                        <property name="label" translatable="yes">This column smoothly grows 
up to a maximum width.</property>
+                                        <property name="label" translatable="yes">This page is clamped to 
smoothly grow up to a maximum width.</property>
                                         <property name="justify">center</property>
                                         <property name="use_markup">true</property>
                                         <property name="wrap">True</property>
@@ -1070,7 +1070,7 @@
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="expand">True</property>
-                                <property name="label" translatable="yes">Column</property>
+                                <property name="label" translatable="yes">Clamp</property>
                                 <property name="justify">left</property>
                                 <property name="halign">start</property>
                                 <property name="margin-bottom">12</property>
@@ -1080,7 +1080,7 @@
                               </object>
                             </child>
                             <child>
-                              <object class="GtkListBox" id="column_listbox">
+                              <object class="GtkListBox" id="clamp_listbox">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="expand">True</property>
@@ -1095,7 +1095,7 @@
                                     <property name="visible">True</property>
                                     <child>
                                       <object class="GtkSpinButton">
-                                        <property name="adjustment">column_width_adjustment</property>
+                                        <property name="adjustment">clamp_width_adjustment</property>
                                         <property name="valign">center</property>
                                         <property name="visible">True</property>
                                       </object>
@@ -1109,7 +1109,7 @@
                                     <property name="visible">True</property>
                                     <child>
                                       <object class="GtkSpinButton">
-                                        <property name="adjustment">column_linear_width_adjustment</property>
+                                        <property name="adjustment">clamp_linear_width_adjustment</property>
                                         <property name="valign">center</property>
                                         <property name="visible">True</property>
                                       </object>
@@ -1122,12 +1122,12 @@
                         </child>
                       </object>
                       <packing>
-                        <property name="name">column</property>
-                        <property name="title">Column</property>
+                        <property name="name">clamp</property>
+                        <property name="title">Clamp</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="HdyColumn">
+                      <object class="HdyClamp">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="halign">fill</property>
@@ -1439,7 +1439,7 @@
                             <property name="hexpand">True</property>
                             <property name="show-close-button">True</property>
                             <child>
-                              <object class="HdyColumn">
+                              <object class="HdyClamp">
                                 <property name="visible">True</property>
                                 <property name="hexpand">True</property>
                                 <property name="maximum-width">600</property>
@@ -1530,7 +1530,7 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
                                     <property name="opacity">0.5</property>
-                                    <property name="label" translatable="yes">Try using it with an 
horizontaly expanded column to make your search entry adaptive.</property>
+                                    <property name="label" translatable="yes">Try using it with an 
horizontaly expanded clamp to make your search entry adaptive.</property>
                                     <property name="justify">center</property>
                                     <property name="wrap">True</property>
                                     <property name="use_markup">True</property>
@@ -1727,7 +1727,7 @@
                           </object>
                         </child>
                         <child>
-                          <object class="HdyColumn">
+                          <object class="HdyClamp">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="halign">fill</property>
@@ -1890,7 +1890,7 @@
                           </object>
                         </child>
                         <child>
-                          <object class="HdyColumn">
+                          <object class="HdyClamp">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="maximum-width">400</property>
@@ -2005,7 +2005,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="HdyColumn">
+                      <object class="HdyClamp">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="halign">fill</property>
@@ -2222,14 +2222,14 @@
       <swipeable name="content_deck"/>
     </swipeables>
   </object>
-  <object class="GtkAdjustment" id="column_width_adjustment">
+  <object class="GtkAdjustment" id="clamp_width_adjustment">
     <property name="lower">0</property>
     <property name="upper">10000</property>
     <property name="value">600</property>
     <property name="page-increment">100</property>
     <property name="step-increment">10</property>
   </object>
-  <object class="GtkAdjustment" id="column_linear_width_adjustment">
+  <object class="GtkAdjustment" id="clamp_linear_width_adjustment">
     <property name="lower">0</property>
     <property name="upper">10000</property>
     <property name="value">500</property>
diff --git a/glade/libhandy.xml b/glade/libhandy.xml
index d10b642c..06df1eb5 100644
--- a/glade/libhandy.xml
+++ b/glade/libhandy.xml
@@ -75,7 +75,7 @@
         <property id="visible-window" disabled="True" />
       </properties>
     </glade-widget-class>
-    <glade-widget-class name="HdyColumn" generic-name="column" title="Column">
+    <glade-widget-class name="HdyClamp" generic-name="clamp" title="Clamp" since="1.0">
       <properties>
         <property id="maximum-width" default="650"/>
         <property id="linear-growth-width" default="400"/>
@@ -409,7 +409,7 @@
     <glade-widget-class-ref name="HdyApplicationWindow"/>
     <glade-widget-class-ref name="HdyAvatar"/>
     <glade-widget-class-ref name="HdyCarousel"/>
-    <glade-widget-class-ref name="HdyColumn"/>
+    <glade-widget-class-ref name="HdyClamp"/>
     <glade-widget-class-ref name="HdyComboRow"/>
     <glade-widget-class-ref name="HdyDeck"/>
     <glade-widget-class-ref name="HdyExpanderRow"/>
diff --git a/src/hdy-clamp.c b/src/hdy-clamp.c
index db37e1e8..72dd48f2 100644
--- a/src/hdy-clamp.c
+++ b/src/hdy-clamp.c
@@ -13,11 +13,11 @@
 #include "hdy-animation-private.h"
 
 /**
- * SECTION:hdy-column
+ * SECTION:hdy-clamp
  * @short_description: A container letting its child grow up to a given width.
- * @Title: HdyColumn
+ * @Title: HdyClamp
  *
- * The #HdyColumn widget limits the size of the widget it contains to a given
+ * The #HdyClamp widget limits the size of the widget it contains to a given
  * maximum width. The expansion of the child from its minimum to its maximum
  * size is eased out for a smooth transition.
  *
@@ -26,10 +26,12 @@
  *
  * # CSS nodes
  *
- * #HdyColumn has a single CSS node with name column. The node will get the
- * style classes .wide when its child reached its maximum width, .narrow when
- * the column allocates its full width to its child, .medium in-between, or none
- * if it didn't compute its size yet.
+ * #HdyClamp has a single CSS node with name clamp. The node will get the style
+ * classes .wide when its child reached its maximum width, .narrow when the
+ * clamp allocates its full width to its child, .medium in-between, or none if
+ * it didn't compute its size yet.
+ *
+ * Since: 1.0
  */
 
 #define HDY_EASE_OUT_TAN_CUBIC 3
@@ -41,7 +43,7 @@ enum {
   LAST_PROP,
 };
 
-struct _HdyColumn
+struct _HdyClamp
 {
   GtkBin parent_instance;
 
@@ -51,22 +53,22 @@ struct _HdyColumn
 
 static GParamSpec *props[LAST_PROP];
 
-G_DEFINE_TYPE (HdyColumn, hdy_column, GTK_TYPE_BIN)
+G_DEFINE_TYPE (HdyClamp, hdy_clamp, GTK_TYPE_BIN)
 
 static void
-hdy_column_get_property (GObject    *object,
-                                  guint       prop_id,
-                                  GValue     *value,
-                                  GParamSpec *pspec)
+hdy_clamp_get_property (GObject    *object,
+                        guint       prop_id,
+                        GValue     *value,
+                        GParamSpec *pspec)
 {
-  HdyColumn *self = HDY_COLUMN (object);
+  HdyClamp *self = HDY_CLAMP (object);
 
   switch (prop_id) {
   case PROP_MAXIMUM_WIDTH:
-    g_value_set_int (value, hdy_column_get_maximum_width (self));
+    g_value_set_int (value, hdy_clamp_get_maximum_width (self));
     break;
   case PROP_LINEAR_GROWTH_WIDTH:
-    g_value_set_int (value, hdy_column_get_linear_growth_width (self));
+    g_value_set_int (value, hdy_clamp_get_linear_growth_width (self));
     break;
   default:
     G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -74,19 +76,19 @@ hdy_column_get_property (GObject    *object,
 }
 
 static void
-hdy_column_set_property (GObject      *object,
-                                  guint         prop_id,
-                                  const GValue *value,
-                                  GParamSpec   *pspec)
+hdy_clamp_set_property (GObject      *object,
+                        guint         prop_id,
+                        const GValue *value,
+                        GParamSpec   *pspec)
 {
-  HdyColumn *self = HDY_COLUMN (object);
+  HdyClamp *self = HDY_CLAMP (object);
 
   switch (prop_id) {
   case PROP_MAXIMUM_WIDTH:
-    hdy_column_set_maximum_width (self, g_value_get_int (value));
+    hdy_clamp_set_maximum_width (self, g_value_get_int (value));
     break;
   case PROP_LINEAR_GROWTH_WIDTH:
-    hdy_column_set_linear_growth_width (self, g_value_get_int (value));
+    hdy_clamp_set_linear_growth_width (self, g_value_get_int (value));
     break;
   default:
     G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -95,23 +97,23 @@ hdy_column_set_property (GObject      *object,
 
 /**
  * get_child_width:
- * @self: a #HdyColumn
- * @for_width: the width of the column
+ * @self: a #HdyClamp
+ * @for_width: the width of the clamp
  * @child_minimum: the minimum width reachable by the child, and hence by @self
  * @child_maximum: the maximum width @self will ever allocate its child
  * @lower_threshold: the threshold below which @self will allocate its full width to its child
  * @upper_threshold: the threshold up from which @self will allocate its maximum size to its child
  *
- * Measures the child's extremes, the column's thresholds, and returns size to
+ * Measures the child's extremes, the clamp's thresholds, and returns size to
  * allocate to the child.
  */
 static gint
-get_child_width (HdyColumn *self,
-                 gint       for_width,
-                 gint      *child_minimum,
-                 gint      *child_maximum,
-                 gint      *lower_threshold,
-                 gint      *upper_threshold)
+get_child_width (HdyClamp *self,
+                 gint      for_width,
+                 gint     *child_minimum,
+                 gint     *child_maximum,
+                 gint     *lower_threshold,
+                 gint     *upper_threshold)
 {
   GtkBin *bin = GTK_BIN (self);
   GtkWidget *child;
@@ -157,13 +159,13 @@ get_child_width (HdyColumn *self,
  * method in GTK 4.
  */
 static void
-hdy_column_measure (GtkWidget      *widget,
-                    GtkOrientation  orientation,
-                    int             for_size,
-                    int            *minimum,
-                    int            *natural,
-                    int            *minimum_baseline,
-                    int            *natural_baseline)
+hdy_clamp_measure (GtkWidget      *widget,
+                   GtkOrientation  orientation,
+                   int             for_size,
+                   int            *minimum,
+                   int            *natural,
+                   int            *minimum_baseline,
+                   int            *natural_baseline)
 {
   GtkBin *bin = GTK_BIN (widget);
   GtkWidget *child;
@@ -184,7 +186,7 @@ hdy_column_measure (GtkWidget      *widget,
   if (orientation == GTK_ORIENTATION_HORIZONTAL)
     gtk_widget_get_preferred_width (child, minimum, natural);
   else {
-    gint child_width = get_child_width (HDY_COLUMN (widget), for_size, NULL, NULL, NULL, NULL);
+    gint child_width = get_child_width (HDY_CLAMP (widget), for_size, NULL, NULL, NULL, NULL);
 
     gtk_widget_get_preferred_height_and_baseline_for_width (child,
                                                             child_width,
@@ -196,40 +198,40 @@ hdy_column_measure (GtkWidget      *widget,
 }
 
 static void
-hdy_column_get_preferred_width (GtkWidget *widget,
-                                gint      *minimum,
-                                gint      *natural)
+hdy_clamp_get_preferred_width (GtkWidget *widget,
+                               gint      *minimum,
+                               gint      *natural)
 {
-  hdy_column_measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
-                      minimum, natural, NULL, NULL);
+  hdy_clamp_measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
+                     minimum, natural, NULL, NULL);
 }
 
 static void
-hdy_column_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
-                                                        gint       width,
-                                                        gint      *minimum,
-                                                        gint      *natural,
-                                                        gint      *minimum_baseline,
-                                                        gint      *natural_baseline)
+hdy_clamp_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
+                                                       gint       width,
+                                                       gint      *minimum,
+                                                       gint      *natural,
+                                                       gint      *minimum_baseline,
+                                                       gint      *natural_baseline)
 {
-  hdy_column_measure (widget, GTK_ORIENTATION_VERTICAL, width,
-                      minimum, natural, minimum_baseline, natural_baseline);
+  hdy_clamp_measure (widget, GTK_ORIENTATION_VERTICAL, width,
+                     minimum, natural, minimum_baseline, natural_baseline);
 }
 
 static void
-hdy_column_get_preferred_height (GtkWidget *widget,
-                                 gint      *minimum,
-                                 gint      *natural)
+hdy_clamp_get_preferred_height (GtkWidget *widget,
+                                gint      *minimum,
+                                gint      *natural)
 {
-  hdy_column_measure (widget, GTK_ORIENTATION_VERTICAL, -1,
-                      minimum, natural, NULL, NULL);
+  hdy_clamp_measure (widget, GTK_ORIENTATION_VERTICAL, -1,
+                     minimum, natural, NULL, NULL);
 }
 
 static void
-hdy_column_size_allocate (GtkWidget     *widget,
-                          GtkAllocation *allocation)
+hdy_clamp_size_allocate (GtkWidget     *widget,
+                         GtkAllocation *allocation)
 {
-  HdyColumn *self = HDY_COLUMN (widget);
+  HdyClamp *self = HDY_CLAMP (widget);
   GtkBin *bin = GTK_BIN (widget);
   GtkAllocation child_allocation;
   gint baseline;
@@ -280,26 +282,28 @@ hdy_column_size_allocate (GtkWidget     *widget,
 }
 
 static void
-hdy_column_class_init (HdyColumnClass *klass)
+hdy_clamp_class_init (HdyClampClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
   GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
 
-  object_class->get_property = hdy_column_get_property;
-  object_class->set_property = hdy_column_set_property;
+  object_class->get_property = hdy_clamp_get_property;
+  object_class->set_property = hdy_clamp_set_property;
 
-  widget_class->get_preferred_width = hdy_column_get_preferred_width;
-  widget_class->get_preferred_height = hdy_column_get_preferred_height;
-  widget_class->get_preferred_height_and_baseline_for_width = 
hdy_column_get_preferred_height_and_baseline_for_width;
-  widget_class->size_allocate = hdy_column_size_allocate;
+  widget_class->get_preferred_width = hdy_clamp_get_preferred_width;
+  widget_class->get_preferred_height = hdy_clamp_get_preferred_height;
+  widget_class->get_preferred_height_and_baseline_for_width = 
hdy_clamp_get_preferred_height_and_baseline_for_width;
+  widget_class->size_allocate = hdy_clamp_size_allocate;
 
   gtk_container_class_handle_border_width (container_class);
 
   /**
-   * HdyColumn:maximum_width:
+   * HdyClamp:maximum_width:
    *
    * The maximum width to allocate to the child.
+   *
+   * Since: 1.0
    */
   props[PROP_MAXIMUM_WIDTH] =
       g_param_spec_int ("maximum-width",
@@ -309,9 +313,11 @@ hdy_column_class_init (HdyColumnClass *klass)
                         G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
-   * HdyColumn:linear_growth_width:
+   * HdyClamp:linear_growth_width:
    *
    * The width up to which the child will be allocated all the width.
+   *
+   * Since: 1.0
    */
   props[PROP_LINEAR_GROWTH_WIDTH] =
       g_param_spec_int ("linear-growth-width",
@@ -322,55 +328,61 @@ hdy_column_class_init (HdyColumnClass *klass)
 
   g_object_class_install_properties (object_class, LAST_PROP, props);
 
-  gtk_widget_class_set_css_name (widget_class, "column");
+  gtk_widget_class_set_css_name (widget_class, "clamp");
 }
 
 static void
-hdy_column_init (HdyColumn *self)
+hdy_clamp_init (HdyClamp *self)
 {
 }
 
 /**
- * hdy_column_new:
+ * hdy_clamp_new:
+ *
+ * Creates a new #HdyClamp.
  *
- * Creates a new #HdyColumn.
+ * Returns: a new #HdyClamp
  *
- * Returns: a new #HdyColumn
+ * Since: 1.0
  */
 GtkWidget *
-hdy_column_new (void)
+hdy_clamp_new (void)
 {
-  return g_object_new (HDY_TYPE_COLUMN, NULL);
+  return g_object_new (HDY_TYPE_CLAMP, NULL);
 }
 
 /**
- * hdy_column_get_maximum_width:
- * @self: a #HdyColumn
+ * hdy_clamp_get_maximum_width:
+ * @self: a #HdyClamp
  *
  * Gets the maximum width to allocate to the contained child.
  *
  * Returns: the maximum width to allocate to the contained child.
+ *
+ * Since: 1.0
  */
 gint
-hdy_column_get_maximum_width (HdyColumn *self)
+hdy_clamp_get_maximum_width (HdyClamp *self)
 {
-  g_return_val_if_fail (HDY_IS_COLUMN (self), 0);
+  g_return_val_if_fail (HDY_IS_CLAMP (self), 0);
 
   return self->maximum_width;
 }
 
 /**
- * hdy_column_set_maximum_width:
- * @self: a #HdyColumn
+ * hdy_clamp_set_maximum_width:
+ * @self: a #HdyClamp
  * @maximum_width: the maximum width
  *
  * Sets the maximum width to allocate to the contained child.
+ *
+ * Since: 1.0
  */
 void
-hdy_column_set_maximum_width (HdyColumn *self,
-                              gint       maximum_width)
+hdy_clamp_set_maximum_width (HdyClamp *self,
+                             gint      maximum_width)
 {
-  g_return_if_fail (HDY_IS_COLUMN (self));
+  g_return_if_fail (HDY_IS_CLAMP (self));
 
   if (self->maximum_width == maximum_width)
     return;
@@ -383,8 +395,8 @@ hdy_column_set_maximum_width (HdyColumn *self,
 }
 
 /**
- * hdy_column_get_linear_growth_width:
- * @self: a #HdyColumn
+ * hdy_clamp_get_linear_growth_width:
+ * @self: a #HdyClamp
  *
  * Gets the width up to which the child will be allocated all the available
  * width and starting from which it will be allocated a portion of the available
@@ -392,30 +404,33 @@ hdy_column_set_maximum_width (HdyColumn *self,
  *
  * Returns: the width up to which the child will be allocated all the available
  * width.
+ *
+ * Since: 1.0
  */
 gint
-hdy_column_get_linear_growth_width (HdyColumn *self)
+hdy_clamp_get_linear_growth_width (HdyClamp *self)
 {
-  g_return_val_if_fail (HDY_IS_COLUMN (self), 0);
+  g_return_val_if_fail (HDY_IS_CLAMP (self), 0);
 
   return self->linear_growth_width;
 }
 
 /**
- * hdy_column_set_linear_growth_width:
- * @self: a #HdyColumn
+ * hdy_clamp_set_linear_growth_width:
+ * @self: a #HdyClamp
  * @linear_growth_width: the linear growth width
  *
  * Sets the width up to which the child will be allocated all the available
  * width and starting from which it will be allocated a portion of the available
  * width. In bith cases the allocated width won't exceed the declared maximum.
  *
+ * Since: 1.0
  */
 void
-hdy_column_set_linear_growth_width (HdyColumn *self,
-                              gint       linear_growth_width)
+hdy_clamp_set_linear_growth_width (HdyClamp *self,
+                                   gint      linear_growth_width)
 {
-  g_return_if_fail (HDY_IS_COLUMN (self));
+  g_return_if_fail (HDY_IS_CLAMP (self));
 
   if (self->linear_growth_width == linear_growth_width)
     return;
diff --git a/src/hdy-clamp.h b/src/hdy-clamp.h
index 95b788b9..0d3103e9 100644
--- a/src/hdy-clamp.h
+++ b/src/hdy-clamp.h
@@ -14,16 +14,16 @@
 
 G_BEGIN_DECLS
 
-#define HDY_TYPE_COLUMN (hdy_column_get_type())
+#define HDY_TYPE_CLAMP (hdy_clamp_get_type())
 
-G_DECLARE_FINAL_TYPE (HdyColumn, hdy_column, HDY, COLUMN, GtkBin)
+G_DECLARE_FINAL_TYPE (HdyClamp, hdy_clamp, HDY, CLAMP, GtkBin)
 
-GtkWidget *hdy_column_new (void);
-gint hdy_column_get_maximum_width (HdyColumn *self);
-void hdy_column_set_maximum_width (HdyColumn *self,
-                                   gint       maximum_width);
-gint hdy_column_get_linear_growth_width (HdyColumn *self);
-void hdy_column_set_linear_growth_width (HdyColumn *self,
-                                         gint       linear_growth_width);
+GtkWidget *hdy_clamp_new (void);
+gint hdy_clamp_get_maximum_width (HdyClamp *self);
+void hdy_clamp_set_maximum_width (HdyClamp *self,
+                                  gint      maximum_width);
+gint hdy_clamp_get_linear_growth_width (HdyClamp *self);
+void hdy_clamp_set_linear_growth_width (HdyClamp *self,
+                                        gint      linear_growth_width);
 
 G_END_DECLS
diff --git a/src/hdy-preferences-page.ui b/src/hdy-preferences-page.ui
index a492b6d7..4e99f6bd 100644
--- a/src/hdy-preferences-page.ui
+++ b/src/hdy-preferences-page.ui
@@ -11,7 +11,7 @@
             <property name="shadow-type">none</property>
             <property name="visible">True</property>
             <child>
-              <object class="HdyColumn">
+              <object class="HdyClamp">
                 <property name="linear-growth-width">400</property>
                 <property name="margin-bottom">18</property>
                 <property name="margin-end">12</property>
diff --git a/src/hdy-preferences-window.ui b/src/hdy-preferences-window.ui
index d43c6faf..519c8b70 100644
--- a/src/hdy-preferences-window.ui
+++ b/src/hdy-preferences-window.ui
@@ -38,7 +38,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="HdyColumn">
+                  <object class="HdyClamp">
                     <property name="linear-growth-width">300</property>
                     <property name="maximum-width">400</property>
                     <property name="visible">True</property>
@@ -128,7 +128,7 @@
                     <property name="hscrollbar_policy">never</property>
                     <property name="visible">True</property>
                     <child>
-                      <object class="HdyColumn">
+                      <object class="HdyClamp">
                         <property name="linear_growth_width">400</property>
                         <property name="margin_bottom">18</property>
                         <property name="margin_end">12</property>
diff --git a/src/hdy-search-bar.c b/src/hdy-search-bar.c
index 1d206f2d..decbda40 100644
--- a/src/hdy-search-bar.c
+++ b/src/hdy-search-bar.c
@@ -69,7 +69,7 @@
  *
  * HdySearchBar is very similar to #GtkSearchBar, the main difference being that
  * it allows the search entry to fill all the available space. This allows you
- * to control your search entry's width with a #HdyColumn.
+ * to control your search entry's width with a #HdyClamp.
  *
  * # CSS nodes
  *


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