# support and is a good baseline :)
./configure --prefix=/opt/rxvt --enable-utmp \
- --enable-wtmp --enable-lastlog --enable-xim --disable-strings \
+ --enable-wtmp --enable-lastlog --disable-strings --enable-xim \
--with-term=rxvt --disable-keepscrolling --enable-xft --enable-mousewheel \
--with-name=rxvt --enable-selectionscrolling --enable-pointer-blank \
--enable-frills --enable-swapscreen --enable-transparency --enable-slipwheeling \
- --with-codesets=eu,jp --enable-menubar --enable-tinting \
+ --with-codesets=all --enable-menubar --enable-tinting \
--enable-cursor-blink --enable-text-blink --enable-fading \
--enable-plain-scroll --enable-rxvt-scroll --enable-combining \
"$@"
}
display->flush ();
+
+ flush_ev.stop ();
}
void
SET_R (this);
SET_LOCALE (locale);
+ display->flush ();
+
+ if (!flush_ev.active)
+ flush_ev.start (NOW + 0.01);
+}
+
+void
+rxvt_term::flush_cb (time_watcher &w)
+{
+ SET_R (this);
+ SET_LOCALE (locale);
+
+ refresh_limit = 1;
+ refresh_count = 0;
flush ();
}
break;
case MappingNotify:
- XRefreshKeyboardMapping (& (ev.xmapping));
+ XRefreshKeyboardMapping (&ev.xmapping);
break;
/*
while (XCheckTypedWindowEvent (display->display, ev.xconfigure.window, ConfigureNotify, &ev));
if (szHint.width != width || szHint.height != height)
- {
- D_SIZE ((stderr, "Size: Resizing from: %4d x %4d", szHint.width, szHint.height));
- resize_all_windows (width, height, 1);
- }
-#ifdef DEBUG_SIZE
- else
- {
- D_SIZE ((stderr, "Size: Not resizing"));
- }
-#endif
+ resize_all_windows (width, height, 1);
+
#ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */
if (Options & Opt_transparent)
{
case Expose:
if (ev.xany.window == TermWin.vt)
{
-#ifdef NO_SLOW_LINK_SUPPORT
- scr_expose (ev.xexpose.x, ev.xexpose.y,
- ev.xexpose.width, ev.xexpose.height, False);
-#else
- // I don't understand this, so I changed it :)
- scr_expose (ev.xexpose.x, ev.xexpose.y,
- ev.xexpose.width, ev.xexpose.height, False);
- //scr_expose (ev.xexpose.x, 0,
- // ev.xexpose.width, TermWin.height, False);
-#endif
- want_refresh = 1;
+ do
+ scr_expose (ev.xexpose.x, ev.xexpose.y,
+ ev.xexpose.width, ev.xexpose.height, False);
+ while (XCheckTypedWindowEvent (display->display, TermWin.vt, ev.xany.type, &ev));
+
+ ev.xany.type = ev.xany.type == Expose ? GraphicsExpose : Expose;
+
+ while (XCheckTypedWindowEvent (display->display, TermWin.vt, ev.xany.type, &ev))
+ scr_expose (ev.xexpose.x, ev.xexpose.y,
+ ev.xexpose.width, ev.xexpose.height, False);
+
+ scr_refresh (refresh_type);
}
else
{
if (menubar_visible () && isMenuBarWindow (ev.xany.window))
menubar_expose ();
#endif
+
+#ifdef TRANSPARENT
+ if (am_transparent && ev.xany.window == TermWin.parent[0])
+ XClearWindow (display->display, ev.xany.window);
+#endif
}
break;
#ifdef TRANSPARENT
#if TINTING
-/* shading taken from eterm-0.9.2 */
-/* RGB 15 */
+/* taken from aterm-0.4.2 */
-static void
-shade_ximage_15(void *data, int bpl, int w, int h, int rm, int gm, int bm)
-{
- unsigned char *ptr;
- int x, y;
-
- ptr = (unsigned char *)data + (w * sizeof(uint16_t));
- if ((rm <= 256) && (gm <= 256) && (bm <= 256)) {
- /* No saturation */
- for (y = h; --y >= 0;) {
- for (x = -w; x < 0; x++) {
- int r, g, b;
-
- b = ((uint16_t *) ptr)[x];
- r = (b & 0x7c00) * rm;
- g = (b & 0x3e0) * gm;
- b = (b & 0x1f) * bm;
- ((uint16_t *) ptr)[x] = ((r >> 8) & 0x7c00)
- | ((g >> 8) & 0x3e0)
- | ((b >> 8) & 0x1f);
- }
- ptr += bpl;
- }
- } else {
- for (y = h; --y >= 0;) {
- for (x = -w; x < 0; x++) {
- int r, g, b;
-
- b = ((uint16_t *) ptr)[x];
- r = (b & 0x7c00) * rm;
- g = (b & 0x3e0) * gm;
- b = (b & 0x1f) * bm;
- r |= (!(r >> 15) - 1);
- g |= (!(g >> 10) - 1);
- b |= (!(b >> 5) - 1);
- ((uint16_t *) ptr)[x] = ((r >> 8) & 0x7c00)
- | ((g >> 8) & 0x3e0)
- | ((b >> 8) & 0x1f);
- }
- ptr += bpl;
- }
- }
-}
+typedef uint32_t RUINT32T;
-/* RGB 16 */
-static void
-shade_ximage_16(void *data, int bpl, int w, int h, int rm, int gm, int bm)
+void ShadeXImage(rxvt_display *display, XImage* srcImage, int shade, int rm, int gm, int bm)
{
- unsigned char *ptr;
- int x, y;
-
- ptr = (unsigned char *)data + (w * sizeof(uint16_t));
- if ((rm <= 256) && (gm <= 256) && (bm <= 256)) {
- /* No saturation */
- for (y = h; --y >= 0;) {
- for (x = -w; x < 0; x++) {
- int r, g, b;
-
- b = ((uint16_t *) ptr)[x];
- r = (b & 0xf800) * rm;
- g = (b & 0x7e0) * gm;
- b = (b & 0x1f) * bm;
- ((uint16_t *) ptr)[x] = ((r >> 8) & 0xf800)
- | ((g >> 8) & 0x7e0)
- | ((b >> 8) & 0x1f);
- }
- ptr += bpl;
- }
- } else {
- for (y = h; --y >= 0;) {
- for (x = -w; x < 0; x++) {
- int r, g, b;
-
- b = ((uint16_t *) ptr)[x];
- r = (b & 0xf800) * rm;
- g = (b & 0x7e0) * gm;
- b = (b & 0x1f) * bm;
- r |= (!(r >> 16) - 1);
- g |= (!(g >> 11) - 1);
- b |= (!(b >> 5) - 1);
- ((uint16_t *) ptr)[x] = ((r >> 8) & 0xf800)
- | ((g >> 8) & 0x7e0)
- | ((b >> 8) & 0x1f);
- }
- ptr += bpl;
+ int sh_r, sh_g, sh_b;
+ RUINT32T mask_r, mask_g, mask_b;
+ RUINT32T *lookup, *lookup_r, *lookup_g, *lookup_b;
+ unsigned int lower_lim_r, lower_lim_g, lower_lim_b;
+ unsigned int upper_lim_r, upper_lim_g, upper_lim_b;
+ int i;
+
+ Visual* visual = display->visual;
+
+ if( visual->c_class != TrueColor || srcImage->format != ZPixmap ) return ;
+
+ /* for convenience */
+ mask_r = visual->red_mask;
+ mask_g = visual->green_mask;
+ mask_b = visual->blue_mask;
+
+ /* boring lookup table pre-initialization */
+ switch (srcImage->bits_per_pixel) {
+ case 15:
+ if ((mask_r != 0x7c00) ||
+ (mask_g != 0x03e0) ||
+ (mask_b != 0x001f))
+ return;
+ lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(32+32+32));
+ lookup_r = lookup;
+ lookup_g = lookup+32;
+ lookup_b = lookup+32+32;
+ sh_r = 10;
+ sh_g = 5;
+ sh_b = 0;
+ break;
+ case 16:
+ if ((mask_r != 0xf800) ||
+ (mask_g != 0x07e0) ||
+ (mask_b != 0x001f))
+ return;
+ lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(32+64+32));
+ lookup_r = lookup;
+ lookup_g = lookup+32;
+ lookup_b = lookup+32+64;
+ sh_r = 11;
+ sh_g = 5;
+ sh_b = 0;
+ break;
+ case 24:
+ if ((mask_r != 0xff0000) ||
+ (mask_g != 0x00ff00) ||
+ (mask_b != 0x0000ff))
+ return;
+ lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(256+256+256));
+ lookup_r = lookup;
+ lookup_g = lookup+256;
+ lookup_b = lookup+256+256;
+ sh_r = 16;
+ sh_g = 8;
+ sh_b = 0;
+ break;
+ case 32:
+ if ((mask_r != 0xff0000) ||
+ (mask_g != 0x00ff00) ||
+ (mask_b != 0x0000ff))
+ return;
+ lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(256+256+256));
+ lookup_r = lookup;
+ lookup_g = lookup+256;
+ lookup_b = lookup+256+256;
+ sh_r = 16;
+ sh_g = 8;
+ sh_b = 0;
+ break;
+ default:
+ return; /* we do not support this color depth */
+ }
+
+ /* prepare limits for color transformation (each channel is handled separately) */
+ if (shade < 0) {
+ shade = -shade;
+ if (shade < 0) shade = 0;
+ if (shade > 100) shade = 100;
+
+ lower_lim_r = 65535-rm;
+ lower_lim_g = 65535-gm;
+ lower_lim_b = 65535-bm;
+
+ lower_lim_r = 65535-(unsigned int)(((RUINT32T)lower_lim_r)*((RUINT32T)shade)/100);
+ lower_lim_g = 65535-(unsigned int)(((RUINT32T)lower_lim_g)*((RUINT32T)shade)/100);
+ lower_lim_b = 65535-(unsigned int)(((RUINT32T)lower_lim_b)*((RUINT32T)shade)/100);
+
+ upper_lim_r = upper_lim_g = upper_lim_b = 65535;
+ } else {
+ if (shade < 0) shade = 0;
+ if (shade > 100) shade = 100;
+
+ lower_lim_r = lower_lim_g = lower_lim_b = 0;
+
+ upper_lim_r = (unsigned int)((((RUINT32T)rm)*((RUINT32T)shade))/100);
+ upper_lim_g = (unsigned int)((((RUINT32T)gm)*((RUINT32T)shade))/100);
+ upper_lim_b = (unsigned int)((((RUINT32T)bm)*((RUINT32T)shade))/100);
+ }
+
+ /* switch red and blue bytes if necessary, we need it for some weird XServers like XFree86 3.3.3.1 */
+ if ((srcImage->bits_per_pixel == 24) && (mask_r >= 0xFF0000 ))
+ {
+ unsigned int tmp;
+
+ tmp = lower_lim_r;
+ lower_lim_r = lower_lim_b;
+ lower_lim_b = tmp;
+
+ tmp = upper_lim_r;
+ upper_lim_r = upper_lim_b;
+ upper_lim_b = tmp;
+ }
+
+ /* fill our lookup tables */
+ for (i = 0; i <= mask_r>>sh_r; i++)
+ {
+ RUINT32T tmp;
+ tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_r-lower_lim_r));
+ tmp += ((RUINT32T)(mask_r>>sh_r))*((RUINT32T)lower_lim_r);
+ lookup_r[i] = (tmp/65535)<<sh_r;
+ }
+ for (i = 0; i <= mask_g>>sh_g; i++)
+ {
+ RUINT32T tmp;
+ tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_g-lower_lim_g));
+ tmp += ((RUINT32T)(mask_g>>sh_g))*((RUINT32T)lower_lim_g);
+ lookup_g[i] = (tmp/65535)<<sh_g;
+ }
+ for (i = 0; i <= mask_b>>sh_b; i++)
+ {
+ RUINT32T tmp;
+ tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_b-lower_lim_b));
+ tmp += ((RUINT32T)(mask_b>>sh_b))*((RUINT32T)lower_lim_b);
+ lookup_b[i] = (tmp/65535)<<sh_b;
+ }
+
+ /* apply table to input image (replacing colors by newly calculated ones) */
+ switch (srcImage->bits_per_pixel)
+ {
+ case 15:
+ {
+ unsigned short *p1, *pf, *p, *pl;
+ p1 = (unsigned short *) srcImage->data;
+ pf = (unsigned short *) (srcImage->data + srcImage->height * srcImage->bytes_per_line);
+ while (p1 < pf)
+ {
+ p = p1;
+ pl = p1 + srcImage->width;
+ for (; p < pl; p++)
+ {
+ *p = lookup_r[(*p & 0x7c00)>>10] |
+ lookup_g[(*p & 0x03e0)>> 5] |
+ lookup_b[(*p & 0x001f)];
}
+ p1 = (unsigned short *) ((char *) p1 + srcImage->bytes_per_line);
+ }
+ break;
}
-}
-
-/* RGB 24 */
-static void
-shade_ximage_24(void *data, int bpl, int w, int h, int rm, int gm, int bm)
-{
- unsigned char *ptr;
- int x, y;
-
- ptr = (unsigned char *)data + (w * 3);
- if ((rm <= 256) && (gm <= 256) && (bm <= 256)) {
- /* No saturation */
- for (y = h; --y >= 0;) {
- for (x = -(w * 3); x < 0; x += 3) {
- int r, g, b;
-
- if (byteorder.big_endian()) {
- r = (ptr[x + 0] * rm) >> 8;
- g = (ptr[x + 1] * gm) >> 8;
- b = (ptr[x + 2] * bm) >> 8;
- ptr[x + 0] = r;
- ptr[x + 1] = g;
- ptr[x + 2] = b;
- } else {
- r = (ptr[x + 2] * rm) >> 8;
- g = (ptr[x + 1] * gm) >> 8;
- b = (ptr[x + 0] * bm) >> 8;
- ptr[x + 2] = r;
- ptr[x + 1] = g;
- ptr[x + 0] = b;
- }
- }
- ptr += bpl;
+ case 16:
+ {
+ unsigned short *p1, *pf, *p, *pl;
+ p1 = (unsigned short *) srcImage->data;
+ pf = (unsigned short *) (srcImage->data + srcImage->height * srcImage->bytes_per_line);
+ while (p1 < pf)
+ {
+ p = p1;
+ pl = p1 + srcImage->width;
+ for (; p < pl; p++)
+ {
+ *p = lookup_r[(*p & 0xf800)>>11] |
+ lookup_g[(*p & 0x07e0)>> 5] |
+ lookup_b[(*p & 0x001f)];
}
- } else {
- for (y = h; --y >= 0;) {
- for (x = -(w * 3); x < 0; x += 3) {
- int r, g, b;
-
- if (byteorder.big_endian()) {
- r = (ptr[x + 0] * rm) >> 8;
- g = (ptr[x + 1] * gm) >> 8;
- b = (ptr[x + 2] * bm) >> 8;
-
- r |= (!(r >> 8) - 1);
- g |= (!(g >> 8) - 1);
- b |= (!(b >> 8) - 1);
-
- ptr[x + 0] = r;
- ptr[x + 1] = g;
- ptr[x + 2] = b;
- } else {
- r = (ptr[x + 2] * rm) >> 8;
- g = (ptr[x + 1] * gm) >> 8;
- b = (ptr[x + 0] * bm) >> 8;
-
- r |= (!(r >> 8) - 1);
- g |= (!(g >> 8) - 1);
- b |= (!(b >> 8) - 1);
-
- ptr[x + 2] = r;
- ptr[x + 1] = g;
- ptr[x + 0] = b;
- }
- }
- ptr += bpl;
+ p1 = (unsigned short *) ((char *) p1 + srcImage->bytes_per_line);
+ }
+ break;
+ }
+ case 24:
+ {
+ unsigned char *p1, *pf, *p, *pl;
+ p1 = (unsigned char *) srcImage->data;
+ pf = (unsigned char *) (srcImage->data + srcImage->height * srcImage->bytes_per_line);
+ while (p1 < pf)
+ {
+ p = p1;
+ pl = p1 + srcImage->width * 3;
+ for (; p < pl; p += 3)
+ {
+ p[0] = lookup_r[(p[0] & 0xff0000)>>16];
+ p[1] = lookup_r[(p[1] & 0x00ff00)>> 8];
+ p[2] = lookup_r[(p[2] & 0x0000ff)];
}
+ p1 = (unsigned char *) ((char *) p1 + srcImage->bytes_per_line);
+ }
+ break;
}
-}
+ case 32:
+ {
+ RUINT32T *p1, *pf, *p, *pl;
+ p1 = (RUINT32T *) srcImage->data;
+ pf = (RUINT32T *) (srcImage->data + srcImage->height * srcImage->bytes_per_line);
-/* RGB 32 */
-static void
-shade_ximage_32(void *data, int bpl, int w, int h, int rm, int gm, int bm)
-{
- unsigned char *ptr;
- int x, y;
-
- ptr = (unsigned char *)data + (w * 4);
- if ((rm <= 256) && (gm <= 256) && (bm <= 256)) {
- /* No saturation */
- for (y = h; --y >= 0;) {
- if (byteorder.big_endian()) {
- for (x = -(w * 4); x < 0; x += 4) {
- int r, g, b;
-
- r = (ptr[x + 1] * rm) >> 8;
- g = (ptr[x + 2] * gm) >> 8;
- b = (ptr[x + 3] * bm) >> 8;
- ptr[x + 1] = r;
- ptr[x + 2] = g;
- ptr[x + 3] = b;
- }
- } else {
- for (x = -(w * 4); x < 0; x += 4) {
- int r, g, b;
-
- r = (ptr[x + 2] * rm) >> 8;
- g = (ptr[x + 1] * gm) >> 8;
- b = (ptr[x + 0] * bm) >> 8;
- ptr[x + 2] = r;
- ptr[x + 1] = g;
- ptr[x + 0] = b;
- }
- }
- ptr += bpl;
- }
- } else {
- for (y = h; --y >= 0;) {
- for (x = -(w * 4); x < 0; x += 4) {
- int r, g, b;
-
- if (byteorder.big_endian()) {
- r = (ptr[x + 1] * rm) >> 8;
- g = (ptr[x + 2] * gm) >> 8;
- b = (ptr[x + 3] * bm) >> 8;
-
- r |= (!(r >> 8) - 1);
- g |= (!(g >> 8) - 1);
- b |= (!(b >> 8) - 1);
-
- ptr[x + 1] = r;
- ptr[x + 2] = g;
- ptr[x + 3] = b;
- } else {
- r = (ptr[x + 2] * rm) >> 8;
- g = (ptr[x + 1] * gm) >> 8;
- b = (ptr[x + 0] * bm) >> 8;
-
- r |= (!(r >> 8) - 1);
- g |= (!(g >> 8) - 1);
- b |= (!(b >> 8) - 1);
-
- ptr[x + 2] = r;
- ptr[x + 1] = g;
- ptr[x + 0] = b;
- }
- }
- ptr += bpl;
+ while (p1 < pf)
+ {
+ p = p1;
+ pl = p1 + srcImage->width;
+ for (; p < pl; p++)
+ {
+ *p = lookup_r[(*p & 0xff0000)>>16] |
+ lookup_g[(*p & 0x00ff00)>> 8] |
+ lookup_b[(*p & 0x0000ff)] |
+ (*p & ~0xffffff);
}
+ p1 = (RUINT32T *) ((char *) p1 + srcImage->bytes_per_line);
+ }
+ break;
}
-}
+ }
+ free (lookup);
+}
#endif
/*
0L, 1L, False, XA_PIXMAP, &atype, &aformat,
&nitems, &bytes_after, &prop) == Success);
- if (!i || prop == NULL || !rs[Rs_color + Color_tint])
+ if (!i || prop == NULL
+#if TINTING
+ || !rs[Rs_color + Color_tint]
+#endif
+ )
have_pixmap = 0;
else
{
GC gc;
XGCValues gcvalue;
- XTranslateCoordinates (display->display, TermWin.vt, display->root,
+ XTranslateCoordinates (display->display, TermWin.parent[0], display->root,
0, 0, &sx, &sy, &cr);
nw = (unsigned int)szHint.width;
nh = (unsigned int)szHint.height;
if (ISSET_PIXCOLOR (Color_tint))
{
unsigned short rm, gm, bm;
- if (rs[Rs_shade])
- PixColorsFocused[Color_tint].fade (display, atoi (rs[Rs_shade])).get (display, rm, gm, bm);
- else
- PixColorsFocused[Color_tint].get (display, rm, gm, bm);
+ int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100;
- rm >>= 8; gm >>= 8; bm >>= 8; // not 100% correct, but...
+ PixColorsFocused[Color_tint].get (display, rm, gm, bm);
- /* Determine bitshift and bitmask values */
- switch (image->bits_per_pixel)
- {
- case 15: shade_ximage_15 (image->data, image->bytes_per_line, image->width, image->height, rm, gm, bm); break;
- case 16: shade_ximage_16 (image->data, image->bytes_per_line, image->width, image->height, rm, gm, bm); break;
- case 24: shade_ximage_24 (image->data, image->bytes_per_line, image->width, image->height, rm, gm, bm); break;
- case 32: shade_ximage_32 (image->data, image->bytes_per_line, image->width, image->height, rm, gm, bm); break;
- }
+ ShadeXImage (display, image, shade, rm, gm, bm);
}
#endif
nx, ny, image->width, image->height);
XFreeGC (display->display, gc);
XDestroyImage (image);
- XSetWindowBackgroundPixmap (display->display, TermWin.vt, TermWin.pixmap);
+ XSetWindowBackgroundPixmap (display->display, TermWin.parent[0], TermWin.pixmap);
+ XClearWindow (display->display, TermWin.parent[0]);
if (!am_transparent || !am_pixmap_trans)
pchanged = 1;
if (n > (int) (sizeof (TermWin.parent) / sizeof (TermWin.parent[0])))
{
- D_X ((stderr, "InheritPixmap Turning off")); /* Mikachu? */
+ D_X ((stderr, "InheritPixmap Turning off"));
XSetWindowBackground (display->display, TermWin.parent[0], PixColorsFocused[Color_fg]);
XSetWindowBackground (display->display, TermWin.vt, PixColorsFocused[Color_bg]);
am_transparent = 0;
#endif
D_X ((stderr, "InheritPixmap Turning on (%d parents)", i - 1));
for (n = 0; n < (unsigned int)i; n++)
- XSetWindowBackgroundPixmap (display->display, TermWin.parent[n], ParentRelative);
+ {
+ XSetWindowBackgroundPixmap (display->display, TermWin.parent[n], ParentRelative);
+ XClearWindow (display->display, TermWin.parent[n]);
+ }
XSetWindowBackgroundPixmap (display->display, TermWin.vt, ParentRelative);
am_transparent = 1;
TermWin.parent[i] = None;
}
+ // this is experimental
+ if (scrollBar.win)
+ {
+ XSetWindowBackgroundPixmap (display->display, scrollBar.win, ParentRelative);
+ XClearWindow (display->display, scrollBar.win);
+ scrollBar.setIdle ();
+ scrollbar_show (0);
+ }
+
return pchanged;
}
#endif
refresh_count++;
if (! (Options & Opt_jumpScroll)
- || (refresh_count >= (refresh_limit * (TermWin.nrow - 1))))
+ || (refresh_count >= refresh_limit * (TermWin.nrow - 1)))
{
refreshnow = true;
- flag = true;
ch = NOCHAR;
break;
}
* What the heck I'll cheat and only refresh less than every page-full.
* the number of pages between refreshes is refresh_limit, which
* is incremented here because we must be doing flat-out scrolling.
- *
- * refreshing should be correct for small scrolls, because of the
- * time-out
*/
if (refreshnow)
{
if ((Options & Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
refresh_limit++;
else
- scr_refresh (refresh_type);
+ {
+ flag = true;
+ scr_refresh (refresh_type);
+ }
}
}
# include <langinfo.h>
#endif
+#include <inttypes.h>
+
#include "rxvtlib.h"
#include "feature.h"
#include "encoding.h"
bool populate (const char *desc);
int find_font (uint32_t unicode, bool bold = false);
+ // font-id's MUST fit into a signed 16 bit integer.
rxvt_font *operator [] (int id) const
{
return fonts[id];
return CS_UNKNOWN;
}
-struct rxvt_codeset_conv_unknown : rxvt_codeset_conv {
- unicode_t to_unicode (uint32_t enc) const { return NOCHAR; }
- uint32_t from_unicode (unicode_t unicode) const { return NOCHAR; }
-} rxvt_codeset_conv_unknown;
+static unicode_t cs_unknown_to_unicode (uint32_t enc) { return NOCHAR; }
+static uint32_t cs_unknown_from_unicode (unicode_t unicode) { return NOCHAR; }
-struct rxvt_codeset_conv_us_ascii : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const { return unicode <= 127 ? unicode : NOCHAR; }
-} rxvt_codeset_conv_us_ascii;
+static unicode_t cs_unicode_to_unicode (uint32_t enc) { return enc; }
+static uint32_t cs_unicode_from_unicode (unicode_t unicode) { return unicode; }
-struct rxvt_codeset_conv_unicode : rxvt_codeset_conv {
- /* transparent */
-} rxvt_codeset_conv_unicode;
+#define cs_us_ascii_to_unicode cs_unicode_to_unicode
+static uint32_t cs_us_ascii_from_unicode (unicode_t unicode) { return unicode <= 127 ? unicode : NOCHAR; }
-struct rxvt_codeset_conv_unicode_16 : rxvt_codeset_conv {
- unicode_t to_unicode (uint32_t enc) const { return enc; }
- uint32_t from_unicode (unicode_t unicode) const { return unicode <= 65535 ? unicode : NOCHAR; }
-} rxvt_codeset_conv_unicode_16;
+#define cs_us_ascii_to_unicode_16 cs_unicode_to_unicode
+static uint32_t cs_unicode_16_from_unicode (unicode_t unicode) { return unicode <= 65535 ? unicode : NOCHAR; }
#define ENCODING_DEFAULT
#include "table/jis0213_1.h"
#include "table/jis0213_2.h"
+#if ENCODING_TO_UNICODE
+# define ENC(base) { cs_ ## base ## _from_unicode, cs_ ## base ## _to_unicode }
+#else
+# define ENC(base) { cs_ ## base ## _from_unicode }
+#endif
+
+
// order must match table in encoding.h(!)
-const rxvt_codeset_conv *rxvt_codeset[NUM_CODESETS] = {
- &rxvt_codeset_conv_unknown,
-
- &rxvt_codeset_conv_us_ascii,
-
- &rxvt_codeset_conv_iso8859_1,
- &rxvt_codeset_conv_iso8859_2,
- &rxvt_codeset_conv_iso8859_3,
- &rxvt_codeset_conv_iso8859_4,
- &rxvt_codeset_conv_iso8859_5,
- &rxvt_codeset_conv_iso8859_6,
- &rxvt_codeset_conv_iso8859_7,
- &rxvt_codeset_conv_iso8859_8,
- &rxvt_codeset_conv_iso8859_9,
- &rxvt_codeset_conv_iso8859_10,
- &rxvt_codeset_conv_iso8859_11,
- &rxvt_codeset_conv_iso8859_13,
- &rxvt_codeset_conv_iso8859_14,
- &rxvt_codeset_conv_iso8859_15,
- &rxvt_codeset_conv_iso8859_16,
-
- &rxvt_codeset_conv_koi8_r,
- &rxvt_codeset_conv_koi8_u,
-
- &rxvt_codeset_conv_jis0201_1976_0,
- &rxvt_codeset_conv_jis0208_1990_0,
- &rxvt_codeset_conv_jis0212_1990_0,
-
- &rxvt_codeset_conv_jis0213_1,
- &rxvt_codeset_conv_jis0213_2,
-
- &rxvt_codeset_conv_ksc5601_1987_0,
-
- &rxvt_codeset_conv_gb2312_1980_0,
-
- &rxvt_codeset_conv_cns11643_1992_1,
- &rxvt_codeset_conv_cns11643_1992_2,
- &rxvt_codeset_conv_cns11643_1992_3,
- &rxvt_codeset_conv_cns11643_1992_4,
- &rxvt_codeset_conv_cns11643_1992_5,
- &rxvt_codeset_conv_cns11643_1992_6,
- &rxvt_codeset_conv_cns11643_1992_7,
- &rxvt_codeset_conv_cns11643_1992_f,
- &rxvt_codeset_conv_big5,
- &rxvt_codeset_conv_big5_ext,
- &rxvt_codeset_conv_big5_plus,
-
- &rxvt_codeset_conv_viscii,
-
- &rxvt_codeset_conv_unicode_16,
- &rxvt_codeset_conv_unicode
+const rxvt_codeset_conv rxvt_codeset[NUM_CODESETS] = {
+ ENC (unknown),
+
+ ENC (us_ascii),
+
+ ENC (iso8859_1),
+ ENC (iso8859_2),
+ ENC (iso8859_3),
+ ENC (iso8859_4),
+ ENC (iso8859_5),
+ ENC (iso8859_6),
+ ENC (iso8859_7),
+ ENC (iso8859_8),
+ ENC (iso8859_9),
+ ENC (iso8859_10),
+ ENC (iso8859_11),
+ ENC (iso8859_13),
+ ENC (iso8859_14),
+ ENC (iso8859_15),
+ ENC (iso8859_16),
+
+ ENC (koi8_r),
+ ENC (koi8_u),
+
+ ENC (jis0201_1976_0),
+ ENC (jis0208_1990_0),
+ ENC (jis0212_1990_0),
+
+ ENC (jis0213_1),
+ ENC (jis0213_2),
+
+ ENC (ksc5601_1987_0),
+
+ ENC (gb2312_1980_0),
+
+ ENC (cns11643_1992_1),
+ ENC (cns11643_1992_2),
+ ENC (cns11643_1992_3),
+ ENC (cns11643_1992_4),
+ ENC (cns11643_1992_5),
+ ENC (cns11643_1992_6),
+ ENC (cns11643_1992_7),
+ ENC (cns11643_1992_f),
+ ENC (big5),
+ ENC (big5_ext),
+ ENC (big5_plus),
+
+ ENC (viscii),
+
+ ENC (unicode_16),
+ ENC (unicode),
};
#if ENABLE_COMBINING
};
struct rxvt_codeset_conv {
- virtual uint32_t from_unicode (unicode_t unicode) const { return unicode; }
+ uint32_t (*from_unicode) (unicode_t unicode);
#if ENCODING_TO_UNICODE
- virtual unicode_t to_unicode (uint32_t enc) const { return enc; }
+ unicode_t (*to_unicode) (uint32_t enc);
#endif
};
-extern const rxvt_codeset_conv *rxvt_codeset[NUM_CODESETS];
+extern const rxvt_codeset_conv rxvt_codeset[NUM_CODESETS];
extern unicode_t rxvt_compose (unicode_t c1, unicode_t c2);
-#define FROM_UNICODE(cs,code) rxvt_codeset[cs]->from_unicode (code)
-#define TO_UNICODE(cs,code) rxvt_codeset[cs]->to_unicode (code)
+#define FROM_UNICODE(cs,code) rxvt_codeset[cs].from_unicode (code)
+#define TO_UNICODE(cs,code) rxvt_codeset[cs].to_unicode (code)
struct unicode { // namespace für arme
static bool is_space (unicode_t c);
#ifdef ENCODING_$group
$tab1$tab2
-struct rxvt_codeset_conv_$base : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
-$fun1 }
+static uint32_t cs_$base\_from_unicode (unicode_t unicode) {
+$fun1}
EOF
if ($TO_UNICODE) {
print OUT <<EOF
#if ENCODING_TO_UNICODE
- unicode_t to_unicode (uint32_t enc) const {
-$fun2 }
+static unicode_t cs_$base\_to_unicode (uint32_t enc) {
+$fun2}
#endif
EOF
}
print OUT <<EOF;
-} rxvt_codeset_conv_$base;
#else
-#define rxvt_codeset_conv_$base rxvt_codeset_conv_unknown
+#define cs_$base\_from_unicode cs_unknown_from_unicode
+#define cs_$base\_to_unicode cs_unknown_to_unicode
#endif
EOF
im_ev (this, &rxvt_term::im_cb),
#endif
check_ev (this, &rxvt_term::check_cb),
+ flush_ev (this, &rxvt_term::flush_cb),
destroy_ev (this, &rxvt_term::destroy_cb),
pty_ev (this, &rxvt_term::pty_cb),
incr_ev (this, &rxvt_term::incr_cb)
scr_touch (true);
}
+ for (unicode_t ch = 0x20; ch <= 0x7f; ch++)
+ TermWin.ascii_map [ch - 0x20] = fs->find_font (ch);
+
return true;
}
}
if (!rXParseAllocColor (& xcol, color))
return;
- /* XStoreColor (display->display, XCMAP, XColor*); */
+ /* XStoreColor (display->display, display->cmap, XColor*); */
/*
* FIXME: should free colors here, but no idea how to do it so instead,
if (i > Color_White)
{
/* fprintf (stderr, "XFreeColors: PixColors [%d] = %lu\n", idx, PixColors [idx]); */
- XFreeColors (display->display, XCMAP, (PixColors + idx), 1,
+ XFreeColors (display->display, display->cmap, (PixColors + idx), 1,
DisplayPlanes (display->display, display->screen));
}
# endif
xcol[0].pixel = ISSET_PIXCOLOR (Color_pointer_fg) ? PixColorsFocused[Color_pointer_fg] : PixColorsFocused[Color_fg];
xcol[1].pixel = ISSET_PIXCOLOR (Color_pointer_bg) ? PixColorsFocused[Color_pointer_bg] : PixColorsFocused[Color_bg];
- XQueryColors (display->display, XCMAP, xcol, 2);
+ XQueryColors (display->display, display->cmap, xcol, 2);
XRecolorCursor (display->display, TermWin_cursor, xcol + 0, xcol + 1);
}
#include <X11/keysym.h>
#include <X11/keysymdef.h>
#include <X11/Xatom.h>
+#ifndef NO_FRILLS
+#include <X11/Xmd.h>
+#endif
#include "encoding.h"
#include "defaultfont.h"
? 0 \
: min ((val), (((uint16_t)-1)>>1)))
+#ifndef NO_FRILLS
+typedef struct _mwmhints {
+ CARD32 flags;
+ CARD32 functions;
+ CARD32 decorations;
+ INT32 input_mode;
+ CARD32 status;
+} MWMHints;
+#endif
+
/*
*****************************************************************************
* NORMAL DEFINES
#ifndef NO_FRILLS
Rs_ext_bwidth,
Rs_int_bwidth,
+ Rs_borderLess,
#endif
Rs_scrollBar_thickness,
#ifndef NO_LINESPACE
# define PrivMode_Default (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor)
#endif
-#define XDEPTH display->depth
-#define XCMAP display->cmap
-#define XVISUAL display->visual
-
+// do not change these constants lightly, there are many interdependencies
#define IMBUFSIZ 128 // input modifier buffer sizes
#define KBUFSZ 512 // size of keyboard mapping buffer
#define CBUFSIZ 4096 // size of command buffer
# define PATH_MAX 16384
#endif
+/* Motif window hints */
+#define MWM_HINTS_FUNCTIONS (1L << 0)
+#define MWM_HINTS_DECORATIONS (1L << 1)
+#define MWM_HINTS_INPUT_MODE (1L << 2)
+#define MWM_HINTS_STATUS (1L << 3)
+/* bit definitions for MwmHints.functions */
+#define MWM_FUNC_ALL (1L << 0)
+#define MWM_FUNC_RESIZE (1L << 1)
+#define MWM_FUNC_MOVE (1L << 2)
+#define MWM_FUNC_MINIMIZE (1L << 3)
+#define MWM_FUNC_MAXIMIZE (1L << 4)
+#define MWM_FUNC_CLOSE (1L << 5)
+/* bit definitions for MwmHints.decorations */
+#define MWM_DECOR_ALL (1L << 0)
+#define MWM_DECOR_BORDER (1L << 1)
+#define MWM_DECOR_RESIZEH (1L << 2)
+#define MWM_DECOR_TITLE (1L << 3)
+#define MWM_DECOR_MENU (1L << 4)
+#define MWM_DECOR_MINIMIZE (1L << 5)
+#define MWM_DECOR_MAXIMIZE (1L << 6)
+/* bit definitions for MwmHints.inputMode */
+#define MWM_INPUT_MODELESS 0
+#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
+#define MWM_INPUT_SYSTEM_MODAL 2
+#define MWM_INPUT_FULL_APPLICATION_MODAL 3
+#define PROP_MWM_HINTS_ELEMENTS 5
+
/*
*****************************************************************************
* MACRO DEFINES
#endif
refresh_count,
refresh_limit,
- fnum, /* logical font number */
last_bot, /* scrollbar last bottom position */
last_top, /* scrollbar last top position */
last_state, /* scrollbar last state */
xevent_watcher menubar_ev;
#endif
- void check_cb (check_watcher &w); check_watcher check_ev;
+ void check_cb (check_watcher &w); check_watcher check_ev;
void destroy_cb (time_watcher &w); time_watcher destroy_ev;
+ void flush_cb (time_watcher &w); time_watcher flush_ev;
void pty_cb (io_watcher &w, short revents); io_watcher pty_ev;
#include <unistd.h>
#include <fcntl.h>
+#ifndef NO_SLOW_LINK_SUPPORT
+# include <sys/socket.h>
+# include <sys/un.h>
+#endif
+
class byteorder byteorder;
byteorder::byteorder ()
cmap = DefaultColormap (display, screen);
depth = DefaultDepth (display, screen);
+ int fd = XConnectionNumber (display);
+
+#ifndef NO_SLOW_LINK_SUPPORT
+ // try to detetc wether we have a local connection.
+ // assume unix domains socket == local, everything else not
+ // TODO: might want to check for inet/127.0.0.1
+ is_local = 0;
+ sockaddr_un sa;
+ socklen_t sl = sizeof (sa);
+
+ if (!getsockname (fd, (sockaddr *)&sa, &sl))
+ is_local = sa.sun_family == AF_LOCAL;
+#endif
+
#ifdef PREFER_24BIT
/*
* If depth is not 24, look for a 24bit visual.
}
#endif
- int fd = XConnectionNumber (display);
x_ev.start (fd, EVENT_READ);
fcntl (fd, F_SETFD, FD_CLOEXEC);
Colormap cmap;
Window root;
rxvt_term *selection_owner;
+#ifndef NO_SLOW_LINK_SUPPORT
+ bool is_local;
+#endif
rxvt_display (const char *id);
bool init ();
Pixmap pixmap;
rxvt_fontset *fontset;
rxvt_drawable *drawable;
+ uint16_t ascii_map[0x7f - 0x20]; // map ascii chars to fonts for speed
} TermWin_t;
/*
#define Opt_mouseWheelScrollPage (1UL<<19)
#define Opt_pointerBlank (1UL<<20)
#define Opt_cursorBlink (1UL<<21)
+#define Opt_secondaryScreen (1UL<<22)
+#define Opt_secondaryScroll (1UL<<23)
#ifdef NO_FRILLS
-# define Opt_insecure 0
+# define Opt_insecure 0
+# define Opt_borderLess 0
#else
-# define Opt_insecure (1UL<<22) // insecure esc sequences
+# define Opt_insecure (1UL<<24) // insecure esc sequences
+# define Opt_borderLess (1UL<<25) // mem borderless hints
#endif
-#define Opt_secondaryScreen (1UL<<23)
-#define Opt_secondaryScroll (1UL<<24)
/* place holder used for parsing command-line options */
#define Opt_Reverse (1UL<<30)
#define Opt_Boolean (1UL<<31)
rxvt_term::scr_blank_line (text_t *et, rend_t *er, unsigned int width, rend_t efs)
{
efs &= ~RS_baseattrMask;
- efs = SET_FONT (efs, TermWin.fontset->find_font (' '));
+ efs = SET_FONT (efs, TermWin.ascii_map [' ' - 0x20]);
while (width--)
{
#ifdef DEBUG_STRICT
assert (screen.cur.col < last_col);
assert ((screen.cur.row < TermWin.nrow)
- && (screen.cur.row >= - (int32_t)TermWin.nscrolled));
+ && (screen.cur.row >= - (int32_t)TermWin.nscrolled));
#else /* drive with your eyes closed */
MIN_IT (screen.cur.col, last_col - 1);
MIN_IT (screen.cur.row, (int32_t)TermWin.nrow - 1);
c = rxvt_composite.compose (c); // map to lower 16 bits
#endif
bool bold = (Options & Opt_realBold) && ((rstyle & RS_Bold) != 0);
- rend_t rend = SET_FONT (rstyle, TermWin.fontset->find_font (c, bold));
+ rend_t rend = SET_FONT (rstyle,
+ c > 0x7f || bold || c < 0x20
+ ? TermWin.fontset->find_font (c, bold)
+ : TermWin.ascii_map [c - 0x20]);
do
{
if (drawn_text == NULL) /* sanity check */
return;
+#ifndef NO_SLOW_LINK_SUPPORT
+ if (refresh_type == FAST_REFRESH && !display->is_local)
+ {
+ y = 0;
+ height = TermWin.height;
+ }
+#endif
+
#ifdef DEBUG_STRICT
x = max (x, 0);
x = min (x, (int)TermWin.width);
* This has been deliberately kept simple.
*/
i = num_scr;
- if (refresh_type == FAST_REFRESH && num_scr_allow && i
+ if (!display->is_local
+ && refresh_type == FAST_REFRESH && num_scr_allow && i
&& abs (i) < TermWin.nrow && !must_clear)
{
int16_t nits;
}
#ifdef TEXT_BLINK
- if (rend & RS_Blink && back == Color_bg)
+ if (rend & RS_Blink && (back == Color_bg || fore == Color_bg))
{
if (!text_blink_ev.active)
{
else
font->draw (*TermWin.drawable, xpixel, ypixel, text, count, fore, back);
- if ((rend & RS_Uline) && (font->descent > 1))
+ if (rend & RS_Uline && font->descent > 1 && fore != back)
XDrawLine (display->display, drawBuffer, TermWin.gc,
xpixel, ypixel + font->ascent + 1,
xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1);
#endif
if (refresh_type & SMOOTH_REFRESH)
- XSync (display->display, False);
+ XFlush (display->display);
num_scr = 0;
num_scr_allow = 1;
};
-struct rxvt_codeset_conv_big5 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_big5_from_unicode (unicode_t unicode) {
if (unicode <= 0x007f) return unicode;
if (unicode == 0x014b) return 0xc8fc;
if (unicode == 0x0153) return 0xc8fa;
? big5_f_i[h - 0x00][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_big5;
+}
#else
-#define rxvt_codeset_conv_big5 rxvt_codeset_conv_unknown
+#define cs_big5_from_unicode cs_unknown_from_unicode
+#define cs_big5_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_big5_ext : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_big5_ext_from_unicode (unicode_t unicode) {
if (unicode <= 0x007f) return unicode;
if (unicode == 0x2605) return 0xa1b9;
if (unicode == 0x2606) return 0xa1b8;
? big5_ext_f_i[h - 0x00][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_big5_ext;
+}
#else
-#define rxvt_codeset_conv_big5_ext rxvt_codeset_conv_unknown
+#define cs_big5_ext_from_unicode cs_unknown_from_unicode
+#define cs_big5_ext_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_big5_plus : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_big5_plus_from_unicode (unicode_t unicode) {
if (unicode <= 0x007f) return unicode;
if (unicode == 0x2605) return 0xa1b9;
if (unicode == 0x2606) return 0xa1b8;
? big5_plus_f_i[h - 0x00][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_big5_plus;
+}
#else
-#define rxvt_codeset_conv_big5_plus rxvt_codeset_conv_unknown
+#define cs_big5_plus_from_unicode cs_unknown_from_unicode
+#define cs_big5_plus_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_cns11643_1992_1 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_cns11643_1992_1_from_unicode (unicode_t unicode) {
uint8_t l = unicode;
uint16_t h = unicode >> 8;
if (0x4e <= h && h <= 0x9f
? cns11643_1992_1_f_i[h - 0x4e][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_cns11643_1992_1;
+}
#else
-#define rxvt_codeset_conv_cns11643_1992_1 rxvt_codeset_conv_unknown
+#define cs_cns11643_1992_1_from_unicode cs_unknown_from_unicode
+#define cs_cns11643_1992_1_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_cns11643_1992_2 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_cns11643_1992_2_from_unicode (unicode_t unicode) {
uint8_t l = unicode;
uint16_t h = unicode >> 8;
if (0x4e <= h && h <= 0x9f
? cns11643_1992_2_f_i[h - 0x4e][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_cns11643_1992_2;
+}
#else
-#define rxvt_codeset_conv_cns11643_1992_2 rxvt_codeset_conv_unknown
+#define cs_cns11643_1992_2_from_unicode cs_unknown_from_unicode
+#define cs_cns11643_1992_2_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_cns11643_1992_3 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_cns11643_1992_3_from_unicode (unicode_t unicode) {
uint8_t l = unicode;
uint16_t h = unicode >> 8;
if (0x34 <= h && h <= 0x9f
? cns11643_1992_3_f_i[h - 0x34][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_cns11643_1992_3;
+}
#else
-#define rxvt_codeset_conv_cns11643_1992_3 rxvt_codeset_conv_unknown
+#define cs_cns11643_1992_3_from_unicode cs_unknown_from_unicode
+#define cs_cns11643_1992_3_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_cns11643_1992_4 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_cns11643_1992_4_from_unicode (unicode_t unicode) {
if (unicode == 0x5a0e) return 0x2c40;
if (unicode == 0x5a10) return 0x2c3e;
if (unicode == 0x5a27) return 0x2c39;
? cns11643_1992_4_f_i[h - 0x34][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_cns11643_1992_4;
+}
#else
-#define rxvt_codeset_conv_cns11643_1992_4 rxvt_codeset_conv_unknown
+#define cs_cns11643_1992_4_from_unicode cs_unknown_from_unicode
+#define cs_cns11643_1992_4_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_cns11643_1992_5 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_cns11643_1992_5_from_unicode (unicode_t unicode) {
if (unicode == 0x5921) return 0x373d;
if (unicode == 0x5e07) return 0x225c;
if (unicode == 0x5e3f) return 0x377c;
? cns11643_1992_5_f_i[h - 0x34][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_cns11643_1992_5;
+}
#else
-#define rxvt_codeset_conv_cns11643_1992_5 rxvt_codeset_conv_unknown
+#define cs_cns11643_1992_5_from_unicode cs_unknown_from_unicode
+#define cs_cns11643_1992_5_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_cns11643_1992_6 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_cns11643_1992_6_from_unicode (unicode_t unicode) {
if (unicode == 0x3637) return 0x2f65;
if (unicode == 0x3652) return 0x474e;
if (unicode == 0x369d) return 0x3e42;
? cns11643_1992_6_f_i[h - 0x34][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_cns11643_1992_6;
+}
#else
-#define rxvt_codeset_conv_cns11643_1992_6 rxvt_codeset_conv_unknown
+#define cs_cns11643_1992_6_from_unicode cs_unknown_from_unicode
+#define cs_cns11643_1992_6_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_cns11643_1992_7 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_cns11643_1992_7_from_unicode (unicode_t unicode) {
if (unicode == 0x34a7) return 0x5274;
if (unicode == 0x34a8) return 0x574c;
if (unicode == 0x34b9) return 0x4d3d;
? cns11643_1992_7_f_i[h - 0x45][l - 0x04]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_cns11643_1992_7;
+}
#else
-#define rxvt_codeset_conv_cns11643_1992_7 rxvt_codeset_conv_unknown
+#define cs_cns11643_1992_7_from_unicode cs_unknown_from_unicode
+#define cs_cns11643_1992_7_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_cns11643_1992_f : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_cns11643_1992_f_from_unicode (unicode_t unicode) {
if (unicode == 0x3406) return 0x216c;
if (unicode == 0x3436) return 0x2144;
if (unicode == 0x343e) return 0x2172;
? cns11643_1992_f_f_i[h - 0x36][l - 0x0e]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_cns11643_1992_f;
+}
#else
-#define rxvt_codeset_conv_cns11643_1992_f rxvt_codeset_conv_unknown
+#define cs_cns11643_1992_f_from_unicode cs_unknown_from_unicode
+#define cs_cns11643_1992_f_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_gb2312_1980_0 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_gb2312_1980_0_from_unicode (unicode_t unicode) {
if (unicode == 0x02c7) return 0x2126;
if (unicode == 0x02c9) return 0x2125;
if (unicode == 0x2312) return 0x2150;
? gb2312_1980_0_f_i[h - 0x00][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_gb2312_1980_0;
+}
#else
-#define rxvt_codeset_conv_gb2312_1980_0 rxvt_codeset_conv_unknown
+#define cs_gb2312_1980_0_from_unicode cs_unknown_from_unicode
+#define cs_gb2312_1980_0_to_unicode cs_unknown_to_unicode
#endif
#ifdef ENCODING_DEFAULT
-struct rxvt_codeset_conv_iso8859_1 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_1_from_unicode (unicode_t unicode) {
if (unicode <= 0x00ff) return unicode;
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_1;
+}
#else
-#define rxvt_codeset_conv_iso8859_1 rxvt_codeset_conv_unknown
+#define cs_iso8859_1_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_1_to_unicode cs_unknown_to_unicode
#endif
0x00, 0x00, 0xd9, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0xbc
};
-struct rxvt_codeset_conv_iso8859_10 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_10_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (unicode == 0x2015) return 0x00bd;
if (0x00a0 <= unicode && unicode <= 0x00fe)
if (0x0100 <= unicode && unicode <= 0x017e)
return iso8859_10_f_256[unicode - 0x0100] == 0 ? NOCHAR : iso8859_10_f_256[unicode - 0x0100];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_10;
+}
#else
-#define rxvt_codeset_conv_iso8859_10 rxvt_codeset_conv_unknown
+#define cs_iso8859_10_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_10_to_unicode cs_unknown_to_unicode
#endif
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb
};
-struct rxvt_codeset_conv_iso8859_11 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_11_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (unicode == 0x00a0) return 0x00a0;
if (0x0e01 <= unicode && unicode <= 0x0e5b)
return iso8859_11_f_3584[unicode - 0x0e01] == 0 ? NOCHAR : iso8859_11_f_3584[unicode - 0x0e01];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_11;
+}
#else
-#define rxvt_codeset_conv_iso8859_11 rxvt_codeset_conv_unknown
+#define cs_iso8859_11_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_11_to_unicode cs_unknown_to_unicode
#endif
0x00, 0x00, 0xd8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0xea, 0xdd, 0xfd, 0xde, 0xfe
};
-struct rxvt_codeset_conv_iso8859_13 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_13_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (unicode == 0x2019) return 0x00ff;
if (unicode == 0x201c) return 0x00b4;
if (0x0100 <= unicode && unicode <= 0x017e)
return iso8859_13_f_256[unicode - 0x0100] == 0 ? NOCHAR : iso8859_13_f_256[unicode - 0x0100];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_13;
+}
#else
-#define rxvt_codeset_conv_iso8859_13 rxvt_codeset_conv_unknown
+#define cs_iso8859_13_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_13_to_unicode cs_unknown_to_unicode
#endif
0xac, 0xbc
};
-struct rxvt_codeset_conv_iso8859_14 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_14_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (0x00a0 <= unicode && unicode <= 0x00ff)
return iso8859_14_f_0[unicode - 0x00a0] == 0 ? NOCHAR : iso8859_14_f_0[unicode - 0x00a0];
if (0x1e02 <= unicode && unicode <= 0x1ef3)
return iso8859_14_f_7680[unicode - 0x1e02] == 0 ? NOCHAR : iso8859_14_f_7680[unicode - 0x1e02];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_14;
+}
#else
-#define rxvt_codeset_conv_iso8859_14 rxvt_codeset_conv_unknown
+#define cs_iso8859_14_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_14_to_unicode cs_unknown_to_unicode
#endif
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x00, 0xb4, 0xb8
};
-struct rxvt_codeset_conv_iso8859_15 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_15_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (unicode == 0x20ac) return 0x00a4;
if (0x00a0 <= unicode && unicode <= 0x00ff)
if (0x0152 <= unicode && unicode <= 0x017e)
return iso8859_15_f_256[unicode - 0x0152] == 0 ? NOCHAR : iso8859_15_f_256[unicode - 0x0152];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_15;
+}
#else
-#define rxvt_codeset_conv_iso8859_15 rxvt_codeset_conv_unknown
+#define cs_iso8859_15_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_15_to_unicode cs_unknown_to_unicode
#endif
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0xac, 0xae, 0xaf, 0xbf, 0xb4, 0xb8
};
-struct rxvt_codeset_conv_iso8859_16 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_16_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (unicode == 0x0218) return 0x00aa;
if (unicode == 0x0219) return 0x00ba;
if (0x0102 <= unicode && unicode <= 0x017e)
return iso8859_16_f_256[unicode - 0x0102] == 0 ? NOCHAR : iso8859_16_f_256[unicode - 0x0102];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_16;
+}
#else
-#define rxvt_codeset_conv_iso8859_16 rxvt_codeset_conv_unknown
+#define cs_iso8859_16_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_16_to_unicode cs_unknown_to_unicode
#endif
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0xbc, 0xaf, 0xbf, 0xae, 0xbe
};
-struct rxvt_codeset_conv_iso8859_2 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_2_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (unicode == 0x02c7) return 0x00b7;
if (unicode == 0x02d8) return 0x00a2;
if (0x0102 <= unicode && unicode <= 0x017e)
return iso8859_2_f_256[unicode - 0x0102] == 0 ? NOCHAR : iso8859_2_f_256[unicode - 0x0102];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_2;
+}
#else
-#define rxvt_codeset_conv_iso8859_2 rxvt_codeset_conv_unknown
+#define cs_iso8859_2_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_2_to_unicode cs_unknown_to_unicode
#endif
0x00, 0x00, 0x00, 0xaf, 0xbf
};
-struct rxvt_codeset_conv_iso8859_3 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_3_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (unicode == 0x02d8) return 0x00a2;
if (unicode == 0x02d9) return 0x00ff;
if (0x0108 <= unicode && unicode <= 0x017c)
return iso8859_3_f_256[unicode - 0x0108] == 0 ? NOCHAR : iso8859_3_f_256[unicode - 0x0108];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_3;
+}
#else
-#define rxvt_codeset_conv_iso8859_3 rxvt_codeset_conv_unknown
+#define cs_iso8859_3_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_3_to_unicode cs_unknown_to_unicode
#endif
0x00, 0x00, 0xd9, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0xbe
};
-struct rxvt_codeset_conv_iso8859_4 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_4_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (unicode == 0x02c7) return 0x00b7;
if (unicode == 0x02d9) return 0x00ff;
if (0x0100 <= unicode && unicode <= 0x017e)
return iso8859_4_f_256[unicode - 0x0100] == 0 ? NOCHAR : iso8859_4_f_256[unicode - 0x0100];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_4;
+}
#else
-#define rxvt_codeset_conv_iso8859_4 rxvt_codeset_conv_unknown
+#define cs_iso8859_4_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_4_to_unicode cs_unknown_to_unicode
#endif
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0xfe, 0xff
};
-struct rxvt_codeset_conv_iso8859_5 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_5_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (unicode == 0x00a0) return 0x00a0;
if (unicode == 0x00a7) return 0x00fd;
if (0x0401 <= unicode && unicode <= 0x045f)
return iso8859_5_f_1024[unicode - 0x0401] == 0 ? NOCHAR : iso8859_5_f_1024[unicode - 0x0401];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_5;
+}
#else
-#define rxvt_codeset_conv_iso8859_5 rxvt_codeset_conv_unknown
+#define cs_iso8859_5_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_5_to_unicode cs_unknown_to_unicode
#endif
0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2
};
-struct rxvt_codeset_conv_iso8859_6 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_6_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (unicode == 0x00a0) return 0x00a0;
if (unicode == 0x00a4) return 0x00a4;
if (0x060c <= unicode && unicode <= 0x0652)
return iso8859_6_f_1536[unicode - 0x060c] == 0 ? NOCHAR : iso8859_6_f_1536[unicode - 0x060c];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_6;
+}
#else
-#define rxvt_codeset_conv_iso8859_6 rxvt_codeset_conv_unknown
+#define cs_iso8859_6_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_6_to_unicode cs_unknown_to_unicode
#endif
0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe
};
-struct rxvt_codeset_conv_iso8859_7 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_7_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (unicode == 0x2015) return 0x00af;
if (unicode == 0x2018) return 0x00a1;
if (0x0384 <= unicode && unicode <= 0x03ce)
return iso8859_7_f_768[unicode - 0x0384] == 0 ? NOCHAR : iso8859_7_f_768[unicode - 0x0384];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_7;
+}
#else
-#define rxvt_codeset_conv_iso8859_7 rxvt_codeset_conv_unknown
+#define cs_iso8859_7_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_7_to_unicode cs_unknown_to_unicode
#endif
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba
};
-struct rxvt_codeset_conv_iso8859_8 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_8_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (unicode <= 0x05d0 && 0x05ea <= unicode) return unicode - 0x04f0;
if (unicode == 0x200e) return 0x00fd;
if (0x00a0 <= unicode && unicode <= 0x00f7)
return iso8859_8_f_0[unicode - 0x00a0] == 0 ? NOCHAR : iso8859_8_f_0[unicode - 0x00a0];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_8;
+}
#else
-#define rxvt_codeset_conv_iso8859_8 rxvt_codeset_conv_unknown
+#define cs_iso8859_8_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_8_to_unicode cs_unknown_to_unicode
#endif
0xde, 0xfe
};
-struct rxvt_codeset_conv_iso8859_9 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_iso8859_9_from_unicode (unicode_t unicode) {
if (unicode <= 0x009f) return unicode;
if (0x00a0 <= unicode && unicode <= 0x00ff)
return iso8859_9_f_0[unicode - 0x00a0] == 0 ? NOCHAR : iso8859_9_f_0[unicode - 0x00a0];
if (0x011e <= unicode && unicode <= 0x015f)
return iso8859_9_f_256[unicode - 0x011e] == 0 ? NOCHAR : iso8859_9_f_256[unicode - 0x011e];
return NOCHAR;
- }
-} rxvt_codeset_conv_iso8859_9;
+}
#else
-#define rxvt_codeset_conv_iso8859_9 rxvt_codeset_conv_unknown
+#define cs_iso8859_9_from_unicode cs_unknown_from_unicode
+#define cs_iso8859_9_to_unicode cs_unknown_to_unicode
#endif
#ifdef ENCODING_JP
-struct rxvt_codeset_conv_jis0201_1976_0 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_jis0201_1976_0_from_unicode (unicode_t unicode) {
if (unicode <= 0x007d) return unicode;
if (0x007f <= unicode && unicode <= 0x009f) return unicode;
if (unicode == 0x203e) return 0x007e;
if (unicode <= 0xff61 && 0xff9f <= unicode) return unicode - 0xfec0;
return NOCHAR;
- }
-} rxvt_codeset_conv_jis0201_1976_0;
+}
#else
-#define rxvt_codeset_conv_jis0201_1976_0 rxvt_codeset_conv_unknown
+#define cs_jis0201_1976_0_from_unicode cs_unknown_from_unicode
+#define cs_jis0201_1976_0_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_jis0208_1990_0 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_jis0208_1990_0_from_unicode (unicode_t unicode) {
if (unicode == 0x2312) return 0x225e;
uint8_t l = unicode;
uint16_t h = unicode >> 8;
- if (h <= 0xff
+ if (0x00 <= h && h <= 0xff
+ && 0x00 <= l && l <= 0xff
&& jis0208_1990_0_f_i[h - 0x00])
return jis0208_1990_0_f_i[h - 0x00][l - 0x00]
? jis0208_1990_0_f_i[h - 0x00][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_jis0208_1990_0;
+}
#else
-#define rxvt_codeset_conv_jis0208_1990_0 rxvt_codeset_conv_unknown
+#define cs_jis0208_1990_0_from_unicode cs_unknown_from_unicode
+#define cs_jis0208_1990_0_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_jis0212_1990_0 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_jis0212_1990_0_from_unicode (unicode_t unicode) {
if (unicode == 0x007e) return 0x2237;
if (unicode == 0x2116) return 0x2271;
if (unicode == 0x2122) return 0x226f;
uint8_t l = unicode;
uint16_t h = unicode >> 8;
- if (h <= 0x9f
+ if (0x00 <= h && h <= 0x9f
+ && 0x00 <= l && l <= 0xff
&& jis0212_1990_0_f_i[h - 0x00])
return jis0212_1990_0_f_i[h - 0x00][l - 0x00]
? jis0212_1990_0_f_i[h - 0x00][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_jis0212_1990_0;
+}
#else
-#define rxvt_codeset_conv_jis0212_1990_0 rxvt_codeset_conv_unknown
+#define cs_jis0212_1990_0_from_unicode cs_unknown_from_unicode
+#define cs_jis0212_1990_0_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_jis0213_1 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_jis0213_1_from_unicode (unicode_t unicode) {
if (unicode == 0x1e3e) return 0x2872;
if (unicode == 0x1e3f) return 0x2873;
if (unicode == 0x1f70) return 0x2b46;
? jis0213_1_f_i[h - 0x00][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_jis0213_1;
+}
#else
-#define rxvt_codeset_conv_jis0213_1 rxvt_codeset_conv_unknown
+#define cs_jis0213_1_from_unicode cs_unknown_from_unicode
+#define cs_jis0213_1_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_jis0213_2 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_jis0213_2_from_unicode (unicode_t unicode) {
if (unicode == 0x3917) return 0x2c46;
if (unicode == 0x391a) return 0x2c4a;
if (unicode == 0x396f) return 0x2c60;
? jis0213_2_f_i[h - 0x34][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_jis0213_2;
+}
#else
-#define rxvt_codeset_conv_jis0213_2 rxvt_codeset_conv_unknown
+#define cs_jis0213_2_from_unicode cs_unknown_from_unicode
+#define cs_jis0213_2_to_unicode cs_unknown_to_unicode
#endif
0x94
};
-struct rxvt_codeset_conv_koi8_r : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_koi8_r_from_unicode (unicode_t unicode) {
if (unicode <= 0x007f) return unicode;
if (unicode == 0x2219) return 0x0095;
if (unicode == 0x221a) return 0x0096;
if (0x2500 <= unicode && unicode <= 0x25a0)
return koi8_r_f_9472[unicode - 0x2500] == 0 ? NOCHAR : koi8_r_f_9472[unicode - 0x2500];
return NOCHAR;
- }
-} rxvt_codeset_conv_koi8_r;
+}
#else
-#define rxvt_codeset_conv_koi8_r rxvt_codeset_conv_unknown
+#define cs_koi8_r_from_unicode cs_unknown_from_unicode
+#define cs_koi8_r_to_unicode cs_unknown_to_unicode
#endif
0x94
};
-struct rxvt_codeset_conv_koi8_u : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_koi8_u_from_unicode (unicode_t unicode) {
if (unicode <= 0x007f) return unicode;
if (unicode == 0x2022) return 0x0095;
if (unicode == 0x221a) return 0x0096;
if (0x2500 <= unicode && unicode <= 0x25a0)
return koi8_u_f_9472[unicode - 0x2500] == 0 ? NOCHAR : koi8_u_f_9472[unicode - 0x2500];
return NOCHAR;
- }
-} rxvt_codeset_conv_koi8_u;
+}
#else
-#define rxvt_codeset_conv_koi8_u rxvt_codeset_conv_unknown
+#define cs_koi8_u_from_unicode cs_unknown_from_unicode
+#define cs_koi8_u_to_unicode cs_unknown_to_unicode
#endif
};
-struct rxvt_codeset_conv_ksc5601_1987_0 : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_ksc5601_1987_0_from_unicode (unicode_t unicode) {
if (unicode == 0x2312) return 0x2152;
if (unicode <= 0x3131 && 0x318e <= unicode) return unicode - 0x0d10;
uint8_t l = unicode;
? ksc5601_1987_0_f_i[h - 0x00][l - 0x00]
: NOCHAR;
return NOCHAR;
- }
-} rxvt_codeset_conv_ksc5601_1987_0;
+}
#else
-#define rxvt_codeset_conv_ksc5601_1987_0 rxvt_codeset_conv_unknown
+#define cs_ksc5601_1987_0_from_unicode cs_unknown_from_unicode
+#define cs_ksc5601_1987_0_to_unicode cs_unknown_to_unicode
#endif
0xb9, 0xf1, 0x9f, 0xcf, 0x1e, 0xdc, 0x14, 0xd6, 0x19, 0xdb
};
-struct rxvt_codeset_conv_viscii : rxvt_codeset_conv {
- uint32_t from_unicode (unicode_t unicode) const {
+static uint32_t cs_viscii_from_unicode (unicode_t unicode) {
if (unicode == 0x007e) return 0x007e;
if (unicode == 0x007f) return 0x007f;
if (0x0000 <= unicode && unicode <= 0x00fd)
if (0x1ea0 <= unicode && unicode <= 0x1ef9)
return viscii_f_7680[unicode - 0x1ea0];
return NOCHAR;
- }
-} rxvt_codeset_conv_viscii;
+}
#else
-#define rxvt_codeset_conv_viscii rxvt_codeset_conv_unknown
+#define cs_viscii_from_unicode cs_unknown_from_unicode
+#define cs_viscii_to_unicode cs_unknown_to_unicode
#endif