Commit b4e2ff3d authored by Matthias Clasen's avatar Matthias Clasen

Make orientable base classes instantiable

This commit adds constructors for GtkPaned, GtkBox, GtkButtonBox,
GtkRuler, GtkScale, GtkScrollbar and GtkSeparator and makes these
types instantiable.
parent bd4609b1
......@@ -420,6 +420,7 @@ gtk_aspect_frame_get_type
<TITLE>GtkButtonBox</TITLE>
GtkButtonBox
GTK_BUTTONBOX_DEFAULT
gtk_button_box_new
gtk_button_box_get_layout
gtk_button_box_get_child_secondary
gtk_button_box_set_layout
......@@ -456,6 +457,7 @@ gtk_bin_get_type
<TITLE>GtkBox</TITLE>
GtkBox
GtkBoxChild
gtk_box_new
gtk_box_pack_start
gtk_box_pack_end
gtk_box_get_homogeneous
......@@ -2295,6 +2297,7 @@ gtk_offscreen_window_get_type
<FILE>gtkpaned</FILE>
<TITLE>GtkPaned</TITLE>
GtkPaned
gtk_paned_new
gtk_paned_add1
gtk_paned_add2
gtk_paned_pack1
......@@ -2753,6 +2756,8 @@ gtk_ruler_draw_pos
<FILE>gtkscale</FILE>
<TITLE>GtkScale</TITLE>
GtkScale
gtk_scale_new
gtk_scale_new_with_range
gtk_scale_set_digits
gtk_scale_set_draw_value
gtk_scale_set_value_pos
......@@ -2803,6 +2808,7 @@ gtk_scale_button_get_type
<FILE>gtkscrollbar</FILE>
<TITLE>GtkScrollbar</TITLE>
GtkScrollbar
gtk_scrollbar_new
<SUBSECTION Standard>
GTK_SCROLLBAR
GTK_IS_SCROLLBAR
......@@ -2848,6 +2854,7 @@ gtk_scrolled_window_get_type
<FILE>gtkseparator</FILE>
<TITLE>GtkSeparator</TITLE>
GtkSeparator
gtk_separator_new
<SUBSECTION Standard>
GTK_SEPARATOR
GTK_IS_SEPARATOR
......
......@@ -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
......
......@@ -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"
......@@ -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);
......
......@@ -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,
......
......@@ -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);
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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);
......
......@@ -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.
......
......@@ -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);
......
......@@ -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__
......
......@@ -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
......
......@@ -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__
......
......@@ -60,6 +60,8 @@ struct _GtkSeparatorClass
GType gtk_separator_get_type (void) G_GNUC_CONST;
GtkWidget * gtk_separator_new (GtkOrientation orientation);
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment