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
37G_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
46typedef struct _GtkWindowClass GtkWindowClass;
47typedef struct _GtkWindowGroup GtkWindowGroup;
48typedef struct _GtkWindowGroupClass GtkWindowGroupClass;
49typedef struct _GtkWindowGroupPrivate GtkWindowGroupPrivate;
50
51struct _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 */
67struct _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
86GDK_AVAILABLE_IN_ALL
87GType gtk_window_get_type (void) G_GNUC_CONST;
88GDK_AVAILABLE_IN_ALL
89GtkWidget* gtk_window_new (void);
90GDK_AVAILABLE_IN_ALL
91void gtk_window_set_title (GtkWindow *window,
92 const char *title);
93GDK_AVAILABLE_IN_ALL
94const char * gtk_window_get_title (GtkWindow *window);
95GDK_AVAILABLE_IN_ALL
96void gtk_window_set_startup_id (GtkWindow *window,
97 const char *startup_id);
98GDK_AVAILABLE_IN_ALL
99void gtk_window_set_focus (GtkWindow *window,
100 GtkWidget *focus);
101GDK_AVAILABLE_IN_ALL
102GtkWidget *gtk_window_get_focus (GtkWindow *window);
103GDK_AVAILABLE_IN_ALL
104void gtk_window_set_default_widget (GtkWindow *window,
105 GtkWidget *default_widget);
106GDK_AVAILABLE_IN_ALL
107GtkWidget *gtk_window_get_default_widget (GtkWindow *window);
108
109GDK_AVAILABLE_IN_ALL
110void gtk_window_set_transient_for (GtkWindow *window,
111 GtkWindow *parent);
112GDK_AVAILABLE_IN_ALL
113GtkWindow *gtk_window_get_transient_for (GtkWindow *window);
114GDK_AVAILABLE_IN_ALL
115void gtk_window_set_destroy_with_parent (GtkWindow *window,
116 gboolean setting);
117GDK_AVAILABLE_IN_ALL
118gboolean gtk_window_get_destroy_with_parent (GtkWindow *window);
119GDK_AVAILABLE_IN_ALL
120void gtk_window_set_hide_on_close (GtkWindow *window,
121 gboolean setting);
122GDK_AVAILABLE_IN_ALL
123gboolean gtk_window_get_hide_on_close (GtkWindow *window);
124GDK_AVAILABLE_IN_ALL
125void gtk_window_set_mnemonics_visible (GtkWindow *window,
126 gboolean setting);
127GDK_AVAILABLE_IN_ALL
128gboolean gtk_window_get_mnemonics_visible (GtkWindow *window);
129GDK_AVAILABLE_IN_ALL
130void gtk_window_set_focus_visible (GtkWindow *window,
131 gboolean setting);
132GDK_AVAILABLE_IN_ALL
133gboolean gtk_window_get_focus_visible (GtkWindow *window);
134
135GDK_AVAILABLE_IN_ALL
136void gtk_window_set_resizable (GtkWindow *window,
137 gboolean resizable);
138GDK_AVAILABLE_IN_ALL
139gboolean gtk_window_get_resizable (GtkWindow *window);
140
141GDK_AVAILABLE_IN_ALL
142void gtk_window_set_display (GtkWindow *window,
143 GdkDisplay *display);
144
145GDK_AVAILABLE_IN_ALL
146gboolean gtk_window_is_active (GtkWindow *window);
147
148GDK_AVAILABLE_IN_ALL
149void gtk_window_set_decorated (GtkWindow *window,
150 gboolean setting);
151GDK_AVAILABLE_IN_ALL
152gboolean gtk_window_get_decorated (GtkWindow *window);
153GDK_AVAILABLE_IN_ALL
154void gtk_window_set_deletable (GtkWindow *window,
155 gboolean setting);
156GDK_AVAILABLE_IN_ALL
157gboolean gtk_window_get_deletable (GtkWindow *window);
158
159GDK_AVAILABLE_IN_ALL
160void gtk_window_set_icon_name (GtkWindow *window,
161 const char *name);
162GDK_AVAILABLE_IN_ALL
163const char * gtk_window_get_icon_name (GtkWindow *window);
164GDK_AVAILABLE_IN_ALL
165void gtk_window_set_default_icon_name (const char *name);
166GDK_AVAILABLE_IN_ALL
167const char * gtk_window_get_default_icon_name (void);
168
169GDK_AVAILABLE_IN_ALL
170void 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 */
173GDK_AVAILABLE_IN_ALL
174void gtk_window_set_modal (GtkWindow *window,
175 gboolean modal);
176GDK_AVAILABLE_IN_ALL
177gboolean gtk_window_get_modal (GtkWindow *window);
178GDK_AVAILABLE_IN_ALL
179GListModel *gtk_window_get_toplevels (void);
180GDK_AVAILABLE_IN_ALL
181GList* gtk_window_list_toplevels (void);
182
183GDK_AVAILABLE_IN_ALL
184void gtk_window_present (GtkWindow *window);
185GDK_AVAILABLE_IN_ALL
186void gtk_window_present_with_time (GtkWindow *window,
187 guint32 timestamp);
188GDK_AVAILABLE_IN_ALL
189void gtk_window_minimize (GtkWindow *window);
190GDK_AVAILABLE_IN_ALL
191void gtk_window_unminimize (GtkWindow *window);
192GDK_AVAILABLE_IN_ALL
193void gtk_window_maximize (GtkWindow *window);
194GDK_AVAILABLE_IN_ALL
195void gtk_window_unmaximize (GtkWindow *window);
196GDK_AVAILABLE_IN_ALL
197void gtk_window_fullscreen (GtkWindow *window);
198GDK_AVAILABLE_IN_ALL
199void gtk_window_unfullscreen (GtkWindow *window);
200GDK_AVAILABLE_IN_ALL
201void gtk_window_fullscreen_on_monitor (GtkWindow *window,
202 GdkMonitor *monitor);
203GDK_AVAILABLE_IN_ALL
204void gtk_window_close (GtkWindow *window);
205
206/* Set initial default size of the window (does not constrain user
207 * resize operations)
208 */
209GDK_AVAILABLE_IN_ALL
210void gtk_window_set_default_size (GtkWindow *window,
211 int width,
212 int height);
213GDK_AVAILABLE_IN_ALL
214void gtk_window_get_default_size (GtkWindow *window,
215 int *width,
216 int *height);
217
218GDK_AVAILABLE_IN_ALL
219GtkWindowGroup *gtk_window_get_group (GtkWindow *window);
220GDK_AVAILABLE_IN_ALL
221gboolean gtk_window_has_group (GtkWindow *window);
222
223
224GDK_AVAILABLE_IN_ALL
225GtkApplication *gtk_window_get_application (GtkWindow *window);
226GDK_AVAILABLE_IN_ALL
227void gtk_window_set_application (GtkWindow *window,
228 GtkApplication *application);
229
230GDK_AVAILABLE_IN_ALL
231void gtk_window_set_child (GtkWindow *window,
232 GtkWidget *child);
233GDK_AVAILABLE_IN_ALL
234GtkWidget *gtk_window_get_child (GtkWindow *window);
235
236GDK_AVAILABLE_IN_ALL
237void gtk_window_set_titlebar (GtkWindow *window,
238 GtkWidget *titlebar);
239GDK_AVAILABLE_IN_ALL
240GtkWidget *gtk_window_get_titlebar (GtkWindow *window);
241
242GDK_AVAILABLE_IN_ALL
243gboolean gtk_window_is_maximized (GtkWindow *window);
244
245GDK_AVAILABLE_IN_ALL
246gboolean gtk_window_is_fullscreen (GtkWindow *window);
247
248GDK_AVAILABLE_IN_ALL
249void gtk_window_destroy (GtkWindow *window);
250
251GDK_AVAILABLE_IN_ALL
252void gtk_window_set_interactive_debugging (gboolean enable);
253
254GDK_AVAILABLE_IN_4_2
255void gtk_window_set_handle_menubar_accel (GtkWindow *window,
256 gboolean handle_menubar_accel);
257GDK_AVAILABLE_IN_4_2
258gboolean gtk_window_get_handle_menubar_accel (GtkWindow *window);
259
260G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkWindow, g_object_unref)
261G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkWindowGroup, g_object_unref)
262
263G_END_DECLS
264
265#endif /* __GTK_WINDOW_H__ */
266

source code of gtk/gtk/gtkwindow.h