| 1 |
/* |
| 2 |
* gdkscreen-x11.h |
| 3 |
* |
| 4 |
* Copyright 2001 Sun Microsystems Inc. |
| 5 |
* |
| 6 |
* Erwann Chenede <[email protected]> |
| 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_SCREEN_X11_H__ |
| 25 |
#define __GDK_SCREEN_X11_H__ |
| 26 |
|
| 27 |
#include "gdkprivate-x11.h" |
| 28 |
#include "xsettings-client.h" |
| 29 |
#include <gdk/gdkscreen.h> |
| 30 |
#include <gdk/gdkvisual.h> |
| 31 |
#include <X11/X.h> |
| 32 |
#include <X11/Xlib.h> |
| 33 |
|
| 34 |
G_BEGIN_DECLS |
| 35 |
|
| 36 |
typedef struct _GdkScreenX11 GdkScreenX11; |
| 37 |
typedef struct _GdkScreenX11Class GdkScreenX11Class; |
| 38 |
|
| 39 |
#define GDK_TYPE_SCREEN_X11 (_gdk_screen_x11_get_type ()) |
| 40 |
#define GDK_SCREEN_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SCREEN_X11, GdkScreenX11)) |
| 41 |
#define GDK_SCREEN_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SCREEN_X11, GdkScreenX11Class)) |
| 42 |
#define GDK_IS_SCREEN_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SCREEN_X11)) |
| 43 |
#define GDK_IS_SCREEN_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SCREEN_X11)) |
| 44 |
#define GDK_SCREEN_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SCREEN_X11, GdkScreenX11Class)) |
| 45 |
|
| 46 |
typedef struct _GdkX11Monitor GdkX11Monitor; |
| 47 |
|
| 48 |
struct _GdkScreenX11 |
| 49 |
{ |
| 50 |
GdkScreen parent_instance; |
| 51 |
|
| 52 |
GdkDisplay *display; |
| 53 |
Display *xdisplay; |
| 54 |
Screen *xscreen; |
| 55 |
gint screen_num; |
| 56 |
Window xroot_window; |
| 57 |
GdkWindow *root_window; |
| 58 |
|
| 59 |
/* Window manager */ |
| 60 |
long last_wmspec_check_time; |
| 61 |
Window wmspec_check_window; |
| 62 |
char *window_manager_name; |
| 63 |
/* TRUE if wmspec_check_window has changed since last |
| 64 |
* fetch of _NET_SUPPORTED |
| 65 |
*/ |
| 66 |
guint need_refetch_net_supported : 1; |
| 67 |
/* TRUE if wmspec_check_window has changed since last |
| 68 |
* fetch of window manager name |
| 69 |
*/ |
| 70 |
guint need_refetch_wm_name : 1; |
| 71 |
|
| 72 |
/* Visual Part */ |
| 73 |
GdkVisualPrivate *system_visual; |
| 74 |
GdkVisualPrivate **visuals; |
| 75 |
gint nvisuals; |
| 76 |
gint available_depths[7]; |
| 77 |
gint navailable_depths; |
| 78 |
GdkVisualType available_types[6]; |
| 79 |
gint navailable_types; |
| 80 |
GHashTable *visual_hash; |
| 81 |
GHashTable *colormap_hash; |
| 82 |
GdkVisual *rgba_visual; |
| 83 |
|
| 84 |
/* Colormap Part */ |
| 85 |
GdkColormap *default_colormap; |
| 86 |
GdkColormap *system_colormap; |
| 87 |
GdkColormap *rgba_colormap; |
| 88 |
|
| 89 |
/* X settings */ |
| 90 |
XSettingsClient *xsettings_client; |
| 91 |
guint xsettings_in_init : 1; |
| 92 |
|
| 93 |
/* Xinerama/RandR 1.2 */ |
| 94 |
gint n_monitors; |
| 95 |
GdkX11Monitor *monitors; |
| 96 |
gint primary_monitor; |
| 97 |
|
| 98 |
/* Pango renderer object singleton */ |
| 99 |
PangoRenderer *renderer; |
| 100 |
|
| 101 |
/* Xft resources for the display, used for default values for |
| 102 |
* the Xft/ XSETTINGS |
| 103 |
*/ |
| 104 |
gboolean xft_init; /* Whether we've intialized these values yet */ |
| 105 |
gboolean xft_antialias; |
| 106 |
gboolean xft_hinting; |
| 107 |
gint xft_hintstyle; |
| 108 |
gint xft_rgba; |
| 109 |
gint xft_dpi; |
| 110 |
|
| 111 |
GdkAtom cm_selection_atom; |
| 112 |
gboolean is_composited; |
| 113 |
}; |
| 114 |
|
| 115 |
struct _GdkScreenX11Class |
| 116 |
{ |
| 117 |
GdkScreenClass parent_class; |
| 118 |
|
| 119 |
void (* window_manager_changed) (GdkScreenX11 *screen_x11); |
| 120 |
}; |
| 121 |
|
| 122 |
GType _gdk_screen_x11_get_type (void); |
| 123 |
GdkScreen * _gdk_x11_screen_new (GdkDisplay *display, |
| 124 |
gint screen_number); |
| 125 |
|
| 126 |
void _gdk_x11_screen_setup (GdkScreen *screen); |
| 127 |
void _gdk_x11_screen_window_manager_changed (GdkScreen *screen); |
| 128 |
void _gdk_x11_screen_size_changed (GdkScreen *screen, |
| 129 |
XEvent *event); |
| 130 |
void _gdk_x11_screen_process_owner_change (GdkScreen *screen, |
| 131 |
XEvent *event); |
| 132 |
|
| 133 |
G_END_DECLS |
| 134 |
|
| 135 |
#endif /* __GDK_SCREEN_X11_H__ */ |