if (fix_screen || old_height == 0)
scr_reset ();
+ // TODO, with nvidia-8178, resizes kill the alpha channel, report if not fixed in newer version
+ //scr_touch (false);
+
#ifdef XPM_BACKGROUND
if (pixmap)
scr_touch (false);
void vt_select_input () const NOTHROW
{
- XSelectInput (xdisp, vt, vt_emask | vt_emask_perl | vt_emask_xim);
+ XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim);
}
#if TRANSPARENT
#define NUM_EXTENT_TEST_CHARS (sizeof (extent_test_chars) / sizeof (extent_test_chars[0]))
-#define dTermDisplay Display *disp = term->xdisp
+#define dTermDisplay Display *disp = term->dpy
#define dTermGC GC gc = term->gc
/////////////////////////////////////////////////////////////////////////////
rxvt_drawable::operator XftDraw *()
{
if (!xftdrawable)
- xftdrawable = XftDrawCreate (screen->xdisp, drawable, screen->visual, screen->cmap);
+ xftdrawable = XftDrawCreate (screen->dpy, drawable, screen->visual, screen->cmap);
return xftdrawable;
}
unsigned long value;
if (XGetFontProperty (f, property, &value))
- return XGetAtomName (term->xdisp, value);
+ return XGetAtomName (term->dpy, value);
else
return rxvt_strdup (repl);
}
unsigned long height;
#if 0
- if (!XGetFontProperty (f, XInternAtom (term->xdisp, "PIXEL_SIZE", 0), &height))
+ if (!XGetFontProperty (f, XInternAtom (term->dpy, "PIXEL_SIZE", 0), &height))
return false;
#else
height = f->ascent + f->descent;
{
if (f)
{
- XFreeFont (term->xdisp, f);
+ XFreeFont (term->dpy, f);
f = 0;
}
}
{
if (f)
{
- XftFontClose (term->xdisp, f);
+ XftFontClose (term->dpy, f);
f = 0;
}
}
{
careful = false;
- if (!XftCharExists (term->xdisp, f, unicode))
+ if (!XftCharExists (term->dpy, f, unicode))
return false;
if (!prop || prop->width == rxvt_fontprop::unset)
// check character against base font bounding box
FcChar32 ch = unicode;
XGlyphInfo g;
- XftTextExtents32 (term->xdisp, f, &ch, 1, &g);
+ XftTextExtents32 (term->dpy, f, &ch, 1, &g);
int w = g.width - g.x;
int wcw = max (WCWIDTH (unicode), 1);
//FcPatternAddBool (p, FC_ANTIALIAS, 1);
XftResult result;
- FcPattern *match = XftFontMatch (term->xdisp, term->display->screen, p, &result);
+ FcPattern *match = XftFontMatch (term->dpy, term->display->screen, p, &result);
FcPatternDestroy (p);
{
display = GET_R->display; //HACK: TODO
- xim = XOpenIM (display->display, 0, 0, 0);
+ xim = XOpenIM (display->dpy, 0, 0, 0);
if (!xim)
return false;
rxvt_screen::set (rxvt_display *disp)
{
display = disp;
- xdisp = disp->display;
+ dpy = disp->dpy;
- Screen *screen = ScreenOfDisplay (xdisp, disp->screen);
+ Screen *screen = ScreenOfDisplay (dpy, disp->screen);
depth = DefaultDepthOfScreen (screen);
visual = DefaultVisualOfScreen (screen);
#if XFT
XVisualInfo vinfo;
- if (XMatchVisualInfo (xdisp, display->screen, bitdepth, TrueColor, &vinfo))
+ if (XMatchVisualInfo (dpy, display->screen, bitdepth, TrueColor, &vinfo))
{
depth = bitdepth;
visual = vinfo.visual;
- cmap = XCreateColormap (xdisp, disp->root, visual, AllocNone);
+ cmap = XCreateColormap (dpy, disp->root, visual, AllocNone);
}
#endif
}
void
rxvt_screen::clear ()
{
- if (cmap != DefaultColormapOfScreen (ScreenOfDisplay (xdisp, display->screen)))
- XFreeColormap (xdisp, cmap);
+ if (cmap != DefaultColormapOfScreen (ScreenOfDisplay (dpy, display->screen)))
+ XFreeColormap (dpy, cmap);
}
/////////////////////////////////////////////////////////////////////////////
char *val = 0;
#if XLIB_ILLEGAL_ACCESS
- if (display->xdefaults)
- XFree (display->xdefaults);
+ if (dpy->xdefaults)
+ XFree (dpy->xdefaults);
#endif
- if (XGetWindowProperty (display, root, XA_RESOURCE_MANAGER,
+ if (XGetWindowProperty (dpy, root, XA_RESOURCE_MANAGER,
0L, 100000000L, False,
XA_STRING, &actual_type, &actual_format,
&nitems, &nremaining,
}
#if XLIB_ILLEGAL_ACCESS
- display->xdefaults = displayResource;
+ dpy->xdefaults = displayResource;
#endif
}
else
- displayResource = XResourceManagerString (display);
+ displayResource = XResourceManagerString (dpy);
if (displayResource)
{
#endif
/* Get screen specific resources */
- displayResource = XScreenResourceString (ScreenOfDisplay (display, screen));
+ displayResource = XScreenResourceString (ScreenOfDisplay (dpy, screen));
if (displayResource)
{
val = rxvt_malloc (5 + strlen (id) + 1);
strcpy (val, "unix/");
strcat (val, id);
- display = XOpenDisplay (val);
+ dpy = XOpenDisplay (val);
free (val);
}
else
#endif
- display = 0;
+ dpy = 0;
- if (!display)
- display = XOpenDisplay (id);
+ if (!dpy)
+ dpy = XOpenDisplay (id);
- if (!display)
+ if (!dpy)
return false;
- screen = DefaultScreen (display);
- root = DefaultRootWindow (display);
+ screen = DefaultScreen (dpy);
+ root = DefaultRootWindow (dpy);
assert (sizeof (xa_names) / sizeof (char *) == NUM_XA);
- XInternAtoms (display, (char **)xa_names, NUM_XA, False, xa);
+ XInternAtoms (dpy, (char **)xa_names, NUM_XA, False, xa);
- XrmSetDatabase (display, get_resources (false));
+ XrmSetDatabase (dpy, get_resources (false));
#ifdef POINTER_BLANK
XColor blackcolour;
blackcolour.red = 0;
blackcolour.green = 0;
blackcolour.blue = 0;
- Font f = XLoadFont (display, "fixed");
- blank_cursor = XCreateGlyphCursor (display, f, f, ' ', ' ',
+ Font f = XLoadFont (dpy, "fixed");
+ blank_cursor = XCreateGlyphCursor (dpy, f, f, ' ', ' ',
&blackcolour, &blackcolour);
- XUnloadFont (display, f);
+ XUnloadFont (dpy, f);
#endif
- int fd = XConnectionNumber (display);
+ int fd = XConnectionNumber (dpy);
#ifndef NO_SLOW_LINK_SUPPORT
// try to detect wether we have a local connection.
x_ev.start (fd, EVENT_READ);
fcntl (fd, F_SETFD, FD_CLOEXEC);
- XSelectInput (display, root, PropertyChangeMask);
+ XSelectInput (dpy, root, PropertyChangeMask);
flush ();
{
// TODO: somehow check wether the database files/resources changed
// before affording re-loading/parsing
- XrmDestroyDatabase (XrmGetDatabase (display));
- XrmSetDatabase (display, get_resources (true));
+ XrmDestroyDatabase (XrmGetDatabase (dpy));
+ XrmSetDatabase (dpy, get_resources (true));
}
rxvt_display::~rxvt_display ()
{
- if (!display)
+ if (!dpy)
return;
#ifdef POINTER_BLANK
- XFreeCursor (display, blank_cursor);
+ XFreeCursor (dpy, blank_cursor);
#endif
x_ev.stop ();
#ifdef USE_XIM
xims.clear ();
#endif
- XCloseDisplay (display);
+ XCloseDisplay (dpy);
}
#ifdef USE_XIM
int actual_format;
unsigned long nitems, bytes_after;
- if (XGetWindowProperty (display, root, xa[XA_XIM_SERVERS], 0L, 1000000L,
+ if (XGetWindowProperty (dpy, root, xa[XA_XIM_SERVERS], 0L, 1000000L,
False, XA_ATOM, &actual_type, &actual_format,
&nitems, &bytes_after, (unsigned char **)&atoms)
!= Success )
if (actual_type == XA_ATOM && actual_format == 32)
for (int i = 0; i < nitems; i++)
- if (XGetSelectionOwner (display, atoms[i]))
+ if (XGetSelectionOwner (dpy, atoms[i]))
{
im_change_cb ();
break;
do
{
XEvent xev;
- XNextEvent (display, &xev);
+ XNextEvent (dpy, &xev);
#ifdef USE_XIM
if (!XFilterEvent (&xev, None))
}
#endif
}
- while (XEventsQueued (display, QueuedAlready));
+ while (XEventsQueued (dpy, QueuedAlready));
- XFlush (display);
+ XFlush (dpy);
}
void rxvt_display::flush ()
{
- if (XEventsQueued (display, QueuedAlready))
+ if (XEventsQueued (dpy, QueuedAlready))
x_cb (x_ev, EVENT_READ);
- XFlush (display);
+ XFlush (dpy);
}
void rxvt_display::reg (xevent_watcher *w)
Atom rxvt_display::atom (const char *name)
{
- return XInternAtom (display, name, False);
+ return XInternAtom (dpy, name, False);
}
/////////////////////////////////////////////////////////////////////////////
// Transparency users should eat shit and die, and then
// XRenderQueryPictIndexValues themselves plenty.
if ((screen->visual->c_class == TrueColor)
- && (format = XRenderFindVisualFormat (screen->xdisp, screen->visual)))
+ && (format = XRenderFindVisualFormat (screen->dpy, screen->visual)))
{
// the fun lies in doing everything manually...
c.color.red = color.r;
d.blue = color.b;
d.alpha = color.a;
- return XftColorAllocValue (screen->xdisp, screen->visual, screen->cmap, &d, &c);
+ return XftColorAllocValue (screen->dpy, screen->visual, screen->cmap, &d, &c);
}
#else
c.red = color.r;
return true;
}
- else if (XAllocColor (screen->xdisp, screen->cmap, &c))
+ else if (XAllocColor (screen->dpy, screen->cmap, &c))
return true;
else
c.pixel = (color.r + color.g + color.b) > 128*3
- ? WhitePixelOfScreen (DefaultScreenOfDisplay (screen->xdisp))
- : BlackPixelOfScreen (DefaultScreenOfDisplay (screen->xdisp));
+ ? WhitePixelOfScreen (DefaultScreenOfDisplay (screen->dpy))
+ : BlackPixelOfScreen (DefaultScreenOfDisplay (screen->dpy));
#endif
return false;
{
XColor xc, xc_exact;
- if (XParseColor (screen->xdisp, screen->cmap, name, &xc))
+ if (XParseColor (screen->dpy, screen->cmap, name, &xc))
{
c.r = xc.red;
c.g = xc.green;
// many kilobytes transfer per colour, but pseudocolor isn't worth
// many extra optimisations.
- XQueryColors (screen->xdisp, screen->cmap, colors, cmap_size);
+ XQueryColors (screen->dpy, screen->cmap, colors, cmap_size);
int diff = 0x7fffffffUL;
XColor *best = colors;
rxvt_color::free (rxvt_screen *screen)
{
#if XFT
- XftColorFree (screen->xdisp, screen->visual, screen->cmap, &c);
+ XftColorFree (screen->dpy, screen->visual, screen->cmap, &c);
#else
- XFreeColors (screen->xdisp, screen->cmap, &c.pixel, 1, AllPlanes);
+ XFreeColors (screen->dpy, screen->cmap, &c.pixel, 1, AllPlanes);
#endif
}
struct rxvt_screen {
rxvt_display *display;
- Display *xdisp;
+ Display *dpy;
int depth;
Visual *visual;
Colormap cmap;
#endif
//public
- Display *display;
+ Display *dpy;
int screen;
Window root;
rxvt_term *selection_owner;
#define CLEAR_ROWS(row, num) \
if (mapped) \
- XClearArea (xdisp, drawBuffer, 0, \
+ XClearArea (dpy, drawBuffer, 0, \
Row2Pixel (row), (unsigned int)width, \
(unsigned int)Height2Pixel (num), False)
#define CLEAR_CHARS(x, y, num) \
if (mapped) \
- XClearArea (xdisp, drawBuffer, x, y, \
+ XClearArea (dpy, drawBuffer, x, y, \
(unsigned int)Width2Pixel (num), \
(unsigned int)Height2Pixel (1), False)
#define ERASE_ROWS(row, num) \
- XFillRectangle (xdisp, drawBuffer, gc, \
+ XFillRectangle (dpy, drawBuffer, gc, \
0, Row2Pixel (row), \
(unsigned int)width, \
(unsigned int)Height2Pixel (num))
{
ren = rstyle & (RS_fgMask | RS_bgMask);
gcvalue.foreground = pix_colors[bgcolor_of (rstyle)];
- XChangeGC (xdisp, gc, GCForeground, &gcvalue);
+ XChangeGC (dpy, gc, GCForeground, &gcvalue);
ERASE_ROWS (row, num);
gcvalue.foreground = pix_colors[Color_fg];
- XChangeGC (xdisp, gc, GCForeground, &gcvalue);
+ XChangeGC (dpy, gc, GCForeground, &gcvalue);
}
for (; num--; row++)
#if TRANSPARENT
if (!OPTION (Opt_transparent) || am_transparent == 0)
#endif
- XSetWindowBackground (xdisp, vt, pix_colors[Color_bg]);
+ XSetWindowBackground (dpy, vt, pix_colors[Color_bg]);
XGCValues gcvalue;
gcvalue.foreground = pix_colors[Color_fg];
gcvalue.background = pix_colors[Color_bg];
- XChangeGC (xdisp, gc, GCBackground | GCForeground, &gcvalue);
+ XChangeGC (dpy, gc, GCBackground | GCForeground, &gcvalue);
scr_clear ();
scr_touch (true);
# ifdef MAPALERT_OPTION
if (OPTION (Opt_mapAlert))
# endif
- XMapWindow (xdisp, parent[0]);
+ XMapWindow (dpy, parent[0]);
# endif
if (OPTION (Opt_visualBell))
bell_ev.start (NOW + VISUAL_BELL_DURATION);
}
else
- XBell (xdisp, 0);
+ XBell (dpy, 0);
#endif
}
if (wlen < len)
::swap (wlen, len);
- XCopyArea (xdisp, vt, vt,
+ XCopyArea (dpy, vt, vt,
gc, 0, Row2Pixel (len + i),
(unsigned int)this->width,
(unsigned int)Height2Pixel (wlen - len + 1),
{
#if ENABLE_FRILLS
if (ISSET_PIXCOLOR (Color_underline))
- XSetForeground (xdisp, gc, pix_colors[Color_underline]);
+ XSetForeground (dpy, gc, pix_colors[Color_underline]);
else
#endif
- XSetForeground (xdisp, gc, pix_colors[fore]);
+ XSetForeground (dpy, gc, pix_colors[fore]);
- XDrawLine (xdisp, drawBuffer, gc,
+ XDrawLine (dpy, drawBuffer, gc,
xpixel, ypixel + font->ascent + 1,
xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1);
}
#ifndef NO_CURSORCOLOR
if (ISSET_PIXCOLOR (Color_cursor))
- XSetForeground (xdisp, gc, pix_colors[Color_cursor]);
+ XSetForeground (dpy, gc, pix_colors[Color_cursor]);
#endif
- XDrawRectangle (xdisp, drawBuffer, gc,
+ XDrawRectangle (dpy, drawBuffer, gc,
Col2Pixel (col),
Row2Pixel (oldcursor.row),
(unsigned int) (Width2Pixel (cursorwidth) - 1),
#endif
)
{
- XSetWindowBackground (xdisp, parent[0], pix_colors[Color_border]);
- XClearWindow (xdisp, parent[0]);
- XSetWindowBackground (xdisp, vt, pix_colors[Color_bg]);
+ XSetWindowBackground (dpy, parent[0], pix_colors[Color_border]);
+ XClearWindow (dpy, parent[0]);
+ XSetWindowBackground (dpy, vt, pix_colors[Color_bg]);
#if HAVE_SCROLLBARS
if (scrollBar.win)
{
- XSetWindowBackground (xdisp, scrollBar.win, pix_colors[Color_border]);
+ XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]);
scrollBar.setIdle ();
scrollbar_show (0);
}
want_refresh = 1;
if (really)
- XClearWindow (xdisp, vt);
+ XClearWindow (dpy, vt);
}
void
unsigned long bytes_after;
XTextProperty ct;
- if (XGetWindowProperty (xdisp, win, prop,
+ if (XGetWindowProperty (dpy, win, prop,
0, PROP_SIZE / 4,
delete_prop, AnyPropertyType,
&ct.encoding, &ct.format,
// fetch and append remaining data
XTextProperty ct2;
- if (XGetWindowProperty (xdisp, win, prop,
+ if (XGetWindowProperty (dpy, win, prop,
ct.nitems / 4, (bytes_after + 3) / 4,
delete_prop, AnyPropertyType,
&ct2.encoding, &ct2.format,
{
// INCR selection, start handshake
if (!delete_prop)
- XDeleteProperty (xdisp, win, prop);
+ XDeleteProperty (dpy, win, prop);
selection_wait = Sel_incr;
incr_buf_fill = 0;
}
else
#endif
- if (XmbTextPropertyToTextList (xdisp, &ct, &cl, &cr) >= 0
+ if (XmbTextPropertyToTextList (dpy, &ct, &cl, &cr) >= 0
&& cl)
{
for (int i = 0; i < cr; i++)
else
sel = xa[XA_CLIPBOARD];
- if (XGetSelectionOwner (xdisp, sel) != None)
+ if (XGetSelectionOwner (dpy, sel) != None)
{
- XConvertSelection (xdisp, sel, target, xa[XA_VT_SELECTION],
+ XConvertSelection (dpy, sel, target, xa[XA_VT_SELECTION],
vt, selection_request_time);
return 1;
}
{
selection_time = tm;
- XSetSelectionOwner (xdisp, XA_PRIMARY, vt, tm);
- if (XGetSelectionOwner (xdisp, XA_PRIMARY) == vt)
+ XSetSelectionOwner (dpy, XA_PRIMARY, vt, tm);
+ if (XGetSelectionOwner (dpy, XA_PRIMARY) == vt)
{
display->set_selection_owner (this);
return true;
#if 0
XTextProperty ct;
- if (XwcTextListToTextProperty (xdisp, &selection.text, 1, XStringStyle, &ct) >= 0)
+ if (XwcTextListToTextProperty (dpy, &selection.text, 1, XStringStyle, &ct) >= 0)
{
set_string_property (XA_CUT_BUFFER0, ct.value, ct.nitems);
XFree (ct.value);
*target++ = xa[XA_UTF8_STRING];
#endif
- XChangeProperty (xdisp, rq.requestor, rq.property, XA_ATOM,
+ XChangeProperty (dpy, rq.requestor, rq.property, XA_ATOM,
32, PropModeReplace,
(unsigned char *)target_list, target - target_list);
ev.property = rq.property;
#endif
else if (rq.target == xa[XA_TIMESTAMP] && selection.text)
{
- XChangeProperty (xdisp, rq.requestor, rq.property, rq.target,
+ XChangeProperty (dpy, rq.requestor, rq.property, rq.target,
32, PropModeReplace, (unsigned char *)&selection_time, 1);
ev.property = rq.property;
}
}
else
#endif
- if (XwcTextListToTextProperty (xdisp, &cl, 1, (XICCEncodingStyle) style, &ct) >= 0)
+ if (XwcTextListToTextProperty (dpy, &cl, 1, (XICCEncodingStyle) style, &ct) >= 0)
freect = 1;
else
{
ct.encoding = target;
}
- XChangeProperty (xdisp, rq.requestor, rq.property,
+ XChangeProperty (dpy, rq.requestor, rq.property,
ct.encoding, 8, PropModeReplace,
ct.value, (int)ct.nitems);
ev.property = rq.property;
XFree (ct.value);
}
- XSendEvent (xdisp, rq.requestor, False, 0L, (XEvent *)&ev);
+ XSendEvent (dpy, rq.requestor, False, 0L, (XEvent *)&ev);
}
\f
/* ------------------------------------------------------------------------- *
{
XWindowAttributes xwa;
- XGetWindowAttributes (xdisp, vt, &xwa);
+ XGetWindowAttributes (dpy, vt, &xwa);
pos.x = xwa.x + Col2Pixel (screen.cur.col);
pos.y = xwa.y + Height2Pixel (screen.cur.row) + fbase;
Pixmap d;
GC pointcolour;
- d = XCreatePixmap (xdisp, scrollBar.win, width, height, depth);
+ d = XCreatePixmap (dpy, scrollBar.win, width, height, depth);
for (y = 0; y < height; y++)
{
else /* if (a == '#' || a == 'b' || a) */
pointcolour = blackGC;
- XDrawPoint (xdisp, d, pointcolour, x, y);
+ XDrawPoint (dpy, d, pointcolour, x, y);
}
}
return d;
gcvalue.graphics_exposures = False;
gcvalue.foreground = pix_colors_focused[Color_Black];
- blackGC = XCreateGC (xdisp, scrollBar.win,
+ blackGC = XCreateGC (dpy, scrollBar.win,
GCForeground | GCGraphicsExposures, &gcvalue);
gcvalue.foreground = pix_colors_focused[Color_White];
- whiteGC = XCreateGC (xdisp, scrollBar.win,
+ whiteGC = XCreateGC (dpy, scrollBar.win,
GCForeground | GCGraphicsExposures, &gcvalue);
xcol.red = 0xaeba;
xcol.blue = 0xaeba;
xcol.pixel = pix_colors_focused[Color_scroll];
light = gcvalue.foreground = xcol.pixel;
- grayGC = XCreateGC (xdisp, scrollBar.win,
+ grayGC = XCreateGC (dpy, scrollBar.win,
GCForeground | GCGraphicsExposures, &gcvalue);
xcol.red = 0x51aa;
//if (!rXAllocColor (&xcol, "dark gray"))//TODO//D//
xcol.pixel = pix_colors_focused[Color_Grey25];
dark = gcvalue.foreground = xcol.pixel;
- darkGC = XCreateGC (xdisp, scrollBar.win,
+ darkGC = XCreateGC (dpy, scrollBar.win,
GCForeground | GCGraphicsExposures, &gcvalue);
- stipple = XCreateBitmapFromData (xdisp, scrollBar.win,
+ stipple = XCreateBitmapFromData (dpy, scrollBar.win,
(char *)n_stp_bits, n_stp_width,
n_stp_height);
gcvalue.fill_style = FillOpaqueStippled;
gcvalue.stipple = stipple;
- /* XSetWindowBackground (xdisp, scrollBar.win, pix_colors_focused[Color_Red]); */
+ /* XSetWindowBackground (dpy, scrollBar.win, pix_colors_focused[Color_Red]); */
- stippleGC = XCreateGC (xdisp, scrollBar.win,
+ stippleGC = XCreateGC (dpy, scrollBar.win,
GCForeground | GCBackground | GCStipple
| GCFillStyle | GCGraphicsExposures, &gcvalue);
x2 = x1 + w - 1; /* right point */
y2 = y1 + h - 1; /* bottom point */
/* white top and left */
- XDrawLine (xdisp, d, whiteGC, x1, y1, x2, y1);
- XDrawLine (xdisp, d, whiteGC, x1, y1, x1, y2);
+ XDrawLine (dpy, d, whiteGC, x1, y1, x2, y1);
+ XDrawLine (dpy, d, whiteGC, x1, y1, x1, y2);
/* black bottom and right */
- XDrawLine (xdisp, d, blackGC, x1, y2, x2, y2);
- XDrawLine (xdisp, d, blackGC, x2, y1, x2, y2);
+ XDrawLine (dpy, d, blackGC, x1, y2, x2, y2);
+ XDrawLine (dpy, d, blackGC, x2, y1, x2, y2);
/* dark inside bottom and right */
x1++, y1++, x2--, y2--; /* move in one point */
- XDrawLine (xdisp, d, darkGC, x1, y2, x2, y2);
- XDrawLine (xdisp, d, darkGC, x2, y1, x2, y2);
+ XDrawLine (dpy, d, darkGC, x1, y2, x2, y2);
+ XDrawLine (dpy, d, darkGC, x2, y1, x2, y2);
}
int
if (top_row == 0 || !update)
{
- XFillRectangle (xdisp, scrollBar.win, grayGC, 0, 0,
+ XFillRectangle (dpy, scrollBar.win, grayGC, 0, 0,
SB_WIDTH_NEXT + 1, height);
- XDrawRectangle (xdisp, scrollBar.win, blackGC, 0,
+ XDrawRectangle (dpy, scrollBar.win, blackGC, 0,
-SB_BORDER_WIDTH, SB_WIDTH_NEXT,
height + SB_BORDER_WIDTH);
- XFillRectangle (xdisp, scrollBar.win, stippleGC,
+ XFillRectangle (dpy, scrollBar.win, stippleGC,
SB_LEFT_PADDING, 0, SB_BUTTON_WIDTH, height);
}
if (top_row)
{
if (last_top < scrollBar.top || !update)
- XFillRectangle (xdisp, scrollBar.win, stippleGC,
+ XFillRectangle (dpy, scrollBar.win, stippleGC,
SB_LEFT_PADDING, SB_PADDING + last_top,
SB_BUTTON_WIDTH, scrollBar.top - last_top);
if (scrollBar.bot < last_bot || !update)
- XFillRectangle (xdisp, scrollBar.win, stippleGC,
+ XFillRectangle (dpy, scrollBar.win, stippleGC,
SB_LEFT_PADDING, scrollBar.bot + SB_PADDING,
SB_BUTTON_WIDTH, (last_bot - scrollBar.bot));
- XFillRectangle (xdisp, scrollBar.win, grayGC,
+ XFillRectangle (dpy, scrollBar.win, grayGC,
SB_LEFT_PADDING, scrollBar.top + SB_PADDING,
SB_BUTTON_WIDTH, scrollbar_len);
- XCopyArea (xdisp, dimple, scrollBar.win, whiteGC, 0, 0,
+ XCopyArea (dpy, dimple, scrollBar.win, whiteGC, 0, 0,
SCROLLER_DIMPLE_WIDTH, SCROLLER_DIMPLE_HEIGHT,
(SB_WIDTH_NEXT - SCROLLER_DIMPLE_WIDTH) / 2,
scrollBar.top + SB_BEVEL_WIDTH_UPPER_LEFT +
SB_BUTTON_HEIGHT);
s = (scrollbar_isUp ()) ? upArrowHi : upArrow;
- XCopyArea (xdisp, s, scrollBar.win, whiteGC, 0, 0,
+ XCopyArea (dpy, s, scrollBar.win, whiteGC, 0, 0,
ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X,
height - SB_BUTTON_BOTH_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT);
s = (scrollbar_isDn ()) ? downArrowHi : downArrow;
- XCopyArea (xdisp, s, scrollBar.win, whiteGC, 0, 0,
+ XCopyArea (dpy, s, scrollBar.win, whiteGC, 0, 0,
ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X,
height - SB_BUTTON_SINGLE_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT);
}
scrollBar.init |= R_SB_PLAIN;
gcvalue.foreground = pix_colors_focused[Color_scroll];
- pscrollbarGC = XCreateGC (xdisp, scrollBar.win, GCForeground, &gcvalue);
+ pscrollbarGC = XCreateGC (dpy, scrollBar.win, GCForeground, &gcvalue);
}
xsb = OPTION (Opt_scrollBar_right) ? 1 : 0;
if (update)
{
if (last_top < scrollBar.top)
- XClearArea (xdisp, scrollBar.win,
+ XClearArea (dpy, scrollBar.win,
sb_shadow, last_top,
sbwidth + 1, scrollBar.top - last_top, False);
if (scrollBar.bot < last_bot)
- XClearArea (xdisp, scrollBar.win,
+ XClearArea (dpy, scrollBar.win,
sb_shadow, scrollBar.bot,
sbwidth + 1, last_bot - scrollBar.bot, False);
}
else
- XClearWindow (xdisp, scrollBar.win);
+ XClearWindow (dpy, scrollBar.win);
/* scrollbar slider */
- XFillRectangle (xdisp, scrollBar.win, pscrollbarGC,
+ XFillRectangle (dpy, scrollBar.win, pscrollbarGC,
1 - xsb, scrollBar.top, sbwidth, scrollbar_len);
return 1;
for (; shadow-- > 0; x++, y++, w--, h--)
{
- XDrawLine (term->xdisp, term->scrollBar.win, term->topShadowGC, x, y, w , y );
- XDrawLine (term->xdisp, term->scrollBar.win, term->topShadowGC, x, y, x , h );
- XDrawLine (term->xdisp, term->scrollBar.win, term->botShadowGC, w, h, w , y + 1);
- XDrawLine (term->xdisp, term->scrollBar.win, term->botShadowGC, w, h, x + 1, h );
+ XDrawLine (term->dpy, term->scrollBar.win, term->topShadowGC, x, y, w , y );
+ XDrawLine (term->dpy, term->scrollBar.win, term->topShadowGC, x, y, x , h );
+ XDrawLine (term->dpy, term->scrollBar.win, term->botShadowGC, w, h, w , y + 1);
+ XDrawLine (term->dpy, term->scrollBar.win, term->botShadowGC, w, h, x + 1, h );
}
}
pt[2].y = y + sz - 1;
}
- XFillPolygon (term->xdisp, term->scrollBar.win, term->scrollbarGC,
+ XFillPolygon (term->dpy, term->scrollBar.win, term->scrollbarGC,
pt, 3, Convex, CoordModeOrigin);
/* draw base */
- XDrawLine (term->xdisp, term->scrollBar.win, (dirn == UP ? bot : top),
+ XDrawLine (term->dpy, term->scrollBar.win, (dirn == UP ? bot : top),
pt[0].x, pt[0].y, pt[1].x, pt[1].y);
/* draw shadow on left */
pt[1].x = x + sz2 - 1;
pt[1].y = y + (dirn == UP ? 0 : sz - 1);
- XDrawLine (term->xdisp, term->scrollBar.win, top,
+ XDrawLine (term->dpy, term->scrollBar.win, top,
pt[0].x, pt[0].y, pt[1].x, pt[1].y);
#if SHADOW_WIDTH > 1
pt[1].y--;
}
- XDrawLine (term->xdisp, term->scrollBar.win, top,
+ XDrawLine (term->dpy, term->scrollBar.win, top,
pt[0].x, pt[0].y, pt[1].x, pt[1].y);
#endif
/* pt[2].x = x + sz2; */
pt[1].y = y + (dirn == UP ? sz - 1 : 0);
pt[2].y = y + (dirn == UP ? 0 : sz - 1);
- XDrawLine (term->xdisp, term->scrollBar.win, bot,
+ XDrawLine (term->dpy, term->scrollBar.win, bot,
pt[2].x, pt[2].y, pt[1].x, pt[1].y);
#if SHADOW_WIDTH > 1
pt[1].y++;
}
- XDrawLine (term->xdisp, term->scrollBar.win, bot,
+ XDrawLine (term->dpy, term->scrollBar.win, bot,
pt[2].x, pt[2].y, pt[1].x, pt[1].y);
#endif
}
if (sbshadow)
{
- XSetWindowBackground (xdisp, scrollBar.win, pix_colors_focused[Color_trough]);
- XClearWindow (xdisp, scrollBar.win);
+ XSetWindowBackground (dpy, scrollBar.win, pix_colors_focused[Color_trough]);
+ XClearWindow (dpy, scrollBar.win);
}
}
else
if (update)
{
if (last_top < scrollBar.top)
- XClearArea (xdisp, scrollBar.win,
+ XClearArea (dpy, scrollBar.win,
sbshadow, last_top,
sbwidth, (scrollBar.top - last_top),
False);
if (scrollBar.bot < last_bot)
- XClearArea (xdisp, scrollBar.win,
+ XClearArea (dpy, scrollBar.win,
sbshadow, scrollBar.bot,
sbwidth, (last_bot - scrollBar.bot),
False);
}
else
- XClearWindow (xdisp, scrollBar.win);
+ XClearWindow (dpy, scrollBar.win);
}
/* scrollbar slider */
else
xofs = sbshadow ? sbwidth : sbwidth - 1;
- XDrawLine (xdisp, scrollBar.win, botShadowGC,
+ XDrawLine (dpy, scrollBar.win, botShadowGC,
xofs, 0, xofs, scrollBar.end + sbwidth);
}
#endif
- XFillRectangle (xdisp, scrollBar.win, scrollbarGC,
+ XFillRectangle (dpy, scrollBar.win, scrollbarGC,
sbshadow, scrollBar.top, sbwidth,
scrollbar_len);
XGCValues gcvalue;
scrollBar.init |= R_SB_XTERM;
- gcvalue.stipple = XCreateBitmapFromData (xdisp, scrollBar.win,
+ gcvalue.stipple = XCreateBitmapFromData (dpy, scrollBar.win,
(char *)x_stp_bits, x_stp_width,
x_stp_height);
if (!gcvalue.stipple)
gcvalue.foreground = pix_colors_focused[Color_fg];
gcvalue.background = pix_colors_focused[Color_bg];
- xscrollbarGC = XCreateGC (xdisp, scrollBar.win,
+ xscrollbarGC = XCreateGC (dpy, scrollBar.win,
GCForeground | GCBackground
| GCFillStyle | GCStipple, &gcvalue);
gcvalue.foreground = pix_colors_focused[Color_border];
- ShadowGC = XCreateGC (xdisp, scrollBar.win, GCForeground, &gcvalue);
+ ShadowGC = XCreateGC (dpy, scrollBar.win, GCForeground, &gcvalue);
}
if (update)
{
xsb = OPTION (Opt_scrollBar_right) ? 1 : 0;
if (last_top < scrollBar.top)
- XClearArea (xdisp, scrollBar.win,
+ XClearArea (dpy, scrollBar.win,
sb_shadow + xsb, last_top,
sbwidth, (scrollBar.top - last_top), False);
if (scrollBar.bot < last_bot)
- XClearArea (xdisp, scrollBar.win,
+ XClearArea (dpy, scrollBar.win,
sb_shadow + xsb, scrollBar.bot,
sbwidth, (last_bot - scrollBar.bot), False);
}
else
- XClearWindow (xdisp, scrollBar.win);
+ XClearWindow (dpy, scrollBar.win);
/* scrollbar slider */
- XFillRectangle (xdisp, scrollBar.win, xscrollbarGC,
+ XFillRectangle (dpy, scrollBar.win, xscrollbarGC,
xsb + 1, scrollBar.top, sbwidth - 2, scrollbar_len);
- XDrawLine (xdisp, scrollBar.win, ShadowGC,
+ XDrawLine (dpy, scrollBar.win, ShadowGC,
xsb ? 0 : sbwidth, scrollBar.beg,
xsb ? 0 : sbwidth, scrollBar.end);
return 1;
if (scrollBar.win)
{
- XMapWindow (xdisp, scrollBar.win);
+ XMapWindow (dpy, scrollBar.win);
change = 1;
}
}
else
{
scrollBar.state = 0;
- XUnmapWindow (xdisp, scrollBar.win);
+ XUnmapWindow (dpy, scrollBar.win);
change = 1;
}
#endif
if (!scrollBar.win)
{
/* create the scrollbar window */
- scrollBar.win = XCreateSimpleWindow (xdisp,
+ scrollBar.win = XCreateSimpleWindow (dpy,
parent[0],
window_sb_x, 0,
scrollbar_TotalWidth (),
0,
pix_colors[Color_fg],
pix_colors[Color_border]);
- XDefineCursor (xdisp, scrollBar.win, leftptr_cursor);
+ XDefineCursor (dpy, scrollBar.win, leftptr_cursor);
- XSelectInput (xdisp, scrollBar.win,
+ XSelectInput (dpy, scrollBar.win,
ExposureMask | ButtonPressMask | ButtonReleaseMask
| Button1MotionMask | Button2MotionMask
| Button3MotionMask);
scrollbar_show (1);
if (delayed_init)
- XMapWindow (xdisp, scrollBar.win);
+ XMapWindow (dpy, scrollBar.win);
#endif
}
const char *
rxvt_term::x_resource (const char *name)
{
- XrmDatabase database = XrmGetDatabase (xdisp);
+ XrmDatabase database = XrmGetDatabase (dpy);
const char *p = get_res (database, rs[Rs_name], name);
const char *p0 = get_res (database, "!INVALIDPROGRAMMENAMEDONTMATCH!", name);
* [R5 or later]: enumerate the resource database
*/
# ifdef KEYSYM_RESOURCE
- XrmDatabase database = XrmGetDatabase (xdisp);
+ XrmDatabase database = XrmGetDatabase (dpy);
XrmName name_prefix[3];
XrmClass class_prefix[3];
GC gc;
if (pixmap != None)
- XFreePixmap (xdisp, pixmap);
+ XFreePixmap (dpy, pixmap);
if (bgPixmap.pixmap == None)
{ /* So be it: I'm not using pixmaps */
pixmap = None;
if (!OPTION (Opt_transparent) || !am_transparent)
- XSetWindowBackground (xdisp, vt, pix_colors[Color_bg]);
+ XSetWindowBackground (dpy, vt, pix_colors[Color_bg]);
return;
}
gcvalue.foreground = pix_colors[Color_bg];
- gc = XCreateGC (xdisp, vt, GCForeground, &gcvalue);
+ gc = XCreateGC (dpy, vt, GCForeground, &gcvalue);
if (bgPixmap.pixmap != None)
{ /* we have a specified pixmap */
if (!w)
{
/* basic X tiling - let the X server do it */
- pixmap = XCreatePixmap (xdisp, vt, xpmw, xpmh, depth);
+ pixmap = XCreatePixmap (dpy, vt, xpmw, xpmh, depth);
- XCopyArea (xdisp, bgPixmap.pixmap, pixmap, gc, x, y, xpmw - x, xpmh - y, 0, 0);
- XCopyArea (xdisp, bgPixmap.pixmap, pixmap, gc, x, 0, xpmw - x, y, 0, xpmh - y);
- XCopyArea (xdisp, bgPixmap.pixmap, pixmap, gc, 0, y, x, xpmh - y, xpmw - x, 0);
- XCopyArea (xdisp, bgPixmap.pixmap, pixmap, gc, 0, 0, x, y, xpmw - x, xpmh - y);
+ XCopyArea (dpy, bgPixmap.pixmap, pixmap, gc, x, y, xpmw - x, xpmh - y, 0, 0);
+ XCopyArea (dpy, bgPixmap.pixmap, pixmap, gc, x, 0, xpmw - x, y, 0, xpmh - y);
+ XCopyArea (dpy, bgPixmap.pixmap, pixmap, gc, 0, y, x, xpmh - y, xpmw - x, 0);
+ XCopyArea (dpy, bgPixmap.pixmap, pixmap, gc, 0, 0, x, y, xpmw - x, xpmh - y);
}
else
{
float incr, p;
Pixmap tmp;
- pixmap = XCreatePixmap (xdisp, vt, width, height, depth);
+ pixmap = XCreatePixmap (dpy, vt, width, height, depth);
/*
* horizontal scaling
*/
rxvt_pixmap_incr (&w, &x, &incr, &p, width, xpmw);
- tmp = XCreatePixmap (xdisp, vt, width, xpmh, depth);
- XFillRectangle (xdisp, tmp, gc, 0, 0, width, xpmh);
+ tmp = XCreatePixmap (dpy, vt, width, xpmh, depth);
+ XFillRectangle (dpy, tmp, gc, 0, 0, width, xpmh);
for ( /*nil */ ; x < w; x++, p += incr)
{
p = 0;
/* copy one column from the original pixmap to the tmp pixmap */
- XCopyArea (xdisp, bgPixmap.pixmap, tmp, gc, (int)p, 0, 1, xpmh, (int)x, 0);
+ XCopyArea (dpy, bgPixmap.pixmap, tmp, gc, (int)p, 0, 1, xpmh, (int)x, 0);
}
/*
rxvt_pixmap_incr (&h, &y, &incr, &p, height, xpmh);
if (y > 0)
- XFillRectangle (xdisp, pixmap, gc, 0, 0, width, y);
+ XFillRectangle (dpy, pixmap, gc, 0, 0, width, y);
if (h < height)
- XFillRectangle (xdisp, pixmap, gc, 0, (int)h, width, height - h + 1);
+ XFillRectangle (dpy, pixmap, gc, 0, (int)h, width, height - h + 1);
for ( /*nil */ ; y < h; y++, p += incr)
{
p = 0;
/* copy one row from the tmp pixmap to the main pixmap */
- XCopyArea (xdisp, tmp, pixmap, gc, 0, (int)p, width, 1, 0, (int)y);
+ XCopyArea (dpy, tmp, pixmap, gc, 0, (int)p, width, 1, 0, (int)y);
}
- XFreePixmap (xdisp, tmp);
+ XFreePixmap (dpy, tmp);
}
}
- XSetWindowBackgroundPixmap (xdisp, vt, pixmap);
+ XSetWindowBackgroundPixmap (dpy, vt, pixmap);
if (pixmap != None)
{
- XFreePixmap (xdisp, pixmap);
+ XFreePixmap (dpy, pixmap);
pixmap = None;
}
- XFreeGC (xdisp, gc);
+ XFreeGC (dpy, gc);
am_transparent = 0;
}
if (bgPixmap.pixmap != None)
{
- XFreePixmap (xdisp, bgPixmap.pixmap);
+ XFreePixmap (dpy, bgPixmap.pixmap);
bgPixmap.pixmap = None;
}
- XSetWindowBackground (xdisp, vt, pix_colors[Color_bg]);
+ XSetWindowBackground (dpy, vt, pix_colors[Color_bg]);
if (*file != '\0')
{
/*
* we already have the required attributes
*/
- /* XGetWindowAttributes (xdisp, vt, &attr); */
+ /* XGetWindowAttributes (dpy, vt, &attr); */
xpmAttr.closeness = 30000;
xpmAttr.colormap = cmap;
/* search environment variables here too */
f = (char *)rxvt_File_find (file, ".xpm", rs[Rs_path]);
if (f == NULL
- || XpmReadFileToPixmap (xdisp, display->root, f,
+ || XpmReadFileToPixmap (dpy, display->root, f,
&bgPixmap.pixmap, NULL,
&xpmAttr))
{