forked from AuroraMiddleware/gtk
x11: Rename GdkScreenX11 to GdkX11Screen
This commit is contained in:
parent
b154d3abf6
commit
a8b69df376
@ -381,7 +381,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
|
||||
GdkWindow *window;
|
||||
GdkWindowImplX11 *window_impl = NULL;
|
||||
GdkScreen *screen = NULL;
|
||||
GdkScreenX11 *screen_x11 = NULL;
|
||||
GdkX11Screen *x11_screen = NULL;
|
||||
GdkToplevelX11 *toplevel = NULL;
|
||||
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
|
||||
gboolean return_val;
|
||||
@ -402,7 +402,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
|
||||
return FALSE;
|
||||
|
||||
screen = GDK_WINDOW_SCREEN (window);
|
||||
screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
x11_screen = GDK_X11_SCREEN (screen);
|
||||
toplevel = _gdk_x11_window_get_toplevel (window);
|
||||
window_impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
||||
xwindow = GDK_WINDOW_XID (window);
|
||||
@ -430,14 +430,14 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
screen = gdk_display_get_screen (display, i);
|
||||
screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
x11_screen = GDK_X11_SCREEN (screen);
|
||||
|
||||
if (screen_x11->wmspec_check_window == xwindow)
|
||||
if (x11_screen->wmspec_check_window == xwindow)
|
||||
{
|
||||
screen_x11->wmspec_check_window = None;
|
||||
screen_x11->last_wmspec_check_time = 0;
|
||||
g_free (screen_x11->window_manager_name);
|
||||
screen_x11->window_manager_name = g_strdup ("unknown");
|
||||
x11_screen->wmspec_check_window = None;
|
||||
x11_screen->last_wmspec_check_time = 0;
|
||||
g_free (x11_screen->window_manager_name);
|
||||
x11_screen->window_manager_name = g_strdup ("unknown");
|
||||
|
||||
/* careful, reentrancy */
|
||||
_gdk_x11_screen_window_manager_changed (screen);
|
||||
@ -592,7 +592,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
|
||||
|
||||
return_val = window && !GDK_WINDOW_DESTROYED (window);
|
||||
|
||||
if (window && GDK_WINDOW_XID (window) != screen_x11->xroot_window)
|
||||
if (window && GDK_WINDOW_XID (window) != x11_screen->xroot_window)
|
||||
gdk_window_destroy_notify (window);
|
||||
}
|
||||
else
|
||||
@ -713,7 +713,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
if (XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window),
|
||||
GDK_WINDOW_XID (window),
|
||||
screen_x11->xroot_window,
|
||||
x11_screen->xroot_window,
|
||||
0, 0,
|
||||
&tx, &ty,
|
||||
&child_window))
|
||||
@ -1273,7 +1273,7 @@ _gdk_x11_display_open (const gchar *display_name)
|
||||
attr.height = 10;
|
||||
attr.event_mask = 0;
|
||||
|
||||
display_x11->leader_gdk_window = gdk_window_new (GDK_SCREEN_X11 (display_x11->default_screen)->root_window,
|
||||
display_x11->leader_gdk_window = gdk_window_new (GDK_X11_SCREEN (display_x11->default_screen)->root_window,
|
||||
&attr, GDK_WA_X | GDK_WA_Y);
|
||||
(_gdk_x11_window_get_toplevel (display_x11->leader_gdk_window))->is_leader = TRUE;
|
||||
|
||||
@ -1349,7 +1349,7 @@ _gdk_x11_display_open (const gchar *display_name)
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
XQueryPointer (display_x11->xdisplay,
|
||||
GDK_SCREEN_X11 (display_x11->default_screen)->xroot_window,
|
||||
GDK_X11_SCREEN (display_x11->default_screen)->xroot_window,
|
||||
&root, &child, &rootx, &rooty, &winx, &winy, &xmask);
|
||||
if (G_UNLIKELY (gdk_x11_display_error_trap_pop (display) == BadWindow))
|
||||
{
|
||||
|
@ -505,7 +505,7 @@ gdk_window_cache_new (GdkScreen *screen)
|
||||
XGetWindowAttributes (xdisplay, GDK_WINDOW_XID (root_window), &xwa);
|
||||
result->old_event_mask = xwa.your_event_mask;
|
||||
|
||||
if (G_UNLIKELY (!GDK_X11_DISPLAY (GDK_SCREEN_X11 (screen)->display)->trusted_client))
|
||||
if (G_UNLIKELY (!GDK_X11_DISPLAY (GDK_X11_SCREEN (screen)->display)->trusted_client))
|
||||
{
|
||||
GList *toplevel_windows, *list;
|
||||
GdkWindow *window;
|
||||
|
@ -224,12 +224,12 @@ gdk_window_queue (GdkWindow *window,
|
||||
static GC
|
||||
_get_scratch_gc (GdkWindow *window, cairo_region_t *clip_region)
|
||||
{
|
||||
GdkScreenX11 *screen;
|
||||
GdkX11Screen *screen;
|
||||
XRectangle *rectangles;
|
||||
gint n_rects;
|
||||
gint depth;
|
||||
|
||||
screen = GDK_SCREEN_X11 (gdk_window_get_screen (window));
|
||||
screen = GDK_X11_SCREEN (gdk_window_get_screen (window));
|
||||
depth = gdk_visual_get_depth (gdk_window_get_visual (window)) - 1;
|
||||
|
||||
if (!screen->subwindow_gcs[depth])
|
||||
|
@ -45,24 +45,24 @@ void _gdk_x11_error_handler_pop (void);
|
||||
|
||||
Colormap _gdk_visual_get_x11_colormap (GdkVisual *visual);
|
||||
|
||||
gint _gdk_screen_x11_visual_get_best_depth (GdkScreen *screen);
|
||||
GdkVisualType _gdk_screen_x11_visual_get_best_type (GdkScreen *screen);
|
||||
GdkVisual * _gdk_screen_x11_get_system_visual (GdkScreen *screen);
|
||||
GdkVisual* _gdk_screen_x11_visual_get_best (GdkScreen *screen);
|
||||
GdkVisual* _gdk_screen_x11_visual_get_best_with_depth (GdkScreen *screen,
|
||||
gint _gdk_x11_screen_visual_get_best_depth (GdkScreen *screen);
|
||||
GdkVisualType _gdk_x11_screen_visual_get_best_type (GdkScreen *screen);
|
||||
GdkVisual * _gdk_x11_screen_get_system_visual (GdkScreen *screen);
|
||||
GdkVisual* _gdk_x11_screen_visual_get_best (GdkScreen *screen);
|
||||
GdkVisual* _gdk_x11_screen_visual_get_best_with_depth (GdkScreen *screen,
|
||||
gint depth);
|
||||
GdkVisual* _gdk_screen_x11_visual_get_best_with_type (GdkScreen *screen,
|
||||
GdkVisual* _gdk_x11_screen_visual_get_best_with_type (GdkScreen *screen,
|
||||
GdkVisualType visual_type);
|
||||
GdkVisual* _gdk_screen_x11_visual_get_best_with_both (GdkScreen *screen,
|
||||
GdkVisual* _gdk_x11_screen_visual_get_best_with_both (GdkScreen *screen,
|
||||
gint depth,
|
||||
GdkVisualType visual_type);
|
||||
void _gdk_screen_x11_query_depths (GdkScreen *screen,
|
||||
void _gdk_x11_screen_query_depths (GdkScreen *screen,
|
||||
gint **depths,
|
||||
gint *count);
|
||||
void _gdk_screen_x11_query_visual_types (GdkScreen *screen,
|
||||
void _gdk_x11_screen_query_visual_types (GdkScreen *screen,
|
||||
GdkVisualType **visual_types,
|
||||
gint *count);
|
||||
GList * _gdk_screen_x11_list_visuals (GdkScreen *screen);
|
||||
GList * _gdk_x11_screen_list_visuals (GdkScreen *screen);
|
||||
|
||||
|
||||
|
||||
@ -288,11 +288,11 @@ cairo_surface_t * _gdk_x11_window_create_bitmap_surface (GdkWindow *window,
|
||||
extern const gint _gdk_x11_event_mask_table[];
|
||||
extern const gint _gdk_x11_event_mask_table_size;
|
||||
|
||||
#define GDK_SCREEN_DISPLAY(screen) (GDK_SCREEN_X11 (screen)->display)
|
||||
#define GDK_SCREEN_XROOTWIN(screen) (GDK_SCREEN_X11 (screen)->xroot_window)
|
||||
#define GDK_SCREEN_DISPLAY(screen) (GDK_X11_SCREEN (screen)->display)
|
||||
#define GDK_SCREEN_XROOTWIN(screen) (GDK_X11_SCREEN (screen)->xroot_window)
|
||||
#define GDK_WINDOW_SCREEN(win) (gdk_window_get_screen (win))
|
||||
#define GDK_WINDOW_DISPLAY(win) (GDK_SCREEN_X11 (GDK_WINDOW_SCREEN (win))->display)
|
||||
#define GDK_WINDOW_XROOTWIN(win) (GDK_SCREEN_X11 (GDK_WINDOW_SCREEN (win))->xroot_window)
|
||||
#define GDK_WINDOW_DISPLAY(win) (GDK_X11_SCREEN (GDK_WINDOW_SCREEN (win))->display)
|
||||
#define GDK_WINDOW_XROOTWIN(win) (GDK_X11_SCREEN (GDK_WINDOW_SCREEN (win))->xroot_window)
|
||||
#define GDK_GC_DISPLAY(gc) (GDK_SCREEN_DISPLAY (GDK_GC_X11(gc)->screen))
|
||||
#define GDK_WINDOW_IS_X11(win) (GDK_IS_WINDOW_IMPL_X11 ((win)->impl))
|
||||
|
||||
@ -303,8 +303,8 @@ extern const gint _gdk_x11_event_mask_table_size;
|
||||
#undef GDK_SCREEN_XDISPLAY
|
||||
|
||||
#define GDK_DISPLAY_XDISPLAY(display) (GDK_X11_DISPLAY(display)->xdisplay)
|
||||
#define GDK_WINDOW_XDISPLAY(win) (GDK_SCREEN_X11 (GDK_WINDOW_SCREEN (win))->xdisplay)
|
||||
#define GDK_WINDOW_XDISPLAY(win) (GDK_X11_SCREEN (GDK_WINDOW_SCREEN (win))->xdisplay)
|
||||
#define GDK_WINDOW_XID(win) (GDK_WINDOW_IMPL_X11(GDK_WINDOW (win)->impl)->xid)
|
||||
#define GDK_SCREEN_XDISPLAY(screen) (GDK_SCREEN_X11 (screen)->xdisplay)
|
||||
#define GDK_SCREEN_XDISPLAY(screen) (GDK_X11_SCREEN (screen)->xdisplay)
|
||||
|
||||
#endif /* __GDK_PRIVATE_X11_H__ */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -21,8 +21,8 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_SCREEN_X11_H__
|
||||
#define __GDK_SCREEN_X11_H__
|
||||
#ifndef __GDK_X11_SCREEN__
|
||||
#define __GDK_X11_SCREEN__
|
||||
|
||||
#include "gdkscreenprivate.h"
|
||||
#include "gdkvisual.h"
|
||||
@ -32,19 +32,19 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GdkScreenX11 GdkScreenX11;
|
||||
typedef struct _GdkScreenX11Class GdkScreenX11Class;
|
||||
typedef struct _GdkX11Screen GdkX11Screen;
|
||||
typedef struct _GdkX11ScreenClass GdkX11ScreenClass;
|
||||
|
||||
#define GDK_TYPE_SCREEN_X11 (_gdk_screen_x11_get_type ())
|
||||
#define GDK_SCREEN_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SCREEN_X11, GdkScreenX11))
|
||||
#define GDK_SCREEN_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SCREEN_X11, GdkScreenX11Class))
|
||||
#define GDK_IS_SCREEN_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SCREEN_X11))
|
||||
#define GDK_IS_SCREEN_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SCREEN_X11))
|
||||
#define GDK_SCREEN_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SCREEN_X11, GdkScreenX11Class))
|
||||
#define GDK_TYPE_X11_SCREEN (_gdk_x11_screen_get_type ())
|
||||
#define GDK_X11_SCREEN(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_X11_SCREEN, GdkX11Screen))
|
||||
#define GDK_X11_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_X11_SCREEN, GdkX11ScreenClass))
|
||||
#define GDK_IS_X11_SCREEN(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_X11_SCREEN))
|
||||
#define GDK_IS_X11_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_X11_SCREEN))
|
||||
#define GDK_X11_SCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_X11_SCREEN, GdkX11ScreenClass))
|
||||
|
||||
typedef struct _GdkX11Monitor GdkX11Monitor;
|
||||
|
||||
struct _GdkScreenX11
|
||||
struct _GdkX11Screen
|
||||
{
|
||||
GdkScreen parent_instance;
|
||||
|
||||
@ -105,14 +105,14 @@ struct _GdkScreenX11
|
||||
gboolean is_composited;
|
||||
};
|
||||
|
||||
struct _GdkScreenX11Class
|
||||
struct _GdkX11ScreenClass
|
||||
{
|
||||
GdkScreenClass parent_class;
|
||||
|
||||
void (* window_manager_changed) (GdkScreenX11 *screen_x11);
|
||||
void (* window_manager_changed) (GdkX11Screen *x11_screen);
|
||||
};
|
||||
|
||||
GType _gdk_screen_x11_get_type (void);
|
||||
GType _gdk_x11_screen_get_type (void);
|
||||
GdkScreen * _gdk_x11_screen_new (GdkDisplay *display,
|
||||
gint screen_number);
|
||||
|
||||
@ -125,4 +125,4 @@ void _gdk_x11_screen_process_owner_change (GdkScreen *screen,
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_SCREEN_X11_H__ */
|
||||
#endif /* __GDK_X11_SCREEN__ */
|
||||
|
@ -79,7 +79,7 @@ _gdk_x11_window_simulate_key (GdkWindow *window,
|
||||
xev.type = key_pressrelease == GDK_KEY_PRESS ? KeyPress : KeyRelease;
|
||||
xev.display = GDK_WINDOW_XDISPLAY (window);
|
||||
xev.window = GDK_WINDOW_XID (window);
|
||||
xev.root = RootWindow (xev.display, GDK_SCREEN_X11 (screen)->screen_num);
|
||||
xev.root = RootWindow (xev.display, GDK_X11_SCREEN (screen)->screen_num);
|
||||
xev.subwindow = 0;
|
||||
xev.time = 0;
|
||||
xev.x = MAX (x, 0);
|
||||
@ -157,7 +157,7 @@ _gdk_x11_window_simulate_button (GdkWindow *window,
|
||||
xev.type = button_pressrelease == GDK_BUTTON_PRESS ? ButtonPress : ButtonRelease;
|
||||
xev.display = GDK_WINDOW_XDISPLAY (window);
|
||||
xev.window = GDK_WINDOW_XID (window);
|
||||
xev.root = RootWindow (xev.display, GDK_SCREEN_X11 (screen)->screen_num);
|
||||
xev.root = RootWindow (xev.display, GDK_X11_SCREEN (screen)->screen_num);
|
||||
xev.subwindow = 0;
|
||||
xev.time = 0;
|
||||
xev.x = x;
|
||||
|
@ -111,7 +111,7 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen)
|
||||
GDK_VISUAL_STATIC_GRAY
|
||||
};
|
||||
|
||||
GdkScreenX11 *screen_x11;
|
||||
GdkX11Screen *x11_screen;
|
||||
XVisualInfo *visual_list;
|
||||
XVisualInfo visual_template;
|
||||
GdkVisual *temp_visual;
|
||||
@ -122,17 +122,17 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen)
|
||||
int i, j;
|
||||
|
||||
g_return_if_fail (GDK_IS_SCREEN (screen));
|
||||
screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
x11_screen = GDK_X11_SCREEN (screen);
|
||||
|
||||
nxvisuals = 0;
|
||||
visual_template.screen = screen_x11->screen_num;
|
||||
visual_list = XGetVisualInfo (screen_x11->xdisplay, VisualScreenMask, &visual_template, &nxvisuals);
|
||||
visual_template.screen = x11_screen->screen_num;
|
||||
visual_list = XGetVisualInfo (x11_screen->xdisplay, VisualScreenMask, &visual_template, &nxvisuals);
|
||||
|
||||
visuals = g_new (GdkVisual *, nxvisuals);
|
||||
for (i = 0; i < nxvisuals; i++)
|
||||
visuals[i] = g_object_new (GDK_TYPE_X11_VISUAL, NULL);
|
||||
|
||||
default_xvisual = DefaultVisual (screen_x11->xdisplay, screen_x11->screen_num);
|
||||
default_xvisual = DefaultVisual (x11_screen->xdisplay, x11_screen->screen_num);
|
||||
|
||||
nvisuals = 0;
|
||||
for (i = 0; i < nxvisuals; i++)
|
||||
@ -169,7 +169,7 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen)
|
||||
|
||||
visuals[nvisuals]->depth = visual_list[i].depth;
|
||||
visuals[nvisuals]->byte_order =
|
||||
(ImageByteOrder(screen_x11->xdisplay) == LSBFirst) ?
|
||||
(ImageByteOrder(x11_screen->xdisplay) == LSBFirst) ?
|
||||
GDK_LSB_FIRST : GDK_MSB_FIRST;
|
||||
visuals[nvisuals]->red_mask = visual_list[i].red_mask;
|
||||
visuals[nvisuals]->green_mask = visual_list[i].green_mask;
|
||||
@ -253,9 +253,9 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen)
|
||||
{
|
||||
if (default_xvisual->visualid == GDK_X11_VISUAL (visuals[i])->xvisual->visualid)
|
||||
{
|
||||
screen_x11->system_visual = visuals[i];
|
||||
x11_screen->system_visual = visuals[i];
|
||||
GDK_X11_VISUAL (visuals[i])->colormap =
|
||||
DefaultColormap (screen_x11->xdisplay, screen_x11->screen_num);
|
||||
DefaultColormap (x11_screen->xdisplay, x11_screen->screen_num);
|
||||
}
|
||||
|
||||
/* For now, we only support 8888 ARGB for the "rgba visual".
|
||||
@ -267,7 +267,7 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen)
|
||||
visuals[i]->green_mask == 0x00ff00 &&
|
||||
visuals[i]->blue_mask == 0x0000ff))
|
||||
{
|
||||
screen_x11->rgba_visual = visuals[i];
|
||||
x11_screen->rgba_visual = visuals[i];
|
||||
}
|
||||
}
|
||||
|
||||
@ -289,30 +289,30 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen)
|
||||
}
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
screen_x11->navailable_depths = 0;
|
||||
x11_screen->navailable_depths = 0;
|
||||
for (i = 0; i < G_N_ELEMENTS (possible_depths); i++)
|
||||
{
|
||||
for (j = 0; j < nvisuals; j++)
|
||||
{
|
||||
if (visuals[j]->depth == possible_depths[i])
|
||||
{
|
||||
screen_x11->available_depths[screen_x11->navailable_depths++] = visuals[j]->depth;
|
||||
x11_screen->available_depths[x11_screen->navailable_depths++] = visuals[j]->depth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (screen_x11->navailable_depths == 0)
|
||||
if (x11_screen->navailable_depths == 0)
|
||||
g_error ("unable to find a usable depth");
|
||||
|
||||
screen_x11->navailable_types = 0;
|
||||
x11_screen->navailable_types = 0;
|
||||
for (i = 0; i < G_N_ELEMENTS (possible_types); i++)
|
||||
{
|
||||
for (j = 0; j < nvisuals; j++)
|
||||
{
|
||||
if (visuals[j]->type == possible_types[i])
|
||||
{
|
||||
screen_x11->available_types[screen_x11->navailable_types++] = visuals[j]->type;
|
||||
x11_screen->available_types[x11_screen->navailable_types++] = visuals[j]->type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -321,54 +321,54 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen)
|
||||
for (i = 0; i < nvisuals; i++)
|
||||
gdk_visual_add (visuals[i]);
|
||||
|
||||
if (screen_x11->navailable_types == 0)
|
||||
if (x11_screen->navailable_types == 0)
|
||||
g_error ("unable to find a usable visual type");
|
||||
|
||||
screen_x11->visuals = visuals;
|
||||
screen_x11->nvisuals = nvisuals;
|
||||
x11_screen->visuals = visuals;
|
||||
x11_screen->nvisuals = nvisuals;
|
||||
}
|
||||
|
||||
gint
|
||||
_gdk_screen_x11_visual_get_best_depth (GdkScreen *screen)
|
||||
_gdk_x11_screen_visual_get_best_depth (GdkScreen *screen)
|
||||
{
|
||||
return GDK_SCREEN_X11 (screen)->available_depths[0];
|
||||
return GDK_X11_SCREEN (screen)->available_depths[0];
|
||||
}
|
||||
|
||||
GdkVisualType
|
||||
_gdk_screen_x11_visual_get_best_type (GdkScreen *screen)
|
||||
_gdk_x11_screen_visual_get_best_type (GdkScreen *screen)
|
||||
{
|
||||
return GDK_SCREEN_X11 (screen)->available_types[0];
|
||||
return GDK_X11_SCREEN (screen)->available_types[0];
|
||||
}
|
||||
|
||||
GdkVisual *
|
||||
_gdk_screen_x11_get_system_visual (GdkScreen *screen)
|
||||
_gdk_x11_screen_get_system_visual (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
|
||||
return ((GdkVisual *) GDK_SCREEN_X11 (screen)->system_visual);
|
||||
return ((GdkVisual *) GDK_X11_SCREEN (screen)->system_visual);
|
||||
}
|
||||
|
||||
GdkVisual*
|
||||
_gdk_screen_x11_visual_get_best (GdkScreen *screen)
|
||||
_gdk_x11_screen_visual_get_best (GdkScreen *screen)
|
||||
{
|
||||
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
|
||||
|
||||
return screen_x11->visuals[0];
|
||||
return x11_screen->visuals[0];
|
||||
}
|
||||
|
||||
GdkVisual*
|
||||
_gdk_screen_x11_visual_get_best_with_depth (GdkScreen *screen,
|
||||
_gdk_x11_screen_visual_get_best_with_depth (GdkScreen *screen,
|
||||
gint depth)
|
||||
{
|
||||
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
|
||||
GdkVisual *return_val;
|
||||
int i;
|
||||
|
||||
return_val = NULL;
|
||||
for (i = 0; i < screen_x11->nvisuals; i++)
|
||||
if (depth == screen_x11->visuals[i]->depth)
|
||||
for (i = 0; i < x11_screen->nvisuals; i++)
|
||||
if (depth == x11_screen->visuals[i]->depth)
|
||||
{
|
||||
return_val = screen_x11->visuals[i];
|
||||
return_val = x11_screen->visuals[i];
|
||||
break;
|
||||
}
|
||||
|
||||
@ -376,18 +376,18 @@ _gdk_screen_x11_visual_get_best_with_depth (GdkScreen *screen,
|
||||
}
|
||||
|
||||
GdkVisual*
|
||||
_gdk_screen_x11_visual_get_best_with_type (GdkScreen *screen,
|
||||
_gdk_x11_screen_visual_get_best_with_type (GdkScreen *screen,
|
||||
GdkVisualType visual_type)
|
||||
{
|
||||
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
|
||||
GdkVisual *return_val;
|
||||
int i;
|
||||
|
||||
return_val = NULL;
|
||||
for (i = 0; i < screen_x11->nvisuals; i++)
|
||||
if (visual_type == screen_x11->visuals[i]->type)
|
||||
for (i = 0; i < x11_screen->nvisuals; i++)
|
||||
if (visual_type == x11_screen->visuals[i]->type)
|
||||
{
|
||||
return_val = screen_x11->visuals[i];
|
||||
return_val = x11_screen->visuals[i];
|
||||
break;
|
||||
}
|
||||
|
||||
@ -395,20 +395,20 @@ _gdk_screen_x11_visual_get_best_with_type (GdkScreen *screen,
|
||||
}
|
||||
|
||||
GdkVisual*
|
||||
_gdk_screen_x11_visual_get_best_with_both (GdkScreen *screen,
|
||||
_gdk_x11_screen_visual_get_best_with_both (GdkScreen *screen,
|
||||
gint depth,
|
||||
GdkVisualType visual_type)
|
||||
{
|
||||
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
|
||||
GdkVisual *return_val;
|
||||
int i;
|
||||
|
||||
return_val = NULL;
|
||||
for (i = 0; i < screen_x11->nvisuals; i++)
|
||||
if ((depth == screen_x11->visuals[i]->depth) &&
|
||||
(visual_type == screen_x11->visuals[i]->type))
|
||||
for (i = 0; i < x11_screen->nvisuals; i++)
|
||||
if ((depth == x11_screen->visuals[i]->depth) &&
|
||||
(visual_type == x11_screen->visuals[i]->type))
|
||||
{
|
||||
return_val = screen_x11->visuals[i];
|
||||
return_val = x11_screen->visuals[i];
|
||||
break;
|
||||
}
|
||||
|
||||
@ -416,41 +416,41 @@ _gdk_screen_x11_visual_get_best_with_both (GdkScreen *screen,
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_screen_x11_query_depths (GdkScreen *screen,
|
||||
_gdk_x11_screen_query_depths (GdkScreen *screen,
|
||||
gint **depths,
|
||||
gint *count)
|
||||
{
|
||||
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
|
||||
|
||||
*count = screen_x11->navailable_depths;
|
||||
*depths = screen_x11->available_depths;
|
||||
*count = x11_screen->navailable_depths;
|
||||
*depths = x11_screen->available_depths;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_screen_x11_query_visual_types (GdkScreen *screen,
|
||||
_gdk_x11_screen_query_visual_types (GdkScreen *screen,
|
||||
GdkVisualType **visual_types,
|
||||
gint *count)
|
||||
{
|
||||
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
|
||||
|
||||
*count = screen_x11->navailable_types;
|
||||
*visual_types = screen_x11->available_types;
|
||||
*count = x11_screen->navailable_types;
|
||||
*visual_types = x11_screen->available_types;
|
||||
}
|
||||
|
||||
GList *
|
||||
_gdk_screen_x11_list_visuals (GdkScreen *screen)
|
||||
_gdk_x11_screen_list_visuals (GdkScreen *screen)
|
||||
{
|
||||
GList *list;
|
||||
GdkScreenX11 *screen_x11;
|
||||
GdkX11Screen *x11_screen;
|
||||
guint i;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
x11_screen = GDK_X11_SCREEN (screen);
|
||||
|
||||
list = NULL;
|
||||
|
||||
for (i = 0; i < screen_x11->nvisuals; ++i)
|
||||
list = g_list_append (list, screen_x11->visuals[i]);
|
||||
for (i = 0; i < x11_screen->nvisuals; ++i)
|
||||
list = g_list_append (list, x11_screen->visuals[i]);
|
||||
|
||||
return list;
|
||||
}
|
||||
@ -472,13 +472,13 @@ gdk_x11_screen_lookup_visual (GdkScreen *screen,
|
||||
VisualID xvisualid)
|
||||
{
|
||||
int i;
|
||||
GdkScreenX11 *screen_x11;
|
||||
GdkX11Screen *x11_screen;
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
x11_screen = GDK_X11_SCREEN (screen);
|
||||
|
||||
for (i = 0; i < screen_x11->nvisuals; i++)
|
||||
if (xvisualid == GDK_X11_VISUAL (screen_x11->visuals[i])->xvisual->visualid)
|
||||
return screen_x11->visuals[i];
|
||||
for (i = 0; i < x11_screen->nvisuals; i++)
|
||||
if (xvisualid == GDK_X11_VISUAL (x11_screen->visuals[i])->xvisual->visualid)
|
||||
return x11_screen->visuals[i];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -486,13 +486,13 @@ gdk_x11_screen_lookup_visual (GdkScreen *screen,
|
||||
static void
|
||||
gdk_visual_add (GdkVisual *visual)
|
||||
{
|
||||
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (visual->screen);
|
||||
GdkX11Screen *x11_screen = GDK_X11_SCREEN (visual->screen);
|
||||
|
||||
if (!screen_x11->visual_hash)
|
||||
screen_x11->visual_hash = g_hash_table_new ((GHashFunc) gdk_visual_hash,
|
||||
if (!x11_screen->visual_hash)
|
||||
x11_screen->visual_hash = g_hash_table_new ((GHashFunc) gdk_visual_hash,
|
||||
(GEqualFunc) gdk_visual_equal);
|
||||
|
||||
g_hash_table_insert (screen_x11->visual_hash, GDK_X11_VISUAL (visual)->xvisual, visual);
|
||||
g_hash_table_insert (x11_screen->visual_hash, GDK_X11_VISUAL (visual)->xvisual, visual);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -312,7 +312,7 @@ _gdk_x11_window_create_bitmap_surface (GdkWindow *window,
|
||||
width, height, 1);
|
||||
surface = cairo_xlib_surface_create_for_bitmap (GDK_WINDOW_XDISPLAY (window),
|
||||
pixmap,
|
||||
GDK_SCREEN_X11 (GDK_WINDOW_SCREEN (window))->xscreen,
|
||||
GDK_X11_SCREEN (GDK_WINDOW_SCREEN (window))->xscreen,
|
||||
width, height);
|
||||
attach_free_pixmap_handler (surface, GDK_WINDOW_DISPLAY (window), pixmap);
|
||||
|
||||
@ -454,13 +454,13 @@ _gdk_x11_screen_init_root_window (GdkScreen *screen)
|
||||
{
|
||||
GdkWindow *window;
|
||||
GdkWindowImplX11 *impl;
|
||||
GdkScreenX11 *screen_x11;
|
||||
GdkX11Screen *x11_screen;
|
||||
|
||||
screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
x11_screen = GDK_X11_SCREEN (screen);
|
||||
|
||||
g_assert (screen_x11->root_window == NULL);
|
||||
g_assert (x11_screen->root_window == NULL);
|
||||
|
||||
window = screen_x11->root_window = g_object_new (GDK_TYPE_WINDOW, NULL);
|
||||
window = x11_screen->root_window = g_object_new (GDK_TYPE_WINDOW, NULL);
|
||||
|
||||
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
|
||||
window->impl_window = window;
|
||||
@ -468,28 +468,28 @@ _gdk_x11_screen_init_root_window (GdkScreen *screen)
|
||||
|
||||
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
||||
|
||||
impl->xid = screen_x11->xroot_window;
|
||||
impl->xid = x11_screen->xroot_window;
|
||||
impl->wrapper = window;
|
||||
|
||||
window->window_type = GDK_WINDOW_ROOT;
|
||||
window->depth = DefaultDepthOfScreen (screen_x11->xscreen);
|
||||
window->depth = DefaultDepthOfScreen (x11_screen->xscreen);
|
||||
|
||||
window->x = 0;
|
||||
window->y = 0;
|
||||
window->abs_x = 0;
|
||||
window->abs_y = 0;
|
||||
window->width = WidthOfScreen (screen_x11->xscreen);
|
||||
window->height = HeightOfScreen (screen_x11->xscreen);
|
||||
window->width = WidthOfScreen (x11_screen->xscreen);
|
||||
window->height = HeightOfScreen (x11_screen->xscreen);
|
||||
window->viewable = TRUE;
|
||||
|
||||
/* see init_randr_support() in gdkscreen-x11.c */
|
||||
window->event_mask = GDK_STRUCTURE_MASK;
|
||||
|
||||
_gdk_window_update_size (screen_x11->root_window);
|
||||
_gdk_window_update_size (x11_screen->root_window);
|
||||
|
||||
_gdk_x11_display_add_window (screen_x11->display,
|
||||
&screen_x11->xroot_window,
|
||||
screen_x11->root_window);
|
||||
_gdk_x11_display_add_window (x11_screen->display,
|
||||
&x11_screen->xroot_window,
|
||||
x11_screen->root_window);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -615,7 +615,7 @@ setup_toplevel_window (GdkWindow *window,
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
Display *xdisplay = GDK_WINDOW_XDISPLAY (window);
|
||||
XID xid = GDK_WINDOW_XID (window);
|
||||
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (GDK_WINDOW_SCREEN (parent));
|
||||
GdkX11Screen *x11_screen = GDK_X11_SCREEN (GDK_WINDOW_SCREEN (parent));
|
||||
XSizeHints size_hints;
|
||||
long pid;
|
||||
Window leader_window;
|
||||
@ -628,12 +628,12 @@ setup_toplevel_window (GdkWindow *window,
|
||||
* press events so they don't get sent to child windows.
|
||||
*/
|
||||
toplevel->focus_window = create_focus_window (display, xid);
|
||||
_gdk_x11_display_add_window (screen_x11->display,
|
||||
_gdk_x11_display_add_window (x11_screen->display,
|
||||
&toplevel->focus_window,
|
||||
window);
|
||||
}
|
||||
|
||||
check_leader_window_title (screen_x11->display);
|
||||
check_leader_window_title (x11_screen->display);
|
||||
|
||||
/* FIXME: Is there any point in doing this? Do any WM's pay
|
||||
* attention to PSize, and even if they do, is this the
|
||||
@ -650,29 +650,29 @@ setup_toplevel_window (GdkWindow *window,
|
||||
|
||||
pid = getpid ();
|
||||
XChangeProperty (xdisplay, xid,
|
||||
gdk_x11_get_xatom_by_name_for_display (screen_x11->display, "_NET_WM_PID"),
|
||||
gdk_x11_get_xatom_by_name_for_display (x11_screen->display, "_NET_WM_PID"),
|
||||
XA_CARDINAL, 32,
|
||||
PropModeReplace,
|
||||
(guchar *)&pid, 1);
|
||||
|
||||
leader_window = GDK_X11_DISPLAY (screen_x11->display)->leader_window;
|
||||
leader_window = GDK_X11_DISPLAY (x11_screen->display)->leader_window;
|
||||
if (!leader_window)
|
||||
leader_window = xid;
|
||||
XChangeProperty (xdisplay, xid,
|
||||
gdk_x11_get_xatom_by_name_for_display (screen_x11->display, "WM_CLIENT_LEADER"),
|
||||
gdk_x11_get_xatom_by_name_for_display (x11_screen->display, "WM_CLIENT_LEADER"),
|
||||
XA_WINDOW, 32, PropModeReplace,
|
||||
(guchar *) &leader_window, 1);
|
||||
|
||||
if (toplevel->focus_window != None)
|
||||
XChangeProperty (xdisplay, xid,
|
||||
gdk_x11_get_xatom_by_name_for_display (screen_x11->display, "_NET_WM_USER_TIME_WINDOW"),
|
||||
gdk_x11_get_xatom_by_name_for_display (x11_screen->display, "_NET_WM_USER_TIME_WINDOW"),
|
||||
XA_WINDOW, 32, PropModeReplace,
|
||||
(guchar *) &toplevel->focus_window, 1);
|
||||
|
||||
if (!window->focus_on_map)
|
||||
gdk_x11_window_set_user_time (window, 0);
|
||||
else if (GDK_X11_DISPLAY (screen_x11->display)->user_time != 0)
|
||||
gdk_x11_window_set_user_time (window, GDK_X11_DISPLAY (screen_x11->display)->user_time);
|
||||
else if (GDK_X11_DISPLAY (x11_screen->display)->user_time != 0)
|
||||
gdk_x11_window_set_user_time (window, GDK_X11_DISPLAY (x11_screen->display)->user_time);
|
||||
|
||||
ensure_sync_counter (window);
|
||||
}
|
||||
@ -687,7 +687,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
|
||||
gint attributes_mask)
|
||||
{
|
||||
GdkWindowImplX11 *impl;
|
||||
GdkScreenX11 *screen_x11;
|
||||
GdkX11Screen *x11_screen;
|
||||
GdkX11Display *display_x11;
|
||||
|
||||
Window xparent;
|
||||
@ -703,13 +703,13 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
|
||||
|
||||
display_x11 = GDK_X11_DISPLAY (display);
|
||||
xparent = GDK_WINDOW_XID (real_parent);
|
||||
screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
x11_screen = GDK_X11_SCREEN (screen);
|
||||
|
||||
impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
|
||||
window->impl = GDK_WINDOW_IMPL (impl);
|
||||
impl->wrapper = GDK_WINDOW (window);
|
||||
|
||||
xdisplay = screen_x11->xdisplay;
|
||||
xdisplay = x11_screen->xdisplay;
|
||||
|
||||
xattributes_mask = 0;
|
||||
|
||||
@ -748,9 +748,9 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
|
||||
{
|
||||
class = InputOutput;
|
||||
|
||||
xattributes.background_pixel = BlackPixel (xdisplay, screen_x11->screen_num);
|
||||
xattributes.background_pixel = BlackPixel (xdisplay, x11_screen->screen_num);
|
||||
|
||||
xattributes.border_pixel = BlackPixel (xdisplay, screen_x11->screen_num);
|
||||
xattributes.border_pixel = BlackPixel (xdisplay, x11_screen->screen_num);
|
||||
xattributes_mask |= CWBorderPixel | CWBackPixel;
|
||||
|
||||
if (window->guffaw_gravity)
|
||||
@ -797,7 +797,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
|
||||
xattributes_mask, &xattributes);
|
||||
|
||||
g_object_ref (window);
|
||||
_gdk_x11_display_add_window (screen_x11->display, &impl->xid, window);
|
||||
_gdk_x11_display_add_window (x11_screen->display, &impl->xid, window);
|
||||
|
||||
switch (GDK_WINDOW_TYPE (window))
|
||||
{
|
||||
|
@ -151,32 +151,32 @@ get_integer_default (Display *dpy,
|
||||
static void
|
||||
init_xft_settings (GdkScreen *screen)
|
||||
{
|
||||
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
|
||||
Display *xdisplay = GDK_SCREEN_XDISPLAY (screen);
|
||||
double dpi_double;
|
||||
|
||||
if (screen_x11->xft_init)
|
||||
if (x11_screen->xft_init)
|
||||
return;
|
||||
|
||||
screen_x11->xft_init = TRUE;
|
||||
x11_screen->xft_init = TRUE;
|
||||
|
||||
if (!get_boolean_default (xdisplay, "antialias", &screen_x11->xft_antialias))
|
||||
screen_x11->xft_antialias = TRUE;
|
||||
if (!get_boolean_default (xdisplay, "antialias", &x11_screen->xft_antialias))
|
||||
x11_screen->xft_antialias = TRUE;
|
||||
|
||||
if (!get_boolean_default (xdisplay, "hinting", &screen_x11->xft_hinting))
|
||||
screen_x11->xft_hinting = TRUE;
|
||||
if (!get_boolean_default (xdisplay, "hinting", &x11_screen->xft_hinting))
|
||||
x11_screen->xft_hinting = TRUE;
|
||||
|
||||
if (!get_integer_default (xdisplay, "hintstyle", &screen_x11->xft_hintstyle))
|
||||
screen_x11->xft_hintstyle = FC_HINT_FULL;
|
||||
if (!get_integer_default (xdisplay, "hintstyle", &x11_screen->xft_hintstyle))
|
||||
x11_screen->xft_hintstyle = FC_HINT_FULL;
|
||||
|
||||
if (!get_integer_default (xdisplay, "rgba", &screen_x11->xft_rgba))
|
||||
screen_x11->xft_rgba = FC_RGBA_UNKNOWN;
|
||||
if (!get_integer_default (xdisplay, "rgba", &x11_screen->xft_rgba))
|
||||
x11_screen->xft_rgba = FC_RGBA_UNKNOWN;
|
||||
|
||||
if (!get_double_default (xdisplay, "dpi", &dpi_double))
|
||||
dpi_double = (((double) DisplayHeight (xdisplay, screen_x11->screen_num) * 25.4) /
|
||||
(double) DisplayHeightMM (xdisplay, screen_x11->screen_num));
|
||||
dpi_double = (((double) DisplayHeight (xdisplay, x11_screen->screen_num) * 25.4) /
|
||||
(double) DisplayHeightMM (xdisplay, x11_screen->screen_num));
|
||||
|
||||
screen_x11->xft_dpi = (int)(0.5 + PANGO_SCALE * dpi_double);
|
||||
x11_screen->xft_dpi = (int)(0.5 + PANGO_SCALE * dpi_double);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -184,7 +184,7 @@ _gdk_x11_get_xft_setting (GdkScreen *screen,
|
||||
const gchar *name,
|
||||
GValue *value)
|
||||
{
|
||||
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
|
||||
|
||||
if (strncmp (name, "gtk-xft-", 8) != 0)
|
||||
return FALSE;
|
||||
@ -195,19 +195,19 @@ _gdk_x11_get_xft_setting (GdkScreen *screen,
|
||||
|
||||
if (strcmp (name, "antialias") == 0)
|
||||
{
|
||||
g_value_set_int (value, screen_x11->xft_antialias);
|
||||
g_value_set_int (value, x11_screen->xft_antialias);
|
||||
return TRUE;
|
||||
}
|
||||
else if (strcmp (name, "hinting") == 0)
|
||||
{
|
||||
g_value_set_int (value, screen_x11->xft_hinting);
|
||||
g_value_set_int (value, x11_screen->xft_hinting);
|
||||
return TRUE;
|
||||
}
|
||||
else if (strcmp (name, "hintstyle") == 0)
|
||||
{
|
||||
const char *str;
|
||||
|
||||
switch (screen_x11->xft_hintstyle)
|
||||
switch (x11_screen->xft_hintstyle)
|
||||
{
|
||||
case FC_HINT_NONE:
|
||||
str = "hintnone";
|
||||
@ -232,7 +232,7 @@ _gdk_x11_get_xft_setting (GdkScreen *screen,
|
||||
{
|
||||
const char *str;
|
||||
|
||||
switch (screen_x11->xft_rgba)
|
||||
switch (x11_screen->xft_rgba)
|
||||
{
|
||||
case FC_RGBA_NONE:
|
||||
str = "none";
|
||||
@ -259,7 +259,7 @@ _gdk_x11_get_xft_setting (GdkScreen *screen,
|
||||
}
|
||||
else if (strcmp (name, "dpi") == 0)
|
||||
{
|
||||
g_value_set_int (value, screen_x11->xft_dpi);
|
||||
g_value_set_int (value, x11_screen->xft_dpi);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user