]> Pileus Git - ~andy/gtk/blob - gdk/x11/gdkwindow-x11.h
Bug 113310.
[~andy/gtk] / gdk / x11 / gdkwindow-x11.h
1 /* GDK - The GIMP Drawing Kit
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 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.
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  * Lesser General Public License for more details.
13  *
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.
18  */
19
20 /*
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/. 
25  */
26
27 #ifndef __GDK_WINDOW_X11_H__
28 #define __GDK_WINDOW_X11_H__
29
30 #include <gdk/x11/gdkdrawable-x11.h>
31
32 G_BEGIN_DECLS
33
34 typedef struct _GdkToplevelX11 GdkToplevelX11;
35 typedef struct _GdkWindowImplX11 GdkWindowImplX11;
36 typedef struct _GdkWindowImplX11Class GdkWindowImplX11Class;
37 typedef struct _GdkXPositionInfo GdkXPositionInfo;
38
39 struct _GdkXPositionInfo
40 {
41   gint x;
42   gint y;
43   gint width;
44   gint height;
45   gint x_offset;                /* Offsets to add to X coordinates within window */
46   gint y_offset;                /*   to get GDK coodinates within window */
47   guint big : 1;
48   guint mapped : 1;
49   guint no_bg : 1;              /* Set when the window background is temporarily
50                                  * unset during resizing and scaling */
51   GdkRectangle clip_rect;       /* visible rectangle of window */
52 };
53
54
55 /* Window implementation for X11
56  */
57
58 #define GDK_TYPE_WINDOW_IMPL_X11              (gdk_window_impl_x11_get_type ())
59 #define GDK_WINDOW_IMPL_X11(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_X11, GdkWindowImplX11))
60 #define GDK_WINDOW_IMPL_X11_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_X11, GdkWindowImplX11Class))
61 #define GDK_IS_WINDOW_IMPL_X11(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_X11))
62 #define GDK_IS_WINDOW_IMPL_X11_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_X11))
63 #define GDK_WINDOW_IMPL_X11_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_X11, GdkWindowImplX11Class))
64
65 struct _GdkWindowImplX11
66 {
67   GdkDrawableImplX11 parent_instance;
68
69   gint width;
70   gint height;
71   
72   GdkXPositionInfo position_info;
73   GdkToplevelX11 *toplevel;     /* Toplevel-specific information */
74   gint8 toplevel_window_type;
75   guint override_redirect : 1;
76 };
77  
78 struct _GdkWindowImplX11Class 
79 {
80   GdkDrawableImplX11Class parent_class;
81 };
82
83 struct _GdkToplevelX11
84 {
85
86   /* Set if the window, or any descendent of it, is the server's focus window
87    */
88   guint has_focus_window : 1;
89
90   /* Set if window->has_focus_window and the focus isn't grabbed elsewhere.
91    */
92   guint has_focus : 1;
93
94   /* Set if !window->has_focus_window, but events are being sent to the
95    * window because the pointer is in it. (Typically, no window
96    * manager is running.
97    */
98   guint has_pointer_focus : 1;
99
100   /* Set if we are requesting these hints */
101   guint skip_taskbar_hint : 1;
102   guint skip_pager_hint : 1;
103
104   guint on_all_desktops : 1;   /* _NET_WM_STICKY == 0xFFFFFFFF */
105
106   guint have_sticky : 1;        /* _NET_WM_STATE_STICKY */
107   guint have_maxvert : 1;       /* _NET_WM_STATE_MAXIMIZED_VERT */
108   guint have_maxhorz : 1;       /* _NET_WM_STATE_MAXIMIZED_HORZ */
109   guint have_fullscreen : 1;    /* _NET_WM_STATE_FULLSCREEN */
110
111   gulong map_serial;    /* Serial of last transition from unmapped */
112   
113   GdkPixmap *icon_pixmap;
114   GdkPixmap *icon_mask;
115   GdkPixmap *icon_window;
116   GdkWindow *group_leader;
117
118   /* We use an extra X window for toplevel windows that we XSetInputFocus()
119    * to in order to avoid getting keyboard events redirected to subwindows
120    * that might not even be part of this app
121    */
122   Window focus_window;
123 };
124
125 GType gdk_window_impl_x11_get_type (void);
126
127 GdkToplevelX11 *_gdk_x11_window_get_toplevel  (GdkWindow *window);
128 void             gdk_x11_window_set_user_time (GdkWindow *window,
129                                                guint32    timestamp);
130 void            _gdk_x11_window_tmp_unset_bg  (GdkWindow *window,
131                                                gboolean   recurse);
132 void            _gdk_x11_window_tmp_reset_bg  (GdkWindow *window,
133                                                gboolean   recurse);
134
135
136 G_END_DECLS
137
138 #endif /* __GDK_WINDOW_X11_H__ */