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, see <http://www.gnu.org/licenses/>. |
16 | */ |
17 | |
18 | /* |
19 | * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS |
20 | * file for a list of people on the GTK+ Team. See the ChangeLog |
21 | * files for a list of changes. These files are distributed with |
22 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. |
23 | */ |
24 | |
25 | #ifndef __GTK_WINDOW_H__ |
26 | #define __GTK_WINDOW_H__ |
27 | |
28 | |
29 | #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) |
30 | #error "Only <gtk/gtk.h> can be included directly." |
31 | #endif |
32 | |
33 | #include <gtk/gtkapplication.h> |
34 | #include <gtk/gtkaccelgroup.h> |
35 | #include <gtk/gtkwidget.h> |
36 | |
37 | G_BEGIN_DECLS |
38 | |
39 | #define GTK_TYPE_WINDOW (gtk_window_get_type ()) |
40 | #define GTK_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_WINDOW, GtkWindow)) |
41 | #define GTK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WINDOW, GtkWindowClass)) |
42 | #define GTK_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_WINDOW)) |
43 | #define GTK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WINDOW)) |
44 | #define GTK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WINDOW, GtkWindowClass)) |
45 | |
46 | typedef struct _GtkWindowClass GtkWindowClass; |
47 | typedef struct _GtkWindowGroup GtkWindowGroup; |
48 | typedef struct _GtkWindowGroupClass GtkWindowGroupClass; |
49 | typedef struct _GtkWindowGroupPrivate GtkWindowGroupPrivate; |
50 | |
51 | struct _GtkWindow |
52 | { |
53 | GtkWidget parent_instance; |
54 | }; |
55 | |
56 | /** |
57 | * GtkWindowClass: |
58 | * @parent_class: The parent class. |
59 | * @activate_focus: Activates the current focused widget within the window. |
60 | * @activate_default: Activates the default widget for the window. |
61 | * @keys_changed: Signal gets emitted when the set of accelerators or |
62 | * mnemonics that are associated with window changes. |
63 | * @enable_debugging: Class handler for the `GtkWindow::enable-debugging` |
64 | * keybinding signal. |
65 | * @close_request: Class handler for the `GtkWindow::close-request` signal. |
66 | */ |
67 | struct _GtkWindowClass |
68 | { |
69 | GtkWidgetClass parent_class; |
70 | |
71 | /*< public >*/ |
72 | |
73 | /* G_SIGNAL_ACTION signals for keybindings */ |
74 | |
75 | void (* activate_focus) (GtkWindow *window); |
76 | void (* activate_default) (GtkWindow *window); |
77 | void (* keys_changed) (GtkWindow *window); |
78 | gboolean (* enable_debugging) (GtkWindow *window, |
79 | gboolean toggle); |
80 | gboolean (* close_request) (GtkWindow *window); |
81 | |
82 | /*< private >*/ |
83 | gpointer padding[8]; |
84 | }; |
85 | |
86 | GDK_AVAILABLE_IN_ALL |
87 | GType gtk_window_get_type (void) G_GNUC_CONST; |
88 | GDK_AVAILABLE_IN_ALL |
89 | GtkWidget* gtk_window_new (void); |
90 | GDK_AVAILABLE_IN_ALL |
91 | void gtk_window_set_title (GtkWindow *window, |
92 | const char *title); |
93 | GDK_AVAILABLE_IN_ALL |
94 | const char * gtk_window_get_title (GtkWindow *window); |
95 | GDK_AVAILABLE_IN_ALL |
96 | void gtk_window_set_startup_id (GtkWindow *window, |
97 | const char *startup_id); |
98 | GDK_AVAILABLE_IN_ALL |
99 | void gtk_window_set_focus (GtkWindow *window, |
100 | GtkWidget *focus); |
101 | GDK_AVAILABLE_IN_ALL |
102 | GtkWidget *gtk_window_get_focus (GtkWindow *window); |
103 | GDK_AVAILABLE_IN_ALL |
104 | void gtk_window_set_default_widget (GtkWindow *window, |
105 | GtkWidget *default_widget); |
106 | GDK_AVAILABLE_IN_ALL |
107 | GtkWidget *gtk_window_get_default_widget (GtkWindow *window); |
108 | |
109 | GDK_AVAILABLE_IN_ALL |
110 | void gtk_window_set_transient_for (GtkWindow *window, |
111 | GtkWindow *parent); |
112 | GDK_AVAILABLE_IN_ALL |
113 | GtkWindow *gtk_window_get_transient_for (GtkWindow *window); |
114 | GDK_AVAILABLE_IN_ALL |
115 | void gtk_window_set_destroy_with_parent (GtkWindow *window, |
116 | gboolean setting); |
117 | GDK_AVAILABLE_IN_ALL |
118 | gboolean gtk_window_get_destroy_with_parent (GtkWindow *window); |
119 | GDK_AVAILABLE_IN_ALL |
120 | void gtk_window_set_hide_on_close (GtkWindow *window, |
121 | gboolean setting); |
122 | GDK_AVAILABLE_IN_ALL |
123 | gboolean gtk_window_get_hide_on_close (GtkWindow *window); |
124 | GDK_AVAILABLE_IN_ALL |
125 | void gtk_window_set_mnemonics_visible (GtkWindow *window, |
126 | gboolean setting); |
127 | GDK_AVAILABLE_IN_ALL |
128 | gboolean gtk_window_get_mnemonics_visible (GtkWindow *window); |
129 | GDK_AVAILABLE_IN_ALL |
130 | void gtk_window_set_focus_visible (GtkWindow *window, |
131 | gboolean setting); |
132 | GDK_AVAILABLE_IN_ALL |
133 | gboolean gtk_window_get_focus_visible (GtkWindow *window); |
134 | |
135 | GDK_AVAILABLE_IN_ALL |
136 | void gtk_window_set_resizable (GtkWindow *window, |
137 | gboolean resizable); |
138 | GDK_AVAILABLE_IN_ALL |
139 | gboolean gtk_window_get_resizable (GtkWindow *window); |
140 | |
141 | GDK_AVAILABLE_IN_ALL |
142 | void gtk_window_set_display (GtkWindow *window, |
143 | GdkDisplay *display); |
144 | |
145 | GDK_AVAILABLE_IN_ALL |
146 | gboolean gtk_window_is_active (GtkWindow *window); |
147 | |
148 | GDK_AVAILABLE_IN_ALL |
149 | void gtk_window_set_decorated (GtkWindow *window, |
150 | gboolean setting); |
151 | GDK_AVAILABLE_IN_ALL |
152 | gboolean gtk_window_get_decorated (GtkWindow *window); |
153 | GDK_AVAILABLE_IN_ALL |
154 | void gtk_window_set_deletable (GtkWindow *window, |
155 | gboolean setting); |
156 | GDK_AVAILABLE_IN_ALL |
157 | gboolean gtk_window_get_deletable (GtkWindow *window); |
158 | |
159 | GDK_AVAILABLE_IN_ALL |
160 | void gtk_window_set_icon_name (GtkWindow *window, |
161 | const char *name); |
162 | GDK_AVAILABLE_IN_ALL |
163 | const char * gtk_window_get_icon_name (GtkWindow *window); |
164 | GDK_AVAILABLE_IN_ALL |
165 | void gtk_window_set_default_icon_name (const char *name); |
166 | GDK_AVAILABLE_IN_ALL |
167 | const char * gtk_window_get_default_icon_name (void); |
168 | |
169 | GDK_AVAILABLE_IN_ALL |
170 | void gtk_window_set_auto_startup_notification (gboolean setting); |
171 | |
172 | /* If window is set modal, input will be grabbed when show and released when hide */ |
173 | GDK_AVAILABLE_IN_ALL |
174 | void gtk_window_set_modal (GtkWindow *window, |
175 | gboolean modal); |
176 | GDK_AVAILABLE_IN_ALL |
177 | gboolean gtk_window_get_modal (GtkWindow *window); |
178 | GDK_AVAILABLE_IN_ALL |
179 | GListModel *gtk_window_get_toplevels (void); |
180 | GDK_AVAILABLE_IN_ALL |
181 | GList* gtk_window_list_toplevels (void); |
182 | |
183 | GDK_AVAILABLE_IN_ALL |
184 | void gtk_window_present (GtkWindow *window); |
185 | GDK_AVAILABLE_IN_ALL |
186 | void gtk_window_present_with_time (GtkWindow *window, |
187 | guint32 timestamp); |
188 | GDK_AVAILABLE_IN_ALL |
189 | void gtk_window_minimize (GtkWindow *window); |
190 | GDK_AVAILABLE_IN_ALL |
191 | void gtk_window_unminimize (GtkWindow *window); |
192 | GDK_AVAILABLE_IN_ALL |
193 | void gtk_window_maximize (GtkWindow *window); |
194 | GDK_AVAILABLE_IN_ALL |
195 | void gtk_window_unmaximize (GtkWindow *window); |
196 | GDK_AVAILABLE_IN_ALL |
197 | void gtk_window_fullscreen (GtkWindow *window); |
198 | GDK_AVAILABLE_IN_ALL |
199 | void gtk_window_unfullscreen (GtkWindow *window); |
200 | GDK_AVAILABLE_IN_ALL |
201 | void gtk_window_fullscreen_on_monitor (GtkWindow *window, |
202 | GdkMonitor *monitor); |
203 | GDK_AVAILABLE_IN_ALL |
204 | void gtk_window_close (GtkWindow *window); |
205 | |
206 | /* Set initial default size of the window (does not constrain user |
207 | * resize operations) |
208 | */ |
209 | GDK_AVAILABLE_IN_ALL |
210 | void gtk_window_set_default_size (GtkWindow *window, |
211 | int width, |
212 | int height); |
213 | GDK_AVAILABLE_IN_ALL |
214 | void gtk_window_get_default_size (GtkWindow *window, |
215 | int *width, |
216 | int *height); |
217 | |
218 | GDK_AVAILABLE_IN_ALL |
219 | GtkWindowGroup *gtk_window_get_group (GtkWindow *window); |
220 | GDK_AVAILABLE_IN_ALL |
221 | gboolean gtk_window_has_group (GtkWindow *window); |
222 | |
223 | |
224 | GDK_AVAILABLE_IN_ALL |
225 | GtkApplication *gtk_window_get_application (GtkWindow *window); |
226 | GDK_AVAILABLE_IN_ALL |
227 | void gtk_window_set_application (GtkWindow *window, |
228 | GtkApplication *application); |
229 | |
230 | GDK_AVAILABLE_IN_ALL |
231 | void gtk_window_set_child (GtkWindow *window, |
232 | GtkWidget *child); |
233 | GDK_AVAILABLE_IN_ALL |
234 | GtkWidget *gtk_window_get_child (GtkWindow *window); |
235 | |
236 | GDK_AVAILABLE_IN_ALL |
237 | void gtk_window_set_titlebar (GtkWindow *window, |
238 | GtkWidget *titlebar); |
239 | GDK_AVAILABLE_IN_ALL |
240 | GtkWidget *gtk_window_get_titlebar (GtkWindow *window); |
241 | |
242 | GDK_AVAILABLE_IN_ALL |
243 | gboolean gtk_window_is_maximized (GtkWindow *window); |
244 | |
245 | GDK_AVAILABLE_IN_ALL |
246 | gboolean gtk_window_is_fullscreen (GtkWindow *window); |
247 | |
248 | GDK_AVAILABLE_IN_ALL |
249 | void gtk_window_destroy (GtkWindow *window); |
250 | |
251 | GDK_AVAILABLE_IN_ALL |
252 | void gtk_window_set_interactive_debugging (gboolean enable); |
253 | |
254 | GDK_AVAILABLE_IN_4_2 |
255 | void gtk_window_set_handle_menubar_accel (GtkWindow *window, |
256 | gboolean handle_menubar_accel); |
257 | GDK_AVAILABLE_IN_4_2 |
258 | gboolean gtk_window_get_handle_menubar_accel (GtkWindow *window); |
259 | |
260 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkWindow, g_object_unref) |
261 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkWindowGroup, g_object_unref) |
262 | |
263 | G_END_DECLS |
264 | |
265 | #endif /* __GTK_WINDOW_H__ */ |
266 | |