| 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, see <http://www.gnu.org/licenses/>. |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef __GDK_X11_SCREEN__ |
| 23 |
#define __GDK_X11_SCREEN__ |
| 24 |
|
| 25 |
#include "gdkscreenprivate.h" |
| 26 |
#include "gdkx11screen.h" |
| 27 |
#include "gdkvisual.h" |
| 28 |
#include <X11/X.h> |
| 29 |
#include <X11/Xlib.h> |
| 30 |
|
| 31 |
G_BEGIN_DECLS |
| 32 |
|
| 33 |
typedef struct _GdkX11Monitor GdkX11Monitor; |
| 34 |
|
| 35 |
struct _GdkX11Screen |
| 36 |
{ |
| 37 |
GdkScreen parent_instance; |
| 38 |
|
| 39 |
GdkDisplay *display; |
| 40 |
Display *xdisplay; |
| 41 |
Screen *xscreen; |
| 42 |
Window xroot_window; |
| 43 |
GdkWindow *root_window; |
| 44 |
gint screen_num; |
| 45 |
|
| 46 |
gint width; |
| 47 |
gint height; |
| 48 |
|
| 49 |
gint window_scale; |
| 50 |
gboolean fixed_window_scale; |
| 51 |
|
| 52 |
/* Xft resources for the display, used for default values for |
| 53 |
* the Xft/ XSETTINGS |
| 54 |
*/ |
| 55 |
gint xft_hintstyle; |
| 56 |
gint xft_rgba; |
| 57 |
gint xft_dpi; |
| 58 |
|
| 59 |
/* Window manager */ |
| 60 |
long last_wmspec_check_time; |
| 61 |
Window wmspec_check_window; |
| 62 |
char *window_manager_name; |
| 63 |
|
| 64 |
/* X Settings */ |
| 65 |
GdkWindow *xsettings_manager_window; |
| 66 |
Atom xsettings_selection_atom; |
| 67 |
GHashTable *xsettings; /* string of GDK settings name => GValue */ |
| 68 |
|
| 69 |
/* TRUE if wmspec_check_window has changed since last |
| 70 |
* fetch of _NET_SUPPORTED |
| 71 |
*/ |
| 72 |
guint need_refetch_net_supported : 1; |
| 73 |
/* TRUE if wmspec_check_window has changed since last |
| 74 |
* fetch of window manager name |
| 75 |
*/ |
| 76 |
guint need_refetch_wm_name : 1; |
| 77 |
guint is_composited : 1; |
| 78 |
guint xft_init : 1; /* Whether we've intialized these values yet */ |
| 79 |
guint xft_antialias : 1; |
| 80 |
guint xft_hinting : 1; |
| 81 |
|
| 82 |
/* Visual Part */ |
| 83 |
gint nvisuals; |
| 84 |
GdkVisual **visuals; |
| 85 |
GdkVisual *system_visual; |
| 86 |
gint available_depths[7]; |
| 87 |
GdkVisualType available_types[6]; |
| 88 |
gint16 navailable_depths; |
| 89 |
gint16 navailable_types; |
| 90 |
GHashTable *visual_hash; |
| 91 |
GdkVisual *rgba_visual; |
| 92 |
|
| 93 |
/* cache for window->translate vfunc */ |
| 94 |
GC subwindow_gcs[32]; |
| 95 |
}; |
| 96 |
|
| 97 |
struct _GdkX11ScreenClass |
| 98 |
{ |
| 99 |
GdkScreenClass parent_class; |
| 100 |
|
| 101 |
void (* window_manager_changed) (GdkX11Screen *x11_screen); |
| 102 |
}; |
| 103 |
|
| 104 |
GType _gdk_x11_screen_get_type (void); |
| 105 |
GdkScreen * _gdk_x11_screen_new (GdkDisplay *display, |
| 106 |
gint screen_number); |
| 107 |
|
| 108 |
void _gdk_x11_screen_setup (GdkScreen *screen); |
| 109 |
void _gdk_x11_screen_update_visuals_for_gl (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 |
void _gdk_x11_screen_get_edge_monitors (GdkScreen *screen, |
| 116 |
gint *top, |
| 117 |
gint *bottom, |
| 118 |
gint *left, |
| 119 |
gint *right); |
| 120 |
void _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen, |
| 121 |
int scale); |
| 122 |
gboolean _gdk_x11_screen_get_monitor_work_area (GdkScreen *screen, |
| 123 |
GdkMonitor *monitor, |
| 124 |
GdkRectangle *area); |
| 125 |
void gdk_x11_screen_get_work_area (GdkScreen *screen, |
| 126 |
GdkRectangle *area); |
| 127 |
gint gdk_x11_screen_get_width (GdkScreen *screen); |
| 128 |
gint gdk_x11_screen_get_height (GdkScreen *screen); |
| 129 |
gint gdk_x11_screen_get_number (GdkScreen *screen); |
| 130 |
|
| 131 |
G_END_DECLS |
| 132 |
|
| 133 |
#endif /* __GDK_X11_SCREEN__ */ |