]> Pileus Git - ~andy/gtk/blob - gdk/x11/gdkscreen-x11.h
be0c669238ca66ecccee6e97c9fc0938ea1df893
[~andy/gtk] / gdk / x11 / gdkscreen-x11.h
1 /*
2  * gdkscreen-x11.h
3  *
4  * Copyright 2001 Sun Microsystems Inc.
5  *
6  * Erwann Chenede <erwann.chenede@sun.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #ifndef __GDK_X11_SCREEN__
25 #define __GDK_X11_SCREEN__
26
27 #include "gdkscreenprivate.h"
28 #include "gdkx11screen.h"
29 #include "gdkvisual.h"
30 #include "xsettings-client.h"
31 #include <X11/X.h>
32 #include <X11/Xlib.h>
33
34 G_BEGIN_DECLS
35   
36 typedef struct _GdkX11Monitor GdkX11Monitor;
37
38 struct _GdkX11Screen
39 {
40   GdkScreen parent_instance;
41
42   GdkDisplay *display;
43   Display *xdisplay;
44   Screen *xscreen;
45   Window xroot_window;
46   GdkWindow *root_window;
47   gint screen_num;
48   /* Xinerama/RandR 1.2 */
49   gint  n_monitors;
50   GdkX11Monitor *monitors;
51   gint primary_monitor;
52
53   /* Xft resources for the display, used for default values for
54    * the Xft/ XSETTINGS
55    */
56   gint xft_hintstyle;
57   gint xft_rgba;
58   gint xft_dpi;
59
60   /* Window manager */
61   GdkAtom cm_selection_atom;
62   long last_wmspec_check_time;
63   Window wmspec_check_window;
64   char *window_manager_name;
65
66   /* TRUE if wmspec_check_window has changed since last
67    * fetch of _NET_SUPPORTED
68    */
69   guint need_refetch_net_supported : 1;
70   /* TRUE if wmspec_check_window has changed since last
71    * fetch of window manager name
72    */
73   guint need_refetch_wm_name : 1;
74   guint xsettings_in_init : 1;
75   guint is_composited : 1;
76   guint xft_init : 1; /* Whether we've intialized these values yet */
77   guint xft_antialias : 1;
78   guint xft_hinting : 1;
79
80   /* Visual Part */
81   gint nvisuals;
82   GdkVisual **visuals;
83   GdkVisual *system_visual;
84   gint available_depths[7];
85   GdkVisualType available_types[6];
86   gint16 navailable_depths;
87   gint16 navailable_types;
88   GHashTable *visual_hash;
89   GdkVisual *rgba_visual;
90
91   /* X settings */
92   XSettingsClient *xsettings_client;
93
94   /* cache for window->translate vfunc */
95   GC subwindow_gcs[32];
96 };
97
98 struct _GdkX11ScreenClass
99 {
100   GdkScreenClass parent_class;
101
102   void (* window_manager_changed) (GdkX11Screen *x11_screen);
103 };
104
105 GType       _gdk_x11_screen_get_type (void);
106 GdkScreen * _gdk_x11_screen_new      (GdkDisplay *display,
107                                       gint        screen_number);
108
109 void _gdk_x11_screen_setup                  (GdkScreen *screen);
110 void _gdk_x11_screen_window_manager_changed (GdkScreen *screen);
111 void _gdk_x11_screen_size_changed           (GdkScreen *screen,
112                                              XEvent    *event);
113 void _gdk_x11_screen_process_owner_change   (GdkScreen *screen,
114                                              XEvent    *event);
115
116 G_END_DECLS
117
118 #endif /* __GDK_X11_SCREEN__ */