summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-05-25 18:55:15 -0400
committerMatthias Clasen <mclasen@redhat.com>2010-05-25 18:55:15 -0400
commitb4e2ff3da32ad2b9670ecf33805eb9993824fe0b (patch)
treededc3f6b06fe6af1ddc1a92dc4b0956a40d6feec /gtk
parentbd4609b14042a91646cd9057764eecfbc6faf42b (diff)
downloadgtk+-b4e2ff3da32ad2b9670ecf33805eb9993824fe0b.tar.gz
Make orientable base classes instantiable
This commit adds constructors for GtkPaned, GtkBox, GtkButtonBox, GtkRuler, GtkScale, GtkScrollbar and GtkSeparator and makes these types instantiable.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtk.symbols8
-rw-r--r--gtk/gtkbbox.c20
-rw-r--r--gtk/gtkbbox.h4
-rw-r--r--gtk/gtkbox.c18
-rw-r--r--gtk/gtkbox.h2
-rw-r--r--gtk/gtkpaned.c10
-rw-r--r--gtk/gtkpaned.h1
-rw-r--r--gtk/gtkruler.c4
-rw-r--r--gtk/gtkruler.h1
-rw-r--r--gtk/gtkscale.c18
-rw-r--r--gtk/gtkscale.h6
-rw-r--r--gtk/gtkscrollbar.c6
-rw-r--r--gtk/gtkscrollbar.h2
-rw-r--r--gtk/gtkseparator.c10
-rw-r--r--gtk/gtkseparator.h2
15 files changed, 70 insertions, 42 deletions
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 8f3340277f..06ccf9c544 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -434,6 +434,7 @@ gtk_bin_get_type G_GNUC_CONST
#if IN_HEADER(__GTK_BOX_H__)
#if IN_FILE(__GTK_BOX_C__)
+gtk_box_new
gtk_box_get_homogeneous
gtk_box_get_spacing
gtk_box_get_type G_GNUC_CONST
@@ -486,6 +487,7 @@ gtk_builder_value_from_string_type
#if IN_HEADER(__GTK_BUTTON_BOX_H__)
#if IN_FILE(__GTK_BUTTON_BOX_C__)
+gtk_button_box_new
gtk_button_box_get_child_secondary
gtk_button_box_get_layout
gtk_button_box_get_type G_GNUC_CONST
@@ -2207,6 +2209,7 @@ gtk_orientable_set_orientation
#if IN_HEADER(__GTK_PANED_H__)
#if IN_FILE(__GTK_PANED_C__)
+gtk_paned_new
gtk_paned_add1
gtk_paned_add2
gtk_paned_get_child1
@@ -3003,6 +3006,7 @@ gtk_text_buffer_unregister_serialize_format
#if IN_HEADER(__GTK_RULER_H__)
#if IN_FILE(__GTK_RULER_C__)
+gtk_ruler_new
gtk_ruler_draw_pos
gtk_ruler_draw_ticks
gtk_ruler_get_metric
@@ -3015,6 +3019,8 @@ gtk_ruler_set_range
#if IN_HEADER(__GTK_SCALE_H__)
#if IN_FILE(__GTK_SCALE_C__)
+gtk_scale_new
+gtk_scale_new_with_range
gtk_scale_get_digits
gtk_scale_get_draw_value
gtk_scale_get_layout
@@ -3047,6 +3053,7 @@ gtk_scale_button_get_popup
#if IN_HEADER(__GTK_SCROLLBAR_H__)
#if IN_FILE(__GTK_SCROLLBAR_C__)
gtk_scrollbar_get_type G_GNUC_CONST
+gtk_scrollbar_new
#endif
#endif
@@ -3126,6 +3133,7 @@ gtk_target_table_free
#if IN_HEADER(__GTK_SEPARATOR_H__)
#if IN_FILE(__GTK_SEPARATOR_C__)
gtk_separator_get_type G_GNUC_CONST
+gtk_separator_new
#endif
#endif
diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c
index 5417be777b..91822148dd 100644
--- a/gtk/gtkbbox.c
+++ b/gtk/gtkbbox.c
@@ -99,7 +99,7 @@ static void gtk_button_box_get_child_property (GtkContainer *container,
#define DEFAULT_CHILD_IPAD_X 4
#define DEFAULT_CHILD_IPAD_Y 0
-G_DEFINE_ABSTRACT_TYPE (GtkButtonBox, gtk_button_box, GTK_TYPE_BOX)
+G_DEFINE_TYPE (GtkButtonBox, gtk_button_box, GTK_TYPE_BOX)
static void
gtk_button_box_class_init (GtkButtonBoxClass *class)
@@ -813,5 +813,23 @@ gtk_button_box_size_allocate (GtkWidget *widget,
}
}
+/**
+ * gtk_button_box_new:
+ * @orientation: the box' orientation.
+ *
+ * Creates a new #GtkButtonBox.
+ *
+ * Return value: a new #GtkButtonBox.
+ *
+ * Since: 3.0
+ */
+GtkWidget *
+gtk_button_box_new (GtkOrientation orientation)
+{
+ return g_object_new (GTK_TYPE_BUTTON_BOX,
+ "orientation", orientation,
+ NULL);
+}
+
#define __GTK_BUTTON_BOX_C__
#include "gtkaliasdef.c"
diff --git a/gtk/gtkbbox.h b/gtk/gtkbbox.h
index 76ac7ba702..72f8458142 100644
--- a/gtk/gtkbbox.h
+++ b/gtk/gtkbbox.h
@@ -65,8 +65,8 @@ struct _GtkButtonBoxClass
};
-GType gtk_button_box_get_type (void) G_GNUC_CONST;
-
+GType gtk_button_box_get_type (void) G_GNUC_CONST;
+GtkWidget * gtk_button_box_new (GtkOrientation orientation);
GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox *widget);
void gtk_button_box_set_layout (GtkButtonBox *widget,
GtkButtonBoxStyle layout_style);
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index b9f5321c48..0aeb82a96b 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -182,11 +182,11 @@ static void gtk_box_get_height_for_width (GtkExtendedLayout *layout,
static GtkExtendedLayoutIface *parent_extended_layout_iface;
-G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkBox, gtk_box, GTK_TYPE_CONTAINER,
- G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
- NULL)
- G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
- gtk_box_extended_layout_init));
+G_DEFINE_TYPE_WITH_CODE (GtkBox, gtk_box, GTK_TYPE_CONTAINER,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
+ NULL)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
+ gtk_box_extended_layout_init));
static void
gtk_box_class_init (GtkBoxClass *class)
@@ -1252,12 +1252,12 @@ gtk_box_get_height_for_width (GtkExtendedLayout *layout,
*
* Return value: a new #GtkHBox.
*
- * Since: 2.16
+ * Since: 3.0
**/
GtkWidget*
-_gtk_box_new (GtkOrientation orientation,
- gboolean homogeneous,
- gint spacing)
+gtk_box_new (GtkOrientation orientation,
+ gboolean homogeneous,
+ gint spacing)
{
return g_object_new (GTK_TYPE_BOX,
"orientation", orientation,
diff --git a/gtk/gtkbox.h b/gtk/gtkbox.h
index 7e9a4cdf18..0d0cfb07a8 100644
--- a/gtk/gtkbox.h
+++ b/gtk/gtkbox.h
@@ -102,7 +102,7 @@ struct _GtkBoxChild
#endif
GType gtk_box_get_type (void) G_GNUC_CONST;
-GtkWidget* _gtk_box_new (GtkOrientation orientation,
+GtkWidget* gtk_box_new (GtkOrientation orientation,
gboolean homogeneous,
gint spacing);
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 69e766d8a3..e17131f8f3 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -154,9 +154,9 @@ struct _GtkPanedPrivate
};
-G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkPaned, gtk_paned, GTK_TYPE_CONTAINER,
- G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
- NULL))
+G_DEFINE_TYPE_WITH_CODE (GtkPaned, gtk_paned, GTK_TYPE_CONTAINER,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
+ NULL))
static guint signals[LAST_SIGNAL] = { 0 };
@@ -1334,7 +1334,6 @@ gtk_paned_motion (GtkWidget *widget,
return FALSE;
}
-#if 0
/**
* gtk_paned_new:
* @orientation: the paned's orientation.
@@ -1343,7 +1342,7 @@ gtk_paned_motion (GtkWidget *widget,
*
* Return value: a new #GtkPaned.
*
- * Since: 2.16
+ * Since: 3.0
**/
GtkWidget *
gtk_paned_new (GtkOrientation orientation)
@@ -1352,7 +1351,6 @@ gtk_paned_new (GtkOrientation orientation)
"orientation", orientation,
NULL);
}
-#endif
void
gtk_paned_add1 (GtkPaned *paned,
diff --git a/gtk/gtkpaned.h b/gtk/gtkpaned.h
index 27e8201de2..1a2861165d 100644
--- a/gtk/gtkpaned.h
+++ b/gtk/gtkpaned.h
@@ -107,6 +107,7 @@ struct _GtkPanedClass
GType gtk_paned_get_type (void) G_GNUC_CONST;
+GtkWidget * gtk_paned_new (GtkOrientation orientation);
void gtk_paned_add1 (GtkPaned *paned,
GtkWidget *child);
void gtk_paned_add2 (GtkPaned *paned,
diff --git a/gtk/gtkruler.c b/gtk/gtkruler.c
index 5e16daf9e4..b6721dbe4c 100644
--- a/gtk/gtkruler.c
+++ b/gtk/gtkruler.c
@@ -278,7 +278,6 @@ gtk_ruler_get_property (GObject *object,
}
}
-#if 0
/**
* gtk_ruler_new:
* @orientation: the ruler's orientation.
@@ -287,7 +286,7 @@ gtk_ruler_get_property (GObject *object,
*
* Return value: a new #GtkRuler.
*
- * Since: 2.16
+ * Since: 3.0
**/
GtkWidget *
gtk_ruler_new (GtkOrientation orientation)
@@ -296,7 +295,6 @@ gtk_ruler_new (GtkOrientation orientation)
"orientation", orientation,
NULL);
}
-#endif
void
gtk_ruler_set_metric (GtkRuler *ruler,
diff --git a/gtk/gtkruler.h b/gtk/gtkruler.h
index 2702125809..07203ea0fe 100644
--- a/gtk/gtkruler.h
+++ b/gtk/gtkruler.h
@@ -110,6 +110,7 @@ struct _GtkRulerMetric
GType gtk_ruler_get_type (void) G_GNUC_CONST;
+GtkWidget * gtk_ruler_new (GtkOrientation orientation);
void gtk_ruler_set_metric (GtkRuler *ruler,
GtkMetricType metric);
GtkMetricType gtk_ruler_get_metric (GtkRuler *ruler);
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 6b7da98469..c2f0f3520c 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -126,9 +126,9 @@ static void gtk_scale_buildable_custom_finished (GtkBuildable *buildable,
gpointer user_data);
-G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkScale, gtk_scale, GTK_TYPE_RANGE,
- G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
- gtk_scale_buildable_interface_init))
+G_DEFINE_TYPE_WITH_CODE (GtkScale, gtk_scale, GTK_TYPE_RANGE,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+ gtk_scale_buildable_interface_init))
static gboolean
@@ -463,7 +463,6 @@ gtk_scale_get_property (GObject *object,
}
}
-#if 0
/**
* gtk_scale_new:
* @orientation: the scale's orientation.
@@ -474,7 +473,7 @@ gtk_scale_get_property (GObject *object,
*
* Return value: a new #GtkScale
*
- * Since: 2.16
+ * Since: 3.0
**/
GtkWidget *
gtk_scale_new (GtkOrientation orientation,
@@ -508,8 +507,8 @@ gtk_scale_new (GtkOrientation orientation,
*
* Return value: a new #GtkScale
*
- * Since: 2.16
- **/
+ * Since: 3.0
+ */
GtkWidget *
gtk_scale_new_with_range (GtkOrientation orientation,
gdouble min,
@@ -541,14 +540,13 @@ gtk_scale_new_with_range (GtkOrientation orientation,
"digits", digits,
NULL);
}
-#endif
/**
* gtk_scale_set_digits:
* @scale: a #GtkScale
- * @digits: the number of decimal places to display,
+ * @digits: the number of decimal places to display,
* e.g. use 1 to display 1.0, 2 to display 1.00, etc
- *
+ *
* Sets the number of decimal places that are displayed in the value.
* Also causes the value of the adjustment to be rounded off to this
* number of digits, so the retrieved value matches the value the user saw.
diff --git a/gtk/gtkscale.h b/gtk/gtkscale.h
index 204aa79891..c98b33a139 100644
--- a/gtk/gtkscale.h
+++ b/gtk/gtkscale.h
@@ -77,6 +77,12 @@ struct _GtkScaleClass
};
GType gtk_scale_get_type (void) G_GNUC_CONST;
+GtkWidget * gtk_scale_new (GtkOrientation orientation,
+ GtkAdjustment *adjustment);
+GtkWidget * gtk_scale_new_with_range (GtkOrientation orientation,
+ gdouble min,
+ gdouble max,
+ gdouble step);
void gtk_scale_set_digits (GtkScale *scale,
gint digits);
gint gtk_scale_get_digits (GtkScale *scale);
diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c
index 634b33791f..6bd2f6150e 100644
--- a/gtk/gtkscrollbar.c
+++ b/gtk/gtkscrollbar.c
@@ -35,7 +35,7 @@
static void gtk_scrollbar_style_set (GtkWidget *widget,
GtkStyle *previous);
-G_DEFINE_ABSTRACT_TYPE (GtkScrollbar, gtk_scrollbar, GTK_TYPE_RANGE)
+G_DEFINE_TYPE (GtkScrollbar, gtk_scrollbar, GTK_TYPE_RANGE)
static void
gtk_scrollbar_class_init (GtkScrollbarClass *class)
@@ -125,7 +125,6 @@ gtk_scrollbar_style_set (GtkWidget *widget,
GTK_WIDGET_CLASS (gtk_scrollbar_parent_class)->style_set (widget, previous);
}
-#if 0
/**
* gtk_scrollbar_new:
* @orientation: the scrollbar's orientation.
@@ -135,7 +134,7 @@ gtk_scrollbar_style_set (GtkWidget *widget,
*
* Return value: the new #GtkScrollbar.
*
- * Since: 2.16
+ * Since: 3.0
**/
GtkWidget *
gtk_scrollbar_new (GtkOrientation orientation,
@@ -149,7 +148,6 @@ gtk_scrollbar_new (GtkOrientation orientation,
"adjustment", adjustment,
NULL);
}
-#endif
#define __GTK_SCROLLBAR_C__
diff --git a/gtk/gtkscrollbar.h b/gtk/gtkscrollbar.h
index eab137e68c..992bb0dcfc 100644
--- a/gtk/gtkscrollbar.h
+++ b/gtk/gtkscrollbar.h
@@ -66,6 +66,8 @@ struct _GtkScrollbarClass
GType gtk_scrollbar_get_type (void) G_GNUC_CONST;
+GtkWidget * gtk_scrollbar_new (GtkOrientation orientation,
+ GtkAdjustment *adjustment);
G_END_DECLS
diff --git a/gtk/gtkseparator.c b/gtk/gtkseparator.c
index 74e0e24427..a41dad5317 100644
--- a/gtk/gtkseparator.c
+++ b/gtk/gtkseparator.c
@@ -74,9 +74,9 @@ static gboolean gtk_separator_expose (GtkWidget *widget,
GdkEventExpose *event);
-G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkSeparator, gtk_separator, GTK_TYPE_WIDGET,
- G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
- NULL))
+G_DEFINE_TYPE_WITH_CODE (GtkSeparator, gtk_separator, GTK_TYPE_WIDGET,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
+ NULL))
static void
@@ -247,7 +247,6 @@ gtk_separator_expose (GtkWidget *widget,
return FALSE;
}
-#if 0
/**
* gtk_separator_new:
* @orientation: the separator's orientation.
@@ -256,7 +255,7 @@ gtk_separator_expose (GtkWidget *widget,
*
* Return value: a new #GtkSeparator.
*
- * Since: 2.16
+ * Since: 3.0
**/
GtkWidget *
gtk_separator_new (GtkOrientation orientation)
@@ -265,7 +264,6 @@ gtk_separator_new (GtkOrientation orientation)
"orientation", orientation,
NULL);
}
-#endif
#define __GTK_SEPARATOR_C__
diff --git a/gtk/gtkseparator.h b/gtk/gtkseparator.h
index b2ae0fba0c..6b3e519395 100644
--- a/gtk/gtkseparator.h
+++ b/gtk/gtkseparator.h
@@ -60,6 +60,8 @@ struct _GtkSeparatorClass
GType gtk_separator_get_type (void) G_GNUC_CONST;
+GtkWidget * gtk_separator_new (GtkOrientation orientation);
+
G_END_DECLS