Ardour  9.0-pre0-384-ga76afae0e9
gtkdialog.h
Go to the documentation of this file.
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 #ifndef __GTK_DIALOG_H__
28 #define __GTK_DIALOG_H__
29 
30 
31 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
32 #error "Only <gtk/gtk.h> can be included directly."
33 #endif
34 
35 #include <gtk/gtkwindow.h>
36 
37 
38 G_BEGIN_DECLS
39 
40 /* Parameters for dialog construction */
41 typedef enum
42 {
43  GTK_DIALOG_MODAL = 1 << 0, /* call gtk_window_set_modal (win, TRUE) */
44  GTK_DIALOG_DESTROY_WITH_PARENT = 1 << 1, /* call gtk_window_set_destroy_with_parent () */
45  GTK_DIALOG_NO_SEPARATOR = 1 << 2 /* no separator bar above buttons */
47 
48 /* Convenience enum to use for response_id's. Positive values are
49  * totally user-interpreted. GTK will sometimes return
50  * GTK_RESPONSE_NONE if no response_id is available.
51  *
52  * Typical usage is:
53  * if (gtk_dialog_run(dialog) == GTK_RESPONSE_ACCEPT)
54  * blah();
55  */
56 typedef enum
57 {
58  /* GTK returns this if a response widget has no response_id,
59  * or if the dialog gets programmatically hidden or destroyed.
60  */
62 
63  /* GTK won't return these unless you pass them in
64  * as the response for an action widget. They are
65  * for your convenience.
66  */
69 
70  /* If the dialog is deleted. */
72 
73  /* These are returned from GTK dialogs, and you can also use them
74  * yourself if you like.
75  */
82  GTK_RESPONSE_HELP = -11
84 
85 
86 #define GTK_TYPE_DIALOG (gtk_dialog_get_type ())
87 #define GTK_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_DIALOG, GtkDialog))
88 #define GTK_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_DIALOG, GtkDialogClass))
89 #define GTK_IS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DIALOG))
90 #define GTK_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DIALOG))
91 #define GTK_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_DIALOG, GtkDialogClass))
92 
93 
94 typedef struct _GtkDialog GtkDialog;
95 typedef struct _GtkDialogClass GtkDialogClass;
96 
97 struct _GtkDialog
98 {
100 
101  /*< public >*/
102  GtkWidget *GSEAL (vbox);
103  GtkWidget *GSEAL (action_area);
104 
105  /*< private >*/
106  GtkWidget *GSEAL (separator);
107 };
108 
110 {
112 
113  void (* response) (GtkDialog *dialog, gint response_id);
114 
115  /* Keybinding signals */
116 
117  void (* close) (GtkDialog *dialog);
118 
119  /* Padding for future expansion */
120  void (*_gtk_reserved1) (void);
121  void (*_gtk_reserved2) (void);
122  void (*_gtk_reserved3) (void);
123  void (*_gtk_reserved4) (void);
124 };
125 
126 
127 GType gtk_dialog_get_type (void) G_GNUC_CONST;
129 
131  GtkWindow *parent,
132  GtkDialogFlags flags,
133  const gchar *first_button_text,
134  ...);
135 
137  GtkWidget *child,
138  gint response_id);
140  const gchar *button_text,
141  gint response_id);
143  const gchar *first_button_text,
144  ...) G_GNUC_NULL_TERMINATED;
145 
147  gint response_id,
148  gboolean setting);
150  gint response_id);
152  gint response_id);
154  GtkWidget *widget);
155 
156 #if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
158  gboolean setting);
160 #endif
161 
164  gint first_response_id,
165  ...);
167  gint n_params,
168  gint *new_order);
169 
170 /* Emit response signal */
172  gint response_id);
173 
174 /* Returns response_id */
175 gint gtk_dialog_run (GtkDialog *dialog);
176 
179 
180 /* For private use only */
182  gboolean ignore_separator);
183 
184 G_END_DECLS
185 
186 #endif /* __GTK_DIALOG_H__ */
GtkResponseType
Definition: gtkdialog.h:57
@ GTK_RESPONSE_CANCEL
Definition: gtkdialog.h:77
@ GTK_RESPONSE_NO
Definition: gtkdialog.h:80
@ GTK_RESPONSE_OK
Definition: gtkdialog.h:76
@ GTK_RESPONSE_CLOSE
Definition: gtkdialog.h:78
@ GTK_RESPONSE_NONE
Definition: gtkdialog.h:61
@ GTK_RESPONSE_DELETE_EVENT
Definition: gtkdialog.h:71
@ GTK_RESPONSE_ACCEPT
Definition: gtkdialog.h:68
@ GTK_RESPONSE_YES
Definition: gtkdialog.h:79
@ GTK_RESPONSE_REJECT
Definition: gtkdialog.h:67
@ GTK_RESPONSE_APPLY
Definition: gtkdialog.h:81
@ GTK_RESPONSE_HELP
Definition: gtkdialog.h:82
GtkWidget * gtk_dialog_get_action_area(GtkDialog *dialog)
GtkWidget * gtk_dialog_get_content_area(GtkDialog *dialog)
GtkDialogFlags
Definition: gtkdialog.h:42
@ GTK_DIALOG_DESTROY_WITH_PARENT
Definition: gtkdialog.h:44
@ GTK_DIALOG_MODAL
Definition: gtkdialog.h:43
@ GTK_DIALOG_NO_SEPARATOR
Definition: gtkdialog.h:45
gboolean gtk_alternative_dialog_button_order(GdkScreen *screen)
void gtk_dialog_set_response_sensitive(GtkDialog *dialog, gint response_id, gboolean setting)
void _gtk_dialog_set_ignore_separator(GtkDialog *dialog, gboolean ignore_separator)
GtkWidget * gtk_dialog_add_button(GtkDialog *dialog, const gchar *button_text, gint response_id)
void gtk_dialog_response(GtkDialog *dialog, gint response_id)
GtkWidget * gtk_dialog_new(void)
gint gtk_dialog_run(GtkDialog *dialog)
void gtk_dialog_set_alternative_button_order(GtkDialog *dialog, gint first_response_id,...)
gboolean gtk_dialog_get_has_separator(GtkDialog *dialog)
GType gtk_dialog_get_type(void) G_GNUC_CONST
void gtk_dialog_add_buttons(GtkDialog *dialog, const gchar *first_button_text,...) G_GNUC_NULL_TERMINATED
void gtk_dialog_set_has_separator(GtkDialog *dialog, gboolean setting)
void gtk_dialog_set_default_response(GtkDialog *dialog, gint response_id)
gint gtk_dialog_get_response_for_widget(GtkDialog *dialog, GtkWidget *widget)
GtkWidget * gtk_dialog_get_widget_for_response(GtkDialog *dialog, gint response_id)
void gtk_dialog_add_action_widget(GtkDialog *dialog, GtkWidget *child, gint response_id)
void gtk_dialog_set_alternative_button_order_from_array(GtkDialog *dialog, gint n_params, gint *new_order)
GtkWidget * gtk_dialog_new_with_buttons(const gchar *title, GtkWindow *parent, GtkDialogFlags flags, const gchar *first_button_text,...)
void(* _gtk_reserved4)(void)
Definition: gtkdialog.h:123
GtkWindowClass parent_class
Definition: gtkdialog.h:111
void(* _gtk_reserved2)(void)
Definition: gtkdialog.h:121
void(* response)(GtkDialog *dialog, gint response_id)
Definition: gtkdialog.h:113
void(* _gtk_reserved1)(void)
Definition: gtkdialog.h:120
void(* close)(GtkDialog *dialog)
Definition: gtkdialog.h:117
void(* _gtk_reserved3)(void)
Definition: gtkdialog.h:122
GtkWidget * GSEAL(separator)
GtkWindow window
Definition: gtkdialog.h:99
GtkWidget * GSEAL(action_area)
GtkWidget * GSEAL(vbox)