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 Library 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 | * Library General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU Library 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. |
---|
18 | */ |
---|
19 | |
---|
20 | /* |
---|
21 | * Modified by the GTK+ Team and others 1997-1999. 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/. |
---|
25 | */ |
---|
26 | |
---|
27 | #ifndef __GTK_WINDOW_H__ |
---|
28 | #define __GTK_WINDOW_H__ |
---|
29 | |
---|
30 | |
---|
31 | #include <gdk/gdk.h> |
---|
32 | #include <gtk/gtkaccelgroup.h> |
---|
33 | #include <gtk/gtkbin.h> |
---|
34 | #include <gtk/gtkenums.h> |
---|
35 | #include <gtk/gtkwidget.h> |
---|
36 | |
---|
37 | #ifdef __cplusplus |
---|
38 | extern "C" { |
---|
39 | #endif /* __cplusplus */ |
---|
40 | |
---|
41 | |
---|
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 | |
---|
48 | |
---|
49 | typedef struct _GtkWindow GtkWindow; |
---|
50 | typedef struct _GtkWindowClass GtkWindowClass; |
---|
51 | |
---|
52 | struct _GtkWindow |
---|
53 | { |
---|
54 | GtkBin bin; |
---|
55 | |
---|
56 | gchar *title; |
---|
57 | gchar *wmclass_name; |
---|
58 | gchar *wmclass_class; |
---|
59 | GtkWindowType type; |
---|
60 | |
---|
61 | GtkWidget *focus_widget; |
---|
62 | GtkWidget *default_widget; |
---|
63 | GtkWindow *transient_parent; |
---|
64 | |
---|
65 | gushort resize_count; |
---|
66 | guint allow_shrink : 1; |
---|
67 | guint allow_grow : 1; |
---|
68 | guint auto_shrink : 1; |
---|
69 | guint handling_resize : 1; |
---|
70 | guint position : 2; |
---|
71 | |
---|
72 | /* The following flag is initially TRUE when a window is mapped. |
---|
73 | * and will be set to FALSE after it is first positioned. |
---|
74 | * It is also temporarily reset when the window's size changes. |
---|
75 | * |
---|
76 | * When TRUE, we move the window to the position the app set. |
---|
77 | */ |
---|
78 | guint use_uposition : 1; |
---|
79 | guint modal : 1; |
---|
80 | |
---|
81 | /* Set if the window, or any descendent of it, has the focus |
---|
82 | */ |
---|
83 | guint window_has_focus : 1; |
---|
84 | |
---|
85 | /* Set if !window_has_focus, but events are being sent to the |
---|
86 | * window because the pointer is in it. (Typically, no window |
---|
87 | * manager is running. |
---|
88 | */ |
---|
89 | guint window_has_pointer_focus : 1; |
---|
90 | }; |
---|
91 | |
---|
92 | struct _GtkWindowClass |
---|
93 | { |
---|
94 | GtkBinClass parent_class; |
---|
95 | |
---|
96 | void (* set_focus) (GtkWindow *window, |
---|
97 | GtkWidget *focus); |
---|
98 | }; |
---|
99 | |
---|
100 | |
---|
101 | GtkType gtk_window_get_type (void); |
---|
102 | GtkWidget* gtk_window_new (GtkWindowType type); |
---|
103 | void gtk_window_set_title (GtkWindow *window, |
---|
104 | const gchar *title); |
---|
105 | void gtk_window_set_wmclass (GtkWindow *window, |
---|
106 | const gchar *wmclass_name, |
---|
107 | const gchar *wmclass_class); |
---|
108 | void gtk_window_set_policy (GtkWindow *window, |
---|
109 | gint allow_shrink, |
---|
110 | gint allow_grow, |
---|
111 | gint auto_shrink); |
---|
112 | void gtk_window_add_accel_group (GtkWindow *window, |
---|
113 | GtkAccelGroup *accel_group); |
---|
114 | void gtk_window_remove_accel_group (GtkWindow *window, |
---|
115 | GtkAccelGroup *accel_group); |
---|
116 | void gtk_window_set_position (GtkWindow *window, |
---|
117 | GtkWindowPosition position); |
---|
118 | gint gtk_window_activate_focus (GtkWindow *window); |
---|
119 | gint gtk_window_activate_default (GtkWindow *window); |
---|
120 | |
---|
121 | void gtk_window_set_transient_for (GtkWindow *window, |
---|
122 | GtkWindow *parent); |
---|
123 | void gtk_window_set_geometry_hints (GtkWindow *window, |
---|
124 | GtkWidget *geometry_widget, |
---|
125 | GdkGeometry *geometry, |
---|
126 | GdkWindowHints geom_mask); |
---|
127 | /* The following differs from gtk_widget_set_usize, in that |
---|
128 | * gtk_widget_set_usize() overrides the requisition, so sets a minimum |
---|
129 | * size, while this only sets the size requested from the WM. |
---|
130 | */ |
---|
131 | void gtk_window_set_default_size (GtkWindow *window, |
---|
132 | gint width, |
---|
133 | gint height); |
---|
134 | |
---|
135 | /* If window is set modal, input will be grabbed when show and released when hide */ |
---|
136 | void gtk_window_set_modal (GtkWindow *window, |
---|
137 | gboolean modal); |
---|
138 | |
---|
139 | /* --- internal functions --- */ |
---|
140 | void gtk_window_set_focus (GtkWindow *window, |
---|
141 | GtkWidget *focus); |
---|
142 | void gtk_window_set_default (GtkWindow *window, |
---|
143 | GtkWidget *defaultw); |
---|
144 | void gtk_window_remove_embedded_xid (GtkWindow *window, |
---|
145 | guint xid); |
---|
146 | void gtk_window_add_embedded_xid (GtkWindow *window, |
---|
147 | guint xid); |
---|
148 | void gtk_window_reposition (GtkWindow *window, |
---|
149 | gint x, |
---|
150 | gint y); |
---|
151 | |
---|
152 | #ifdef __cplusplus |
---|
153 | } |
---|
154 | #endif /* __cplusplus */ |
---|
155 | |
---|
156 | |
---|
157 | #endif /* __GTK_WINDOW_H__ */ |
---|