gtkwindow.h 16.8 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
 */

25
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
26 27 28
#error "Only <gtk/gtk.h> can be included directly."
#endif

Elliot Lee's avatar
Elliot Lee committed
29 30 31
#ifndef __GTK_WINDOW_H__
#define __GTK_WINDOW_H__

32

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 142 143
void       gtk_window_set_opacity              (GtkWindow           *window, 
						gdouble              opacity);
gdouble    gtk_window_get_opacity              (GtkWindow           *window);
144 145
void       gtk_window_set_type_hint            (GtkWindow           *window, 
						GdkWindowTypeHint    hint);
146
GdkWindowTypeHint gtk_window_get_type_hint     (GtkWindow           *window);
147 148 149 150 151 152
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);
153 154 155
void       gtk_window_set_urgency_hint         (GtkWindow           *window,
                                                gboolean             setting);
gboolean   gtk_window_get_urgency_hint         (GtkWindow           *window);
156 157 158
void       gtk_window_set_accept_focus         (GtkWindow           *window,
                                                gboolean             setting);
gboolean   gtk_window_get_accept_focus         (GtkWindow           *window);
159 160 161
void       gtk_window_set_focus_on_map         (GtkWindow           *window,
                                                gboolean             setting);
gboolean   gtk_window_get_focus_on_map         (GtkWindow           *window);
162 163
void       gtk_window_set_destroy_with_parent  (GtkWindow           *window,
                                                gboolean             setting);
164
gboolean   gtk_window_get_destroy_with_parent  (GtkWindow           *window);
165
GDK_AVAILABLE_IN_3_4
166 167
void       gtk_window_set_hide_titlebar_when_maximized (GtkWindow   *window,
                                                        gboolean     setting);
168
GDK_AVAILABLE_IN_3_4
169
gboolean   gtk_window_get_hide_titlebar_when_maximized (GtkWindow   *window);
170 171 172
void       gtk_window_set_mnemonics_visible    (GtkWindow           *window,
                                                gboolean             setting);
gboolean   gtk_window_get_mnemonics_visible    (GtkWindow           *window);
173
GDK_AVAILABLE_IN_3_2
174 175
void       gtk_window_set_focus_visible        (GtkWindow           *window,
                                                gboolean             setting);
176
GDK_AVAILABLE_IN_3_2
177
gboolean   gtk_window_get_focus_visible        (GtkWindow           *window);
178

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

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);

193 194 195 196
void	   gtk_window_set_screen	       (GtkWindow	    *window,
						GdkScreen	    *screen);
GdkScreen* gtk_window_get_screen	       (GtkWindow	    *window);

197 198 199
gboolean   gtk_window_is_active                (GtkWindow           *window);
gboolean   gtk_window_has_toplevel_focus       (GtkWindow           *window);

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

Havoc Pennington's avatar
Havoc Pennington committed
207 208 209 210 211
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);
212 213
void       gtk_window_set_icon_name                (GtkWindow   *window,
						    const gchar *name);
214 215 216
gboolean   gtk_window_set_icon_from_file           (GtkWindow   *window,
						    const gchar *filename,
						    GError     **err);
Havoc Pennington's avatar
Havoc Pennington committed
217
GdkPixbuf* gtk_window_get_icon                     (GtkWindow  *window);
218
const gchar * gtk_window_get_icon_name             (GtkWindow  *window);
Havoc Pennington's avatar
Havoc Pennington committed
219 220
void       gtk_window_set_default_icon_list        (GList      *list);
GList*     gtk_window_get_default_icon_list        (void);
221
void       gtk_window_set_default_icon             (GdkPixbuf  *icon);
222
void       gtk_window_set_default_icon_name        (const gchar *name);
223
const gchar * gtk_window_get_default_icon_name     (void);
224 225 226
gboolean   gtk_window_set_default_icon_from_file   (const gchar *filename,
						    GError     **err);

227
void       gtk_window_set_auto_startup_notification (gboolean setting);
Havoc Pennington's avatar
Havoc Pennington committed
228

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

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

250 251
gboolean gtk_window_activate_key          (GtkWindow        *window,
					   GdkEventKey      *event);
252 253
gboolean gtk_window_propagate_key_event   (GtkWindow        *window,
					   GdkEventKey      *event);
254

255 256 257
void     gtk_window_present            (GtkWindow *window);
void     gtk_window_present_with_time  (GtkWindow *window,
				        guint32    timestamp);
258 259 260 261 262 263
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);
264 265
void     gtk_window_fullscreen    (GtkWindow *window);
void     gtk_window_unfullscreen  (GtkWindow *window);
266 267
void     gtk_window_set_keep_above    (GtkWindow *window, gboolean setting);
void     gtk_window_set_keep_below    (GtkWindow *window, gboolean setting);
268

Owen Taylor's avatar
Owen Taylor committed
269 270 271 272 273 274 275 276 277 278 279 280
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
281 282
/* Set initial default size of the window (does not constrain user
 * resize operations)
283
 */
Havoc Pennington's avatar
Havoc Pennington committed
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
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,
300 301
                                      gint        *root_x,
                                      gint        *root_y);
Havoc Pennington's avatar
Havoc Pennington committed
302 303
gboolean gtk_window_parse_geometry   (GtkWindow   *window,
                                      const gchar *geometry);
304 305 306 307 308 309 310 311

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

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

/* Ignore this unless you are writing a GUI builder */
void     gtk_window_reshow_with_initial_size (GtkWindow *window);
317

318 319
GtkWindowType gtk_window_get_window_type     (GtkWindow     *window);

320 321
/* Window groups
 */
322
GType            gtk_window_group_get_type      (void) G_GNUC_CONST;
323 324 325 326 327 328

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);
329
GList *          gtk_window_group_list_windows  (GtkWindowGroup     *window_group);
330

331
GtkWidget *      gtk_window_group_get_current_grab (GtkWindowGroup *window_group);
332 333 334
GtkWidget *      gtk_window_group_get_current_device_grab (GtkWindowGroup *window_group,
                                                           GdkDevice      *device);

335 336 337 338
GtkApplication *gtk_window_get_application      (GtkWindow          *window);
void            gtk_window_set_application      (GtkWindow          *window,
                                                 GtkApplication     *application);

339

340 341 342 343 344 345 346 347 348
/* 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);

349
G_END_DECLS
Elliot Lee's avatar
Elliot Lee committed
350 351

#endif /* __GTK_WINDOW_H__ */