rxvt-unicode changelog <= google-friendly title
TODO: event mechanism that replaces on_keyboard_command with something more scalable.
+TODO: overlays collide with the way the out-of-focus cursor is being drawn
TODO: simplify selection_request and make it callable from perl.
TODO: split perl documentation and urxvt.pm into separate files
TODO: harmonize --disable-options into position-dependent options.
WISH: http://www120.pair.com/mccarthy/nextstep/intro.htmld/Workspace.html is the correct nextstep look.
DUMB: support tex fonts
-TODO: overlays collide with the way the out-of-focus cursor is being drawn
+7.3
- don't let iso14755 or mouse reporting get into the way of perl
(could lead to global grabs never being cleared).
- experimental OnTheSpot editing support (-pe xim-onthespot).
/* Define if you want hide the pointer while typing */
#undef POINTER_BLANK
-/* Define to use a 24 bit visual if the screen has 24 bit mode */
-#undef PREFER_24BIT
-
/* Resource class */
#undef RESCLASS
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os VERSION DATE LSMDATE LIBVERSION CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA EGREP LINKER INSTALL_LIBRXVT RXVTNAME MV RM CP LN SED ECHO CMP TIC CXXCPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XPM_CPPFLAGS XPM_CFLAGS XPM_LIBS rxvt_int16_typedef rxvt_uint16_typedef rxvt_int32_typedef rxvt_uint32_typedef rxvt_intp_define rxvt_u_intp_define PKG_CONFIG XFT_CONFIG PERL PERLLIB PERLFLAGS PERLPRIVLIBEXP IF_PERL PERL_O DEBUG DINCLUDE DLIB include_stdint_h include_stdarg_h include_stdlib_h include_unistd_h include_string_h include_fcntl_h include_util_h include_assert_h include_sys_ioctl_h include_sys_select_h include_sys_strredir_h include_sys_time_h include_time_h LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os VERSION DATE LSMDATE LIBVERSION CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA EGREP LINKER INSTALL_LIBRXVT RXVTNAME MV CP LN SED ECHO CMP TIC CXXCPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XPM_CPPFLAGS XPM_CFLAGS XPM_LIBS rxvt_int16_typedef rxvt_uint16_typedef rxvt_int32_typedef rxvt_uint32_typedef rxvt_intp_define rxvt_u_intp_define PKG_CONFIG XFT_CONFIG PERL PERLLIB PERLFLAGS PERLPRIVLIBEXP IF_PERL PERL_O DEBUG DINCLUDE DLIB include_stdint_h include_stdarg_h include_stdlib_h include_unistd_h include_string_h include_fcntl_h include_util_h include_assert_h include_sys_ioctl_h include_sys_select_h include_sys_strredir_h include_sys_time_h include_time_h LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
--enable-combining enable composition of base and combining characters
--enable-xft enable xft support on systems that have it
--enable-font-styles enable bold and italic support
- --enable-utmp enable utmp (utmpx) support
- --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)
- --enable-lastlog enable lastlog support (requires --enable-utmp)
--enable-xpm-background enable XPM background pixmaps
--enable-transparency enable transparent backgrounds
--enable-tinting enable tinting of transparent bg
--disable-swapscreen disable swap screen support
--enable-iso14755 enable support for extended ISO 14755 modes
--enable-frills enable support for rarely used features
- --enable-24bit enable support for using 24bit visuals if available
--enable-keepscrolling enable continual scrolling on scrollbar arrow press
--enable-selectionscrolling enable scrolling during selections
--enable-mousewheel enable scrolling via mouse wheel or buttons 4 & 5
--enable-slipwheeling enable slip wheel scrolling (requires previous)
- --enable-dmalloc enable Gray Watson's malloc - for debugging use
- --enable-dlmalloc enable Doug Lea's malloc - for production use
- NOTE: enable only one malloc package
--enable-smart-resize enable smart growth/shrink behaviour
--enable-text-blink enable blinking text
--enable-pointer-blank enable pointer blank when typing or inactive pointer
+ --enable-utmp enable utmp (utmpx) support
+ --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)
+ --enable-lastlog enable lastlog support (requires --enable-utmp)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
conftest$ac_exeext conftest.$ac_ext
-MALLOC_TYPE=S
-
support_frills=yes
support_inheritpixmap=yes
support_tinting=yes
support_selectionscrolling=yes
support_mousewheel=yes
support_mouseslipwheel=yes
-support_utmp=yes
-support_wtmp=yes
-support_lastlog=yes
support_text_blink=yes
support_pointer_blank=yes
support_scroll_rxvt=yes
enableval="$enable_everything"
if test x$enableval = xno; then
- support_24bit=no
support_frills=no
support_inheritpixmap=no
support_tinting=no
codesets=
fi
if test x$enableval = xyes; then
- support_24bit=yes
support_frills=yes
support_inheritpixmap=yes
support_tinting=yes
fi
fi;
-# Check whether --enable-utmp or --disable-utmp was given.
-if test "${enable_utmp+set}" = set; then
- enableval="$enable_utmp"
- if test x$enableval = xyes -o x$enableval = xno; then
- support_utmp=$enableval
- fi
-fi;
-
-# Check whether --enable-wtmp or --disable-wtmp was given.
-if test "${enable_wtmp+set}" = set; then
- enableval="$enable_wtmp"
- if test x$enableval = xyes -o x$enableval = xno; then
- support_wtmp=$enableval
- fi
-fi;
-
-# Check whether --enable-lastlog or --disable-lastlog was given.
-if test "${enable_lastlog+set}" = set; then
- enableval="$enable_lastlog"
- if test x$enableval = xyes -o x$enableval = xno; then
- support_lastlog=$enableval
- fi
-fi;
-
# Check whether --enable-xpm-background or --disable-xpm-background was given.
if test "${enable_xpm_background+set}" = set; then
enableval="$enable_xpm_background"
fi
fi;
-# Check whether --enable-24bit or --disable-24bit was given.
-if test "${enable_24bit+set}" = set; then
- enableval="$enable_24bit"
- if test x$enableval = xyes -o x$enableval = xno; then
- support_24bit=$enableval
- fi
-fi;
-
# Check whether --enable-keepscrolling or --disable-keepscrolling was given.
if test "${enable_keepscrolling+set}" = set; then
enableval="$enable_keepscrolling"
fi
fi;
-# Check whether --enable-dmalloc or --disable-dmalloc was given.
-if test "${enable_dmalloc+set}" = set; then
- enableval="$enable_dmalloc"
- if test x$enableval = xyes; then
- MALLOC_TYPE=G
- DEBUG=-DDEBUG_MALLOC
- DLIB="-L/usr/local/lib -ldmalloc"
- DINCLUDE=-I/usr/local/include
- fi
-fi;
-
-# Check whether --enable-dlmalloc or --disable-dlmalloc was given.
-if test "${enable_dlmalloc+set}" = set; then
- enableval="$enable_dlmalloc"
- if test x$enableval = xyes; then
- MALLOC_TYPE=D
- DEBUG=
- DLIB="-L/usr/local/lib -ldlmalloc"
- DINCLUDE=
- fi
-fi;
-
# Check whether --enable-smart-resize or --disable-smart-resize was given.
if test "${enable_smart_resize+set}" = set; then
enableval="$enable_smart_resize"
echo "${ECHO_T}no" >&6
fi
-# Extract the first word of "rm", so it can be a program name with args.
-set dummy rm; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_RM+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $RM in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_RM="$RM" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_path_RM" && ac_cv_path_RM="rm"
- ;;
-esac
-fi
-RM=$ac_cv_path_RM
-
-if test -n "$RM"; then
- echo "$as_me:$LINENO: result: $RM" >&5
-echo "${ECHO_T}$RM" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
# Extract the first word of "cp", so it can be a program name with args.
set dummy cp; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
+support_utmp=yes
+support_wtmp=yes
+support_lastlog=yes
+
+# Check whether --enable-utmp or --disable-utmp was given.
+if test "${enable_utmp+set}" = set; then
+ enableval="$enable_utmp"
+ if test x$enableval = xyes -o x$enableval = xno; then
+ support_utmp=$enableval
+ fi
+fi;
+
+# Check whether --enable-wtmp or --disable-wtmp was given.
+if test "${enable_wtmp+set}" = set; then
+ enableval="$enable_wtmp"
+ if test x$enableval = xyes -o x$enableval = xno; then
+ support_wtmp=$enableval
+ fi
+fi;
+
+# Check whether --enable-lastlog or --disable-lastlog was given.
+if test "${enable_lastlog+set}" = set; then
+ enableval="$enable_lastlog"
+ if test x$enableval = xyes -o x$enableval = xno; then
+ support_lastlog=$enableval
+ fi
+fi;
+
+if test x$support_utmp = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define UTMP_SUPPORT 1
+_ACEOF
+
+fi
+if test x$support_wtmp = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WTMP_SUPPORT 1
+_ACEOF
+
+fi
+if test x$support_lastlog = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define LASTLOG_SUPPORT 1
+_ACEOF
+
+fi
+
fi
+if test x$support_utmp != xyes; then
+ echo " utmp support: disabled"
+ echo
+else
+ echo " utmp support: enabled
+ utmp file: $path_utmp
+ utmpx file: $path_utmpx
+ wtmp file: $path_wtmp
+ wtmpx file: $path_wtmpx
+ lastlog file: $path_lastlog
+ lastlogx file: $path_lastlogx"
+fi
+
echo "$as_me:$LINENO: checking where ttys/ttytab is located" >&5
#define ENABLE_FRILLS 1
_ACEOF
-fi
-if test x$support_24bit = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define PREFER_24BIT 1
-_ACEOF
-
fi
if test x$support_mousewheel = xyes; then
#define MOUSE_SLIP_WHEELING 1
_ACEOF
-fi
-if test x$support_utmp = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define UTMP_SUPPORT 1
-_ACEOF
-
-fi
-if test x$support_wtmp = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define WTMP_SUPPORT 1
-_ACEOF
-
-fi
-if test x$support_lastlog = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define LASTLOG_SUPPORT 1
-_ACEOF
-
fi
if test x$support_xim = xyes -o x$multichar_set = xyes; then
if test x$rxvt_cv_func_xlocale = xyes; then
s,@INSTALL_LIBRXVT@,$INSTALL_LIBRXVT,;t t
s,@RXVTNAME@,$RXVTNAME,;t t
s,@MV@,$MV,;t t
-s,@RM@,$RM,;t t
s,@CP@,$CP,;t t
s,@LN@,$LN,;t t
s,@SED@,$SED,;t t
Compiler flags: $CFLAGS
Linker: $LINKER"
-if test "$MALLOC_TYPE" = S; then
- echo " malloc support: system default"
-fi
-if test "$MALLOC_TYPE" = G; then
- echo " malloc support: Gray Watson's dmalloc"
-fi
-if test "$MALLOC_TYPE" = D; then
- echo " malloc support: Doug Lea's malloc"
-fi
-
if test x$support_xpm = xyes; then
echo " Xpm library: $XPM_LIBS"
fi
-if test x$support_utmp != xyes; then
- echo " utmp support: disabled"
- echo
-else
- echo " utmp support: enabled
- utmp file: $path_utmp
- utmpx file: $path_utmpx
- wtmp file: $path_wtmp
- wtmpx file: $path_wtmpx
- lastlog file: $path_lastlog
- lastlogx file: $path_lastlogx"
-fi
if test x$term != x; then
echo " set TERM to: $term"
fi
NOTE: automatically enabled with --enable-shared],
[
if test x$enableval = xno; then
- support_24bit=no
support_frills=no
support_inheritpixmap=no
support_tinting=no
codesets=
fi
if test x$enableval = xyes; then
- support_24bit=yes
support_frills=yes
support_inheritpixmap=yes
support_tinting=yes
support_frills=$enableval
fi])
-AC_ARG_ENABLE(24bit,
- [ --enable-24bit enable support for using 24bit visuals if available],
- [if test x$enableval = xyes -o x$enableval = xno; then
- support_24bit=$enableval
- fi])
-
AC_ARG_ENABLE(keepscrolling,
[ --enable-keepscrolling enable continual scrolling on scrollbar arrow press],
[if test x$enableval = xyes -o x$enableval = xno; then
if test x$support_frills = xyes; then
AC_DEFINE(ENABLE_FRILLS, 1, Define if you want handling for rarely used but handy features)
fi
-if test x$support_24bit = xyes; then
- AC_DEFINE(PREFER_24BIT, 1, Define to use a 24 bit visual if the screen has 24 bit mode, even if the default is 8 bit)
-fi
if test x$support_mousewheel = xyes; then
AC_DEFINE(MOUSE_WHEEL, 1, Define to use wheel events (button4 and button5) to scroll)
fi
respected). In the absence of this option, the display specified by the
B<DISPLAY> environment variable is used.
+=item B<-depth> I<bitdepth>
+
+Compile I<frills>: Attempt to find a visual with the given bit depth;
+resource B<depth>.
+
=item B<-geometry> I<geom>
Window geometry (B<-g> still respected); resource B<geometry>.
=over 4
+=item B<depth:> I<bitdepth>
+
+Compile I<frills>: Attempt to find a visual with the given bit depth;
+option B<-depth>.
+
=item B<geometry:> I<geom>
Create the window with the specified X window geometry [default 80x24];
EWMH-hints (pid, utf8 names) and protocols (ping)
seperate underline colour (-underlineColor)
settable border widths and borderless switch (-w, -b, -bl)
+ visual selection (-depth)
settable extra linespacing /-lsp)
iso-14755-2 and -3, and visual feedback
backindex and forwardindex escape sequence
{
make_current ();
- dDisp;
+ dLocal (Display *, xdisp);
if (ev.xany.window == vt
&& SHOULD_INVOKE (HOOK_X_EVENT)
}
#if ENABLE_EWMH
else if (ev.xclient.data.l[0] == xa[XA_NET_WM_PING])
- XSendEvent (disp, ev.xclient.window = display->root,
+ XSendEvent (xdisp, ev.xclient.window = display->root,
False, SubstructureRedirectMask | SubstructureNotifyMask,
&ev);
#endif
case ConfigureNotify:
if (ev.xconfigure.window == parent[0])
{
- while (XCheckTypedWindowEvent (disp, ev.xconfigure.window, ConfigureNotify, &ev))
+ while (XCheckTypedWindowEvent (xdisp, ev.xconfigure.window, ConfigureNotify, &ev))
;
if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height)
do
scr_expose (ev.xexpose.x, ev.xexpose.y,
ev.xexpose.width, ev.xexpose.height, False);
- while (XCheckTypedWindowEvent (disp, vt, ev.xany.type, &ev));
+ while (XCheckTypedWindowEvent (xdisp, vt, ev.xany.type, &ev));
ev.xany.type = ev.xany.type == Expose ? GraphicsExpose : Expose;
- while (XCheckTypedWindowEvent (disp, vt, ev.xany.type, &ev))
+ while (XCheckTypedWindowEvent (xdisp, vt, ev.xany.type, &ev))
scr_expose (ev.xexpose.x, ev.xexpose.y,
ev.xexpose.width, ev.xexpose.height, False);
{
XEvent unused_event;
- while (XCheckTypedWindowEvent (disp, ev.xany.window, Expose, &unused_event))
+ while (XCheckTypedWindowEvent (xdisp, ev.xany.window, Expose, &unused_event))
;
- while (XCheckTypedWindowEvent (disp, ev.xany.window, GraphicsExpose, &unused_event))
+ while (XCheckTypedWindowEvent (xdisp, ev.xany.window, GraphicsExpose, &unused_event))
;
if (isScrollbarWindow (ev.xany.window))
#ifdef TRANSPARENT
if (am_transparent && ev.xany.window == parent[0])
- XClearWindow (disp, ev.xany.window);
+ XClearWindow (xdisp, ev.xany.window);
#endif
}
break;
; // nop
else if (ev.xbutton.state & (Button1Mask | Button3Mask))
{
- while (XCheckTypedWindowEvent (disp, vt, MotionNotify, &ev))
+ while (XCheckTypedWindowEvent (xdisp, vt, MotionNotify, &ev))
;
- XQueryPointer (disp, vt,
+ XQueryPointer (xdisp, vt,
&unused_root, &unused_child,
&unused_root_x, &unused_root_y,
&ev.xbutton.x, &ev.xbutton.y,
}
else if (isScrollbarWindow (ev.xany.window) && scrollbar_isMotion ())
{
- while (XCheckTypedWindowEvent (disp, scrollBar.win,
+ while (XCheckTypedWindowEvent (xdisp, scrollBar.win,
MotionNotify, &ev))
;
- XQueryPointer (disp, scrollBar.win,
+ XQueryPointer (xdisp, scrollBar.win,
&unused_root, &unused_child,
&unused_root_x, &unused_root_y,
&ev.xbutton.x, &ev.xbutton.y,
typedef uint32_t RUINT32T;
-void ShadeXImage(rxvt_display *display, XImage* srcImage, int shade, int rm, int gm, int bm)
+void ShadeXImage(rxvt_term *term, XImage* srcImage, int shade, int rm, int gm, int bm)
{
int sh_r, sh_g, sh_b;
RUINT32T mask_r, mask_g, mask_b;
unsigned int upper_lim_r, upper_lim_g, upper_lim_b;
int i;
- Visual *visual = display->visual;
+ Visual *visual = term->visual;
if( visual->c_class != TrueColor || srcImage->format != ZPixmap ) return ;
Window root, oldp, *list;
Pixmap rootpixmap = None;
XWindowAttributes wattr, wrootattr;
- dDisp;
pchanged = 0;
if (!OPTION (Opt_transparent))
return pchanged; /* Don't try any more */
- XGetWindowAttributes (disp, display->root, &wrootattr);
+ XGetWindowAttributes (xdisp, display->root, &wrootattr);
rootdepth = wrootattr.depth;
- XGetWindowAttributes (disp, parent[0], &wattr);
+ XGetWindowAttributes (xdisp, parent[0], &wattr);
if (rootdepth != wattr.depth)
{
if (am_transparent)
{
pchanged = 1;
- XSetWindowBackground (disp, vt, pix_colors_focused[Color_bg]);
+ XSetWindowBackground (xdisp, vt, pix_colors_focused[Color_bg]);
am_transparent = am_pixmap_trans = 0;
}
}
/* Get all X ops out of the queue so that our information is up-to-date. */
- XSync (disp, False);
+ XSync (xdisp, False);
/*
* Make the frame window set by the window manager have
* windows for each client, so we have to take care about that.
*/
i = (xa[XA_XROOTPMAP_ID]
- && XGetWindowProperty (disp, display->root, xa[XA_XROOTPMAP_ID],
+ && XGetWindowProperty (xdisp, display->root, xa[XA_XROOTPMAP_ID],
0L, 1L, False, XA_PIXMAP, &atype, &aformat,
&nitems, &bytes_after, &prop) == Success);
if (!i || prop == NULL)
i = (xa[XA_ESETROOT_PMAP_ID]
- && XGetWindowProperty (disp, display->root, xa[XA_ESETROOT_PMAP_ID],
+ && XGetWindowProperty (xdisp, display->root, xa[XA_ESETROOT_PMAP_ID],
0L, 1L, False, XA_PIXMAP, &atype, &aformat,
&nitems, &bytes_after, &prop) == Success);
GC gc;
XGCValues gcvalue;
- XTranslateCoordinates (disp, parent[0], display->root,
+ XTranslateCoordinates (xdisp, parent[0], display->root,
0, 0, &sx, &sy, &cr);
nw = (unsigned int)szHint.width;
nh = (unsigned int)szHint.height;
min_it (nw, (unsigned int) (wrootattr.width - sx));
min_it (nh, (unsigned int) (wrootattr.height - sy));
- XSync (disp, False);
+ XSync (xdisp, False);
allowedxerror = -1;
- image = XGetImage (disp, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap);
+ image = XGetImage (xdisp, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap);
/* XXX: handle BadMatch - usually because we're outside the pixmap */
/* XXX: may need a delay here? */
pchanged = 1;
if (pixmap != None)
{
- XFreePixmap (disp, pixmap);
+ XFreePixmap (xdisp, pixmap);
pixmap = None;
}
}
else
{
if (pixmap != None)
- XFreePixmap (disp, pixmap);
+ XFreePixmap (xdisp, pixmap);
#if TINTING
if (ISSET_PIXCOLOR (Color_tint))
unsigned short rm, gm, bm;
int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100;
- pix_colors_focused[Color_tint].get (display, rm, gm, bm);
+ pix_colors_focused[Color_tint].get (this, rm, gm, bm);
- ShadeXImage (display, image, shade, rm, gm, bm);
+ ShadeXImage (this, image, shade, rm, gm, bm);
}
#endif
- pixmap = XCreatePixmap (disp, vt,
- szHint.width, szHint.height, image->depth);
- gc = XCreateGC (disp, vt, 0UL, &gcvalue);
- XPutImage (disp, pixmap, gc, image, 0, 0,
+ pixmap = XCreatePixmap (xdisp, vt, szHint.width, szHint.height, image->depth);
+ gc = XCreateGC (xdisp, vt, 0UL, &gcvalue);
+ XPutImage (xdisp, pixmap, gc, image, 0, 0,
nx, ny, image->width, image->height);
- XFreeGC (disp, gc);
+ XFreeGC (xdisp, gc);
XDestroyImage (image);
- XSetWindowBackgroundPixmap (disp, parent[0], pixmap);
- XClearWindow (disp, parent[0]);
+ XSetWindowBackgroundPixmap (xdisp, parent[0], pixmap);
+ XClearWindow (xdisp, parent[0]);
if (!am_transparent || !am_pixmap_trans)
pchanged = 1;
}
if (am_pixmap_trans)
- XSetWindowBackgroundPixmap (disp, vt, ParentRelative);
+ XSetWindowBackgroundPixmap (xdisp, vt, ParentRelative);
else
{
unsigned int n;
for (i = 1; i < (int) (sizeof (parent) / sizeof (Window)); i++)
{
oldp = parent[i];
- XQueryTree (disp, parent[i - 1], &root,
+ XQueryTree (xdisp, parent[i - 1], &root,
&parent[i], &list, &n);
XFree (list);
{
for (; n < (unsigned int)i; n++)
{
- XGetWindowAttributes (disp, parent[n], &wattr);
+ XGetWindowAttributes (xdisp, parent[n], &wattr);
if (wattr.depth != rootdepth || wattr.c_class == InputOnly)
{
n = (int) (sizeof (parent) / sizeof (Window)) + 1;
if (n > (int) (sizeof (parent) / sizeof (parent[0])))
{
- XSetWindowBackground (disp, parent[0], pix_colors_focused[Color_border]);
- XSetWindowBackground (disp, vt, pix_colors_focused[Color_bg]);
+ XSetWindowBackground (xdisp, parent[0], pix_colors_focused[Color_border]);
+ XSetWindowBackground (xdisp, vt, pix_colors_focused[Color_bg]);
am_transparent = 0;
/* XXX: also turn off Opt_transparent? */
}
{
for (n = 0; n < (unsigned int)i; n++)
{
- XSetWindowBackgroundPixmap (disp, parent[n], ParentRelative);
- XClearWindow (disp, parent[n]);
+ XSetWindowBackgroundPixmap (xdisp, parent[n], ParentRelative);
+ XClearWindow (xdisp, parent[n]);
}
- XSetWindowBackgroundPixmap (disp, vt, ParentRelative);
+ XSetWindowBackgroundPixmap (xdisp, vt, ParentRelative);
am_transparent = 1;
}
if (scrollBar.win)
{
- XSetWindowBackgroundPixmap (disp, scrollBar.win, ParentRelative);
+ XSetWindowBackgroundPixmap (xdisp, scrollBar.win, ParentRelative);
scrollBar.setIdle ();
scrollbar_show (0);
}
int x, y;
XWindowAttributes wattr;
Window wdummy;
- dDisp;
+
+ dLocal (Display *, xdisp);
if (nargs == 0)
return;
* commands
*/
case 1: /* deiconify window */
- XMapWindow (disp, parent[0]);
+ XMapWindow (xdisp, parent[0]);
break;
case 2: /* iconify window */
- XIconifyWindow (disp, parent[0], display->screen);
+ XIconifyWindow (xdisp, parent[0], display->screen);
break;
case 3: /* set position (pixels) */
- XMoveWindow (disp, parent[0], args[1], args[2]);
+ XMoveWindow (xdisp, parent[0], args[1], args[2]);
break;
case 4: /* set size (pixels) */
set_widthheight ((unsigned int)args[2], (unsigned int)args[1]);
break;
case 5: /* raise window */
- XRaiseWindow (disp, parent[0]);
+ XRaiseWindow (xdisp, parent[0]);
break;
case 6: /* lower window */
- XLowerWindow (disp, parent[0]);
+ XLowerWindow (xdisp, parent[0]);
break;
case 7: /* refresh window */
scr_touch (true);
* reports - some output format copied from XTerm
*/
case 11: /* report window state */
- XGetWindowAttributes (disp, parent[0], &wattr);
+ XGetWindowAttributes (xdisp, parent[0], &wattr);
tt_printf ("\033[%dt", wattr.map_state == IsViewable ? 1 : 2);
break;
case 13: /* report window position */
- XGetWindowAttributes (disp, parent[0], &wattr);
- XTranslateCoordinates (disp, parent[0], wattr.root,
+ XGetWindowAttributes (xdisp, parent[0], &wattr);
+ XTranslateCoordinates (xdisp, parent[0], wattr.root,
-wattr.border_width, -wattr.border_width,
&x, &y, &wdummy);
tt_printf ("\033[3;%d;%dt", x, y);
break;
case 14: /* report window size (pixels) */
- XGetWindowAttributes (disp, parent[0], &wattr);
+ XGetWindowAttributes (xdisp, parent[0], &wattr);
tt_printf ("\033[4;%d;%dt", wattr.height, wattr.width);
break;
case 18: /* report text area size (chars) */
case 20: /* report icon label */
{
char *s;
- XGetIconName (disp, parent[0], &s);
+ XGetIconName (xdisp, parent[0], &s);
tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */
XFree (s);
}
case 21: /* report window title */
{
char *s;
- XFetchName (disp, parent[0], &s);
+ XFetchName (xdisp, parent[0], &s);
tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */
XFree (s);
}
if (str[0] == '?' && !str[1])
{
unsigned short r, g, b;
- pix_colors_focused[color].get (display, r, g, b);
+ pix_colors_focused[color].get (this, r, g, b);
tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, r, g, b, resp);
}
else
char *buf, *name;
bool query = str[0] == '?' && !str[1];
int saveop = op;
- dDisp;
+
+ dLocal (Display *, xdisp);
assert (str != NULL);
switch (op)
const char *str = "";
if (prop
- && XGetWindowProperty (disp, parent[0],
+ && XGetWindowProperty (xdisp, parent[0],
prop, 0, 1<<16, 0, AnyPropertyType,
&actual_type, &actual_format,
&nitems, &bytes_after, &value) == Success
set_utf8_property (display->atom (str), eq + 1);
}
else
- XDeleteProperty (disp, parent[0],
+ XDeleteProperty (xdisp, parent[0],
display->atom (str));
}
break;
if (name[0] == '?' && !name[1])
{
unsigned short r, g, b;
- pix_colors_focused[color].get (display, r, g, b);
+ pix_colors_focused[color].get (this, r, g, b);
tt_printf ("\033]%d;%d;rgb:%04x/%04x/%04x%c", XTerm_Color, color, r, g, b, resp);
}
else
}
#endif
+ xa = display->xa;
+
+#if ENABLE_FRILLS
+ if (rs[Rs_depth])
+ set (display, strtol (rs[Rs_depth], 0, 0));
+ else
+#endif
+ set (display);
+
/*
* set any defaults not already set
*/
putenv ("TERMINFO=" RXVT_TERMINFO);
#endif
- if (display->depth <= 2)
+ if (depth <= 2)
putenv ("COLORTERM=" COLORTERMENV "-mono");
else
putenv ("COLORTERM=" COLORTERMENVFULL);
pix_colors = pix_colors_focused;
#endif
- for (i = 0; i < (display->depth <= 2 ? 2 : NRS_COLORS); i++)
+ for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++)
{
rxvt_color xcol;
#ifdef OFF_FOCUS_FADING
if (rs[Rs_fade])
- for (i = 0; i < (display->depth <= 2 ? 2 : NRS_COLORS); i++)
- pix_colors_unfocused[i] = pix_colors_focused[i].fade (display, atoi (rs[Rs_fade]), pix_colors[Color_fade]);
+ for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++)
+ pix_colors_unfocused[i] = pix_colors_focused[i].fade (this, atoi (rs[Rs_fade]), pix_colors[Color_fade]);
#endif
- if (display->depth <= 2)
+ if (depth <= 2)
{
if (!rs[Rs_color + Color_pointer_fg]) pix_colors[Color_pointer_fg] = pix_colors[Color_fg];
if (!rs[Rs_color + Color_pointer_bg]) pix_colors[Color_pointer_bg] = pix_colors[Color_bg];
*/
#ifdef KEEP_SCROLLCOLOR
- if (display->depth <= 2)
+ if (depth <= 2)
{
/* Monochrome */
pix_colors[Color_scroll] = pix_colors[Color_fg];
* xcol[2] == bot shadow */
xcol[1] = pix_colors[Color_scroll];
- xcol[0].set (display, 65535, 65535, 65535);
+ xcol[0].set (this, 65535, 65535, 65535);
unsigned short pr1, pg1, pb1, pr0, pg0, pb0;
- xcol[0].get (display, pr0, pg0, pb0);
- xcol[1].get (display, pr1, pg1, pb1);
+ xcol[0].get (this, pr0, pg0, pb0);
+ xcol[1].get (this, pr1, pg1, pb1);
- pix_colors[Color_bottomShadow] = xcol[1].fade (display, 50);
+ pix_colors[Color_bottomShadow] = xcol[1].fade (this, 50);
/* topShadowColor */
- if (!xcol[1].set (display,
+ if (!xcol[1].set (this,
min (pr0, max (pr0 / 5, pr1) * 7 / 5),
min (pg0, max (pg0 / 5, pg1) * 7 / 5),
min (pb0, max (pb0 / 5, pb1) * 7 / 5)))
XGCValues gcvalue;
XSetWindowAttributes attributes;
Window top, parent;
- dDisp;
- xa = display->xa;
+ dLocal (Display *, xdisp);
/* grab colors before netscape does */
Get_Colours ();
#if ENABLE_FRILLS
if (OPTION (Opt_borderLess))
{
- if (XInternAtom (disp, "_MOTIF_WM_INFO", True) == None)
+ if (XInternAtom (xdisp, "_MOTIF_WM_INFO", True) == None)
{
/* print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.\n");*/
attributes.override_redirect = TRUE;
parent = strtol (rs[Rs_embed], 0, 0);
- if (!XGetWindowAttributes (disp, parent, &wattr))
+ if (!XGetWindowAttributes (xdisp, parent, &wattr))
rxvt_fatal ("invalid window-id specified with -embed, aborting.\n");
window_calc (wattr.width, wattr.height);
window_calc (0, 0);
/* sub-window placement & size in rxvt_resize_subwindows () */
- attributes.background_pixel = pix_colors_focused[Color_border];
- attributes.border_pixel = pix_colors_focused[Color_border];
- attributes.colormap = display->cmap;
+ attributes.background_pixel = pix_colors_focused [Color_border];
+ attributes.border_pixel = pix_colors_focused [Color_border];
+ attributes.colormap = cmap;
- top = XCreateWindow (disp, parent,
+ top = XCreateWindow (xdisp, parent,
szHint.x, szHint.y,
szHint.width, szHint.height,
ext_bwidth,
- display->depth, InputOutput,
- display->visual,
+ depth, InputOutput, visual,
CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect,
&attributes);
wmHint.initial_state = OPTION (Opt_iconic) ? IconicState : NormalState;
wmHint.window_group = top;
- XmbSetWMProperties (disp, top, NULL, NULL, (char **)argv, argc,
+ XmbSetWMProperties (xdisp, top, NULL, NULL, (char **)argv, argc,
&szHint, &wmHint, &classHint);
#if ENABLE_FRILLS
if (mwmhints.flags)
- XChangeProperty (disp, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32,
+ XChangeProperty (xdisp, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32,
PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS);
#endif
#endif
};
- XSetWMProtocols (disp, top, protocols, sizeof (protocols) / sizeof (protocols[0]));
+ XSetWMProtocols (xdisp, top, protocols, sizeof (protocols) / sizeof (protocols[0]));
#if ENABLE_FRILLS
if (rs[Rs_transient_for])
- XSetTransientForHint (disp, top, (Window)strtol (rs[Rs_transient_for], 0, 0));
+ XSetTransientForHint (xdisp, top, (Window)strtol (rs[Rs_transient_for], 0, 0));
#endif
#if ENABLE_EWMH
long pid = getpid ();
- XChangeProperty (disp, top,
+ XChangeProperty (xdisp, top,
xa[XA_NET_WM_PID], XA_CARDINAL, 32,
PropModeReplace, (unsigned char *)&pid, 1);
// _NET_WM_WINDOW_TYPE is NORMAL, which is the default
#endif
- XSelectInput (disp, top,
+ XSelectInput (xdisp, top,
KeyPressMask
#if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ENABLE_FRILLS || ISO_14755
| KeyReleaseMask
termwin_ev.start (display, top);
/* vt cursor: Black-on-White is standard, but this is more popular */
- TermWin_cursor = XCreateFontCursor (disp, XC_xterm);
+ TermWin_cursor = XCreateFontCursor (xdisp, XC_xterm);
#ifdef HAVE_SCROLLBARS
/* cursor scrollBar: Black-on-White */
- leftptr_cursor = XCreateFontCursor (disp, XC_left_ptr);
+ leftptr_cursor = XCreateFontCursor (xdisp, XC_left_ptr);
#endif
/* the vt window */
- vt = XCreateSimpleWindow (disp, top,
+ vt = XCreateSimpleWindow (xdisp, top,
window_vt_x, window_vt_y,
width, height,
0,
pix_colors_focused[Color_bg]);
attributes.bit_gravity = NorthWestGravity;
- XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes);
+ XChangeWindowAttributes (xdisp, vt, CWBitGravity, &attributes);
vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask;
gcvalue.background = pix_colors[Color_bg];
gcvalue.graphics_exposures = 1;
- gc = XCreateGC (disp, vt,
+ gc = XCreateGC (xdisp, vt,
GCForeground | GCBackground | GCGraphicsExposures,
&gcvalue);
- drawable = new rxvt_drawable (display, vt);
+ drawable = new rxvt_drawable (this, vt);
#ifdef RXVT_SCROLLBAR
gcvalue.foreground = pix_colors[Color_topShadow];
- topShadowGC = XCreateGC (disp, vt, GCForeground, &gcvalue);
+ topShadowGC = XCreateGC (xdisp, vt, GCForeground, &gcvalue);
gcvalue.foreground = pix_colors[Color_bottomShadow];
- botShadowGC = XCreateGC (disp, vt, GCForeground, &gcvalue);
- gcvalue.foreground = pix_colors[ (display->depth <= 2 ? Color_fg : Color_scroll)];
- scrollbarGC = XCreateGC (disp, vt, GCForeground, &gcvalue);
+ botShadowGC = XCreateGC (xdisp, vt, GCForeground, &gcvalue);
+ gcvalue.foreground = pix_colors[ (depth <= 2 ? Color_fg : Color_scroll)];
+ scrollbarGC = XCreateGC (xdisp, vt, GCForeground, &gcvalue);
#endif
#ifdef OFF_FOCUS_FADING
if (display)
{
- dDisp;
-
selection_clear ();
#ifdef USE_XIM
im_destroy ();
#endif
#ifdef XTERM_SCROLLBAR
- if (xscrollbarGC) XFreeGC (disp, xscrollbarGC);
- if (ShadowGC) XFreeGC (disp, ShadowGC);
+ if (xscrollbarGC) XFreeGC (xdisp, xscrollbarGC);
+ if (ShadowGC) XFreeGC (xdisp, ShadowGC);
#endif
#ifdef PLAIN_SCROLLBAR
- if (pscrollbarGC) XFreeGC (disp, pscrollbarGC);
+ if (pscrollbarGC) XFreeGC (xdisp, pscrollbarGC);
#endif
#ifdef NEXT_SCROLLBAR
- if (blackGC) XFreeGC (disp, blackGC);
- if (whiteGC) XFreeGC (disp, whiteGC);
- if (grayGC) XFreeGC (disp, grayGC);
- if (darkGC) XFreeGC (disp, darkGC);
- if (stippleGC) XFreeGC (disp, stippleGC);
- if (dimple) XFreePixmap (disp, dimple);
- if (upArrow) XFreePixmap (disp, upArrow);
- if (downArrow) XFreePixmap (disp, downArrow);
- if (upArrowHi) XFreePixmap (disp, upArrowHi);
- if (downArrowHi) XFreePixmap (disp, downArrowHi);
+ if (blackGC) XFreeGC (xdisp, blackGC);
+ if (whiteGC) XFreeGC (xdisp, whiteGC);
+ if (grayGC) XFreeGC (xdisp, grayGC);
+ if (darkGC) XFreeGC (xdisp, darkGC);
+ if (stippleGC) XFreeGC (xdisp, stippleGC);
+ if (dimple) XFreePixmap (xdisp, dimple);
+ if (upArrow) XFreePixmap (xdisp, upArrow);
+ if (downArrow) XFreePixmap (xdisp, downArrow);
+ if (upArrowHi) XFreePixmap (xdisp, upArrowHi);
+ if (downArrowHi) XFreePixmap (xdisp, downArrowHi);
#endif
#ifdef RXVT_SCROLLBAR
- if (topShadowGC) XFreeGC (disp, topShadowGC);
- if (botShadowGC) XFreeGC (disp, botShadowGC);
- if (scrollbarGC) XFreeGC (disp, scrollbarGC);
+ if (topShadowGC) XFreeGC (xdisp, topShadowGC);
+ if (botShadowGC) XFreeGC (xdisp, botShadowGC);
+ if (scrollbarGC) XFreeGC (xdisp, scrollbarGC);
#endif
- if (gc) XFreeGC (disp, gc);
+ if (gc) XFreeGC (xdisp, gc);
delete drawable;
// destroy all windows
if (parent[0])
- XDestroyWindow (disp, parent[0]);
+ XDestroyWindow (xdisp, parent[0]);
+
+ clear ();
}
// TODO: free pixcolours, colours should become part of rxvt_display
create_windows (argc, argv);
- dDisp;
-
init_xlocale ();
scr_reset (); // initialize screen
#if 0
- XSynchronize (disp, True);
+ XSynchronize (xdisp, True);
#endif
#ifdef HAVE_SCROLLBARS
#ifdef TRANSPARENT
if (OPTION (Opt_transparent))
{
- XSelectInput (disp, display->root, PropertyChangeMask);
+ XSelectInput (xdisp, display->root, PropertyChangeMask);
check_our_parents ();
rootwin_ev.start (display, display->root);
}
}
#endif
- XMapWindow (disp, vt);
- XMapWindow (disp, parent[0]);
+ XMapWindow (xdisp, vt);
+ XMapWindow (xdisp, parent[0]);
return true;
}
int x, y, sb_w, flags;
unsigned int w, h;
unsigned int max_width, max_height;
- dDisp;
szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity;
szHint.win_gravity = NorthWestGravity;
window_sb_x = szHint.width - sb_w;
if (recalc_x)
- szHint.x += DisplayWidth (disp, display->screen) - szHint.width - 2 * ext_bwidth;
+ szHint.x += DisplayWidth (xdisp, display->screen) - szHint.width - 2 * ext_bwidth;
+
if (recalc_y)
- szHint.y += DisplayHeight (disp, display->screen) - szHint.height - 2 * ext_bwidth;
+ szHint.y += DisplayHeight (xdisp, display->screen) - szHint.height - 2 * ext_bwidth;
ncol = width / fwidth;
nrow = height / fheight;
#if OFF_FOCUS_FADING
if (rs[Rs_fade])
- pix_colors_unfocused[idx] = pix_colors_focused[idx].fade (display, atoi (rs[Rs_fade]), pix_colors[Color_fade]);
+ pix_colors_unfocused[idx] = pix_colors_focused[idx].fade (this, atoi (rs[Rs_fade]), pix_colors[Color_fade]);
#endif
/*TODO: handle Color_BD, scrollbar background, etc. */
? pix_colors_focused[Color_pointer_bg]
: pix_colors_focused[Color_bg];
- XQueryColors (display->display, display->cmap, xcol, 2);
+ XQueryColors (display->display, cmap, xcol, 2);
XRecolorCursor (display->display, TermWin_cursor, xcol + 0, xcol + 1);
}
int
rxvt_term::rXParseAllocColor (rxvt_color *screen_in_out, const char *colour)
{
- if (!screen_in_out->set (display, colour))
+ if (!screen_in_out->set (this, colour))
{
rxvt_warn ("can't get colour '%s', continuing without.\n", colour);
return false;
int fix_screen;
int old_width = szHint.width;
int old_height = szHint.height;
- dDisp;
window_calc (newwidth, newheight);
- XSetWMNormalHints (disp, parent[0], &szHint);
+ XSetWMNormalHints (xdisp, parent[0], &szHint);
if (!ignoreparent)
{
unsigned int unused_w1, unused_h1, unused_b1, unused_d1;
Window unused_cr;
- XTranslateCoordinates (disp, parent[0], display->root,
+ XTranslateCoordinates (xdisp, parent[0], display->root,
0, 0, &x, &y, &unused_cr);
- XGetGeometry (disp, parent[0], &unused_cr, &x1, &y1,
+ XGetGeometry (xdisp, parent[0], &unused_cr, &x1, &y1,
&unused_w1, &unused_h1, &unused_b1, &unused_d1);
/*
* if display->root isn't the parent window, a WM will probably have offset
y -= y1;
}
- x1 = (DisplayWidth (disp, display->screen) - old_width ) / 2;
- y1 = (DisplayHeight (disp, display->screen) - old_height) / 2;
+ x1 = (DisplayWidth (xdisp, display->screen) - old_width ) / 2;
+ y1 = (DisplayHeight (xdisp, display->screen) - old_height) / 2;
dx = old_width - szHint.width;
dy = old_height - szHint.height;
else if (y == y1) /* exact center */
dy /= 2;
- XMoveResizeWindow (disp, parent[0], x + dx, y + dy,
+ XMoveResizeWindow (xdisp, parent[0], x + dx, y + dy,
szHint.width, szHint.height);
#else
- XResizeWindow (disp, parent[0], szHint.width, szHint.height);
+ XResizeWindow (xdisp, parent[0], szHint.width, szHint.height);
#endif
}
{
if (scrollBar.state)
{
- XMoveResizeWindow (disp, scrollBar.win,
+ XMoveResizeWindow (xdisp, scrollBar.win,
window_sb_x, 0,
scrollbar_TotalWidth (), szHint.height);
resize_scrollbar ();
}
- XMoveResizeWindow (disp, vt,
+ XMoveResizeWindow (xdisp, vt,
window_vt_x, window_vt_y,
width, height);
def (override_redirect)
def (pty_fd)
def (hold)
+ def (depth)
def (ext_bwidth)
def (int_bwidth)
def (borderLess)
*****************************************************************************
*/
#define dLocal(type,name) type const name = this->name
-#define dDisp Display *disp = this->display->display
// for speed reasons, we assume that all latin1 characters
// are single-width (the first unicode combining character
class keyboard_manager;
#endif
-struct rxvt_term : zero_initialized, rxvt_vars {
+struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen {
log_callback *log_hook; // log error messages through this hook, if != 0
getfd_callback *getfd_hook; // convert remote to local fd, if != 0
#if ENABLE_PERL
void vt_select_input () const NOTHROW
{
- XSelectInput (display->display, vt, vt_emask | vt_emask_perl | vt_emask_xim);
+ XSelectInput (xdisp, vt, vt_emask | vt_emask_perl | vt_emask_xim);
}
#if TRANSPARENT
rxvt_drawable::operator XftDraw *()
{
if (!xftdrawable)
- xftdrawable = XftDrawCreate (display->display, drawable, display->visual, display->cmap);
+ xftdrawable = XftDrawCreate (screen->xdisp, drawable, screen->visual, screen->cmap);
return xftdrawable;
}
};
struct rxvt_drawable {
- rxvt_display *display;
+ rxvt_screen *screen;
#if XFT
XftDraw *xftdrawable;
operator XftDraw *();
#endif
Drawable drawable;
- rxvt_drawable (rxvt_display *display, Drawable drawable)
- : display(display),
+ rxvt_drawable (rxvt_screen *screen, Drawable drawable)
+ : screen(screen),
#if XFT
xftdrawable(0),
#endif
struct rxvt_color;
struct rxvt_vars; /* defined later on */
struct rxvt_term;
-struct rxvt_display;
struct rxvt_im;
struct rxvt_drawable;
scrollBar_t scrollBar;
uint32_t options;
XSizeHints szHint;
- rxvt_display *display;
rxvt_color *pix_colors;
rxvt_color *pix_colors_focused;
#ifdef OFF_FOCUS_FADING
/////////////////////////////////////////////////////////////////////////////
+void
+rxvt_screen::set (rxvt_display *disp)
+{
+ display = disp;
+
+ xdisp = disp->display;
+
+ Screen *screen = ScreenOfDisplay (xdisp, disp->screen);
+
+ depth = DefaultDepthOfScreen (screen);
+ visual = DefaultVisualOfScreen (screen);
+ cmap = DefaultColormapOfScreen (screen);
+}
+
+void
+rxvt_screen::set (rxvt_display *disp, int depth)
+{
+ set (disp);
+
+ XVisualInfo vinfo;
+
+ if (XMatchVisualInfo (xdisp, display->screen, depth, TrueColor, &vinfo))
+ {
+ this->depth = depth;
+ this->visual = vinfo.visual;
+ this->cmap = XCreateColormap (xdisp, disp->root, visual, AllocNone);
+ }
+}
+
+void
+rxvt_screen::clear ()
+{
+ if (cmap != DefaultColormapOfScreen (ScreenOfDisplay (xdisp, display->screen)))
+ XFreeColormap (xdisp, cmap);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
rxvt_display::rxvt_display (const char *id)
: refcounted (id)
, x_ev (this, &rxvt_display::x_cb)
screen = DefaultScreen (display);
root = DefaultRootWindow (display);
- visual = DefaultVisual (display, screen);
- cmap = DefaultColormap (display, screen);
- depth = DefaultDepth (display, screen);
assert (sizeof (xa_names) / sizeof (char *) == NUM_XA);
XInternAtoms (display, (char **)xa_names, NUM_XA, False, xa);
XUnloadFont (display, f);
#endif
-#ifdef PREFER_24BIT
- /*
- * If depth is not 24, look for a 24bit visual.
- */
- if (depth != 24)
- {
- XVisualInfo vinfo;
-
- if (XMatchVisualInfo (display, screen, 24, TrueColor, &vinfo))
- {
- depth = 24;
- visual = vinfo.visual;
- cmap = XCreateColormap (display,
- RootWindow (display, screen),
- visual, AllocNone);
- }
- }
-#endif
-
int fd = XConnectionNumber (display);
#ifndef NO_SLOW_LINK_SUPPORT
/////////////////////////////////////////////////////////////////////////////
bool
-rxvt_color::set (rxvt_display *display, Pixel p)
+rxvt_color::set (rxvt_screen *screen, Pixel p)
{
#if XFT
XColor xc;
xc.pixel = p;
- if (!XQueryColor (display->display, display->cmap, &xc))
+ if (!XQueryColor (screen->xdisp, screen->cmap, &xc))
return false;
XRenderColor d;
d.alpha = 0xffff;
return
- XftColorAllocValue (display->display,
- display->visual,
- display->cmap,
+ XftColorAllocValue (screen->xdisp,
+ screen->visual,
+ screen->cmap,
&d, &c);
#else
this->p = p;
}
bool
-rxvt_color::set (rxvt_display *display, const char *name)
+rxvt_color::set (rxvt_screen *screen, const char *name)
{
#if XFT
- return XftColorAllocName (display->display, display->visual, display->cmap,
- name, &c);
+ return XftColorAllocName (screen->xdisp, screen->visual, screen->cmap, name, &c);
#else
XColor xc;
- if (XParseColor (display->display, display->cmap, name, &xc))
- return set (display, xc.red, xc.green, xc.blue);
+ if (XParseColor (screen->xdisp, screen->cmap, name, &xc))
+ return set (screen, xc.red, xc.green, xc.blue);
return false;
#endif
}
bool
-rxvt_color::set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb)
+rxvt_color::set (rxvt_screen *screen, unsigned short cr, unsigned short cg, unsigned short cb)
{
XColor xc;
xc.blue = cb;
xc.flags = DoRed | DoGreen | DoBlue;
- if (XAllocColor (display->display, display->cmap, &xc))
- return set (display, xc.pixel);
+ if (XAllocColor (screen->xdisp, screen->cmap, &xc))
+ return set (screen, xc.pixel);
return false;
}
void
-rxvt_color::get (rxvt_display *display, unsigned short &cr, unsigned short &cg, unsigned short &cb)
+rxvt_color::get (rxvt_screen *screen, unsigned short &cr, unsigned short &cg, unsigned short &cb)
{
#if XFT
cr = c.color.red;
XColor c;
c.pixel = p;
- XQueryColor (display->display, display->cmap, &c);
+ XQueryColor (screen->xdisp, screen->cmap, &c);
cr = c.red;
cg = c.green;
}
void
-rxvt_color::free (rxvt_display *display)
+rxvt_color::free (rxvt_screen *screen)
{
#if XFT
- XftColorFree (display->display, display->visual, display->cmap, &c);
+ XftColorFree (screen->xdisp, screen->visual, screen->cmap, &c);
#else
- XFreeColors (display->display, display->cmap, &p, 1, AllPlanes);
+ XFreeColors (screen->xdisp, screen->cmap, &p, 1, AllPlanes);
#endif
}
rxvt_color
-rxvt_color::fade (rxvt_display *display, int percent)
+rxvt_color::fade (rxvt_screen *screen, int percent)
{
percent = 100 - percent;
unsigned short cr, cg, cb;
rxvt_color faded;
- get (display, cr, cg, cb);
+ get (screen, cr, cg, cb);
faded.set (
- display,
+ screen,
cr * percent / 100,
cg * percent / 100,
cb * percent / 100
#define LERP(a,b,p) (a * p + b * (100 - p)) / 100
rxvt_color
-rxvt_color::fade (rxvt_display *display, int percent, rxvt_color &fadeto)
+rxvt_color::fade (rxvt_screen *screen, int percent, rxvt_color &fadeto)
{
percent = 100 - percent;
unsigned short fcr, fcg, fcb;
rxvt_color faded;
- get (display, cr, cg, cb);
- fadeto.get(display, fcr, fcg, fcb);
+ get (screen, cr, cg, cb);
+ fadeto.get (screen, fcr, fcg, fcb);
faded.set (
- display,
+ screen,
LERP (cr, fcr, percent),
LERP (cg, fcg, percent),
LERP (cb, fcb, percent)
};
#endif
+struct rxvt_screen {
+ rxvt_display *display;
+ Display *xdisp;
+ int depth;
+ Visual *visual;
+ Colormap cmap;
+
+ void set (rxvt_display *disp);
+ void set (rxvt_display *disp, int depth);
+ void clear ();
+};
+
struct rxvt_display : refcounted {
io_manager_vec<xevent_watcher> xw;
//public
Display *display;
- int depth;
int screen;
- Visual *visual;
- Colormap cmap;
Window root;
rxvt_term *selection_owner;
Atom xa[NUM_XA];
bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); }
bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); }
- void get (rxvt_display *display, unsigned short &cr, unsigned short &cg, unsigned short &cb);
+ void get (rxvt_screen *screen, unsigned short &cr, unsigned short &cg, unsigned short &cb);
- bool set (rxvt_display *display, Pixel p);
- bool set (rxvt_display *display, const char *name);
- bool set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb);
+ bool set (rxvt_screen *screen, Pixel p);
+ bool set (rxvt_screen *screen, const char *name);
+ bool set (rxvt_screen *screen, unsigned short cr, unsigned short cg, unsigned short cb);
- rxvt_color fade (rxvt_display *, int percent); // fades to black
- rxvt_color fade (rxvt_display *, int percent, rxvt_color &fadeto);
+ rxvt_color fade (rxvt_screen *screen, int percent); // fades to black
+ rxvt_color fade (rxvt_screen *screen, int percent, rxvt_color &fadeto);
- void free (rxvt_display *display);
+ void free (rxvt_screen *screen);
};
#endif
rxvt_term::selection_send (const XSelectionRequestEvent &rq) NOTHROW
{
XSelectionEvent ev;
- dDisp;
ev.type = SelectionNotify;
ev.property = None;
*target++ = xa[XA_UTF8_STRING];
#endif
- XChangeProperty (disp, rq.requestor, rq.property, XA_ATOM,
+ XChangeProperty (xdisp, 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 (disp, rq.requestor, rq.property, rq.target,
+ XChangeProperty (xdisp, rq.requestor, rq.property, rq.target,
32, PropModeReplace, (unsigned char *)&selection_time, 1);
ev.property = rq.property;
}
}
else
#endif
- if (XwcTextListToTextProperty (disp, &cl, 1, (XICCEncodingStyle) style, &ct) >= 0)
+ if (XwcTextListToTextProperty (xdisp, &cl, 1, (XICCEncodingStyle) style, &ct) >= 0)
freect = 1;
else
{
ct.encoding = target;
}
- XChangeProperty (disp, rq.requestor, rq.property,
+ XChangeProperty (xdisp, rq.requestor, rq.property,
ct.encoding, 8, PropModeReplace,
ct.value, (int)ct.nitems);
ev.property = rq.property;
XFree (ct.value);
}
- XSendEvent (disp, rq.requestor, False, 0L, (XEvent *)&ev);
+ XSendEvent (xdisp, rq.requestor, False, 0L, (XEvent *)&ev);
}
\f
/* ------------------------------------------------------------------------- *
Pixmap d;
GC pointcolour;
- d = XCreatePixmap (display->display, scrollBar.win, width, height, display->depth);
+ d = XCreatePixmap (display->display, scrollBar.win, width, height, depth);
for (y = 0; y < height; y++)
{
XColor xcol;
Pixmap stipple;
unsigned long light, dark;
- dDisp;
gcvalue.graphics_exposures = False;
gcvalue.foreground = pix_colors_focused[Color_Black];
- blackGC = XCreateGC (disp, scrollBar.win,
- GCForeground | GCGraphicsExposures, &gcvalue);
+ blackGC = XCreateGC (xdisp, scrollBar.win,
+ GCForeground | GCGraphicsExposures, &gcvalue);
gcvalue.foreground = pix_colors_focused[Color_White];
- whiteGC = XCreateGC (disp, scrollBar.win,
- GCForeground | GCGraphicsExposures, &gcvalue);
+ whiteGC = XCreateGC (xdisp, scrollBar.win,
+ GCForeground | GCGraphicsExposures, &gcvalue);
xcol.red = 0xaeba;
xcol.green = 0xaaaa;
xcol.blue = 0xaeba;
xcol.pixel = pix_colors_focused[Color_scroll];
light = gcvalue.foreground = xcol.pixel;
- grayGC = XCreateGC (disp, scrollBar.win,
- GCForeground | GCGraphicsExposures, &gcvalue);
+ grayGC = XCreateGC (xdisp, scrollBar.win,
+ GCForeground | GCGraphicsExposures, &gcvalue);
xcol.red = 0x51aa;
xcol.green = 0x5555;
//if (!rXAllocColor (&xcol, "dark gray"))//TODO//D//
xcol.pixel = pix_colors_focused[Color_Grey25];
dark = gcvalue.foreground = xcol.pixel;
- darkGC = XCreateGC (disp, scrollBar.win,
+ darkGC = XCreateGC (xdisp, scrollBar.win,
GCForeground | GCGraphicsExposures, &gcvalue);
- stipple = XCreateBitmapFromData (disp, scrollBar.win,
- (char *)n_stp_bits, n_stp_width,
- n_stp_height);
+ stipple = XCreateBitmapFromData (xdisp, scrollBar.win,
+ (char *)n_stp_bits, n_stp_width,
+ n_stp_height);
gcvalue.foreground = dark;
gcvalue.background = light;
gcvalue.fill_style = FillOpaqueStippled;
gcvalue.stipple = stipple;
- /* XSetWindowBackground (disp, scrollBar.win, pix_colors_focused[Color_Red]); */
+ /* XSetWindowBackground (xdisp, scrollBar.win, pix_colors_focused[Color_Red]); */
- stippleGC = XCreateGC (disp, scrollBar.win,
- GCForeground | GCBackground | GCStipple
- | GCFillStyle | GCGraphicsExposures, &gcvalue);
+ stippleGC = XCreateGC (xdisp, scrollBar.win,
+ GCForeground | GCBackground | GCStipple
+ | GCFillStyle | GCGraphicsExposures, &gcvalue);
dimple = renderPixmap (SCROLLER_DIMPLE, SCROLLER_DIMPLE_WIDTH,
SCROLLER_DIMPLE_HEIGHT);
rxvt_term::drawBevel (Drawable d, int x1, int y1, int w, int h)
{
int x2, y2;
- dDisp;
x2 = x1 + w - 1; /* right point */
y2 = y1 + h - 1; /* bottom point */
/* white top and left */
- XDrawLine (disp, d, whiteGC, x1, y1, x2, y1);
- XDrawLine (disp, d, whiteGC, x1, y1, x1, y2);
+ XDrawLine (xdisp, d, whiteGC, x1, y1, x2, y1);
+ XDrawLine (xdisp, d, whiteGC, x1, y1, x1, y2);
/* black bottom and right */
- XDrawLine (disp, d, blackGC, x1, y2, x2, y2);
- XDrawLine (disp, d, blackGC, x2, y1, x2, y2);
+ XDrawLine (xdisp, d, blackGC, x1, y2, x2, y2);
+ XDrawLine (xdisp, d, blackGC, x2, y1, x2, y2);
/* dark inside bottom and right */
x1++, y1++, x2--, y2--; /* move in one point */
- XDrawLine (disp, d, darkGC, x1, y2, x2, y2);
- XDrawLine (disp, d, darkGC, x2, y1, x2, y2);
+ XDrawLine (xdisp, d, darkGC, x1, y2, x2, y2);
+ XDrawLine (xdisp, d, darkGC, x2, y1, x2, y2);
}
int
{
int height = scrollBar.end + SB_BUTTON_TOTAL_HEIGHT + SB_PADDING;
Drawable s;
- dDisp;
if ((scrollBar.init & R_SB_NEXT) == 0)
{
if (top_row == 0 || !update)
{
- XFillRectangle (disp, scrollBar.win, grayGC, 0, 0,
- SB_WIDTH_NEXT + 1, height);
- XDrawRectangle (disp, scrollBar.win, blackGC, 0,
- -SB_BORDER_WIDTH, SB_WIDTH_NEXT,
- height + SB_BORDER_WIDTH);
- XFillRectangle (disp, scrollBar.win, stippleGC,
- SB_LEFT_PADDING, 0, SB_BUTTON_WIDTH, height);
+ XFillRectangle (xdisp, scrollBar.win, grayGC, 0, 0,
+ SB_WIDTH_NEXT + 1, height);
+ XDrawRectangle (xdisp, scrollBar.win, blackGC, 0,
+ -SB_BORDER_WIDTH, SB_WIDTH_NEXT,
+ height + SB_BORDER_WIDTH);
+ XFillRectangle (xdisp, scrollBar.win, stippleGC,
+ SB_LEFT_PADDING, 0, SB_BUTTON_WIDTH, height);
}
if (top_row)
{
if (last_top < scrollBar.top || !update)
- XFillRectangle (disp, scrollBar.win, stippleGC,
- SB_LEFT_PADDING, SB_PADDING + last_top,
- SB_BUTTON_WIDTH, scrollBar.top - last_top);
+ XFillRectangle (xdisp, scrollBar.win, stippleGC,
+ SB_LEFT_PADDING, SB_PADDING + last_top,
+ SB_BUTTON_WIDTH, scrollBar.top - last_top);
if (scrollBar.bot < last_bot || !update)
- XFillRectangle (disp, scrollBar.win, stippleGC,
- SB_LEFT_PADDING, scrollBar.bot + SB_PADDING,
- SB_BUTTON_WIDTH, (last_bot - scrollBar.bot));
+ XFillRectangle (xdisp, scrollBar.win, stippleGC,
+ SB_LEFT_PADDING, scrollBar.bot + SB_PADDING,
+ SB_BUTTON_WIDTH, (last_bot - scrollBar.bot));
- XFillRectangle (disp, scrollBar.win, grayGC,
- SB_LEFT_PADDING, scrollBar.top + SB_PADDING,
- SB_BUTTON_WIDTH, scrollbar_len);
+ XFillRectangle (xdisp, scrollBar.win, grayGC,
+ SB_LEFT_PADDING, scrollBar.top + SB_PADDING,
+ SB_BUTTON_WIDTH, scrollbar_len);
- XCopyArea (disp, 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 +
- (scrollbar_len - SCROLLER_DIMPLE_HEIGHT) / 2);
+ XCopyArea (xdisp, 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 +
+ (scrollbar_len - SCROLLER_DIMPLE_HEIGHT) / 2);
drawBevel (scrollBar.win, SB_BUTTON_BEVEL_X,
scrollBar.top + SB_PADDING, SB_BUTTON_WIDTH,
SB_BUTTON_HEIGHT);
s = (scrollbar_isUp ()) ? upArrowHi : upArrow;
- XCopyArea (disp, s, scrollBar.win, whiteGC, 0, 0,
- ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X,
- height - SB_BUTTON_BOTH_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT);
+ XCopyArea (xdisp, 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 (disp, s, scrollBar.win, whiteGC, 0, 0,
- ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X,
- height - SB_BUTTON_SINGLE_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT);
+ XCopyArea (xdisp, s, scrollBar.win, whiteGC, 0, 0,
+ ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X,
+ height - SB_BUTTON_SINGLE_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT);
}
return 1;
// VERSION _must_ be \d.\d+
-#define VERSION "7.2"
+#define VERSION "7.3"
#define DATE "2006-01-22"
BOOL (Rs_override_redirect, "override-redirect", "override-redirect", Opt_override_redirect, "set override-redirect on the terminal window"),
STRG (Rs_pty_fd, NULL, "pty-fd", "fileno", "file descriptor of pty to use"),
BOOL (Rs_hold, "hold", "hold", Opt_hold, "retain window after shell exit"),
+ STRG (Rs_depth, "depth", "depth", "number", "depth of visual to request"),
STRG (Rs_ext_bwidth, "externalBorder", "w", "number", "external border in pixels"),
STRG (Rs_ext_bwidth, NULL, "bw", NULL, NULL),
STRG (Rs_ext_bwidth, NULL, "borderwidth", NULL, NULL),
#if defined(ENABLE_FRILLS)
"frills,"
#endif
-#if defined(PREFER_24BIT)
- "24bit,"
-#endif
#if defined(SELECTION_SCROLLING)
"selectionscrolling,"
#endif
{
XGCValues gcvalue;
GC gc;
- dDisp;
if (pixmap != None)
- XFreePixmap (disp, pixmap);
+ XFreePixmap (xdisp, pixmap);
if (bgPixmap.pixmap == None)
{ /* So be it: I'm not using pixmaps */
pixmap = None;
if (!OPTION (Opt_transparent) || !am_transparent)
- XSetWindowBackground (disp, vt, pix_colors[Color_bg]);
+ XSetWindowBackground (xdisp, vt, pix_colors[Color_bg]);
return;
}
gcvalue.foreground = pix_colors[Color_bg];
- gc = XCreateGC (disp, vt, GCForeground, &gcvalue);
+ gc = XCreateGC (xdisp, 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 (disp, vt, xpmw, xpmh, display->depth);
+ pixmap = XCreatePixmap (xdisp, vt, xpmw, xpmh, depth);
- XCopyArea (disp, bgPixmap.pixmap, pixmap, gc, x, y, xpmw - x, xpmh - y, 0, 0);
- XCopyArea (disp, bgPixmap.pixmap, pixmap, gc, x, 0, xpmw - x, y, 0, xpmh - y);
- XCopyArea (disp, bgPixmap.pixmap, pixmap, gc, 0, y, x, xpmh - y, xpmw - x, 0);
- XCopyArea (disp, bgPixmap.pixmap, pixmap, gc, 0, 0, x, y, xpmw - x, xpmh - y);
+ 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);
}
else
{
float incr, p;
Pixmap tmp;
- pixmap = XCreatePixmap (disp, vt, width, height,
- (unsigned int)display->depth);
+ pixmap = XCreatePixmap (xdisp, vt, width, height, depth);
/*
* horizontal scaling
*/
rxvt_pixmap_incr (&w, &x, &incr, &p, width, xpmw);
- tmp = XCreatePixmap (disp, vt, width, xpmh, (unsigned int)display->depth);
- XFillRectangle (disp, tmp, gc, 0, 0, width, xpmh);
+ tmp = XCreatePixmap (xdisp, vt, width, xpmh, depth);
+ XFillRectangle (xdisp, 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 (disp, bgPixmap.pixmap, tmp, gc,
- (int)p, 0, 1, xpmh, (int)x, 0);
+ XCopyArea (xdisp, 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 (disp, pixmap, gc, 0, 0, width, y);
+ XFillRectangle (xdisp, pixmap, gc, 0, 0, width, y);
if (h < height)
- XFillRectangle (disp, pixmap, gc, 0, (int)h, width, height - h + 1);
+ XFillRectangle (xdisp, 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 (disp, tmp, pixmap, gc,
- 0, (int)p, width, 1, 0, (int)y);
+ XCopyArea (xdisp, tmp, pixmap, gc, 0, (int)p, width, 1, 0, (int)y);
}
- XFreePixmap (disp, tmp);
+ XFreePixmap (xdisp, tmp);
}
}
- XSetWindowBackgroundPixmap (disp, vt, pixmap);
+ XSetWindowBackgroundPixmap (xdisp, vt, pixmap);
if (pixmap != None)
{
- XFreePixmap (disp, pixmap);
+ XFreePixmap (xdisp, pixmap);
pixmap = None;
}
- XFreeGC (disp, gc);
+ XFreeGC (xdisp, gc);
am_transparent = 0;
}
/* XGetWindowAttributes (display->display, vt, &attr); */
xpmAttr.closeness = 30000;
- xpmAttr.colormap = display->cmap;
- xpmAttr.visual = display->visual;
- xpmAttr.depth = display->depth;
- xpmAttr.valuemask = (XpmCloseness | XpmColormap | XpmVisual |
- XpmDepth | XpmSize | XpmReturnPixels);
+ xpmAttr.colormap = cmap;
+ xpmAttr.visual = visual;
+ xpmAttr.depth = depth;
+ xpmAttr.valuemask = (XpmCloseness | XpmColormap | XpmVisual
+ | XpmDepth | XpmSize | XpmReturnPixels);
/* search environment variables here too */
f = (char *)rxvt_File_find (file, ".xpm", rs[Rs_path]);
if (f == NULL
|| XpmReadFileToPixmap (display->display, display->root, f,
- &bgPixmap.pixmap, NULL,
- &xpmAttr))
+ &bgPixmap.pixmap, NULL,
+ &xpmAttr))
{
char *p;