+gtk_separator_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ gtk_separator_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, minimum, natural);
+}
+
+static gboolean
+gtk_separator_draw (GtkWidget *widget,
+ cairo_t *cr)
+{
+ GtkSeparator *separator = GTK_SEPARATOR (widget);
+ GtkSeparatorPrivate *private = separator->priv;
+ GtkStateFlags state;
+ GtkStyleContext *context;
+ GtkBorder padding;
+ gboolean wide_separators;
+ gint separator_width;
+ gint separator_height;
+ int width, height;
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_widget_style_get (widget,
+ "wide-separators", &wide_separators,
+ "separator-width", &separator_width,
+ "separator-height", &separator_height,
+ NULL);
+
+ state = gtk_widget_get_state_flags (widget);
+ width = gtk_widget_get_allocated_width (widget);
+ height = gtk_widget_get_allocated_height (widget);
+
+ gtk_style_context_get_padding (context, state, &padding);
+
+ if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ if (wide_separators)
+ gtk_render_frame (context, cr,
+ 0, (height - separator_height) / 2,
+ width, separator_height);
+ else
+ gtk_render_line (context, cr,
+ 0, (height - padding.top) / 2,
+ width - 1, (height - padding.top) / 2);
+ }
+ else
+ {
+ if (wide_separators)
+ gtk_render_frame (context, cr,
+ (width - separator_width) / 2, 0,
+ separator_width, height);
+ else
+ gtk_render_line (context, cr,
+ (width - padding.left) / 2, 0,
+ (width - padding.left) / 2, height - 1);
+ }
+
+ return FALSE;
+}
+
+/**
+ * gtk_separator_new:
+ * @orientation: the separator's orientation.
+ *
+ * Creates a new #GtkSeparator with the given orientation.
+ *
+ * Return value: a new #GtkSeparator.
+ *
+ * Since: 3.0
+ */
+GtkWidget *
+gtk_separator_new (GtkOrientation orientation)