Rename dsp -> display
This commit is contained in:
@@ -228,7 +228,7 @@ void draw_tree(Area *a)
|
||||
}
|
||||
|
||||
if (a->pix)
|
||||
XCopyArea(server.dsp, a->pix, ((Panel *)a->panel)->temp_pmap, server.gc, 0, 0, a->width, a->height, a->posx, a->posy);
|
||||
XCopyArea(server.display, a->pix, ((Panel *)a->panel)->temp_pmap, server.gc, 0, 0, a->width, a->height, a->posx, a->posy);
|
||||
|
||||
for (GList *l = a->children; l; l = l->next)
|
||||
draw_tree((Area *)l->data);
|
||||
@@ -329,13 +329,13 @@ void schedule_redraw(Area *a)
|
||||
|
||||
if (a->has_mouse_over_effect) {
|
||||
for (int i = 0; i < MOUSE_STATE_COUNT; i++) {
|
||||
XFreePixmap(server.dsp, a->pix_by_state[i]);
|
||||
XFreePixmap(server.display, a->pix_by_state[i]);
|
||||
if (a->pix == a->pix_by_state[i])
|
||||
a->pix = None;
|
||||
a->pix_by_state[i] = None;
|
||||
}
|
||||
if (a->pix) {
|
||||
XFreePixmap(server.dsp, a->pix);
|
||||
XFreePixmap(server.display, a->pix);
|
||||
a->pix = None;
|
||||
}
|
||||
}
|
||||
@@ -371,19 +371,19 @@ void show(Area *a)
|
||||
void draw(Area *a)
|
||||
{
|
||||
if (a->pix) {
|
||||
XFreePixmap(server.dsp, a->pix);
|
||||
XFreePixmap(server.display, a->pix);
|
||||
if (a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0] != a->pix)
|
||||
XFreePixmap(server.dsp, a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0]);
|
||||
XFreePixmap(server.display, a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0]);
|
||||
}
|
||||
a->pix = XCreatePixmap(server.dsp, server.root_win, a->width, a->height, server.depth);
|
||||
a->pix = XCreatePixmap(server.display, server.root_win, a->width, a->height, server.depth);
|
||||
a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0] = a->pix;
|
||||
|
||||
// Add layer of root pixmap (or clear pixmap if real_transparency==true)
|
||||
if (server.real_transparency)
|
||||
clear_pixmap(a->pix, 0, 0, a->width, a->height);
|
||||
XCopyArea(server.dsp, ((Panel *)a->panel)->temp_pmap, a->pix, server.gc, a->posx, a->posy, a->width, a->height, 0, 0);
|
||||
XCopyArea(server.display, ((Panel *)a->panel)->temp_pmap, a->pix, server.gc, a->posx, a->posy, a->width, a->height, 0, 0);
|
||||
|
||||
cairo_surface_t *cs = cairo_xlib_surface_create(server.dsp, a->pix, server.visual, a->width, a->height);
|
||||
cairo_surface_t *cs = cairo_xlib_surface_create(server.display, a->pix, server.visual, a->width, a->height);
|
||||
cairo_t *c = cairo_create(cs);
|
||||
|
||||
draw_background(a, c);
|
||||
@@ -502,14 +502,14 @@ void free_area(Area *a)
|
||||
a->children = NULL;
|
||||
}
|
||||
for (int i = 0; i < MOUSE_STATE_COUNT; i++) {
|
||||
XFreePixmap(server.dsp, a->pix_by_state[i]);
|
||||
XFreePixmap(server.display, a->pix_by_state[i]);
|
||||
if (a->pix == a->pix_by_state[i]) {
|
||||
a->pix = None;
|
||||
}
|
||||
a->pix_by_state[i] = None;
|
||||
}
|
||||
if (a->pix) {
|
||||
XFreePixmap(server.dsp, a->pix);
|
||||
XFreePixmap(server.display, a->pix);
|
||||
a->pix = None;
|
||||
}
|
||||
if (mouse_over_area == a) {
|
||||
|
||||
@@ -419,26 +419,26 @@ void render_image(Drawable d, int x, int y)
|
||||
|
||||
int w = imlib_image_get_width(), h = imlib_image_get_height();
|
||||
|
||||
Pixmap pixmap = XCreatePixmap(server.dsp, server.root_win, w, h, 32);
|
||||
Pixmap pixmap = XCreatePixmap(server.display, server.root_win, w, h, 32);
|
||||
imlib_context_set_drawable(pixmap);
|
||||
imlib_context_set_blend(0);
|
||||
imlib_render_image_on_drawable(0, 0);
|
||||
|
||||
Pixmap mask = XCreatePixmap(server.dsp, server.root_win, w, h, 32);
|
||||
Pixmap mask = XCreatePixmap(server.display, server.root_win, w, h, 32);
|
||||
imlib_context_set_drawable(mask);
|
||||
imlib_context_set_blend(0);
|
||||
imlib_render_image_on_drawable(0, 0);
|
||||
|
||||
Picture pict = XRenderCreatePicture(server.dsp, pixmap, XRenderFindStandardFormat(server.dsp, PictStandardARGB32), 0, 0);
|
||||
Picture pict_drawable = XRenderCreatePicture(server.dsp, d, XRenderFindVisualFormat(server.dsp, server.visual), 0, 0);
|
||||
Picture pict_mask = XRenderCreatePicture(server.dsp, mask, XRenderFindStandardFormat(server.dsp, PictStandardARGB32), 0, 0);
|
||||
XRenderComposite(server.dsp, PictOpOver, pict, pict_mask, pict_drawable, 0, 0, 0, 0, x, y, w, h);
|
||||
Picture pict = XRenderCreatePicture(server.display, pixmap, XRenderFindStandardFormat(server.display, PictStandardARGB32), 0, 0);
|
||||
Picture pict_drawable = XRenderCreatePicture(server.display, d, XRenderFindVisualFormat(server.display, server.visual), 0, 0);
|
||||
Picture pict_mask = XRenderCreatePicture(server.display, mask, XRenderFindStandardFormat(server.display, PictStandardARGB32), 0, 0);
|
||||
XRenderComposite(server.display, PictOpOver, pict, pict_mask, pict_drawable, 0, 0, 0, 0, x, y, w, h);
|
||||
|
||||
XRenderFreePicture(server.dsp, pict_mask);
|
||||
XRenderFreePicture(server.dsp, pict_drawable);
|
||||
XRenderFreePicture(server.dsp, pict);
|
||||
XFreePixmap(server.dsp, mask);
|
||||
XFreePixmap(server.dsp, pixmap);
|
||||
XRenderFreePicture(server.display, pict_mask);
|
||||
XRenderFreePicture(server.display, pict_drawable);
|
||||
XRenderFreePicture(server.display, pict);
|
||||
XFreePixmap(server.display, mask);
|
||||
XFreePixmap(server.display, pixmap);
|
||||
}
|
||||
|
||||
void draw_text(PangoLayout *layout, cairo_t *c, int posx, int posy, Color *color, int font_shadow)
|
||||
@@ -557,11 +557,11 @@ void draw_rect(cairo_t *c, double x, double y, double w, double h, double r)
|
||||
|
||||
void clear_pixmap(Pixmap p, int x, int y, int w, int h)
|
||||
{
|
||||
Picture pict = XRenderCreatePicture(server.dsp, p, XRenderFindVisualFormat(server.dsp, server.visual), 0, 0);
|
||||
Picture pict = XRenderCreatePicture(server.display, p, XRenderFindVisualFormat(server.display, server.visual), 0, 0);
|
||||
XRenderColor col;
|
||||
col.red = col.green = col.blue = col.alpha = 0;
|
||||
XRenderFillRectangle(server.dsp, PictOpSrc, pict, &col, x, y, w, h);
|
||||
XRenderFreePicture(server.dsp, pict);
|
||||
XRenderFillRectangle(server.display, PictOpSrc, pict, &col, x, y, w, h);
|
||||
XRenderFreePicture(server.display, pict);
|
||||
}
|
||||
|
||||
void get_text_size2(PangoFontDescription *font,
|
||||
@@ -578,9 +578,9 @@ void get_text_size2(PangoFontDescription *font,
|
||||
{
|
||||
PangoRectangle rect_ink, rect;
|
||||
|
||||
Pixmap pmap = XCreatePixmap(server.dsp, server.root_win, panel_height, panel_width, server.depth);
|
||||
Pixmap pmap = XCreatePixmap(server.display, server.root_win, panel_height, panel_width, server.depth);
|
||||
|
||||
cairo_surface_t *cs = cairo_xlib_surface_create(server.dsp, pmap, server.visual, panel_height, panel_width);
|
||||
cairo_surface_t *cs = cairo_xlib_surface_create(server.display, pmap, server.visual, panel_height, panel_width);
|
||||
cairo_t *c = cairo_create(cs);
|
||||
|
||||
PangoLayout *layout = pango_cairo_create_layout(c);
|
||||
@@ -603,7 +603,7 @@ void get_text_size2(PangoFontDescription *font,
|
||||
g_object_unref(layout);
|
||||
cairo_destroy(c);
|
||||
cairo_surface_destroy(cs);
|
||||
XFreePixmap(server.dsp, pmap);
|
||||
XFreePixmap(server.display, pmap);
|
||||
}
|
||||
|
||||
#if !GLIB_CHECK_VERSION (2, 33, 4)
|
||||
|
||||
@@ -74,7 +74,7 @@ gboolean window_is_hidden(Window win)
|
||||
}
|
||||
// do not add transient_for windows if the transient window is already in the taskbar
|
||||
window = win;
|
||||
while (XGetTransientForHint(server.dsp, window, &window)) {
|
||||
while (XGetTransientForHint(server.display, window, &window)) {
|
||||
if (task_get_tasks(window)) {
|
||||
XFree(at);
|
||||
return TRUE;
|
||||
@@ -162,7 +162,7 @@ int get_window_monitor(Window win)
|
||||
int i, x, y;
|
||||
Window src;
|
||||
|
||||
XTranslateCoordinates(server.dsp, win, server.root_win, 0, 0, &x, &y, &src);
|
||||
XTranslateCoordinates(server.display, win, server.root_win, 0, 0, &x, &y, &src);
|
||||
int best_match = -1;
|
||||
int match_right = 0;
|
||||
int match_bottom = 0;
|
||||
@@ -190,8 +190,8 @@ void get_window_coordinates(Window win, int *x, int *y, int *w, int *h)
|
||||
int dummy_int;
|
||||
unsigned ww, wh, bw, bh;
|
||||
Window src;
|
||||
XTranslateCoordinates(server.dsp, win, server.root_win, 0, 0, x, y, &src);
|
||||
XGetGeometry(server.dsp, win, &src, &dummy_int, &dummy_int, &ww, &wh, &bw, &bh);
|
||||
XTranslateCoordinates(server.display, win, server.root_win, 0, 0, x, y, &src);
|
||||
XGetGeometry(server.display, win, &src, &dummy_int, &dummy_int, &ww, &wh, &bw, &bh);
|
||||
*w = ww + bw;
|
||||
*h = wh + bh;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user