gtkwindow.h 17 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

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

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 _GtkWindowPrivate      GtkWindowPrivate;
47 48
typedef struct _GtkWindowClass        GtkWindowClass;
typedef struct _GtkWindowGeometryInfo GtkWindowGeometryInfo;
49 50
typedef struct _GtkWindowGroup        GtkWindowGroup;
typedef struct _GtkWindowGroupClass   GtkWindowGroupClass;
51
typedef struct _GtkWindowGroupPrivate GtkWindowGroupPrivate;
Elliot Lee's avatar
Elliot Lee committed
52 53 54 55 56

struct _GtkWindow
{
  GtkBin bin;

57
  GtkWindowPrivate *priv;
Elliot Lee's avatar
Elliot Lee committed
58 59 60 61 62 63
};

struct _GtkWindowClass
{
  GtkBinClass parent_class;

64
  void     (* set_focus)   (GtkWindow *window,
65
                            GtkWidget *focus);
66 67 68

  /* G_SIGNAL_ACTION signals for keybindings */

69 70 71
  void     (* activate_focus)   (GtkWindow *window);
  void     (* activate_default) (GtkWindow *window);
  void	   (* keys_changed)     (GtkWindow *window);
72

73 74 75 76 77
  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
Elliot Lee's avatar
Elliot Lee committed
78 79
};

80 81 82 83 84
#define GTK_TYPE_WINDOW_GROUP             (gtk_window_group_get_type ())
#define GTK_WINDOW_GROUP(object)          (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_WINDOW_GROUP, GtkWindowGroup))
#define GTK_WINDOW_GROUP_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WINDOW_GROUP, GtkWindowGroupClass))
#define GTK_IS_WINDOW_GROUP(object)       (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_WINDOW_GROUP))
#define GTK_IS_WINDOW_GROUP_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WINDOW_GROUP))
85
#define GTK_WINDOW_GROUP_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WINDOW_GROUP, GtkWindowGroupClass))
86 87 88 89 90

struct _GtkWindowGroup
{
  GObject parent_instance;

91
  GtkWindowGroupPrivate *priv;
92 93 94 95 96
};

struct _GtkWindowGroupClass
{
  GObjectClass parent_class;
97 98 99 100 101 102

  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
103
};
Elliot Lee's avatar
Elliot Lee committed
104

Manish Singh's avatar
Manish Singh committed
105
GType      gtk_window_get_type                 (void) G_GNUC_CONST;
Elliot Lee's avatar
Elliot Lee committed
106 107 108
GtkWidget* gtk_window_new                      (GtkWindowType        type);
void       gtk_window_set_title                (GtkWindow           *window,
						const gchar         *title);
109
const gchar * gtk_window_get_title             (GtkWindow           *window);
Elliot Lee's avatar
Elliot Lee committed
110
void       gtk_window_set_wmclass              (GtkWindow           *window,
111 112
						const gchar         *wmclass_name,
						const gchar         *wmclass_class);
113 114
void       gtk_window_set_role                 (GtkWindow           *window,
                                                const gchar         *role);
115 116
void       gtk_window_set_startup_id           (GtkWindow           *window,
                                                const gchar         *startup_id);
117
const gchar * gtk_window_get_role              (GtkWindow           *window);
Tim Janik's avatar
Tim Janik committed
118 119 120 121
void       gtk_window_add_accel_group          (GtkWindow           *window,
						GtkAccelGroup	    *accel_group);
void       gtk_window_remove_accel_group       (GtkWindow           *window,
						GtkAccelGroup	    *accel_group);
122
void       gtk_window_set_position             (GtkWindow           *window,
Elliot Lee's avatar
Elliot Lee committed
123
						GtkWindowPosition    position);
124
gboolean   gtk_window_activate_focus	       (GtkWindow           *window);
125 126
void       gtk_window_set_focus                (GtkWindow           *window,
						GtkWidget           *focus);
127
GtkWidget *gtk_window_get_focus                (GtkWindow           *window);
128 129
void       gtk_window_set_default              (GtkWindow           *window,
						GtkWidget           *default_widget);
130
GtkWidget *gtk_window_get_default_widget       (GtkWindow           *window);
131
gboolean   gtk_window_activate_default	       (GtkWindow           *window);
Elliot Lee's avatar
Elliot Lee committed
132

133 134
void       gtk_window_set_transient_for        (GtkWindow           *window, 
						GtkWindow           *parent);
135
GtkWindow *gtk_window_get_transient_for        (GtkWindow           *window);
136
GDK_AVAILABLE_IN_3_4
137 138
void       gtk_window_set_attached_to          (GtkWindow           *window, 
                                                GtkWidget           *attach_widget);
139
GDK_AVAILABLE_IN_3_4
140
GtkWidget *gtk_window_get_attached_to          (GtkWindow           *window);
141
GDK_DEPRECATED_IN_3_8_FOR(gtk_widget_set_opacity)
142 143
void       gtk_window_set_opacity              (GtkWindow           *window, 
						gdouble              opacity);
144
GDK_DEPRECATED_IN_3_8_FOR(gtk_widget_get_opacity)
145
gdouble    gtk_window_get_opacity              (GtkWindow           *window);
146 147
void       gtk_window_set_type_hint            (GtkWindow           *window, 
						GdkWindowTypeHint    hint);
148
GdkWindowTypeHint gtk_window_get_type_hint     (GtkWindow           *window);
149 150 151 152 153 154
void       gtk_window_set_skip_taskbar_hint    (GtkWindow           *window,
                                                gboolean             setting);
gboolean   gtk_window_get_skip_taskbar_hint    (GtkWindow           *window);
void       gtk_window_set_skip_pager_hint      (GtkWindow           *window,
                                                gboolean             setting);
gboolean   gtk_window_get_skip_pager_hint      (GtkWindow           *window);
155 156 157
void       gtk_window_set_urgency_hint         (GtkWindow           *window,
                                                gboolean             setting);
gboolean   gtk_window_get_urgency_hint         (GtkWindow           *window);
158 159 160
void       gtk_window_set_accept_focus         (GtkWindow           *window,
                                                gboolean             setting);
gboolean   gtk_window_get_accept_focus         (GtkWindow           *window);
161 162 163
void       gtk_window_set_focus_on_map         (GtkWindow           *window,
                                                gboolean             setting);
gboolean   gtk_window_get_focus_on_map         (GtkWindow           *window);
164 165
void       gtk_window_set_destroy_with_parent  (GtkWindow           *window,
                                                gboolean             setting);
166
gboolean   gtk_window_get_destroy_with_parent  (GtkWindow           *window);
167
GDK_AVAILABLE_IN_3_4
168 169
void       gtk_window_set_hide_titlebar_when_maximized (GtkWindow   *window,
                                                        gboolean     setting);
170
GDK_AVAILABLE_IN_3_4
171
gboolean   gtk_window_get_hide_titlebar_when_maximized (GtkWindow   *window);
172 173 174
void       gtk_window_set_mnemonics_visible    (GtkWindow           *window,
                                                gboolean             setting);
gboolean   gtk_window_get_mnemonics_visible    (GtkWindow           *window);
175
GDK_AVAILABLE_IN_3_2
176 177
void       gtk_window_set_focus_visible        (GtkWindow           *window,
                                                gboolean             setting);
178
GDK_AVAILABLE_IN_3_2
179
gboolean   gtk_window_get_focus_visible        (GtkWindow           *window);
180

181 182 183
void       gtk_window_set_resizable            (GtkWindow           *window,
                                                gboolean             resizable);
gboolean   gtk_window_get_resizable            (GtkWindow           *window);
184 185 186 187 188 189 190 191 192 193 194

void       gtk_window_set_gravity              (GtkWindow           *window,
                                                GdkGravity           gravity);
GdkGravity gtk_window_get_gravity              (GtkWindow           *window);


void       gtk_window_set_geometry_hints       (GtkWindow           *window,
						GtkWidget           *geometry_widget,
						GdkGeometry         *geometry,
						GdkWindowHints       geom_mask);

195 196 197 198
void	   gtk_window_set_screen	       (GtkWindow	    *window,
						GdkScreen	    *screen);
GdkScreen* gtk_window_get_screen	       (GtkWindow	    *window);

199 200 201
gboolean   gtk_window_is_active                (GtkWindow           *window);
gboolean   gtk_window_has_toplevel_focus       (GtkWindow           *window);

202 203 204
void       gtk_window_set_decorated            (GtkWindow *window,
                                                gboolean   setting);
gboolean   gtk_window_get_decorated            (GtkWindow *window);
205 206 207
void       gtk_window_set_deletable            (GtkWindow *window,
                                                gboolean   setting);
gboolean   gtk_window_get_deletable            (GtkWindow *window);
Hans Breuer's avatar
Hans Breuer committed
208

Havoc Pennington's avatar
Havoc Pennington committed
209 210 211 212 213
void       gtk_window_set_icon_list                (GtkWindow  *window,
                                                    GList      *list);
GList*     gtk_window_get_icon_list                (GtkWindow  *window);
void       gtk_window_set_icon                     (GtkWindow  *window,
                                                    GdkPixbuf  *icon);
214 215
void       gtk_window_set_icon_name                (GtkWindow   *window,
						    const gchar *name);
216 217 218
gboolean   gtk_window_set_icon_from_file           (GtkWindow   *window,
						    const gchar *filename,
						    GError     **err);
Havoc Pennington's avatar
Havoc Pennington committed
219
GdkPixbuf* gtk_window_get_icon                     (GtkWindow  *window);
220
const gchar * gtk_window_get_icon_name             (GtkWindow  *window);
Havoc Pennington's avatar
Havoc Pennington committed
221 222
void       gtk_window_set_default_icon_list        (GList      *list);
GList*     gtk_window_get_default_icon_list        (void);
223
void       gtk_window_set_default_icon             (GdkPixbuf  *icon);
224
void       gtk_window_set_default_icon_name        (const gchar *name);
225
const gchar * gtk_window_get_default_icon_name     (void);
226 227 228
gboolean   gtk_window_set_default_icon_from_file   (const gchar *filename,
						    GError     **err);

229
void       gtk_window_set_auto_startup_notification (gboolean setting);
Havoc Pennington's avatar
Havoc Pennington committed
230

231
/* If window is set modal, input will be grabbed when show and released when hide */
232 233
void       gtk_window_set_modal      (GtkWindow *window,
				      gboolean   modal);
234
gboolean   gtk_window_get_modal      (GtkWindow *window);
235
GList*     gtk_window_list_toplevels (void);
236 237
void       gtk_window_set_has_user_ref_count (GtkWindow *window,
                                              gboolean   setting);
238

239 240 241 242 243 244
void     gtk_window_add_mnemonic          (GtkWindow       *window,
					   guint            keyval,
					   GtkWidget       *target);
void     gtk_window_remove_mnemonic       (GtkWindow       *window,
					   guint            keyval,
					   GtkWidget       *target);
245
gboolean gtk_window_mnemonic_activate     (GtkWindow       *window,
246 247 248 249
					   guint            keyval,
					   GdkModifierType  modifier);
void     gtk_window_set_mnemonic_modifier (GtkWindow       *window,
					   GdkModifierType  modifier);
250
GdkModifierType gtk_window_get_mnemonic_modifier (GtkWindow *window);
251

252 253
gboolean gtk_window_activate_key          (GtkWindow        *window,
					   GdkEventKey      *event);
254 255
gboolean gtk_window_propagate_key_event   (GtkWindow        *window,
					   GdkEventKey      *event);
256

257 258 259
void     gtk_window_present            (GtkWindow *window);
void     gtk_window_present_with_time  (GtkWindow *window,
				        guint32    timestamp);
260 261 262 263 264 265
void     gtk_window_iconify       (GtkWindow *window);
void     gtk_window_deiconify     (GtkWindow *window);
void     gtk_window_stick         (GtkWindow *window);
void     gtk_window_unstick       (GtkWindow *window);
void     gtk_window_maximize      (GtkWindow *window);
void     gtk_window_unmaximize    (GtkWindow *window);
266 267
void     gtk_window_fullscreen    (GtkWindow *window);
void     gtk_window_unfullscreen  (GtkWindow *window);
268 269
void     gtk_window_set_keep_above    (GtkWindow *window, gboolean setting);
void     gtk_window_set_keep_below    (GtkWindow *window, gboolean setting);
270

Owen Taylor's avatar
Owen Taylor committed
271 272 273 274 275 276 277 278 279 280 281 282
void gtk_window_begin_resize_drag (GtkWindow     *window,
                                   GdkWindowEdge  edge,
                                   gint           button,
                                   gint           root_x,
                                   gint           root_y,
                                   guint32        timestamp);
void gtk_window_begin_move_drag   (GtkWindow     *window,
                                   gint           button,
                                   gint           root_x,
                                   gint           root_y,
                                   guint32        timestamp);

Havoc Pennington's avatar
Havoc Pennington committed
283 284
/* Set initial default size of the window (does not constrain user
 * resize operations)
285
 */
Havoc Pennington's avatar
Havoc Pennington committed
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
void     gtk_window_set_default_size (GtkWindow   *window,
                                      gint         width,
                                      gint         height);
void     gtk_window_get_default_size (GtkWindow   *window,
                                      gint        *width,
                                      gint        *height);
void     gtk_window_resize           (GtkWindow   *window,
                                      gint         width,
                                      gint         height);
void     gtk_window_get_size         (GtkWindow   *window,
                                      gint        *width,
                                      gint        *height);
void     gtk_window_move             (GtkWindow   *window,
                                      gint         x,
                                      gint         y);
void     gtk_window_get_position     (GtkWindow   *window,
302 303
                                      gint        *root_x,
                                      gint        *root_y);
Havoc Pennington's avatar
Havoc Pennington committed
304 305
gboolean gtk_window_parse_geometry   (GtkWindow   *window,
                                      const gchar *geometry);
306 307 308 309 310 311 312 313

void gtk_window_set_default_geometry (GtkWindow *window,
                                      gint       width,
                                      gint       height);
void gtk_window_resize_to_geometry   (GtkWindow *window,
                                      gint       width,
                                      gint       height);

314
GtkWindowGroup *gtk_window_get_group (GtkWindow   *window);
315
gboolean gtk_window_has_group        (GtkWindow   *window);
Havoc Pennington's avatar
Havoc Pennington committed
316 317

/* Ignore this unless you are writing a GUI builder */
318
GDK_DEPRECATED_IN_3_10
Havoc Pennington's avatar
Havoc Pennington committed
319
void     gtk_window_reshow_with_initial_size (GtkWindow *window);
320

321 322
GtkWindowType gtk_window_get_window_type     (GtkWindow     *window);

323 324
/* Window groups
 */
325
GType            gtk_window_group_get_type      (void) G_GNUC_CONST;
326 327 328 329 330 331

GtkWindowGroup * gtk_window_group_new           (void);
void             gtk_window_group_add_window    (GtkWindowGroup     *window_group,
						 GtkWindow          *window);
void             gtk_window_group_remove_window (GtkWindowGroup     *window_group,
					         GtkWindow          *window);
332
GList *          gtk_window_group_list_windows  (GtkWindowGroup     *window_group);
333

334
GtkWidget *      gtk_window_group_get_current_grab (GtkWindowGroup *window_group);
335 336 337
GtkWidget *      gtk_window_group_get_current_device_grab (GtkWindowGroup *window_group,
                                                           GdkDevice      *device);

338 339 340 341
GtkApplication *gtk_window_get_application      (GtkWindow          *window);
void            gtk_window_set_application      (GtkWindow          *window,
                                                 GtkApplication     *application);

342

343 344 345 346 347 348 349 350 351
/* Window grips
 */
void     gtk_window_set_has_resize_grip    (GtkWindow    *window,
                                            gboolean      value);
gboolean gtk_window_get_has_resize_grip    (GtkWindow    *window);
gboolean gtk_window_resize_grip_is_visible (GtkWindow    *window);
gboolean gtk_window_get_resize_grip_area   (GtkWindow    *window,
                                            GdkRectangle *rect);

352
GDK_AVAILABLE_IN_3_10
353 354 355
void     gtk_window_set_titlebar           (GtkWindow    *window,
                                            GtkWidget    *titlebar);

356
G_END_DECLS
Elliot Lee's avatar
Elliot Lee committed
357 358

#endif /* __GTK_WINDOW_H__ */