gtkwindow.h 10.2 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GTK - The GIMP Toolkit
Elliot Lee's avatar
Elliot Lee committed
2
3
4
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
Elliot Lee's avatar
Elliot Lee committed
6
7
8
9
10
11
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Lesser General Public License for more details.
Elliot Lee's avatar
Elliot Lee committed
13
 *
14
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
Elliot Lee's avatar
Elliot Lee committed
16
 */
17
18

/*
19
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
20
21
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
22
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23
24
 */

Elliot Lee's avatar
Elliot Lee committed
25
26
27
#ifndef __GTK_WINDOW_H__
#define __GTK_WINDOW_H__

28

29
30
31
32
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

Allison Karlitskaya's avatar
Allison Karlitskaya committed
33
#include <gtk/gtkapplication.h>
Tim Janik's avatar
Tim Janik committed
34
#include <gtk/gtkaccelgroup.h>
35
#include <gtk/gtkwidget.h>
Elliot Lee's avatar
Elliot Lee committed
36

37
G_BEGIN_DECLS
38
39

#define GTK_TYPE_WINDOW			(gtk_window_get_type ())
Manish Singh's avatar
Manish Singh committed
40
41
42
43
44
#define GTK_WINDOW(obj)			(G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_WINDOW, GtkWindow))
#define GTK_WINDOW_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WINDOW, GtkWindowClass))
#define GTK_IS_WINDOW(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_WINDOW))
#define GTK_IS_WINDOW_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WINDOW))
#define GTK_WINDOW_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WINDOW, GtkWindowClass))
Elliot Lee's avatar
Elliot Lee committed
45

46
typedef struct _GtkWindowClass        GtkWindowClass;
47
48
typedef struct _GtkWindowGroup        GtkWindowGroup;
typedef struct _GtkWindowGroupClass   GtkWindowGroupClass;
Matthias Clasen's avatar
Matthias Clasen committed
49
typedef struct _GtkWindowGroupPrivate GtkWindowGroupPrivate;
Elliot Lee's avatar
Elliot Lee committed
50
51
52

struct _GtkWindow
{
53
  GtkWidget parent_instance;
Elliot Lee's avatar
Elliot Lee committed
54
55
};

William Jon McCann's avatar
William Jon McCann committed
56
57
58
59
60
/**
 * GtkWindowClass:
 * @parent_class: The parent class.
 * @activate_focus: Activates the current focused widget within the window.
 * @activate_default: Activates the default widget for the window.
61
62
 * @keys_changed: Signal gets emitted when the set of accelerators or
 *   mnemonics that are associated with window changes.
Matthias Clasen's avatar
Matthias Clasen committed
63
 * @enable_debugging: Class handler for the `GtkWindow::enable-debugging`
Matthias Clasen's avatar
Matthias Clasen committed
64
 *   keybinding signal.
Matthias Clasen's avatar
Matthias Clasen committed
65
 * @close_request: Class handler for the `GtkWindow::close-request` signal.
William Jon McCann's avatar
William Jon McCann committed
66
 */
Elliot Lee's avatar
Elliot Lee committed
67
68
struct _GtkWindowClass
{
69
  GtkWidgetClass parent_class;
Elliot Lee's avatar
Elliot Lee committed
70

William Jon McCann's avatar
William Jon McCann committed
71
72
  /*< public >*/

73
74
  /* G_SIGNAL_ACTION signals for keybindings */

75
76
77
  void     (* activate_focus)   (GtkWindow *window);
  void     (* activate_default) (GtkWindow *window);
  void	   (* keys_changed)     (GtkWindow *window);
78
  gboolean (* enable_debugging) (GtkWindow *window,
79
                                 gboolean   toggle);
80
  gboolean (* close_request)    (GtkWindow *window);
81

William Jon McCann's avatar
William Jon McCann committed
82
  /*< private >*/
Matthias Clasen's avatar
Matthias Clasen committed
83
  gpointer padding[8];
Elliot Lee's avatar
Elliot Lee committed
84
85
};

86
GDK_AVAILABLE_IN_ALL
Manish Singh's avatar
Manish Singh committed
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
Elliot Lee's avatar
Elliot Lee committed
91
void       gtk_window_set_title                (GtkWindow           *window,
Benjamin Otte's avatar
Benjamin Otte committed
92
						const char          *title);
93
GDK_AVAILABLE_IN_ALL
Benjamin Otte's avatar
Benjamin Otte committed
94
const char * gtk_window_get_title             (GtkWindow           *window);
95
GDK_AVAILABLE_IN_ALL
96
void       gtk_window_set_startup_id           (GtkWindow           *window,
Benjamin Otte's avatar
Benjamin Otte committed
97
                                                const char          *startup_id);
98
GDK_AVAILABLE_IN_ALL
99
100
void       gtk_window_set_focus                (GtkWindow           *window,
						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);
Elliot Lee's avatar
Elliot Lee committed
108

109
GDK_AVAILABLE_IN_ALL
Timm Bäder's avatar
Timm Bäder committed
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);
Matthias Clasen's avatar
Matthias Clasen committed
114
GDK_AVAILABLE_IN_ALL
115
116
void       gtk_window_set_destroy_with_parent  (GtkWindow           *window,
                                                gboolean             setting);
117
GDK_AVAILABLE_IN_ALL
118
gboolean   gtk_window_get_destroy_with_parent  (GtkWindow           *window);
Matthias Clasen's avatar
Matthias Clasen committed
119
GDK_AVAILABLE_IN_ALL
120
121
void       gtk_window_set_hide_on_close        (GtkWindow           *window,
                                                gboolean             setting);
Matthias Clasen's avatar
Matthias Clasen committed
122
GDK_AVAILABLE_IN_ALL
123
gboolean   gtk_window_get_hide_on_close        (GtkWindow           *window);
124
GDK_AVAILABLE_IN_ALL
125
126
void       gtk_window_set_mnemonics_visible    (GtkWindow           *window,
                                                gboolean             setting);
127
GDK_AVAILABLE_IN_ALL
128
gboolean   gtk_window_get_mnemonics_visible    (GtkWindow           *window);
Matthias Clasen's avatar
Matthias Clasen committed
129
GDK_AVAILABLE_IN_ALL
130
131
void       gtk_window_set_focus_visible        (GtkWindow           *window,
                                                gboolean             setting);
Matthias Clasen's avatar
Matthias Clasen committed
132
GDK_AVAILABLE_IN_ALL
133
gboolean   gtk_window_get_focus_visible        (GtkWindow           *window);
134

135
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
136
137
void       gtk_window_set_resizable            (GtkWindow           *window,
                                                gboolean             resizable);
138
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
139
gboolean   gtk_window_get_resizable            (GtkWindow           *window);
140

Matthias Clasen's avatar
Matthias Clasen committed
141
GDK_AVAILABLE_IN_ALL
142
143
void	   gtk_window_set_display              (GtkWindow	    *window,
						GdkDisplay          *display);
144

145
GDK_AVAILABLE_IN_ALL
146
147
gboolean   gtk_window_is_active                (GtkWindow           *window);

148
GDK_AVAILABLE_IN_ALL
149
150
void       gtk_window_set_decorated            (GtkWindow *window,
                                                gboolean   setting);
151
GDK_AVAILABLE_IN_ALL
152
gboolean   gtk_window_get_decorated            (GtkWindow *window);
153
GDK_AVAILABLE_IN_ALL
154
155
void       gtk_window_set_deletable            (GtkWindow *window,
                                                gboolean   setting);
156
GDK_AVAILABLE_IN_ALL
157
gboolean   gtk_window_get_deletable            (GtkWindow *window);
Hans Breuer's avatar
updated    
Hans Breuer committed
158

159
GDK_AVAILABLE_IN_ALL
160
void       gtk_window_set_icon_name                (GtkWindow   *window,
Benjamin Otte's avatar
Benjamin Otte committed
161
						    const char *name);
162
GDK_AVAILABLE_IN_ALL
Benjamin Otte's avatar
Benjamin Otte committed
163
const char * gtk_window_get_icon_name             (GtkWindow  *window);
164
GDK_AVAILABLE_IN_ALL
Benjamin Otte's avatar
Benjamin Otte committed
165
void       gtk_window_set_default_icon_name        (const char *name);
166
GDK_AVAILABLE_IN_ALL
Benjamin Otte's avatar
Benjamin Otte committed
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);
Havoc Pennington's avatar
Havoc Pennington committed
171

172
/* If window is set modal, input will be grabbed when show and released when hide */
173
GDK_AVAILABLE_IN_ALL
174
175
void       gtk_window_set_modal      (GtkWindow *window,
				      gboolean   modal);
176
GDK_AVAILABLE_IN_ALL
177
gboolean   gtk_window_get_modal      (GtkWindow *window);
178
GDK_AVAILABLE_IN_ALL
179
180
GListModel *gtk_window_get_toplevels (void);
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
187
void     gtk_window_present_with_time  (GtkWindow *window,
				        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
Havoc Pennington's avatar
Havoc Pennington committed
193
void     gtk_window_maximize      (GtkWindow *window);
194
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
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);
Matthias Clasen's avatar
Matthias Clasen committed
200
GDK_AVAILABLE_IN_ALL
201
202
void     gtk_window_fullscreen_on_monitor (GtkWindow  *window,
                                           GdkMonitor *monitor);
Matthias Clasen's avatar
Matthias Clasen committed
203
GDK_AVAILABLE_IN_ALL
204
void     gtk_window_close         (GtkWindow *window);
Havoc Pennington's avatar
Havoc Pennington committed
205

Havoc Pennington's avatar
Havoc Pennington committed
206
207
/* Set initial default size of the window (does not constrain user
 * resize operations)
208
 */
209
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
210
void     gtk_window_set_default_size (GtkWindow   *window,
Benjamin Otte's avatar
Benjamin Otte committed
211
212
                                      int          width,
                                      int          height);
213
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
214
void     gtk_window_get_default_size (GtkWindow   *window,
Benjamin Otte's avatar
Benjamin Otte committed
215
216
                                      int         *width,
                                      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);
Havoc Pennington's avatar
Havoc Pennington committed
222

223

224
GDK_AVAILABLE_IN_ALL
Allison Karlitskaya's avatar
Allison Karlitskaya committed
225
GtkApplication *gtk_window_get_application      (GtkWindow          *window);
226
GDK_AVAILABLE_IN_ALL
Allison Karlitskaya's avatar
Allison Karlitskaya committed
227
228
229
void            gtk_window_set_application      (GtkWindow          *window,
                                                 GtkApplication     *application);

Matthias Clasen's avatar
Matthias Clasen committed
230
231
232
233
234
235
GDK_AVAILABLE_IN_ALL
void     gtk_window_set_child              (GtkWindow    *window,
                                            GtkWidget    *child);
GDK_AVAILABLE_IN_ALL
GtkWidget *gtk_window_get_child            (GtkWindow    *window);

Matthias Clasen's avatar
Matthias Clasen committed
236
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
237
238
void     gtk_window_set_titlebar           (GtkWindow    *window,
                                            GtkWidget    *titlebar);
Matthias Clasen's avatar
Matthias Clasen committed
239
GDK_AVAILABLE_IN_ALL
240
GtkWidget *gtk_window_get_titlebar         (GtkWindow    *window);
Matthias Clasen's avatar
Matthias Clasen committed
241

Matthias Clasen's avatar
Matthias Clasen committed
242
GDK_AVAILABLE_IN_ALL
243
244
gboolean gtk_window_is_maximized           (GtkWindow    *window);

245
246
247
GDK_AVAILABLE_IN_ALL
gboolean gtk_window_is_fullscreen          (GtkWindow    *window);

248
249
250
GDK_AVAILABLE_IN_ALL
void     gtk_window_destroy                (GtkWindow    *window);

Matthias Clasen's avatar
Matthias Clasen committed
251
GDK_AVAILABLE_IN_ALL
252
253
void     gtk_window_set_interactive_debugging (gboolean enable);

254
255
256
257
258
259
GDK_AVAILABLE_IN_4_2
void     gtk_window_set_handle_menubar_accel (GtkWindow *window,
                                              gboolean   handle_menubar_accel);
GDK_AVAILABLE_IN_4_2
gboolean gtk_window_get_handle_menubar_accel (GtkWindow *window);

260
261
262
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkWindow, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkWindowGroup, g_object_unref)

263
G_END_DECLS
Elliot Lee's avatar
Elliot Lee committed
264
265

#endif /* __GTK_WINDOW_H__ */