]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkdialog.c
infobar: Port to draw vfunc
[~andy/gtk] / gtk / gtkdialog.c
index 6aac6c95d62a35b8a74d78193c0c2e0bf70b9469..86e28e320d3d37fedab7b504743a3550d1812d93 100644 (file)
  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
  * file for a list of people on the GTK+ Team.  See the ChangeLog
  * files for a list of changes.  These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  */
 
 #include <stdlib.h>
 #include <string.h>
-#include <config.h>
+#include "config.h"
 #include "gtkbutton.h"
 #include "gtkdialog.h"
 #include "gtkhbbox.h"
 #include "gtklabel.h"
-#include "gtkhseparator.h"
 #include "gtkmarshalers.h"
 #include "gtkvbox.h"
 #include "gdkkeysyms.h"
 #include "gtkbindings.h"
 #include "gtkprivate.h"
 #include "gtkbuildable.h"
-#include "gtkalias.h"
 
-#define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_DIALOG, GtkDialogPrivate))
 
-typedef struct {
-  guint ignore_separator : 1;
-} GtkDialogPrivate;
+struct _GtkDialogPrivate
+{
+  GtkWidget *vbox;
+  GtkWidget *action_area;
+};
 
 typedef struct _ResponseData ResponseData;
 
@@ -55,50 +54,37 @@ struct _ResponseData
   gint response_id;
 };
 
-static void gtk_dialog_add_buttons_valist (GtkDialog   *dialog,
-                                           const gchar *first_button_text,
-                                           va_list      args);
-
-static gint gtk_dialog_delete_event_handler (GtkWidget   *widget,
-                                             GdkEventAny *event,
-                                             gpointer     user_data);
-
-static void gtk_dialog_set_property      (GObject          *object,
-                                          guint             prop_id,
-                                          const GValue     *value,
-                                          GParamSpec       *pspec);
-static void gtk_dialog_get_property      (GObject          *object,
-                                          guint             prop_id,
-                                          GValue           *value,
-                                          GParamSpec       *pspec);
-static void gtk_dialog_style_set         (GtkWidget        *widget,
-                                          GtkStyle         *prev_style);
-static void gtk_dialog_map               (GtkWidget        *widget);
-
-static void gtk_dialog_close             (GtkDialog        *dialog);
-
-static void gtk_dialog_add               (GtkContainer     *container,
-                                         GtkWidget        *widget);
-static void gtk_dialog_remove            (GtkContainer     *container,
-                                         GtkWidget        *widget);
-
-static ResponseData* get_response_data   (GtkWidget        *widget,
-                                         gboolean          create);
-static void gtk_dialog_buildable_interface_init     (GtkBuildableIface *iface);
-static GObject * gtk_dialog_buildable_get_internal_child (GtkBuildable *buildable,
-                                                    GtkBuilder   *builder,
-                                                    const gchar  *childname);
-static gboolean gtk_dialog_buildable_custom_tag_start (GtkBuildable  *buildable,
-                                                      GtkBuilder    *builder,
-                                                      GObject       *child,
-                                                      const gchar   *tagname,
-                                                      GMarkupParser *parser,
-                                                      gpointer      *data);
-static void gtk_dialog_buildable_custom_finished (GtkBuildable *buildable,
-                                                 GtkBuilder   *builder,
-                                                 GObject       *child,
-                                                 const gchar   *tagname,
-                                                 gpointer      user_data);
+static void      gtk_dialog_add_buttons_valist   (GtkDialog    *dialog,
+                                                  const gchar  *first_button_text,
+                                                  va_list       args);
+
+static gboolean  gtk_dialog_delete_event_handler (GtkWidget    *widget,
+                                                  GdkEventAny  *event,
+                                                  gpointer      user_data);
+static void      gtk_dialog_style_set            (GtkWidget    *widget,
+                                                  GtkStyle     *prev_style);
+static void      gtk_dialog_map                  (GtkWidget    *widget);
+
+static void      gtk_dialog_close                (GtkDialog    *dialog);
+
+static ResponseData * get_response_data          (GtkWidget    *widget,
+                                                  gboolean      create);
+
+static void      gtk_dialog_buildable_interface_init     (GtkBuildableIface *iface);
+static GObject * gtk_dialog_buildable_get_internal_child (GtkBuildable  *buildable,
+                                                          GtkBuilder    *builder,
+                                                          const gchar   *childname);
+static gboolean  gtk_dialog_buildable_custom_tag_start   (GtkBuildable  *buildable,
+                                                          GtkBuilder    *builder,
+                                                          GObject       *child,
+                                                          const gchar   *tagname,
+                                                          GMarkupParser *parser,
+                                                          gpointer      *data);
+static void      gtk_dialog_buildable_custom_finished    (GtkBuildable  *buildable,
+                                                          GtkBuilder    *builder,
+                                                          GObject       *child,
+                                                          const gchar   *tagname,
+                                                          gpointer       user_data);
 
 
 enum {
@@ -123,38 +109,17 @@ gtk_dialog_class_init (GtkDialogClass *class)
 {
   GObjectClass *gobject_class;
   GtkWidgetClass *widget_class;
-  GtkContainerClass *container_class;
   GtkBindingSet *binding_set;
-  
+
   gobject_class = G_OBJECT_CLASS (class);
   widget_class = GTK_WIDGET_CLASS (class);
-  container_class = GTK_CONTAINER_CLASS (class);
-  
-  gobject_class->set_property = gtk_dialog_set_property;
-  gobject_class->get_property = gtk_dialog_get_property;
 
-  container_class->add = gtk_dialog_add;
-  container_class->remove = gtk_dialog_remove;
-  
   widget_class->map = gtk_dialog_map;
   widget_class->style_set = gtk_dialog_style_set;
 
   class->close = gtk_dialog_close;
-  
-  g_type_class_add_private (gobject_class, sizeof (GtkDialogPrivate));
 
-  /**
-   * GtkDialog:has-separator:
-   *
-   * When %TRUE, the dialog has a separator bar above its buttons.
-   */
-  g_object_class_install_property (gobject_class,
-                                   PROP_HAS_SEPARATOR,
-                                   g_param_spec_boolean ("has-separator",
-                                                        P_("Has separator"),
-                                                        P_("The dialog has a separator bar above its buttons"),
-                                                         TRUE,
-                                                         GTK_PARAM_READWRITE));
+  g_type_class_add_private (gobject_class, sizeof (GtkDialogPrivate));
 
   /**
    * GtkDialog::response:
@@ -172,7 +137,7 @@ gtk_dialog_class_init (GtkDialogClass *class)
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkDialogClass, response),
                  NULL, NULL,
-                 _gtk_marshal_NONE__INT,
+                 _gtk_marshal_VOID__INT,
                  G_TYPE_NONE, 1,
                  G_TYPE_INT);
 
@@ -181,7 +146,7 @@ gtk_dialog_class_init (GtkDialogClass *class)
    *
    * The ::close signal is a 
    * <link linkend="keybinding-signals">keybinding signal</link>
-   * which getrs emitted when the user uses a keybinding to close
+   * which gets emitted when the user uses a keybinding to close
    * the dialog.
    *
    * The default binding for this signal is the Escape key.
@@ -192,7 +157,7 @@ gtk_dialog_class_init (GtkDialogClass *class)
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkDialogClass, close),
                  NULL, NULL,
-                 _gtk_marshal_NONE__NONE,
+                 _gtk_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   
   gtk_widget_class_install_style_property (widget_class,
@@ -203,6 +168,24 @@ gtk_dialog_class_init (GtkDialogClass *class)
                                                              G_MAXINT,
                                                              2,
                                                              GTK_PARAM_READABLE));
+  /**
+   * GtkDialog:content-area-spacing:
+   *
+   * The default spacing used between elements of the
+   * content area of the dialog, as returned by
+   * gtk_dialog_get_content_area(), unless gtk_box_set_spacing()
+   * was called on that widget directly.
+   *
+   * Since: 2.16
+   */
+  gtk_widget_class_install_style_property (widget_class,
+                                           g_param_spec_int ("content-area-spacing",
+                                                             P_("Content area spacing"),
+                                                             P_("Spacing between elements of the main dialog area"),
+                                                             0,
+                                                             G_MAXINT,
+                                                             0,
+                                                             GTK_PARAM_READABLE));
   gtk_widget_class_install_style_property (widget_class,
                                            g_param_spec_int ("button-spacing",
                                                              P_("Button spacing"),
@@ -223,30 +206,35 @@ gtk_dialog_class_init (GtkDialogClass *class)
 
   binding_set = gtk_binding_set_by_class (class);
   
-  gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, "close", 0);
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "close", 0);
 }
 
 static void
 update_spacings (GtkDialog *dialog)
 {
-  GtkWidget *widget;
+  GtkDialogPrivate *priv = dialog->priv;
   gint content_area_border;
+  gint content_area_spacing;
   gint button_spacing;
   gint action_area_border;
-  
-  widget = GTK_WIDGET (dialog);
 
-  gtk_widget_style_get (widget,
+  gtk_widget_style_get (GTK_WIDGET (dialog),
                         "content-area-border", &content_area_border,
+                        "content-area-spacing", &content_area_spacing,
                         "button-spacing", &button_spacing,
                         "action-area-border", &action_area_border,
                         NULL);
 
-  gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox),
+  gtk_container_set_border_width (GTK_CONTAINER (priv->vbox),
                                   content_area_border);
-  gtk_box_set_spacing (GTK_BOX (dialog->action_area),
+  if (!_gtk_box_get_spacing_set (GTK_BOX (priv->vbox)))
+    {
+      gtk_box_set_spacing (GTK_BOX (priv->vbox), content_area_spacing);
+      _gtk_box_set_spacing_set (GTK_BOX (priv->vbox), FALSE);
+    }
+  gtk_box_set_spacing (GTK_BOX (priv->action_area),
                        button_spacing);
-  gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area),
+  gtk_container_set_border_width (GTK_CONTAINER (priv->action_area),
                                   action_area_border);
 }
 
@@ -255,37 +243,33 @@ gtk_dialog_init (GtkDialog *dialog)
 {
   GtkDialogPrivate *priv;
 
-  priv = GET_PRIVATE (dialog);
-  priv->ignore_separator = FALSE;
+  dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog,
+                                              GTK_TYPE_DIALOG,
+                                              GtkDialogPrivate);
+  priv = dialog->priv;
 
   /* To avoid breaking old code that prevents destroy on delete event
    * by connecting a handler, we have to have the FIRST signal
    * connection on the dialog.
    */
   g_signal_connect (dialog,
-                    "delete_event",
+                    "delete-event",
                     G_CALLBACK (gtk_dialog_delete_event_handler),
                     NULL);
-  
-  dialog->vbox = gtk_vbox_new (FALSE, 0);
 
-  /* gtk_container_add () from superclass */
-  GTK_CONTAINER_CLASS (gtk_dialog_parent_class)->add (GTK_CONTAINER (dialog),
-                                                     dialog->vbox);
-  gtk_widget_show (dialog->vbox);
+  priv->vbox = gtk_vbox_new (FALSE, 0);
 
-  dialog->action_area = gtk_hbutton_box_new ();
+  gtk_container_add (GTK_CONTAINER (dialog), priv->vbox);
+  gtk_widget_show (priv->vbox);
 
-  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog->action_area),
-                             GTK_BUTTONBOX_END);  
+  priv->action_area = gtk_hbutton_box_new ();
 
-  gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->action_area,
-                    FALSE, TRUE, 0);
-  gtk_widget_show (dialog->action_area);
+  gtk_button_box_set_layout (GTK_BUTTON_BOX (priv->action_area),
+                             GTK_BUTTONBOX_END);
 
-  dialog->separator = gtk_hseparator_new ();
-  gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->separator, FALSE, TRUE, 0);
-  gtk_widget_show (dialog->separator);
+  gtk_box_pack_end (GTK_BOX (priv->vbox), priv->action_area,
+                    FALSE, TRUE, 0);
+  gtk_widget_show (priv->action_area);
 
   gtk_window_set_type_hint (GTK_WINDOW (dialog),
                            GDK_WINDOW_TYPE_HINT_DIALOG);
@@ -308,83 +292,19 @@ gtk_dialog_buildable_get_internal_child (GtkBuildable *buildable,
                                         GtkBuilder   *builder,
                                         const gchar  *childname)
 {
-    if (strcmp (childname, "vbox") == 0)
-      return G_OBJECT (GTK_DIALOG (buildable)->vbox);
-    else if (strcmp (childname, "action_area") == 0)
-      return G_OBJECT (GTK_DIALOG (buildable)->action_area);
-
-    return parent_buildable_iface->get_internal_child (buildable,
-                                                      builder,
-                                                      childname);
-}
+  GtkDialogPrivate *priv = GTK_DIALOG (buildable)->priv;
 
-static void 
-gtk_dialog_set_property (GObject      *object,
-                         guint         prop_id,
-                         const GValue *value,
-                         GParamSpec   *pspec)
-{
-  GtkDialog *dialog;
-  
-  dialog = GTK_DIALOG (object);
-  
-  switch (prop_id)
-    {
-    case PROP_HAS_SEPARATOR:
-      gtk_dialog_set_has_separator (dialog, g_value_get_boolean (value));
-      break;
+  if (strcmp (childname, "vbox") == 0)
+    return G_OBJECT (priv->vbox);
+  else if (strcmp (childname, "action_area") == 0)
+    return G_OBJECT (priv->action_area);
 
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
+  return parent_buildable_iface->get_internal_child (buildable,
+                                                     builder,
+                                                     childname);
 }
 
-static void 
-gtk_dialog_get_property (GObject     *object,
-                         guint        prop_id,
-                         GValue      *value,
-                         GParamSpec  *pspec)
-{
-  GtkDialog *dialog;
-  
-  dialog = GTK_DIALOG (object);
-  
-  switch (prop_id)
-    {
-    case PROP_HAS_SEPARATOR:
-      g_value_set_boolean (value, dialog->separator != NULL);
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-static void
-gtk_dialog_add (GtkContainer *container,
-               GtkWidget    *widget)
-{
-  GtkDialog *dialog;
-
-  dialog = GTK_DIALOG (container);
-
-  gtk_box_pack_start (GTK_BOX (dialog->vbox), widget, FALSE, FALSE, 0);
-}
-
-static void
-gtk_dialog_remove (GtkContainer *container,
-                  GtkWidget    *widget)
-{
-  GtkDialog *dialog;
-
-  dialog = GTK_DIALOG (container);
-
-  gtk_container_remove (GTK_CONTAINER (dialog->vbox), widget);
-}
-
-static gint
+static gboolean
 gtk_dialog_delete_event_handler (GtkWidget   *widget,
                                  GdkEventAny *event,
                                  gpointer     user_data)
@@ -408,44 +328,50 @@ gtk_dialog_delete_event_handler (GtkWidget   *widget,
 static void
 gtk_dialog_map (GtkWidget *widget)
 {
+  GtkWidget *default_widget, *focus;
   GtkWindow *window = GTK_WINDOW (widget);
   GtkDialog *dialog = GTK_DIALOG (widget);
+  GtkDialogPrivate *priv = dialog->priv;
   
   GTK_WIDGET_CLASS (gtk_dialog_parent_class)->map (widget);
 
-  if (!window->focus_widget)
+  focus = gtk_window_get_focus (window);
+  if (!focus)
     {
       GList *children, *tmp_list;
       GtkWidget *first_focus = NULL;
-      
-      do 
-       {
-         g_signal_emit_by_name (window, "move_focus", GTK_DIR_TAB_FORWARD);
 
-         if (first_focus == NULL)
-           first_focus = window->focus_widget;
-         else if (first_focus == window->focus_widget)
-           break;
+      do
+        {
+          g_signal_emit_by_name (window, "move_focus", GTK_DIR_TAB_FORWARD);
 
-         if (!GTK_IS_LABEL (window->focus_widget))
-           break;
-         else
-           gtk_label_select_region (GTK_LABEL (window->focus_widget), 0, 0);
-       }
+          focus = gtk_window_get_focus (window);
+          if (GTK_IS_LABEL (focus) &&
+              !gtk_label_get_current_uri (GTK_LABEL (focus)))
+            gtk_label_select_region (GTK_LABEL (focus), 0, 0);
+
+          if (first_focus == NULL)
+            first_focus = focus;
+          else if (first_focus == focus)
+            break;
+
+          if (!GTK_IS_LABEL (focus))
+            break;
+        }
       while (TRUE);
 
-      tmp_list = children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
-      
+      tmp_list = children = gtk_container_get_children (GTK_CONTAINER (priv->action_area));
+
       while (tmp_list)
        {
          GtkWidget *child = tmp_list->data;
-         
-         if ((window->focus_widget == NULL || 
-              child == window->focus_widget) && 
-             child != window->default_widget &&
-             window->default_widget)
+
+          default_widget = gtk_window_get_default_widget (window);
+         if ((focus == NULL || child == focus) &&
+             child != default_widget &&
+             default_widget)
            {
-             gtk_widget_grab_focus (window->default_widget);
+             gtk_widget_grab_focus (default_widget);
              break;
            }
          
@@ -467,10 +393,11 @@ static GtkWidget *
 dialog_find_button (GtkDialog *dialog,
                    gint       response_id)
 {
-  GList *children, *tmp_list;
+  GtkDialogPrivate *priv = dialog->priv;
   GtkWidget *child = NULL;
+  GList *children, *tmp_list;
       
-  children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
+  children = gtk_container_get_children (GTK_CONTAINER (priv->action_area));
 
   for (tmp_list = children; tmp_list; tmp_list = tmp_list->next)
     {
@@ -497,8 +424,8 @@ gtk_dialog_close (GtkDialog *dialog)
   GdkEvent *event;
 
   event = gdk_event_new (GDK_DELETE);
-  
-  event->any.window = g_object_ref (widget->window);
+
+  event->any.window = g_object_ref (gtk_widget_get_window (widget));
   event->any.send_event = TRUE;
   
   gtk_main_do_event (event);
@@ -528,24 +455,21 @@ gtk_dialog_new_empty (const gchar     *title,
 
   if (flags & GTK_DIALOG_MODAL)
     gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
-  
+
   if (flags & GTK_DIALOG_DESTROY_WITH_PARENT)
     gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
 
-  if (flags & GTK_DIALOG_NO_SEPARATOR)
-    gtk_dialog_set_has_separator (dialog, FALSE);
-  
   return GTK_WIDGET (dialog);
 }
 
 /**
  * gtk_dialog_new_with_buttons:
- * @title: Title of the dialog, or %NULL
- * @parent: Transient parent of the dialog, or %NULL
+ * @title: (allow-none): Title of the dialog, or %NULL
+ * @parent: (allow-none): Transient parent of the dialog, or %NULL
  * @flags: from #GtkDialogFlags
- * @first_button_text: stock ID or text to go in first button, or %NULL
+ * @first_button_text: (allow-none): stock ID or text to go in first button, or %NULL
  * @Varargs: response ID for first button, then additional buttons, ending with %NULL
- * 
+ *
  * Creates a new #GtkDialog with title @title (or %NULL for the default
  * title; see gtk_window_set_title()) and transient parent @parent (or
  * %NULL for none; see gtk_window_set_transient_for()). The @flags
@@ -656,12 +580,15 @@ gtk_dialog_add_action_widget (GtkDialog *dialog,
                               GtkWidget *child,
                               gint       response_id)
 {
+  GtkDialogPrivate *priv;
   ResponseData *ad;
   guint signal_id;
   
   g_return_if_fail (GTK_IS_DIALOG (dialog));
   g_return_if_fail (GTK_IS_WIDGET (child));
 
+  priv = dialog->priv;
+
   ad = get_response_data (child, TRUE);
 
   ad->response_id = response_id;
@@ -686,12 +613,12 @@ gtk_dialog_add_action_widget (GtkDialog *dialog,
   else
     g_warning ("Only 'activatable' widgets can be packed into the action area of a GtkDialog");
 
-  gtk_box_pack_end (GTK_BOX (dialog->action_area),
+  gtk_box_pack_end (GTK_BOX (priv->action_area),
                     child,
                     FALSE, TRUE, 0);
   
   if (response_id == GTK_RESPONSE_HELP)
-    gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (dialog->action_area), child, TRUE);
+    gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (priv->action_area), child, TRUE);
 }
 
 /**
@@ -706,7 +633,7 @@ gtk_dialog_add_action_widget (GtkDialog *dialog,
  * appended to the end of the dialog's action area. The button widget is 
  * returned, but usually you don't need it.
  *
- * Return value: the button widget that was added
+ * Return value: (transfer full): the button widget that was added
  **/
 GtkWidget*
 gtk_dialog_add_button (GtkDialog   *dialog,
@@ -720,7 +647,7 @@ gtk_dialog_add_button (GtkDialog   *dialog,
 
   button = gtk_button_new_from_stock (button_text);
 
-  GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+  gtk_widget_set_can_default (button, TRUE);
   
   gtk_widget_show (button);
   
@@ -800,12 +727,15 @@ gtk_dialog_set_response_sensitive (GtkDialog *dialog,
                                    gint       response_id,
                                    gboolean   setting)
 {
+  GtkDialogPrivate *priv;
   GList *children;
   GList *tmp_list;
 
   g_return_if_fail (GTK_IS_DIALOG (dialog));
 
-  children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
+  priv = dialog->priv;
+
+  children = gtk_container_get_children (GTK_CONTAINER (priv->action_area));
 
   tmp_list = children;
   while (tmp_list != NULL)
@@ -835,12 +765,15 @@ void
 gtk_dialog_set_default_response (GtkDialog *dialog,
                                  gint       response_id)
 {
+  GtkDialogPrivate *priv;
   GList *children;
   GList *tmp_list;
 
   g_return_if_fail (GTK_IS_DIALOG (dialog));
 
-  children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
+  priv = dialog->priv;
+
+  children = gtk_container_get_children (GTK_CONTAINER (priv->action_area));
 
   tmp_list = children;
   while (tmp_list != NULL)
@@ -857,69 +790,6 @@ gtk_dialog_set_default_response (GtkDialog *dialog,
   g_list_free (children);
 }
 
-/**
- * gtk_dialog_set_has_separator:
- * @dialog: a #GtkDialog
- * @setting: %TRUE to have a separator
- *
- * Sets whether the dialog has a separator above the buttons.
- * %TRUE by default.
- **/
-void
-gtk_dialog_set_has_separator (GtkDialog *dialog,
-                              gboolean   setting)
-{
-  GtkDialogPrivate *priv;
-
-  g_return_if_fail (GTK_IS_DIALOG (dialog));
-
-  priv = GET_PRIVATE (dialog);
-
-  /* this might fail if we get called before _init() somehow */
-  g_assert (dialog->vbox != NULL);
-
-  if (priv->ignore_separator)
-    {
-      g_warning ("Ignoring the separator setting");
-      return;
-    }
-  
-  if (setting && dialog->separator == NULL)
-    {
-      dialog->separator = gtk_hseparator_new ();
-      gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->separator, FALSE, TRUE, 0);
-
-      /* The app programmer could screw this up, but, their own fault.
-       * Moves the separator just above the action area.
-       */
-      gtk_box_reorder_child (GTK_BOX (dialog->vbox), dialog->separator, 1);
-      gtk_widget_show (dialog->separator);
-    }
-  else if (!setting && dialog->separator != NULL)
-    {
-      gtk_widget_destroy (dialog->separator);
-      dialog->separator = NULL;
-    }
-
-  g_object_notify (G_OBJECT (dialog), "has-separator");
-}
-
-/**
- * gtk_dialog_get_has_separator:
- * @dialog: a #GtkDialog
- * 
- * Accessor for whether the dialog has a separator.
- * 
- * Return value: %TRUE if the dialog has a separator
- **/
-gboolean
-gtk_dialog_get_has_separator (GtkDialog *dialog)
-{
-  g_return_val_if_fail (GTK_IS_DIALOG (dialog), FALSE);
-
-  return dialog->separator != NULL;
-}
-
 /**
  * gtk_dialog_response:
  * @dialog: a #GtkDialog
@@ -1064,11 +934,11 @@ gtk_dialog_run (GtkDialog *dialog)
 
   g_object_ref (dialog);
 
-  was_modal = GTK_WINDOW (dialog)->modal;
+  was_modal = gtk_window_get_modal (GTK_WINDOW (dialog));
   if (!was_modal)
     gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
 
-  if (!GTK_WIDGET_VISIBLE (dialog))
+  if (!gtk_widget_get_visible (GTK_WIDGET (dialog)))
     gtk_widget_show (GTK_WIDGET (dialog));
   
   response_handler =
@@ -1121,14 +991,50 @@ gtk_dialog_run (GtkDialog *dialog)
   return ri.response_id;
 }
 
-void
-_gtk_dialog_set_ignore_separator (GtkDialog *dialog,
-                                 gboolean   ignore_separator)
+/**
+ * gtk_dialog_get_widget_for_response:
+ * @dialog: a #GtkDialog
+ * @response_id: the response ID used by the @dialog widget
+ *
+ * Gets the widget button that uses the given response ID in the action area
+ * of a dialog.
+ *
+ * Returns: (transfer none):the @widget button that uses the given @response_id, or %NULL.
+ *
+ * Since: 2.20
+ */
+GtkWidget*
+gtk_dialog_get_widget_for_response (GtkDialog *dialog,
+                                   gint       response_id)
 {
   GtkDialogPrivate *priv;
+  GList *children;
+  GList *tmp_list;
+
+  g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
+
+  priv = dialog->priv;
+
+  children = gtk_container_get_children (GTK_CONTAINER (priv->action_area));
+
+  tmp_list = children;
+  while (tmp_list != NULL)
+    {
+      GtkWidget *widget = tmp_list->data;
+      ResponseData *rd = get_response_data (widget, FALSE);
+
+      if (rd && rd->response_id == response_id)
+        {
+          g_list_free (children);
+          return widget;
+        }
+
+      tmp_list = g_list_next (tmp_list);
+    }
+
+  g_list_free (children);
 
-  priv = GET_PRIVATE (dialog);
-  priv->ignore_separator = ignore_separator;
+  return NULL;
 }
 
 /**
@@ -1159,10 +1065,10 @@ gtk_dialog_get_response_for_widget (GtkDialog *dialog,
 
 /**
  * gtk_alternative_dialog_button_order:
- * @screen: a #GdkScreen, or %NULL to use the default screen
+ * @screen: (allow-none): a #GdkScreen, or %NULL to use the default screen
  *
  * Returns %TRUE if dialogs are expected to use an alternative
- * button order on the screen @screen. See 
+ * button order on the screen @screen. See
  * gtk_dialog_set_alternative_button_order() for more details
  * about alternative button order. 
  *
@@ -1197,6 +1103,7 @@ gtk_dialog_set_alternative_button_order_valist (GtkDialog *dialog,
                                                gint       first_response_id,
                                                va_list    args)
 {
+  GtkDialogPrivate *priv = dialog->priv;
   GtkWidget *child;
   gint response_id;
   gint position;
@@ -1207,7 +1114,7 @@ gtk_dialog_set_alternative_button_order_valist (GtkDialog *dialog,
     {
       /* reorder child with response_id to position */
       child = dialog_find_button (dialog, response_id);
-      gtk_box_reorder_child (GTK_BOX (dialog->action_area), child, position);
+      gtk_box_reorder_child (GTK_BOX (priv->action_area), child, position);
 
       response_id = va_arg (args, gint);
       position++;
@@ -1301,6 +1208,7 @@ gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
                                                     gint       n_params,
                                                     gint      *new_order)
 {
+  GtkDialogPrivate *priv = dialog->priv;
   GdkScreen *screen;
   GtkWidget *child;
   gint position;
@@ -1316,7 +1224,7 @@ gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
   {
       /* reorder child with response_id to position */
       child = dialog_find_button (dialog, new_order[position]);
-      gtk_box_reorder_child (GTK_BOX (dialog->action_area), child, position);
+      gtk_box_reorder_child (GTK_BOX (priv->action_area), child, position);
     }
 }
 
@@ -1344,9 +1252,11 @@ attributes_start_element (GMarkupParseContext *context,
   guint i;
 
   if (strcmp (element_name, "action-widget") == 0)
-    for (i = 0; names[i]; i++)
-      if (strcmp (names[i], "response") == 0)
-       parser_data->response = g_strdup (values[i]);
+    {
+      for (i = 0; names[i]; i++)
+       if (strcmp (names[i], "response") == 0)
+         parser_data->response = g_strdup (values[i]);
+    }
   else if (strcmp (element_name, "action-widgets") == 0)
     return;
   else
@@ -1380,7 +1290,7 @@ static const GMarkupParser attributes_parser =
     attributes_text_element,
   };
 
-gboolean
+static gboolean
 gtk_dialog_buildable_custom_tag_start (GtkBuildable  *buildable,
                                       GtkBuilder    *builder,
                                       GObject       *child,
@@ -1415,10 +1325,11 @@ gtk_dialog_buildable_custom_finished (GtkBuildable *buildable,
                                      const gchar  *tagname,
                                      gpointer      user_data)
 {
+  GtkDialog *dialog = GTK_DIALOG (buildable);
+  GtkDialogPrivate *priv = dialog->priv;
   GSList *l;
   ActionWidgetsSubParserData *parser_data;
   GObject *object;
-  GtkDialog *dialog;
   ResponseData *ad;
   guint signal_id;
   
@@ -1429,7 +1340,6 @@ gtk_dialog_buildable_custom_finished (GtkBuildable *buildable,
     return;
     }
 
-  dialog = GTK_DIALOG (buildable);
   parser_data = (ActionWidgetsSubParserData*)user_data;
   parser_data->items = g_slist_reverse (parser_data->items);
 
@@ -1468,7 +1378,7 @@ gtk_dialog_buildable_custom_finished (GtkBuildable *buildable,
        }
 
       if (ad->response_id == GTK_RESPONSE_HELP)
-       gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (dialog->action_area),
+       gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (priv->action_area),
                                            GTK_WIDGET (object), TRUE);
 
       g_free (item->widget_name);
@@ -1485,71 +1395,32 @@ gtk_dialog_buildable_custom_finished (GtkBuildable *buildable,
  *
  * Returns the action area of @dialog.
  *
- * Returns: a #GtkHButtonBox.
+ * Returns: (transfer none): the action area.
  *
- * Since: GSEAL-branch
+ * Since: 2.14
  **/
-GtkHButtonBox *
+GtkWidget *
 gtk_dialog_get_action_area (GtkDialog *dialog)
 {
   g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
 
-  return dialog->action_area;
+  return dialog->priv->action_area;
 }
 
 /**
- * gtk_dialog_pack_start:
+ * gtk_dialog_get_content_area:
  * @dialog: a #GtkDialog
- * @widget: #GtkWidget to be added to @dialog.
- * @expand: %TRUE if @widget should take all extra space.
- * @fill: %TRUE if all space given should be used by @widget
- * @padding: extra pixels to put between @widget and its neighbors
- *
- * This function similar to gtk_box_pack_start() packs @widget
- * with reference to the start of @dialog.
  *
- * Since: GSEAL-branch
- **/
-void
-gtk_dialog_pack_start (GtkDialog *dialog,
-                      GtkWidget *widget,
-                      gboolean   expand,
-                      gboolean   fill,
-                      guint      padding)
-{
-  g_return_if_fail (GTK_IS_DIALOG (dialog));
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-
-  gtk_box_pack_start (GTK_BOX (dialog->vbox),
-                     widget, expand, fill, padding);
-}
-
-/**
- * gtk_dialog_pack_end:
- * @dialog: a #GtkDialog
- * @widget: #GtkWidget to be added to @dialog.
- * @expand: %TRUE if @widget should take all extra space.
- * @fill: %TRUE if all space given should be used by @widget
- * @padding: extra pixels to put between @widget and its neighbors
+ * Returns the content area of @dialog.
  *
- * This function similar to gtk_box_pack_end() packs @widget
- * with reference to the end of @dialog.
+ * Returns: (transfer none): the content area #GtkVBox.
  *
- * Since: GSEAL-branch
+ * Since: 2.14
  **/
-void
-gtk_dialog_pack_end (GtkDialog *dialog,
-                    GtkWidget *widget,
-                    gboolean   expand,
-                    gboolean   fill,
-                    guint      padding)
+GtkWidget *
+gtk_dialog_get_content_area (GtkDialog *dialog)
 {
-  g_return_if_fail (GTK_IS_DIALOG (dialog));
-  g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
 
-  gtk_box_pack_end (GTK_BOX (dialog->vbox),
-                   widget, expand, fill, padding);
+  return dialog->priv->vbox;
 }
-
-#define __GTK_DIALOG_C__
-#include "gtkaliasdef.c"