#define TIMING_TEST_START(id) \
struct timeval timing_test_##id##_stv;\
gettimeofday (&timing_test_##id##_stv, NULL);
-
+
#define TIMING_TEST_PRINT_RESULT(id) \
do{ struct timeval tv;gettimeofday (&tv, NULL); tv.tv_sec -= (timing_test_##id##_stv).tv_sec;\
fprintf (stderr, "%s: %s: %d: elapsed %ld usec\n", #id, __FILE__, __LINE__,\
x = y = defaultAlign;
w = h = defaultScale;
}
-
+
if (!(flags & geometrySet))
geom_flags |= WidthValue|HeightValue|XValue|YValue;
if ((w > 0 && w != original_asim->width)
|| (h > 0 && h != original_asim->height))
{
- result = scale_asimage (target->asv, original_asim,
- w > 0 ? w : original_asim->width,
+ result = scale_asimage (target->asv, original_asim,
+ w > 0 ? w : original_asim->width,
h > 0 ? h : original_asim->height,
background ? ASA_ASImage : ASA_XImage,
100, ASIMAGE_QUALITY_DEFAULT);
if (h_scale == 0 || v_scale == 0)
{
ASImage *tmp = tile_asimage (target->asv, result,
- (h_scale > 0) ? 0 : (int)result->width - x,
- (v_scale > 0) ? 0 : (int)result->height - y,
+ (h_scale > 0) ? 0 : (int)result->width - x,
+ (v_scale > 0) ? 0 : (int)result->height - y,
result->width, result->height,
TINT_LEAVE_SAME, ASA_XImage,
100, ASIMAGE_QUALITY_DEFAULT);
/* put result on pixmap */
if (dst_x < new_pmap_width && dst_y < new_pmap_height)
asimage2drawable (target->asv, pixmap, result, gc, src_x, src_y, dst_x, dst_y, dst_width, dst_height, True);
-
+
if (result != background && result != original_asim)
destroy_asimage (&result);
free (f);
}
return (original_asim != NULL);
-# endif
+# endif
}
return false;
}
# endif /* BG_IMAGE_FROM_FILE */
# ifdef ENABLE_TRANSPARENCY
-bool
+bool
bgPixmap_t::set_transparent ()
{
if (!(flags & isTransparent))
++changed;
v_blurRadius = vr;
}
-
+
if (v_blurRadius == 0 && h_blurRadius == 0)
flags &= ~blurNeeded;
else
flags |= bgPixmap_t::tintNeeded;
}
}
-
+
if (flags & bgPixmap_t::tintNeeded)
{
if (flags & bgPixmap_t::tintWholesome)
return false;
}
-/* make_transparency_pixmap()
+/* make_transparency_pixmap()
* Builds a pixmap sized the same as terminal window, with depth same as the root window
- * that pixmap contains tiled portion of the root pixmap that is supposed to be covered by
+ * that pixmap contains tiled portion of the root pixmap that is supposed to be covered by
* our window.
*/
unsigned long
if (tiled_root_pmap != None)
{
- if (!need_client_side_rendering ())
+ if (!need_client_side_rendering ())
{
- if ((flags & tintNeeded))
+ if ((flags & tintNeeded))
{
if (flags & tintWholesome)
{
Picture overlay_pic = XRenderCreatePicture (dpy, overlay_pmap, solid_format, CPRepeat, &pa);
XFreePixmap (dpy, overlay_pmap);
- pa.component_alpha = True;
+ pa.component_alpha = True;
Pixmap mask_pmap = XCreatePixmap (dpy, root, 1, 1, 32);
Picture mask_pic = XRenderCreatePicture (dpy, mask_pmap, solid_format, CPRepeat|CPComponentAlpha, &pa);
XFreePixmap (dpy, mask_pmap);
XRenderFreePicture (dpy, back_pic);
# if DO_TIMING_TEST
XSync (dpy, False);
-# endif
+# endif
# endif
}
}
pmap_height = window_height;
pmap_depth = root_depth;
}
-
+
if (gc)
XFreeGC (dpy, gc);
TIMING_TEST_PRINT_RESULT (tp);
-
- return result;
+
+ return result;
}
bool
bgPixmap_t::set_root_pixmap ()
{
Pixmap new_root_pixmap = None;
-
+
new_root_pixmap = target->get_pixmap_property (XA_XROOTPMAP_ID);
if (new_root_pixmap == None)
new_root_pixmap = target->get_pixmap_property (XA_ESETROOT_PMAP_ID);
TIMING_TEST_PRINT_RESULT (tp);
- return true;
+ return true;
}
-bool
+bool
bgPixmap_t::set_target (rxvt_term *new_target)
{
if (new_target)
XSetWindowBackground (target->dpy, target->scrollBar.win, target->pix_colors[Color_border]);
# endif
}
- /* don't want Expose on the parent or vt. It is better to use
+ /* don't want Expose on the parent or vt. It is better to use
scr_touch or we get a great deal of flicker otherwise: */
XClearWindow (target->dpy, target->parent[0]);
}; /* this flags are returned by make_transparency_pixmap if called */
bool check_clearChanged () { bool r = flags & hasChanged; flags &= ~hasChanged; return r; };
-
+
# ifdef BG_IMAGE_FROM_FILE
# ifdef HAVE_AFTERIMAGE
ASImage *original_asim;
bool render ();
void invalidate () {
if (!(flags & isInvalid))
- {
- flags |= isInvalid;
+ {
+ flags |= isInvalid;
invalid_since = NOW;
}
};
rxvt_term::flush ()
{
flush_ev.stop ();
-
-#ifdef HAVE_BG_PIXMAP
+
+#ifdef HAVE_BG_PIXMAP
if (bgPixmap.check_clearChanged ())
{
// scr_clear (true); This needs to be researched further!
{ "ISO885915", CS_ISO8859_15 },
{ "FCD885915", CS_ISO8859_15 },
{ "ISO885916", CS_ISO8859_16 },
-
+
{ "TIS620*", CS_ISO8859_11 }, // close enough
{ "ISO10646*", CS_UNICODE },
{ "UNICODE", CS_UNICODE },
{ "UTF8", CS_UNICODE },
-
+
{ "ASCII", CS_US_ASCII },
{ "USASCII", CS_US_ASCII },
{ "ANSIX341968", CS_US_ASCII },
{ "ISO646.1991-IRV", CS_US_ASCII }, // older versions used the currency sign
-
+
{ "KOI8R*", CS_KOI8_R },
{ "GOST1976874*", CS_KOI8_R },
{ "KOI8RU", CS_KOI8_U },
{ "KOI8U", CS_KOI8_U },
{ "VISCII*", CS_VISCII },
-
+
{ "JISX0201*", CS_JIS0201_1976_0 },
{ "JISC6226*", CS_JIS0208_1990_0 }, // also wrongly matches -1987-0? (check Encode::JP)
{ "JISX0208*", CS_JIS0208_1990_0 }, // also wrongly matches -1987-0? (check Encode::JP)
{ "JISX021320001", CS_JIS0213_1 },
{ "JISX021320002", CS_JIS0213_2 },
{ "JISX0221*", CS_UNICODE }, // _very_ close
-
+
{ "KSC5601*", CS_KSC5601_1987_0 },
{ "KSX1001*", CS_KSC5601_1987_0 },
{ "KSC5700*", CS_UNICODE }, // unicode plus extensions
-
+
{ "BIG5P*", CS_BIG5_PLUS },
{ "BIG5ETEN*", CS_BIG5_EXT },
{ "BIG5*", CS_BIG5 },
#else
# define ENC(base) { cs_ ## base ## _from_unicode }
#endif
-
+
// order must match table in encoding.h(!)
const rxvt_codeset_conv rxvt_codeset[NUM_CODESETS] = {
# define X11LIBDIR X11USRLIBDIR "/X11"
#endif
#ifndef XAPPLOADDIR
-# define XAPPLOADDIR X11LIBDIR "/app-defaults"
+# define XAPPLOADDIR X11LIBDIR "/app-defaults"
# define XAPPLOADDIRLOCALE X11LIBDIR "/%s/app-defaults"
#endif
* Allow 80/132 mode switching on startup
*/
/* #define ALLOW_132_MODE */
-
+
/*---------------------------------KEYS---------------------------------*/
/*
/*
* Allow scrolling with modifier+Up/Down keys, in addition
* to modifier+Prior/Next? (modifier is controlled with
- * SCROLL_ON_* defines above.).
+ * SCROLL_ON_* defines above.).
* Also for modifier+Home/End keys to move to top/bottom
*/
/* #define SCROLL_ON_UPDOWN_KEYS */
my $ch = 0x2500;
# coordinate system:
-#
+#
# 0..8 (equally spaced) 9,11 mid-1,mid+1, makes 4 bit
# one point = 8 bit, two points = 16 bit
emit 0, 0, 10,10, 10 if $h & 1;
emit 0, 0, 11,10, 11 if $h > 1;
}
-
+
if ($H) {
emit 0,10, 9, 8, 9 if $H > 1;
emit 0,10, 10, 8, 10 if $H & 1;
emit 0,10, 11, 8, 11 if $H > 1;
}
-
+
if ($v) {
emit 0, 9, 0, 9, 10 if $v > 1;
emit 0,10, 0,10, 10 if $v & 1;
emit 0,11, 0,11, 10 if $v > 1;
}
-
+
if ($V) {
emit 0, 9, 10, 9, 8 if $V > 1;
emit 0,10, 10,10, 8 if $V & 1;
}
$offs[-1] = ($offs[-1] << 4) | ($offs - $offs[-1]);
-
+
printf " // %04x\n", $ch;
$ch++;
}
EU iso8859_10 iso-8859-10
EU iso8859_11 iso-8859-11
EU iso8859_13 iso-8859-13
-EU iso8859_14 iso-8859-14
+EU iso8859_14 iso-8859-14
DEFAULT iso8859_15 iso-8859-15
EU iso8859_16 iso-8859-16
JP jis0201_1976_0 jis0201-raw
"rgb:00/00/cd", // 4: blue (Blue3)
"rgb:cd/00/cd", // 5: magenta (Magenta3)
"rgb:00/cd/cd", // 6: cyan (Cyan3)
-# ifdef XTERM_COLORS
+# ifdef XTERM_COLORS
"rgb:e5/e5/e5", // 7: white (Grey90)
-# else
+# else
"rgb:fa/eb/d7", // 7: white (AntiqueWhite)
# endif
/* high-intensity colors */
#ifdef OFF_FOCUS_FADING
pix_colors = pix_colors_focused;
#endif
-
+
for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++)
{
const char *name = rs[Rs_color + i];
/*
iom_conf.h -- generic I/O multiplexer config
Copyright (C) 2003-2006 Marc Lehmann <pcg@goof.com>
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
{
char *middle = strchr (translation + 5, translation [4]);
char *suffix = strrchr (translation + 5, translation [4]);
-
+
if (suffix && middle && suffix > middle + 1)
{
key->type = keysym_t::LIST;
int hashkey = keysym & KEYSYM_HASH_MASK;
unsigned int index = hash [hashkey];
unsigned int end = hashkey < KEYSYM_HASH_BUDGETS - 1
- ? hash [hashkey + 1]
+ ? hash [hashkey + 1]
: keymap.size ();
for (; index < end; ++index)
text_t rxvt_composite_vec::compose (unicode_t c1, unicode_t c2)
{
compose_char *cc;
-
+
// break compose chains, as stupid readline really likes to duplicate
// composing characters for some reason near the end of a line.
cc = (*this)[c1];
#ifdef USE_XIM
im_ev (this, &rxvt_term::im_cb),
#endif
-#ifndef NO_BELL
+#ifndef NO_BELL
bell_ev (this, &rxvt_term::bell_cb),
#endif
termwin_ev (this, &rxvt_term::x_cb),
mesg, BUFSIZ);
rxvt_warn (strncat (mesg, "\n", BUFSIZ), event->resourceid);
}
- XGetErrorDatabaseText(dpy, mtype, "ErrorSerial", "Error Serial #%d",
+ XGetErrorDatabaseText(dpy, mtype, "ErrorSerial", "Error Serial #%d",
mesg, BUFSIZ);
rxvt_warn (strncat (mesg, "\n", BUFSIZ), event->serial);
}
if (option (Opt_transparent))
{
bgPixmap.set_transparent ();
-#ifdef HAVE_AFTERIMAGE
+#ifdef HAVE_AFTERIMAGE
if (rs [Rs_blurradius])
bgPixmap.set_blur_radius (rs [Rs_blurradius]);
-#endif
+#endif
if (ISSET_PIXCOLOR (Color_tint))
bgPixmap.set_tint (pix_colors_focused [Color_tint]);
if (rs [Rs_shade])
static struct sig_handlers
{
sig_watcher sw_term, sw_int;
-
+
/*
* Catch a fatal signal and tidy up before quitting
*/
resize_all_windows (0, 0, 0);
scr_remap_chars ();
scr_touch (true);
- }
+ }
return true;
}
#ifdef XTERM_COLOR_CHANGE
rxvt_color xcol;
int i;
-
+
if (color == NULL || *color == '\0')
return;
}
else
str = (void *)text->string.wide_char;
-
+
HOOK_INVOKE ((term, HOOK_XIM_PREEDIT_DRAW,
DT_INT, call_data->caret,
DT_INT, call_data->chg_first,
{
im_set_size (preedit_rect);
preedit_attr = XVaCreateNestedList (0, XNArea, &preedit_rect, NULL);
-
+
XSetICValues (Input_Context,
XNPreeditAttributes, preedit_attr, NULL);
}
else if (s[0] < 0x80)
*p++ = *s++;
else if (len >= 2
- && s[0] >= 0xc2 && s[0] <= 0xdf
+ && s[0] >= 0xc2 && s[0] <= 0xdf
&& (s[1] & 0xc0) == 0x80)
{
*p++ = ((s[0] & 0x1f) << 6)
&& (s[2] & 0xc0) == 0x80
&& (s[3] & 0xc0) == 0x80)
{
- *p++ = ((s[0] & 0x07) << 18)
- | ((s[1] & 0x3f) << 12)
- | ((s[2] & 0x3f) << 6)
+ *p++ = ((s[0] & 0x07) << 18)
+ | ((s[1] & 0x3f) << 12)
+ | ((s[2] & 0x3f) << 6)
| (s[3] & 0x3f);
s += 4;
}
/*
*****************************************************************************
- * PROTOTYPES
+ * PROTOTYPES
*****************************************************************************
*/
// main.C
#if ENABLE_XEMBED
// XEMBED messages
-# define XEMBED_EMBEDDED_NOTIFY 0
-# define XEMBED_WINDOW_ACTIVATE 1
-# define XEMBED_WINDOW_DEACTIVATE 2
-# define XEMBED_REQUEST_FOCUS 3
-# define XEMBED_FOCUS_IN 4
-# define XEMBED_FOCUS_OUT 5
-# define XEMBED_FOCUS_NEXT 6
+# define XEMBED_EMBEDDED_NOTIFY 0
+# define XEMBED_WINDOW_ACTIVATE 1
+# define XEMBED_WINDOW_DEACTIVATE 2
+# define XEMBED_REQUEST_FOCUS 3
+# define XEMBED_FOCUS_IN 4
+# define XEMBED_FOCUS_OUT 5
+# define XEMBED_FOCUS_NEXT 6
# define XEMBED_FOCUS_PREV 7
-# define XEMBED_MODALITY_ON 10
-# define XEMBED_MODALITY_OFF 11
-# define XEMBED_REGISTER_ACCELERATOR 12
-# define XEMBED_UNREGISTER_ACCELERATOR 13
+# define XEMBED_MODALITY_ON 10
+# define XEMBED_MODALITY_OFF 11
+# define XEMBED_REGISTER_ACCELERATOR 12
+# define XEMBED_UNREGISTER_ACCELERATOR 13
# define XEMBED_ACTIVATE_ACCELERATOR 14
// XEMBED detail code
-# define XEMBED_FOCUS_CURRENT 0
-# define XEMBED_FOCUS_FIRST 1
+# define XEMBED_FOCUS_CURRENT 0
+# define XEMBED_FOCUS_FIRST 1
# define XEMBED_FOCUS_LAST 2
# define XEMBED_MAPPED (1 << 0)
C0_BS , C0_HT , C0_LF , C0_VT , C0_FF , C0_CR , C0_SO , C0_SI ,
C0_DLE, C0_DC1, C0_DC2, D0_DC3, C0_DC4, C0_NAK, C0_SYN, C0_ETB,
C0_CAN, C0_EM , C0_SUB, C0_ESC, C0_IS4, C0_IS3, C0_IS2, C0_IS1,
-};
+};
#define CHAR_ST 0x9c /* 0234 */
/*
static const char resval_undef []; // options specifically unset
static const char resval_on []; // boolean options switched on
static const char resval_off []; // or off
-
+
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
#ifdef TEXT_BLINK
void text_blink_cb (time_watcher &w); time_watcher text_blink_ev;
#endif
-#ifndef NO_BELL
+#ifndef NO_BELL
void bell_cb (time_watcher &w); time_watcher bell_ev;
#endif
{
sockaddr_un sa;
char *sockname = rxvt_connection::unix_sockname ();
-
+
if (strlen(sockname) >= sizeof(sa.sun_path))
{
fputs ("socket name too long, aborting.\n", stderr);
exit (STATUS_FAILURE);
}
-
+
if ((fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
{
perror ("unable to create communications socket");
: accept_ev (this, &unix_listener::accept_cb)
{
sockaddr_un sa;
-
+
if (strlen (sockname) >= sizeof(sa.sun_path))
{
fputs ("socket name too long, aborting.\n", stderr);
{
stringvec *argv = new stringvec;
stringvec *envv = new stringvec;
-
+
for (;;)
{
if (!recv (tok))
{
rxvt_term *term = new rxvt_term;
-
+
term->log_hook = &log_cb;
term->getfd_hook = &getfd_cb;
bool success;
-
+
try
{
success = term->init (argv, envv);
return EXIT_FAILURE;
}
}
-
+
chdir ("/");
if (opt_opendisplay)
{ CS_ISO8859_1, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-1" },
{ CS_ISO8859_15, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-15" },
{ CS_ISO8859_15, "-*-*-*-r-*--*-*-*-*-c-*-fcd8859-15" },
-
-#if ENCODING_EU
- // cyrillic
+
+#if ENCODING_EU
+ // cyrillic
{ CS_KOI8_R, "-*-*-*-r-*--*-*-*-*-c-*-koi8-r" },
{ CS_KOI8_U, "-*-*-*-r-*--*-*-*-*-c-*-koi8-u" },
-
+
{ CS_ISO8859_2, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-2" },
{ CS_ISO8859_3, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-3" },
{ CS_ISO8859_4, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-4" },
# if XFT
{ CS_KOI8_U, "xft::lang=ru" },
-
+
{ CS_ISO8859_5, "xft::lang=ru" },
{ CS_ISO8859_6, "xft::lang=ar" },
{ CS_ISO8859_7, "xft::lang=el" },
{
dTermDisplay;
dTermGC;
-
+
if (color == Color_bg || color == Color_transparent)
XClearArea (disp, d, x, y, w, h, false);
else if (color >= 0)
done = true;
}
}
-#endif
+#endif
if (!done)
XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h);
#else
if (a)
{
static char bm[] = { 0,0 , 3,1 , 1,2 , 1,0 };
-
+
gcv.fill_style = FillStippled;
gcv.stipple = XCreateBitmapFromData (disp, d, bm + a * 2, 2, 2);
gcv.ts_x_origin = x;
if (prop.weight != rxvt_fontprop::unset)
{
- replace_field (fname, name, 2, 0,
+ replace_field (fname, name, 2, 0,
prop.weight < rxvt_fontprop::bold
? "medium" : "bold");
set_name (strdup (fname));
if (encm)
N += (f->max_byte1 - f->min_byte1)
* (f->max_char_or_byte2 - f->min_char_or_byte2 + 1);
-
+
while (N)
{
if (f->per_char[N].width > width)
clear_rect (d, x, y, term->fwidth * len, term->fheight, bg);
XChangeGC (disp, gc, GCForeground | GCFont, &v);
-
+
if (slow)
{
do
clear_rect (d, x, y, term->fwidth * len, term->fheight, bg);
XChangeGC (disp, gc, GCForeground | GCFont, &v);
-
+
if (slow)
{
do
int h = term->fheight;
/* TODO: this logic needs some more thinking, since we no longer do pseudo-transparency.
- * Maybe make buffering into a resource flag? Compile time option doesn't seems like a
+ * Maybe make buffering into a resource flag? Compile time option doesn't seems like a
* good idea from the perspective of packaging for wide variety of user configs.
*/
bool buffered = true
while (len && *text == NOCHAR)
text++, len--, cwidth += term->fwidth;
-
+
if (fc != ' ') // skip spaces
{
FT_UInt glyph = XftCharIndex (disp, f, fc);
if (bg >= 0 && term->pix_colors[bg].c.color.alpha < 0x0ff00)
dst = XftDrawPicture (d2);
-
+
if (bg < 0 || dst != 0)
{
- int src_x = x, src_y = y ;
-
+ int src_x = x, src_y = y ;
+
if (term->bgPixmap.is_parentOrigin ())
{
src_x += term->window_vt_x;
src_y += term->window_vt_y;
}
-
+
if (term->bgPixmap.pmap_width >= src_x+w
&& term->bgPixmap.pmap_height >= src_y+h)
{
rxvt_fontset::new_font (const char *name, codeset cs)
{
rxvt_font *f;
-
+
if (!name || !*name)
{
name = "";
char fontname[4096];
sprintf (fontname, "xft:%-.4090s", font);
- fonts.push_back (new_font (fontname, CS_UNICODE));
+ fonts.push_back (new_font (fontname, CS_UNICODE));
}
free (font);
* |························= row_buf[2] etc.
* |
* +------------+···········= term_start + top_row
- * | scrollback |
+ * | scrollback |
* | scrollback +---------+·= term_start + view_start
* | scrollback | display |
* | scrollback | display |
if (htype == HOOK_REFRESH_END)
{
AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0));
-
+
for (int i = 0; i <= AvFILL (av); i++)
((overlay *)SvIV (*av_fetch (av, i, 0)))->swap ();
}
if (htype == HOOK_REFRESH_BEGIN)
{
AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0));
-
+
for (int i = AvFILL (av); i >= 0; i--)
((overlay *)SvIV (*av_fetch (av, i, 0)))->swap ();
}
{
clearSVptr ((SV *)term->perl.self);
SvREFCNT_dec ((SV *)term->perl.self);
-
+
// don't allow further calls
term->perl.self = 0;
}
EXTEND (SP, count);
while (count--)
PUSHs (newSVuv ((U32)props [count]));
-
+
XFree (props);
}
{
return (value * (mask + 1) >> 16) << shift;
}
-
+
bool
rxvt_color::alloc (rxvt_screen *screen, const rgba &color)
{
for (int i = 0; i < cmap_size; i++)
colors [i].pixel = i;
-
+
// many kilobytes transfer per colour, but pseudocolor isn't worth
// many extra optimisations.
XQueryColors (screen->dpy, screen->cmap, colors, cmap_size);
//rxvt_warn ("could not allocate %04x %04x %04x, getting %04x %04x %04x instead (%d)\n",
// color.r, color.g, color.b, best->red, best->green, best->blue, diff);
-
+
got = alloc (screen, rgba (best->red, best->green, best->blue));
delete [] colors;
color.pixel = (Pixel)*this;
}
-void
+void
rxvt_color::free (rxvt_screen *screen)
{
if (screen->visual->c_class == TrueColor)
void get (rgba &color);
void get (XColor &color);
-
+
bool set (rxvt_screen *screen, const char *name);
bool set (rxvt_screen *screen, const rgba &color);
rxvt_temp_buf (int len)
{
if (len > temp_len)
- {
+ {
temp_buf = realloc (temp_buf, len);
temp_len = len;
}
-
+
return temp_buf;
}
};
/* simplevec taken (and heavily modified), from:
- *
+ *
* MICO --- a free CORBA implementation
* Copyright (C) 1997-98 Kay Roemer & Arno Puder
*/
line_t *old_buf = row_buf;
row_buf = (line_t *)rxvt_calloc (total_rows + nrow, sizeof (line_t));
-
+
int p = MOD (term_start + prev_nrow, prev_total_rows); // previous row
int pend = MOD (term_start + top_row , prev_total_rows);
int q = total_rows; // rewrapped row
// see below for cursor adjustment rationale
if (p == ocur.row)
screen.cur.row = q - (total_rows - nrow);
-
+
// fill a single destination line
while (lofs < llen && qcol < ncol)
{
term_start = total_rows - nrow;
top_row = q - term_start;
-
+
// make sure all terminal lines exist
while (top_row > 0)
scr_blank_screen_mem (ROW (--top_row), DEFAULT_RSTYLE);
else
{
// if no scrollback exists (yet), wing, instead of wrap
-
+
for (int row = min (nrow, prev_nrow); row--; )
{
line_t &pline = old_buf [MOD (term_start + row, prev_total_rows)];
::swap (l1, l2);
l2.touch ();
}
-
+
// move and/or clear selection, if any
if (selection.op && current_screen == selection.screen)
{
selection.beg.row -= count;
selection.end.row -= count;
selection.mark.row -= count;
-
+
selection_check (0);
}
}
if (screen.flags & Screen_WrapNext)
{
scr_do_wrap ();
-
+
line->l = ncol;
line->is_longer (1);
if (!--count)
break;
}
- else
+ else
ht &= l.t[i] == ' '
&& RS_SAME (l.r[i], base_rend);
{
tt_printf ("\033[%d;%dR", screen.cur.row + 1, screen.cur.col + 1);
}
-\f
+
/* ------------------------------------------------------------------------- *
* FONTS *
* ------------------------------------------------------------------------- */
set_font_style ();
}
-\f
+
/* ------------------------------------------------------------------------- *
* MAJOR SCREEN MANIPULATION *
* ------------------------------------------------------------------------- */
scr_touch (true);
want_refresh = 1;
#endif
-
+
}
/* ------------------------------------------------------------------------- */
}
}
#endif
-\f
+
/* ------------------------------------------------------------------------- *
* CHARACTER SELECTION *
* ------------------------------------------------------------------------- */
incr_buf_size = 0;
incr_ev.stop ();
}
- else
+ else
{
if (selection_wait == Sel_normal
&& (win != display->root || prop != XA_CUT_BUFFER0)) // avoid recursion
/* ------------------------------------------------------------------------- */
/*
- * Request the current selection:
+ * Request the current selection:
* Order: > internal selection if available
* > PRIMARY, SECONDARY, CLIPBOARD if ownership is claimed (+)
* > CUT_BUFFER0
while (selection.mark.col > 0
&& ROW(selection.mark.row).t[selection.mark.col] == NOCHAR)
--selection.mark.col;
-
+
if (selection.op)
{ /* clear the old selection */
selection.beg.row = selection.end.row = selection.mark.row;
XSendEvent (dpy, rq.requestor, False, 0L, (XEvent *)&ev);
}
-\f
+
/* ------------------------------------------------------------------------- *
* MOUSE ROUTINES *
* ------------------------------------------------------------------------- */
if ($htype == 0) { # INIT
my @dirs = ((split /:/, $TERM->resource ("perl_lib")), "$LIBDIR/perl");
-
+
my %ext_arg;
{
->cb (sub {
$term->{overlay}->set (0, 0,
sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]);
- });
+ });
=over 4
->cb (sub {
my ($pw, $exit_status) = @_;
...
- });
+ });
=over 4