]> Pileus Git - ~andy/gtk/blob - gtk/gtkdialog.c
Move signal and property documentation inline, fix a problem with the
[~andy/gtk] / gtk / gtkdialog.c
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 #include <stdlib.h>
28 #include <string.h>
29 #include <config.h>
30 #include "gtkbutton.h"
31 #include "gtkdialog.h"
32 #include "gtkhbbox.h"
33 #include "gtklabel.h"
34 #include "gtkhseparator.h"
35 #include "gtkmarshalers.h"
36 #include "gtkvbox.h"
37 #include "gdkkeysyms.h"
38 #include "gtkmain.h"
39 #include "gtkintl.h"
40 #include "gtkbindings.h"
41 #include "gtkprivate.h"
42 #include "gtkbuildable.h"
43 #include "gtkalias.h"
44
45 #define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_DIALOG, GtkDialogPrivate))
46
47 typedef struct {
48   guint ignore_separator : 1;
49 } GtkDialogPrivate;
50
51 typedef struct _ResponseData ResponseData;
52
53 struct _ResponseData
54 {
55   gint response_id;
56 };
57
58 static void gtk_dialog_add_buttons_valist (GtkDialog   *dialog,
59                                            const gchar *first_button_text,
60                                            va_list      args);
61
62 static gint gtk_dialog_delete_event_handler (GtkWidget   *widget,
63                                              GdkEventAny *event,
64                                              gpointer     user_data);
65
66 static void gtk_dialog_set_property      (GObject          *object,
67                                           guint             prop_id,
68                                           const GValue     *value,
69                                           GParamSpec       *pspec);
70 static void gtk_dialog_get_property      (GObject          *object,
71                                           guint             prop_id,
72                                           GValue           *value,
73                                           GParamSpec       *pspec);
74 static void gtk_dialog_style_set         (GtkWidget        *widget,
75                                           GtkStyle         *prev_style);
76 static void gtk_dialog_map               (GtkWidget        *widget);
77
78 static void gtk_dialog_close             (GtkDialog        *dialog);
79
80 static ResponseData* get_response_data   (GtkWidget        *widget,
81                                           gboolean          create);
82 static void gtk_dialog_buildable_interface_init     (GtkBuildableIface *iface);
83 static GObject * gtk_dialog_buildable_get_internal_child (GtkBuildable *buildable,
84                                                      GtkBuilder   *builder,
85                                                      const gchar  *childname);
86 static gboolean gtk_dialog_buildable_custom_tag_start (GtkBuildable  *buildable,
87                                                        GtkBuilder    *builder,
88                                                        GObject       *child,
89                                                        const gchar   *tagname,
90                                                        GMarkupParser *parser,
91                                                        gpointer      *data);
92 static void gtk_dialog_buildable_custom_finished (GtkBuildable *buildable,
93                                                   GtkBuilder   *builder,
94                                                   GObject       *child,
95                                                   const gchar   *tagname,
96                                                   gpointer      user_data);
97
98
99 enum {
100   PROP_0,
101   PROP_HAS_SEPARATOR
102 };
103
104 enum {
105   RESPONSE,
106   CLOSE,
107   LAST_SIGNAL
108 };
109
110 static guint dialog_signals[LAST_SIGNAL];
111
112 G_DEFINE_TYPE_WITH_CODE (GtkDialog, gtk_dialog, GTK_TYPE_WINDOW,
113                          G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
114                                                 gtk_dialog_buildable_interface_init))
115
116 static void
117 gtk_dialog_class_init (GtkDialogClass *class)
118 {
119   GObjectClass *gobject_class;
120   GtkWidgetClass *widget_class;
121   GtkBindingSet *binding_set;
122   
123   gobject_class = G_OBJECT_CLASS (class);
124   widget_class = GTK_WIDGET_CLASS (class);
125   
126   gobject_class->set_property = gtk_dialog_set_property;
127   gobject_class->get_property = gtk_dialog_get_property;
128   
129   widget_class->map = gtk_dialog_map;
130   widget_class->style_set = gtk_dialog_style_set;
131
132   class->close = gtk_dialog_close;
133   
134   g_type_class_add_private (gobject_class, sizeof (GtkDialogPrivate));
135
136   /**
137    * GtkDialog:has-separator:
138    *
139    * When %TRUE, the dialog has a separator bar above its buttons.
140    */
141   g_object_class_install_property (gobject_class,
142                                    PROP_HAS_SEPARATOR,
143                                    g_param_spec_boolean ("has-separator",
144                                                          P_("Has separator"),
145                                                          P_("The dialog has a separator bar above its buttons"),
146                                                          TRUE,
147                                                          GTK_PARAM_READWRITE));
148
149   /**
150    * GtkDialog::response:
151    * @dialog: the object on which the signal is emitted
152    * @response_id: the response ID
153    * 
154    * Emitted when an action widget is clicked, the dialog receives a 
155    * delete event, or the application programmer calls gtk_dialog_response(). 
156    * On a delete event, the response ID is #GTK_RESPONSE_DELETE_EVENT. 
157    * Otherwise, it depends on which action widget was clicked.
158    */
159   dialog_signals[RESPONSE] =
160     g_signal_new (I_("response"),
161                   G_OBJECT_CLASS_TYPE (class),
162                   G_SIGNAL_RUN_LAST,
163                   G_STRUCT_OFFSET (GtkDialogClass, response),
164                   NULL, NULL,
165                   _gtk_marshal_NONE__INT,
166                   G_TYPE_NONE, 1,
167                   G_TYPE_INT);
168
169   /**
170    * GtkDialog::close:
171    *
172    * The ::close signal is a 
173    * <link linkend="keybinding-signals">keybinding signal</link>
174    * which getrs emitted when the user uses a keybinding to close
175    * the dialog.
176    *
177    * The default binding for this signal is the Escape key.
178    */ 
179   dialog_signals[CLOSE] =
180     g_signal_new (I_("close"),
181                   G_OBJECT_CLASS_TYPE (class),
182                   G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
183                   G_STRUCT_OFFSET (GtkDialogClass, close),
184                   NULL, NULL,
185                   _gtk_marshal_NONE__NONE,
186                   G_TYPE_NONE, 0);
187   
188   gtk_widget_class_install_style_property (widget_class,
189                                            g_param_spec_int ("content-area-border",
190                                                              P_("Content area border"),
191                                                              P_("Width of border around the main dialog area"),
192                                                              0,
193                                                              G_MAXINT,
194                                                              2,
195                                                              GTK_PARAM_READABLE));
196   gtk_widget_class_install_style_property (widget_class,
197                                            g_param_spec_int ("button-spacing",
198                                                              P_("Button spacing"),
199                                                              P_("Spacing between buttons"),
200                                                              0,
201                                                              G_MAXINT,
202                                                              6,
203                                                              GTK_PARAM_READABLE));
204   
205   gtk_widget_class_install_style_property (widget_class,
206                                            g_param_spec_int ("action-area-border",
207                                                              P_("Action area border"),
208                                                              P_("Width of border around the button area at the bottom of the dialog"),
209                                                              0,
210                                                              G_MAXINT,
211                                                              5,
212                                                              GTK_PARAM_READABLE));
213
214   binding_set = gtk_binding_set_by_class (class);
215   
216   gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, "close", 0);
217 }
218
219 static void
220 update_spacings (GtkDialog *dialog)
221 {
222   GtkWidget *widget;
223   gint content_area_border;
224   gint button_spacing;
225   gint action_area_border;
226   
227   widget = GTK_WIDGET (dialog);
228
229   gtk_widget_style_get (widget,
230                         "content-area-border", &content_area_border,
231                         "button-spacing", &button_spacing,
232                         "action-area-border", &action_area_border,
233                         NULL);
234
235   gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox),
236                                   content_area_border);
237   gtk_box_set_spacing (GTK_BOX (dialog->action_area),
238                        button_spacing);
239   gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area),
240                                   action_area_border);
241 }
242
243 static void
244 gtk_dialog_init (GtkDialog *dialog)
245 {
246   GtkDialogPrivate *priv;
247
248   priv = GET_PRIVATE (dialog);
249   priv->ignore_separator = FALSE;
250
251   /* To avoid breaking old code that prevents destroy on delete event
252    * by connecting a handler, we have to have the FIRST signal
253    * connection on the dialog.
254    */
255   g_signal_connect (dialog,
256                     "delete_event",
257                     G_CALLBACK (gtk_dialog_delete_event_handler),
258                     NULL);
259   
260   dialog->vbox = gtk_vbox_new (FALSE, 0);
261   
262   gtk_container_add (GTK_CONTAINER (dialog), dialog->vbox);
263   gtk_widget_show (dialog->vbox);
264
265   dialog->action_area = gtk_hbutton_box_new ();
266
267   gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog->action_area),
268                              GTK_BUTTONBOX_END);  
269
270   gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->action_area,
271                     FALSE, TRUE, 0);
272   gtk_widget_show (dialog->action_area);
273
274   dialog->separator = gtk_hseparator_new ();
275   gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->separator, FALSE, TRUE, 0);
276   gtk_widget_show (dialog->separator);
277
278   gtk_window_set_type_hint (GTK_WINDOW (dialog),
279                             GDK_WINDOW_TYPE_HINT_DIALOG);
280   gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT);
281 }
282
283 static void
284 gtk_dialog_buildable_interface_init (GtkBuildableIface *iface)
285 {
286   iface->get_internal_child = gtk_dialog_buildable_get_internal_child;
287   iface->custom_tag_start = gtk_dialog_buildable_custom_tag_start;
288   iface->custom_finished = gtk_dialog_buildable_custom_finished;
289 }
290
291 static GObject *
292 gtk_dialog_buildable_get_internal_child (GtkBuildable *buildable,
293                                          GtkBuilder   *builder,
294                                          const gchar  *childname)
295 {
296     if (strcmp (childname, "vbox") == 0)
297       return G_OBJECT (GTK_DIALOG (buildable)->vbox);
298     else if (strcmp (childname, "action_area") == 0)
299       return G_OBJECT (GTK_DIALOG (buildable)->action_area);
300
301     return NULL;
302 }
303
304 static void 
305 gtk_dialog_set_property (GObject      *object,
306                          guint         prop_id,
307                          const GValue *value,
308                          GParamSpec   *pspec)
309 {
310   GtkDialog *dialog;
311   
312   dialog = GTK_DIALOG (object);
313   
314   switch (prop_id)
315     {
316     case PROP_HAS_SEPARATOR:
317       gtk_dialog_set_has_separator (dialog, g_value_get_boolean (value));
318       break;
319
320     default:
321       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
322       break;
323     }
324 }
325
326 static void 
327 gtk_dialog_get_property (GObject     *object,
328                          guint        prop_id,
329                          GValue      *value,
330                          GParamSpec  *pspec)
331 {
332   GtkDialog *dialog;
333   
334   dialog = GTK_DIALOG (object);
335   
336   switch (prop_id)
337     {
338     case PROP_HAS_SEPARATOR:
339       g_value_set_boolean (value, dialog->separator != NULL);
340       break;
341
342     default:
343       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
344       break;
345     }
346 }
347
348 static gint
349 gtk_dialog_delete_event_handler (GtkWidget   *widget,
350                                  GdkEventAny *event,
351                                  gpointer     user_data)
352 {
353   /* emit response signal */
354   gtk_dialog_response (GTK_DIALOG (widget), GTK_RESPONSE_DELETE_EVENT);
355
356   /* Do the destroy by default */
357   return FALSE;
358 }
359
360 /* A far too tricky heuristic for getting the right initial
361  * focus widget if none was set. What we do is we focus the first
362  * widget in the tab chain, but if this results in the focus
363  * ending up on one of the response widgets _other_ than the
364  * default response, we focus the default response instead.
365  *
366  * Additionally, skip selectable labels when looking for the
367  * right initial focus widget.
368  */
369 static void
370 gtk_dialog_map (GtkWidget *widget)
371 {
372   GtkWindow *window = GTK_WINDOW (widget);
373   GtkDialog *dialog = GTK_DIALOG (widget);
374   
375   GTK_WIDGET_CLASS (gtk_dialog_parent_class)->map (widget);
376
377   if (!window->focus_widget)
378     {
379       GList *children, *tmp_list;
380       GtkWidget *first_focus = NULL;
381       
382       do 
383         {
384           g_signal_emit_by_name (window, "move_focus", GTK_DIR_TAB_FORWARD);
385
386           if (first_focus == NULL)
387             first_focus = window->focus_widget;
388           else if (first_focus == window->focus_widget)
389             break;
390
391           if (!GTK_IS_LABEL (window->focus_widget))
392             break;
393           else
394             gtk_label_select_region (GTK_LABEL (window->focus_widget), 0, 0);
395         }
396       while (TRUE);
397
398       tmp_list = children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
399       
400       while (tmp_list)
401         {
402           GtkWidget *child = tmp_list->data;
403           
404           if ((window->focus_widget == NULL || 
405                child == window->focus_widget) && 
406               child != window->default_widget &&
407               window->default_widget)
408             {
409               gtk_widget_grab_focus (window->default_widget);
410               break;
411             }
412           
413           tmp_list = tmp_list->next;
414         }
415       
416       g_list_free (children);
417     }
418 }
419
420 static void
421 gtk_dialog_style_set (GtkWidget *widget,
422                       GtkStyle  *prev_style)
423 {
424   update_spacings (GTK_DIALOG (widget));
425 }
426
427 static GtkWidget *
428 dialog_find_button (GtkDialog *dialog,
429                     gint       response_id)
430 {
431   GList *children, *tmp_list;
432   GtkWidget *child = NULL;
433       
434   children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
435
436   for (tmp_list = children; tmp_list; tmp_list = tmp_list->next)
437     {
438       ResponseData *rd = get_response_data (tmp_list->data, FALSE);
439       
440       if (rd && rd->response_id == response_id)
441         {
442           child = tmp_list->data;
443           break;
444         }
445     }
446
447   g_list_free (children);
448
449   return child;
450 }
451
452 static void
453 gtk_dialog_close (GtkDialog *dialog)
454 {
455   /* Synthesize delete_event to close dialog. */
456   
457   GtkWidget *widget = GTK_WIDGET (dialog);
458   GdkEvent *event;
459
460   event = gdk_event_new (GDK_DELETE);
461   
462   event->any.window = g_object_ref (widget->window);
463   event->any.send_event = TRUE;
464   
465   gtk_main_do_event (event);
466   gdk_event_free (event);
467 }
468
469 GtkWidget*
470 gtk_dialog_new (void)
471 {
472   return g_object_new (GTK_TYPE_DIALOG, NULL);
473 }
474
475 static GtkWidget*
476 gtk_dialog_new_empty (const gchar     *title,
477                       GtkWindow       *parent,
478                       GtkDialogFlags   flags)
479 {
480   GtkDialog *dialog;
481
482   dialog = g_object_new (GTK_TYPE_DIALOG, NULL);
483
484   if (title)
485     gtk_window_set_title (GTK_WINDOW (dialog), title);
486
487   if (parent)
488     gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
489
490   if (flags & GTK_DIALOG_MODAL)
491     gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
492   
493   if (flags & GTK_DIALOG_DESTROY_WITH_PARENT)
494     gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
495
496   if (flags & GTK_DIALOG_NO_SEPARATOR)
497     gtk_dialog_set_has_separator (dialog, FALSE);
498   
499   return GTK_WIDGET (dialog);
500 }
501
502 /**
503  * gtk_dialog_new_with_buttons:
504  * @title: Title of the dialog, or %NULL
505  * @parent: Transient parent of the dialog, or %NULL
506  * @flags: from #GtkDialogFlags
507  * @first_button_text: stock ID or text to go in first button, or %NULL
508  * @Varargs: response ID for first button, then additional buttons, ending with %NULL
509  * 
510  * Creates a new #GtkDialog with title @title (or %NULL for the default
511  * title; see gtk_window_set_title()) and transient parent @parent (or
512  * %NULL for none; see gtk_window_set_transient_for()). The @flags
513  * argument can be used to make the dialog modal (#GTK_DIALOG_MODAL)
514  * and/or to have it destroyed along with its transient parent
515  * (#GTK_DIALOG_DESTROY_WITH_PARENT). After @flags, button
516  * text/response ID pairs should be listed, with a %NULL pointer ending
517  * the list. Button text can be either a stock ID such as
518  * #GTK_STOCK_OK, or some arbitrary text. A response ID can be
519  * any positive number, or one of the values in the #GtkResponseType
520  * enumeration. If the user clicks one of these dialog buttons,
521  * #GtkDialog will emit the #GtkDialog::response signal with the corresponding
522  * response ID. If a #GtkDialog receives the #GtkWidget::delete-event signal, 
523  * it will emit ::response with a response ID of #GTK_RESPONSE_DELETE_EVENT.
524  * However, destroying a dialog does not emit the ::response signal;
525  * so be careful relying on ::response when using the 
526  * #GTK_DIALOG_DESTROY_WITH_PARENT flag. Buttons are from left to right,
527  * so the first button in the list will be the leftmost button in the dialog.
528  *
529  * Here's a simple example:
530  * <informalexample><programlisting>
531  *  GtkWidget *dialog = gtk_dialog_new_with_buttons ("My dialog",
532  *                                                   main_app_window,
533  *                                                   GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
534  *                                                   GTK_STOCK_OK,
535  *                                                   GTK_RESPONSE_ACCEPT,
536  *                                                   GTK_STOCK_CANCEL,
537  *                                                   GTK_RESPONSE_REJECT,
538  *                                                   NULL);
539  * </programlisting></informalexample>
540  * 
541  * Return value: a new #GtkDialog
542  **/
543 GtkWidget*
544 gtk_dialog_new_with_buttons (const gchar    *title,
545                              GtkWindow      *parent,
546                              GtkDialogFlags  flags,
547                              const gchar    *first_button_text,
548                              ...)
549 {
550   GtkDialog *dialog;
551   va_list args;
552   
553   dialog = GTK_DIALOG (gtk_dialog_new_empty (title, parent, flags));
554
555   va_start (args, first_button_text);
556
557   gtk_dialog_add_buttons_valist (dialog,
558                                  first_button_text,
559                                  args);
560   
561   va_end (args);
562
563   return GTK_WIDGET (dialog);
564 }
565
566 static void 
567 response_data_free (gpointer data)
568 {
569   g_slice_free (ResponseData, data);
570 }
571
572 static ResponseData*
573 get_response_data (GtkWidget *widget,
574                    gboolean   create)
575 {
576   ResponseData *ad = g_object_get_data (G_OBJECT (widget),
577                                         "gtk-dialog-response-data");
578
579   if (ad == NULL && create)
580     {
581       ad = g_slice_new (ResponseData);
582       
583       g_object_set_data_full (G_OBJECT (widget),
584                               I_("gtk-dialog-response-data"),
585                               ad,
586                               response_data_free);
587     }
588
589   return ad;
590 }
591
592 static void
593 action_widget_activated (GtkWidget *widget, GtkDialog *dialog)
594 {
595   gint response_id;
596   
597   response_id = gtk_dialog_get_response_for_widget (dialog, widget);
598
599   gtk_dialog_response (dialog, response_id);
600 }
601
602 /**
603  * gtk_dialog_add_action_widget:
604  * @dialog: a #GtkDialog
605  * @child: an activatable widget
606  * @response_id: response ID for @child
607  * 
608  * Adds an activatable widget to the action area of a #GtkDialog,
609  * connecting a signal handler that will emit the #GtkDialog::response 
610  * signal on the dialog when the widget is activated. The widget is 
611  * appended to the end of the dialog's action area. If you want to add a
612  * non-activatable widget, simply pack it into the @action_area field 
613  * of the #GtkDialog struct.
614  **/
615 void
616 gtk_dialog_add_action_widget (GtkDialog *dialog,
617                               GtkWidget *child,
618                               gint       response_id)
619 {
620   ResponseData *ad;
621   guint signal_id;
622   
623   g_return_if_fail (GTK_IS_DIALOG (dialog));
624   g_return_if_fail (GTK_IS_WIDGET (child));
625
626   ad = get_response_data (child, TRUE);
627
628   ad->response_id = response_id;
629
630   if (GTK_IS_BUTTON (child))
631     signal_id = g_signal_lookup ("clicked", GTK_TYPE_BUTTON);
632   else
633     signal_id = GTK_WIDGET_GET_CLASS (child)->activate_signal;
634
635   if (signal_id)
636     {
637       GClosure *closure;
638
639       closure = g_cclosure_new_object (G_CALLBACK (action_widget_activated),
640                                        G_OBJECT (dialog));
641       g_signal_connect_closure_by_id (child,
642                                       signal_id,
643                                       0,
644                                       closure,
645                                       FALSE);
646     }
647   else
648     g_warning ("Only 'activatable' widgets can be packed into the action area of a GtkDialog");
649
650   gtk_box_pack_end (GTK_BOX (dialog->action_area),
651                     child,
652                     FALSE, TRUE, 0);
653   
654   if (response_id == GTK_RESPONSE_HELP)
655     gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (dialog->action_area), child, TRUE);
656 }
657
658 /**
659  * gtk_dialog_add_button:
660  * @dialog: a #GtkDialog
661  * @button_text: text of button, or stock ID
662  * @response_id: response ID for the button
663  * 
664  * Adds a button with the given text (or a stock button, if @button_text is a
665  * stock ID) and sets things up so that clicking the button will emit the
666  * #GtkDialog::response signal with the given @response_id. The button is 
667  * appended to the end of the dialog's action area. The button widget is 
668  * returned, but usually you don't need it.
669  *
670  * Return value: the button widget that was added
671  **/
672 GtkWidget*
673 gtk_dialog_add_button (GtkDialog   *dialog,
674                        const gchar *button_text,
675                        gint         response_id)
676 {
677   GtkWidget *button;
678   
679   g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
680   g_return_val_if_fail (button_text != NULL, NULL);
681
682   button = gtk_button_new_from_stock (button_text);
683
684   GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
685   
686   gtk_widget_show (button);
687   
688   gtk_dialog_add_action_widget (dialog,
689                                 button,
690                                 response_id);
691
692   return button;
693 }
694
695 static void
696 gtk_dialog_add_buttons_valist (GtkDialog      *dialog,
697                                const gchar    *first_button_text,
698                                va_list         args)
699 {
700   const gchar* text;
701   gint response_id;
702
703   g_return_if_fail (GTK_IS_DIALOG (dialog));
704   
705   if (first_button_text == NULL)
706     return;
707   
708   text = first_button_text;
709   response_id = va_arg (args, gint);
710
711   while (text != NULL)
712     {
713       gtk_dialog_add_button (dialog, text, response_id);
714
715       text = va_arg (args, gchar*);
716       if (text == NULL)
717         break;
718       response_id = va_arg (args, int);
719     }
720 }
721
722 /**
723  * gtk_dialog_add_buttons:
724  * @dialog: a #GtkDialog
725  * @first_button_text: button text or stock ID
726  * @Varargs: response ID for first button, then more text-response_id pairs
727  * 
728  * Adds more buttons, same as calling gtk_dialog_add_button()
729  * repeatedly.  The variable argument list should be %NULL-terminated
730  * as with gtk_dialog_new_with_buttons(). Each button must have both
731  * text and response ID.
732  **/
733 void
734 gtk_dialog_add_buttons (GtkDialog   *dialog,
735                         const gchar *first_button_text,
736                         ...)
737 {  
738   va_list args;
739
740   va_start (args, first_button_text);
741
742   gtk_dialog_add_buttons_valist (dialog,
743                                  first_button_text,
744                                  args);
745   
746   va_end (args);
747 }
748
749 /**
750  * gtk_dialog_set_response_sensitive:
751  * @dialog: a #GtkDialog
752  * @response_id: a response ID
753  * @setting: %TRUE for sensitive
754  *
755  * Calls <literal>gtk_widget_set_sensitive (widget, @setting)</literal> 
756  * for each widget in the dialog's action area with the given @response_id.
757  * A convenient way to sensitize/desensitize dialog buttons.
758  **/
759 void
760 gtk_dialog_set_response_sensitive (GtkDialog *dialog,
761                                    gint       response_id,
762                                    gboolean   setting)
763 {
764   GList *children;
765   GList *tmp_list;
766
767   g_return_if_fail (GTK_IS_DIALOG (dialog));
768
769   children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
770
771   tmp_list = children;
772   while (tmp_list != NULL)
773     {
774       GtkWidget *widget = tmp_list->data;
775       ResponseData *rd = get_response_data (widget, FALSE);
776
777       if (rd && rd->response_id == response_id)
778         gtk_widget_set_sensitive (widget, setting);
779
780       tmp_list = g_list_next (tmp_list);
781     }
782
783   g_list_free (children);
784 }
785
786 /**
787  * gtk_dialog_set_default_response:
788  * @dialog: a #GtkDialog
789  * @response_id: a response ID
790  * 
791  * Sets the last widget in the dialog's action area with the given @response_id
792  * as the default widget for the dialog. Pressing "Enter" normally activates
793  * the default widget.
794  **/
795 void
796 gtk_dialog_set_default_response (GtkDialog *dialog,
797                                  gint       response_id)
798 {
799   GList *children;
800   GList *tmp_list;
801
802   g_return_if_fail (GTK_IS_DIALOG (dialog));
803
804   children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
805
806   tmp_list = children;
807   while (tmp_list != NULL)
808     {
809       GtkWidget *widget = tmp_list->data;
810       ResponseData *rd = get_response_data (widget, FALSE);
811
812       if (rd && rd->response_id == response_id)
813         gtk_widget_grab_default (widget);
814             
815       tmp_list = g_list_next (tmp_list);
816     }
817
818   g_list_free (children);
819 }
820
821 /**
822  * gtk_dialog_set_has_separator:
823  * @dialog: a #GtkDialog
824  * @setting: %TRUE to have a separator
825  *
826  * Sets whether the dialog has a separator above the buttons.
827  * %TRUE by default.
828  **/
829 void
830 gtk_dialog_set_has_separator (GtkDialog *dialog,
831                               gboolean   setting)
832 {
833   GtkDialogPrivate *priv;
834
835   g_return_if_fail (GTK_IS_DIALOG (dialog));
836
837   priv = GET_PRIVATE (dialog);
838
839   /* this might fail if we get called before _init() somehow */
840   g_assert (dialog->vbox != NULL);
841
842   if (priv->ignore_separator)
843     {
844       g_warning ("Ignoring the separator setting");
845       return;
846     }
847   
848   if (setting && dialog->separator == NULL)
849     {
850       dialog->separator = gtk_hseparator_new ();
851       gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->separator, FALSE, TRUE, 0);
852
853       /* The app programmer could screw this up, but, their own fault.
854        * Moves the separator just above the action area.
855        */
856       gtk_box_reorder_child (GTK_BOX (dialog->vbox), dialog->separator, 1);
857       gtk_widget_show (dialog->separator);
858     }
859   else if (!setting && dialog->separator != NULL)
860     {
861       gtk_widget_destroy (dialog->separator);
862       dialog->separator = NULL;
863     }
864
865   g_object_notify (G_OBJECT (dialog), "has-separator");
866 }
867
868 /**
869  * gtk_dialog_get_has_separator:
870  * @dialog: a #GtkDialog
871  * 
872  * Accessor for whether the dialog has a separator.
873  * 
874  * Return value: %TRUE if the dialog has a separator
875  **/
876 gboolean
877 gtk_dialog_get_has_separator (GtkDialog *dialog)
878 {
879   g_return_val_if_fail (GTK_IS_DIALOG (dialog), FALSE);
880
881   return dialog->separator != NULL;
882 }
883
884 /**
885  * gtk_dialog_response:
886  * @dialog: a #GtkDialog
887  * @response_id: response ID 
888  * 
889  * Emits the #GtkDialog::response signal with the given response ID. 
890  * Used to indicate that the user has responded to the dialog in some way;
891  * typically either you or gtk_dialog_run() will be monitoring the
892  * ::response signal and take appropriate action.
893  **/
894 void
895 gtk_dialog_response (GtkDialog *dialog,
896                      gint       response_id)
897 {
898   g_return_if_fail (GTK_IS_DIALOG (dialog));
899
900   g_signal_emit (dialog,
901                  dialog_signals[RESPONSE],
902                  0,
903                  response_id);
904 }
905
906 typedef struct
907 {
908   GtkDialog *dialog;
909   gint response_id;
910   GMainLoop *loop;
911   gboolean destroyed;
912 } RunInfo;
913
914 static void
915 shutdown_loop (RunInfo *ri)
916 {
917   if (g_main_loop_is_running (ri->loop))
918     g_main_loop_quit (ri->loop);
919 }
920
921 static void
922 run_unmap_handler (GtkDialog *dialog, gpointer data)
923 {
924   RunInfo *ri = data;
925
926   shutdown_loop (ri);
927 }
928
929 static void
930 run_response_handler (GtkDialog *dialog,
931                       gint response_id,
932                       gpointer data)
933 {
934   RunInfo *ri;
935
936   ri = data;
937
938   ri->response_id = response_id;
939
940   shutdown_loop (ri);
941 }
942
943 static gint
944 run_delete_handler (GtkDialog *dialog,
945                     GdkEventAny *event,
946                     gpointer data)
947 {
948   RunInfo *ri = data;
949     
950   shutdown_loop (ri);
951   
952   return TRUE; /* Do not destroy */
953 }
954
955 static void
956 run_destroy_handler (GtkDialog *dialog, gpointer data)
957 {
958   RunInfo *ri = data;
959
960   /* shutdown_loop will be called by run_unmap_handler */
961   
962   ri->destroyed = TRUE;
963 }
964
965 /**
966  * gtk_dialog_run:
967  * @dialog: a #GtkDialog
968  * 
969  * Blocks in a recursive main loop until the @dialog either emits the
970  * #GtkDialog::response signal, or is destroyed. If the dialog is 
971  * destroyed during the call to gtk_dialog_run(), gtk_dialog_run() returns 
972  * #GTK_RESPONSE_NONE. Otherwise, it returns the response ID from the 
973  * ::response signal emission.
974  *
975  * Before entering the recursive main loop, gtk_dialog_run() calls
976  * gtk_widget_show() on the dialog for you. Note that you still
977  * need to show any children of the dialog yourself.
978  *
979  * During gtk_dialog_run(), the default behavior of #GtkWidget::delete-event 
980  * is disabled; if the dialog receives ::delete_event, it will not be
981  * destroyed as windows usually are, and gtk_dialog_run() will return
982  * #GTK_RESPONSE_DELETE_EVENT. Also, during gtk_dialog_run() the dialog 
983  * will be modal. You can force gtk_dialog_run() to return at any time by
984  * calling gtk_dialog_response() to emit the ::response signal. Destroying 
985  * the dialog during gtk_dialog_run() is a very bad idea, because your 
986  * post-run code won't know whether the dialog was destroyed or not.
987  *
988  * After gtk_dialog_run() returns, you are responsible for hiding or
989  * destroying the dialog if you wish to do so.
990  *
991  * Typical usage of this function might be:
992  * <informalexample><programlisting>
993  *   gint result = gtk_dialog_run (GTK_DIALOG (dialog));
994  *   switch (result)
995  *     {
996  *       case GTK_RESPONSE_ACCEPT:
997  *          do_application_specific_something (<!-- -->);
998  *          break;
999  *       default:
1000  *          do_nothing_since_dialog_was_cancelled (<!-- -->);
1001  *          break;
1002  *     }
1003  *   gtk_widget_destroy (dialog);
1004  * </programlisting></informalexample>
1005  * 
1006  * Note that even though the recursive main loop gives the effect of a
1007  * modal dialog (it prevents the user from interacting with other 
1008  * windows in the same window group while the dialog is run), callbacks 
1009  * such as timeouts, IO channel watches, DND drops, etc, <emphasis>will</emphasis> 
1010  * be triggered during a gtk_dialog_run() call.
1011  * 
1012  * Return value: response ID
1013  **/
1014 gint
1015 gtk_dialog_run (GtkDialog *dialog)
1016 {
1017   RunInfo ri = { NULL, GTK_RESPONSE_NONE, NULL, FALSE };
1018   gboolean was_modal;
1019   gulong response_handler;
1020   gulong unmap_handler;
1021   gulong destroy_handler;
1022   gulong delete_handler;
1023   
1024   g_return_val_if_fail (GTK_IS_DIALOG (dialog), -1);
1025
1026   g_object_ref (dialog);
1027
1028   was_modal = GTK_WINDOW (dialog)->modal;
1029   if (!was_modal)
1030     gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
1031
1032   if (!GTK_WIDGET_VISIBLE (dialog))
1033     gtk_widget_show (GTK_WIDGET (dialog));
1034   
1035   response_handler =
1036     g_signal_connect (dialog,
1037                       "response",
1038                       G_CALLBACK (run_response_handler),
1039                       &ri);
1040   
1041   unmap_handler =
1042     g_signal_connect (dialog,
1043                       "unmap",
1044                       G_CALLBACK (run_unmap_handler),
1045                       &ri);
1046   
1047   delete_handler =
1048     g_signal_connect (dialog,
1049                       "delete-event",
1050                       G_CALLBACK (run_delete_handler),
1051                       &ri);
1052   
1053   destroy_handler =
1054     g_signal_connect (dialog,
1055                       "destroy",
1056                       G_CALLBACK (run_destroy_handler),
1057                       &ri);
1058   
1059   ri.loop = g_main_loop_new (NULL, FALSE);
1060
1061   GDK_THREADS_LEAVE ();  
1062   g_main_loop_run (ri.loop);
1063   GDK_THREADS_ENTER ();  
1064
1065   g_main_loop_unref (ri.loop);
1066
1067   ri.loop = NULL;
1068   
1069   if (!ri.destroyed)
1070     {
1071       if (!was_modal)
1072         gtk_window_set_modal (GTK_WINDOW(dialog), FALSE);
1073       
1074       g_signal_handler_disconnect (dialog, response_handler);
1075       g_signal_handler_disconnect (dialog, unmap_handler);
1076       g_signal_handler_disconnect (dialog, delete_handler);
1077       g_signal_handler_disconnect (dialog, destroy_handler);
1078     }
1079
1080   g_object_unref (dialog);
1081
1082   return ri.response_id;
1083 }
1084
1085 void
1086 _gtk_dialog_set_ignore_separator (GtkDialog *dialog,
1087                                   gboolean   ignore_separator)
1088 {
1089   GtkDialogPrivate *priv;
1090
1091   priv = GET_PRIVATE (dialog);
1092   priv->ignore_separator = ignore_separator;
1093 }
1094
1095 /**
1096  * gtk_dialog_get_response_for_widget:
1097  * @dialog: a #GtkDialog
1098  * @widget: a widget in the action area of @dialog
1099  *
1100  * Gets the response id of a widget in the action area
1101  * of a dialog.
1102  *
1103  * Returns: the response id of @widget, or %GTK_RESPONSE_NONE
1104  *  if @widget doesn't have a response id set.
1105  *
1106  * Since: 2.8
1107  */
1108 gint
1109 gtk_dialog_get_response_for_widget (GtkDialog *dialog,
1110                                     GtkWidget *widget)
1111 {
1112   ResponseData *rd;
1113
1114   rd = get_response_data (widget, FALSE);
1115   if (!rd)
1116     return GTK_RESPONSE_NONE;
1117   else
1118     return rd->response_id;
1119 }
1120
1121 /**
1122  * gtk_alternative_dialog_button_order:
1123  * @screen: a #GdkScreen, or %NULL to use the default screen
1124  *
1125  * Returns %TRUE if dialogs are expected to use an alternative
1126  * button order on the screen @screen. See 
1127  * gtk_dialog_set_alternative_button_order() for more details
1128  * about alternative button order. 
1129  *
1130  * If you need to use this function, you should probably connect
1131  * to the ::notify:gtk-alternative-button-order signal on the
1132  * #GtkSettings object associated to @screen, in order to be 
1133  * notified if the button order setting changes.
1134  *
1135  * Returns: Whether the alternative button order should be used
1136  *
1137  * Since: 2.6
1138  */
1139 gboolean 
1140 gtk_alternative_dialog_button_order (GdkScreen *screen)
1141 {
1142   GtkSettings *settings;
1143   gboolean result;
1144
1145   if (screen)
1146     settings = gtk_settings_get_for_screen (screen);
1147   else
1148     settings = gtk_settings_get_default ();
1149   
1150   g_object_get (settings,
1151                 "gtk-alternative-button-order", &result, NULL);
1152
1153   return result;
1154 }
1155
1156 static void
1157 gtk_dialog_set_alternative_button_order_valist (GtkDialog *dialog,
1158                                                 gint       first_response_id,
1159                                                 va_list    args)
1160 {
1161   GtkWidget *child;
1162   gint response_id;
1163   gint position;
1164
1165   response_id = first_response_id;
1166   position = 0;
1167   while (response_id != -1)
1168     {
1169       /* reorder child with response_id to position */
1170       child = dialog_find_button (dialog, response_id);
1171       gtk_box_reorder_child (GTK_BOX (dialog->action_area), child, position);
1172
1173       response_id = va_arg (args, gint);
1174       position++;
1175     }
1176 }
1177
1178 /**
1179  * gtk_dialog_set_alternative_button_order:
1180  * @dialog: a #GtkDialog
1181  * @first_response_id: a response id used by one @dialog's buttons
1182  * @Varargs: a list of more response ids of @dialog's buttons, terminated by -1
1183  *
1184  * Sets an alternative button order. If the 
1185  * #GtkSettings:gtk-alternative-button-order setting is set to %TRUE, 
1186  * the dialog buttons are reordered according to the order of the 
1187  * response ids passed to this function.
1188  *
1189  * By default, GTK+ dialogs use the button order advocated by the Gnome 
1190  * <ulink url="http://developer.gnome.org/projects/gup/hig/2.0/">Human 
1191  * Interface Guidelines</ulink> with the affirmative button at the far 
1192  * right, and the cancel button left of it. But the builtin GTK+ dialogs
1193  * and #GtkMessageDialog<!-- -->s do provide an alternative button order,
1194  * which is more suitable on some platforms, e.g. Windows.
1195  *
1196  * Use this function after adding all the buttons to your dialog, as the 
1197  * following example shows:
1198  * <informalexample><programlisting>
1199  * cancel_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
1200  *                                        GTK_STOCK_CANCEL,
1201  *                                        GTK_RESPONSE_CANCEL);
1202  *  
1203  * ok_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
1204  *                                    GTK_STOCK_OK,
1205  *                                    GTK_RESPONSE_OK);
1206  *   
1207  * gtk_widget_grab_default (ok_button);
1208  *   
1209  * help_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
1210  *                                      GTK_STOCK_HELP,
1211  *                                      GTK_RESPONSE_HELP);
1212  *  
1213  * gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
1214  *                                          GTK_RESPONSE_OK,
1215  *                                          GTK_RESPONSE_CANCEL,
1216  *                                          GTK_RESPONSE_HELP,
1217  *                                          -1);
1218  * </programlisting></informalexample>
1219  * 
1220  * Since: 2.6
1221  */
1222 void 
1223 gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
1224                                          gint       first_response_id,
1225                                          ...)
1226 {
1227   GdkScreen *screen;
1228   va_list args;
1229   
1230   g_return_if_fail (GTK_IS_DIALOG (dialog));
1231
1232   screen = gtk_widget_get_screen (GTK_WIDGET (dialog));
1233   if (!gtk_alternative_dialog_button_order (screen))
1234       return;
1235
1236   va_start (args, first_response_id);
1237
1238   gtk_dialog_set_alternative_button_order_valist (dialog,
1239                                                   first_response_id,
1240                                                   args);
1241   va_end (args);
1242 }
1243 /**
1244  * gtk_dialog_set_alternative_button_order_from_array:
1245  * @dialog: a #GtkDialog
1246  * @n_params: the number of response ids in @new_order
1247  * @new_order: an array of response ids of @dialog's buttons
1248  *
1249  * Sets an alternative button order. If the 
1250  * #GtkSettings:gtk-alternative-button-order setting is set to %TRUE, 
1251  * the dialog buttons are reordered according to the order of the 
1252  * response ids in @new_order.
1253  *
1254  * See gtk_dialog_set_alternative_button_order() for more information.
1255  *
1256  * This function is for use by language bindings.
1257  * 
1258  * Since: 2.6
1259  */
1260 void 
1261 gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
1262                                                     gint       n_params,
1263                                                     gint      *new_order)
1264 {
1265   GdkScreen *screen;
1266   GtkWidget *child;
1267   gint position;
1268
1269   g_return_if_fail (GTK_IS_DIALOG (dialog));
1270   g_return_if_fail (new_order != NULL);
1271
1272   screen = gtk_widget_get_screen (GTK_WIDGET (dialog));
1273   if (!gtk_alternative_dialog_button_order (screen))
1274       return;
1275
1276   for (position = 0; position < n_params; position++)
1277   {
1278       /* reorder child with response_id to position */
1279       child = dialog_find_button (dialog, new_order[position]);
1280       gtk_box_reorder_child (GTK_BOX (dialog->action_area), child, position);
1281     }
1282 }
1283
1284 typedef struct {
1285   gchar *widget_name;
1286   gchar *response_id;
1287 } ActionWidgetInfo;
1288
1289 typedef struct {
1290   GtkDialog *dialog;
1291   GtkBuilder *builder;
1292   GSList *items;
1293   gchar *response;
1294 } ActionWidgetsSubParserData;
1295
1296 static void
1297 attributes_start_element (GMarkupParseContext *context,
1298                           const gchar         *element_name,
1299                           const gchar        **names,
1300                           const gchar        **values,
1301                           gpointer             user_data,
1302                           GError             **error)
1303 {
1304   ActionWidgetsSubParserData *parser_data = (ActionWidgetsSubParserData*)user_data;
1305   guint i;
1306
1307   if (strcmp (element_name, "action-widget") == 0)
1308     for (i = 0; names[i]; i++)
1309       if (strcmp (names[i], "response") == 0)
1310         parser_data->response = g_strdup (values[i]);
1311   else if (strcmp (element_name, "action-widgets") == 0)
1312     return;
1313   else
1314     g_warning ("Unsupported tag for GtkDialog: %s\n", element_name);
1315 }
1316
1317 static void
1318 attributes_text_element (GMarkupParseContext *context,
1319                          const gchar         *text,
1320                          gsize                text_len,
1321                          gpointer             user_data,
1322                          GError             **error)
1323 {
1324   ActionWidgetsSubParserData *parser_data = (ActionWidgetsSubParserData*)user_data;
1325   ActionWidgetInfo *item;
1326
1327   if (!parser_data->response)
1328     return;
1329
1330   item = g_new (ActionWidgetInfo, 1);
1331   item->widget_name = g_strndup (text, text_len);
1332   item->response_id = parser_data->response;
1333   parser_data->items = g_slist_prepend (parser_data->items, item);
1334   parser_data->response = NULL;
1335 }
1336
1337 static const GMarkupParser attributes_parser =
1338   {
1339     attributes_start_element,
1340     NULL,
1341     attributes_text_element,
1342   };
1343
1344 gboolean
1345 gtk_dialog_buildable_custom_tag_start (GtkBuildable  *buildable,
1346                                        GtkBuilder    *builder,
1347                                        GObject       *child,
1348                                        const gchar   *tagname,
1349                                        GMarkupParser *parser,
1350                                        gpointer      *data)
1351 {
1352   ActionWidgetsSubParserData *parser_data;
1353
1354   if (child)
1355     return FALSE;
1356
1357   if (strcmp (tagname, "action-widgets") == 0)
1358     {
1359       parser_data = g_slice_new0 (ActionWidgetsSubParserData);
1360       parser_data->dialog = GTK_DIALOG (buildable);
1361       parser_data->items = NULL;
1362
1363       *parser = attributes_parser;
1364       *data = parser_data;
1365       return TRUE;
1366     }
1367
1368   return FALSE;
1369 }
1370
1371 static void
1372 gtk_dialog_buildable_custom_finished (GtkBuildable *buildable,
1373                                       GtkBuilder   *builder,
1374                                       GObject      *child,
1375                                       const gchar  *tagname,
1376                                       gpointer      user_data)
1377 {
1378   GSList *l;
1379   ActionWidgetsSubParserData *parser_data;
1380   GObject *object;
1381   GtkDialog *dialog;
1382   ResponseData *ad;
1383   guint signal_id;
1384   
1385   if (strcmp (tagname, "action-widgets"))
1386     return;
1387
1388   dialog = GTK_DIALOG (buildable);
1389   parser_data = (ActionWidgetsSubParserData*)user_data;
1390   parser_data->items = g_slist_reverse (parser_data->items);
1391
1392   for (l = parser_data->items; l; l = l->next)
1393     {
1394       ActionWidgetInfo *item = l->data;
1395
1396       object = gtk_builder_get_object (builder, item->widget_name);
1397       if (!object)
1398         {
1399           g_warning ("Unknown object %s specified in action-widgets of %s",
1400                      item->widget_name,
1401                      gtk_buildable_get_name (GTK_BUILDABLE (buildable)));
1402           continue;
1403         }
1404
1405       ad = get_response_data (GTK_WIDGET (object), TRUE);
1406       ad->response_id = atoi (item->response_id);
1407
1408       if (GTK_IS_BUTTON (object))
1409         signal_id = g_signal_lookup ("clicked", GTK_TYPE_BUTTON);
1410       else
1411         signal_id = GTK_WIDGET_GET_CLASS (object)->activate_signal;
1412       
1413       if (signal_id)
1414         {
1415           GClosure *closure;
1416           
1417           closure = g_cclosure_new_object (G_CALLBACK (action_widget_activated),
1418                                            G_OBJECT (dialog));
1419           g_signal_connect_closure_by_id (object,
1420                                           signal_id,
1421                                           0,
1422                                           closure,
1423                                           FALSE);
1424         }
1425
1426       if (ad->response_id == GTK_RESPONSE_HELP)
1427         gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (dialog->action_area),
1428                                             GTK_WIDGET (object), TRUE);
1429
1430       g_free (item->widget_name);
1431       g_free (item->response_id);
1432       g_free (item);
1433     }
1434   g_slist_free (parser_data->items);
1435   g_slice_free (ActionWidgetsSubParserData, parser_data);
1436 }
1437
1438 #define __GTK_DIALOG_C__
1439 #include "gtkaliasdef.c"