1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27 #ifndef __GTK_WINDOW_H__
28 #define __GTK_WINDOW_H__
32 #include <gtk/gtkaccelgroup.h>
33 #include <gtk/gtkbin.h>
34 #include <gtk/gtkenums.h>
35 #include <gtk/gtkwidget.h>
39 #endif /* __cplusplus */
42 #define GTK_TYPE_WINDOW (gtk_window_get_type ())
43 #define GTK_WINDOW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_WINDOW, GtkWindow))
44 #define GTK_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_WINDOW, GtkWindowClass))
45 #define GTK_IS_WINDOW(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_WINDOW))
46 #define GTK_IS_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WINDOW))
47 #define GTK_WINDOW_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_WINDOW, GtkWindowClass))
50 typedef struct _GtkWindow GtkWindow;
51 typedef struct _GtkWindowClass GtkWindowClass;
52 typedef struct _GtkWindowGeometryInfo GtkWindowGeometryInfo;
63 GtkWidget *focus_widget;
64 GtkWidget *default_widget;
65 GtkWindow *transient_parent;
66 GtkWindowGeometryInfo *geometry_info;
71 GtkWindowType type : 4;
72 guint has_user_ref_count : 1;
73 guint allow_shrink : 1;
75 guint auto_shrink : 1;
76 guint handling_resize : 1;
79 /* The following flag is initially TRUE when a window is mapped.
80 * and will be set to FALSE after it is first positioned.
81 * It is also temporarily reset when the window's size changes.
83 * When TRUE, we move the window to the position the app set.
85 guint use_uposition : 1;
87 guint destroy_with_parent : 1;
91 /* gtk_window_iconify() called before realization */
92 guint iconify_initially : 1;
93 guint stick_initially : 1;
94 guint maximize_initially : 1;
97 GdkWindowTypeHint type_hint : 3;
98 GdkGravity gravity : 5;
105 GdkModifierType mnemonic_modifier;
108 struct _GtkWindowClass
110 GtkBinClass parent_class;
112 void (* set_focus) (GtkWindow *window,
114 gboolean (* frame_event) (GtkWidget *widget,
119 GtkType gtk_window_get_type (void) G_GNUC_CONST;
120 GtkWidget* gtk_window_new (GtkWindowType type);
121 void gtk_window_set_title (GtkWindow *window,
123 void gtk_window_set_wmclass (GtkWindow *window,
124 const gchar *wmclass_name,
125 const gchar *wmclass_class);
126 void gtk_window_set_role (GtkWindow *window,
128 void gtk_window_add_accel_group (GtkWindow *window,
129 GtkAccelGroup *accel_group);
130 void gtk_window_remove_accel_group (GtkWindow *window,
131 GtkAccelGroup *accel_group);
132 void gtk_window_set_position (GtkWindow *window,
133 GtkWindowPosition position);
134 gboolean gtk_window_activate_focus (GtkWindow *window);
135 gboolean gtk_window_activate_default (GtkWindow *window);
137 void gtk_window_set_transient_for (GtkWindow *window,
139 void gtk_window_set_type_hint (GtkWindow *window,
140 GdkWindowTypeHint hint);
141 void gtk_window_set_destroy_with_parent (GtkWindow *window,
143 void gtk_window_set_decorations_hint (GtkWindow *window,
144 GdkWMDecoration decorations);
145 void gtk_window_set_functions_hint (GtkWindow *window,
146 GdkWMFunction functions);
148 void gtk_window_set_resizeable (GtkWindow *window,
149 gboolean resizeable);
150 gboolean gtk_window_get_resizeable (GtkWindow *window);
152 void gtk_window_set_gravity (GtkWindow *window,
154 GdkGravity gtk_window_get_gravity (GtkWindow *window);
157 void gtk_window_set_geometry_hints (GtkWindow *window,
158 GtkWidget *geometry_widget,
159 GdkGeometry *geometry,
160 GdkWindowHints geom_mask);
162 /* gtk_window_set_has_frame () must be called before realizing the window_*/
163 void gtk_window_set_has_frame (GtkWindow *window);
164 void gtk_window_set_frame_dimensions (GtkWindow *window,
170 void gtk_window_set_decorated (GtkWindow *window,
173 /* If window is set modal, input will be grabbed when show and released when hide */
174 void gtk_window_set_modal (GtkWindow *window,
176 GList* gtk_window_list_toplevels (void);
178 void gtk_window_add_mnemonic (GtkWindow *window,
181 void gtk_window_remove_mnemonic (GtkWindow *window,
184 gboolean gtk_window_mnemonic_activate (GtkWindow *window,
186 GdkModifierType modifier);
187 void gtk_window_set_mnemonic_modifier (GtkWindow *window,
188 GdkModifierType modifier);
190 void gtk_window_present (GtkWindow *window);
191 void gtk_window_iconify (GtkWindow *window);
192 void gtk_window_deiconify (GtkWindow *window);
193 void gtk_window_stick (GtkWindow *window);
194 void gtk_window_unstick (GtkWindow *window);
195 void gtk_window_maximize (GtkWindow *window);
196 void gtk_window_unmaximize (GtkWindow *window);
198 void gtk_window_begin_resize_drag (GtkWindow *window,
204 void gtk_window_begin_move_drag (GtkWindow *window,
210 #ifndef GTK_DISABLE_DEPRECATED
211 void gtk_window_set_policy (GtkWindow *window,
215 /* The following differs from gtk_widget_set_usize, in that
216 * gtk_widget_set_usize() overrides the requisition, so sets a minimum
217 * size, while this only sets the size requested from the WM.
219 void gtk_window_set_default_size (GtkWindow *window,
224 /* --- internal functions --- */
225 void gtk_window_set_focus (GtkWindow *window,
227 void gtk_window_set_default (GtkWindow *window,
228 GtkWidget *defaultw);
229 void gtk_window_remove_embedded_xid (GtkWindow *window,
231 void gtk_window_add_embedded_xid (GtkWindow *window,
233 void _gtk_window_reposition (GtkWindow *window,
236 void _gtk_window_constrain_size (GtkWindow *window,
244 #endif /* __cplusplus */
247 #endif /* __GTK_WINDOW_H__ */