-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 78e9e7a6d1e2e1a1676014e13d88eac0c2a69c20: path_to: revision_to:
commit 78e9e7a6d1e2e1a1676014e13d88eac0c2a69c20 Author: Marc Lehmann <schmorp@schmorp.de> Date: Wed Aug 4 03:29:29 2004 +0000 *** empty log message *** diff --git a/reconf b/reconf
--- a/reconf +++ b/reconf @@ -4,11 +4,11 @@ # 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 \ "$@" diff --git a/src/command.C b/src/command.C
--- a/src/command.C +++ b/src/command.C @@ -677,6 +677,8 @@ rxvt_term::flush () } display->flush (); + + flush_ev.stop (); } void @@ -685,6 +687,20 @@ rxvt_term::check_cb (check_watcher &w) 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 (); } @@ -1076,7 +1092,7 @@ rxvt_term::x_cb (XEvent &ev) break; case MappingNotify: - XRefreshKeyboardMapping (& (ev.xmapping)); + XRefreshKeyboardMapping (&ev.xmapping); break; /* @@ -1171,16 +1187,8 @@ rxvt_term::x_cb (XEvent &ev) 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) { @@ -1230,17 +1238,18 @@ rxvt_term::x_cb (XEvent &ev) 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 { @@ -1260,6 +1269,11 @@ rxvt_term::x_cb (XEvent &ev) 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; @@ -1769,238 +1783,234 @@ rxvt_term::button_release (XButtonEvent &ev) #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 /* @@ -2059,7 +2069,11 @@ rxvt_term::check_our_parents () 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 { @@ -2080,7 +2094,7 @@ rxvt_term::check_our_parents () 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; @@ -2132,21 +2146,11 @@ rxvt_term::check_our_parents () 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 @@ -2157,7 +2161,8 @@ rxvt_term::check_our_parents () 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; @@ -2211,7 +2216,7 @@ rxvt_term::check_our_parents () 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; @@ -2226,7 +2231,10 @@ rxvt_term::check_our_parents () #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; @@ -2236,6 +2244,15 @@ rxvt_term::check_our_parents () 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 @@ -2286,10 +2303,9 @@ rxvt_term::cmd_parse () 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; } @@ -2317,16 +2333,16 @@ rxvt_term::cmd_parse () * 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); + } } } diff --git a/src/defaultfont.h b/src/defaultfont.h
--- a/src/defaultfont.h +++ b/src/defaultfont.h @@ -19,6 +19,8 @@ # include <langinfo.h> #endif +#include <inttypes.h> + #include "rxvtlib.h" #include "feature.h" #include "encoding.h" @@ -110,6 +112,7 @@ struct rxvt_fontset { 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]; diff --git a/src/encoding.C b/src/encoding.C
--- a/src/encoding.C +++ b/src/encoding.C @@ -139,23 +139,17 @@ codeset_from_name (const char *name) 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 @@ -218,58 +212,65 @@ struct rxvt_codeset_conv_unicode_16 : rxvt_codeset_conv { #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 diff --git a/src/encoding.h b/src/encoding.h
--- a/src/encoding.h +++ b/src/encoding.h @@ -68,18 +68,18 @@ enum { }; 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); diff --git a/src/gentables b/src/gentables
--- a/src/gentables +++ b/src/gentables @@ -236,26 +236,25 @@ while (<DATA>) { #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 diff --git a/src/main.C b/src/main.C
--- a/src/main.C +++ b/src/main.C @@ -173,6 +173,7 @@ rxvt_term::rxvt_term () 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) @@ -888,6 +889,9 @@ rxvt_term::change_font (const char *fontname) scr_touch (true); } + for (unicode_t ch = 0x20; ch <= 0x7f; ch++) + TermWin.ascii_map [ch - 0x20] = fs->find_font (ch); + return true; } } @@ -977,7 +981,7 @@ rxvt_term::set_window_color (int idx, const char *color) 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, @@ -990,7 +994,7 @@ rxvt_term::set_window_color (int idx, const char *color) 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 @@ -1025,7 +1029,7 @@ rxvt_term::recolour_cursor () 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); } diff --git a/src/rxvt.h b/src/rxvt.h
--- a/src/rxvt.h +++ b/src/rxvt.h @@ -11,6 +11,9 @@ #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" @@ -133,6 +136,16 @@ struct mouse_event { ? 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 @@ -535,6 +548,7 @@ enum { #ifndef NO_FRILLS Rs_ext_bwidth, Rs_int_bwidth, + Rs_borderLess, #endif Rs_scrollBar_thickness, #ifndef NO_LINESPACE @@ -625,10 +639,7 @@ enum { # 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 @@ -638,6 +649,33 @@ enum { # 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 @@ -964,7 +1002,6 @@ struct rxvt_term : rxvt_vars { #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 */ @@ -1134,8 +1171,9 @@ struct rxvt_term : rxvt_vars { 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; diff --git a/src/rxvtcolor.C b/src/rxvtcolor.C
--- a/src/rxvtcolor.C +++ b/src/rxvtcolor.C @@ -27,6 +27,11 @@ #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 () @@ -167,6 +172,20 @@ bool rxvt_display::init () 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. @@ -186,7 +205,6 @@ bool rxvt_display::init () } #endif - int fd = XConnectionNumber (display); x_ev.start (fd, EVENT_READ); fcntl (fd, F_SETFD, FD_CLOEXEC); diff --git a/src/rxvtcolor.h b/src/rxvtcolor.h
--- a/src/rxvtcolor.h +++ b/src/rxvtcolor.h @@ -84,6 +84,9 @@ struct rxvt_display : refcounted { Colormap cmap; Window root; rxvt_term *selection_owner; +#ifndef NO_SLOW_LINK_SUPPORT + bool is_local; +#endif rxvt_display (const char *id); bool init (); diff --git a/src/rxvtlib.h.in b/src/rxvtlib.h.in
--- a/src/rxvtlib.h.in +++ b/src/rxvtlib.h.in @@ -106,6 +106,7 @@ typedef struct { Pixmap pixmap; rxvt_fontset *fontset; rxvt_drawable *drawable; + uint16_t ascii_map[0x7f - 0x20]; // map ascii chars to fonts for speed } TermWin_t; /* @@ -204,13 +205,15 @@ typedef struct { #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) diff --git a/src/table/big5.h b/src/table/big5.h
--- a/src/table/big5.h +++ b/src/table/big5.h @@ -2401,8 +2401,7 @@ const uint16_t *big5_f_i[] = { }; -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; @@ -2427,11 +2426,11 @@ struct rxvt_codeset_conv_big5 : rxvt_codeset_conv { ? 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 diff --git a/src/table/big5_ext.h b/src/table/big5_ext.h
--- a/src/table/big5_ext.h +++ b/src/table/big5_ext.h @@ -2284,8 +2284,7 @@ const uint16_t *big5_ext_f_i[] = { }; -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; @@ -2303,11 +2302,11 @@ struct rxvt_codeset_conv_big5_ext : rxvt_codeset_conv { ? 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 diff --git a/src/table/big5_plus.h b/src/table/big5_plus.h
--- a/src/table/big5_plus.h +++ b/src/table/big5_plus.h @@ -2308,8 +2308,7 @@ const uint16_t *big5_plus_f_i[] = { }; -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; @@ -2328,11 +2327,11 @@ struct rxvt_codeset_conv_big5_plus : rxvt_codeset_conv { ? 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 diff --git a/src/table/cns11643_1992_1.h b/src/table/cns11643_1992_1.h
--- a/src/table/cns11643_1992_1.h +++ b/src/table/cns11643_1992_1.h @@ -1995,8 +1995,7 @@ const uint16_t *cns11643_1992_1_f_i[] = { }; -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 @@ -2006,11 +2005,11 @@ struct rxvt_codeset_conv_cns11643_1992_1 : rxvt_codeset_conv { ? 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 diff --git a/src/table/cns11643_1992_2.h b/src/table/cns11643_1992_2.h
--- a/src/table/cns11643_1992_2.h +++ b/src/table/cns11643_1992_2.h @@ -1995,8 +1995,7 @@ const uint16_t *cns11643_1992_2_f_i[] = { }; -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 @@ -2006,11 +2005,11 @@ struct rxvt_codeset_conv_cns11643_1992_2 : rxvt_codeset_conv { ? 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 diff --git a/src/table/cns11643_1992_3.h b/src/table/cns11643_1992_3.h
--- a/src/table/cns11643_1992_3.h +++ b/src/table/cns11643_1992_3.h @@ -2624,8 +2624,7 @@ const uint16_t *cns11643_1992_3_f_i[] = { }; -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 @@ -2635,11 +2634,11 @@ struct rxvt_codeset_conv_cns11643_1992_3 : rxvt_codeset_conv { ? 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 diff --git a/src/table/cns11643_1992_4.h b/src/table/cns11643_1992_4.h
--- a/src/table/cns11643_1992_4.h +++ b/src/table/cns11643_1992_4.h @@ -2382,8 +2382,7 @@ const uint16_t *cns11643_1992_4_f_i[] = { }; -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; @@ -2429,11 +2428,11 @@ struct rxvt_codeset_conv_cns11643_1992_4 : rxvt_codeset_conv { ? 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 diff --git a/src/table/cns11643_1992_5.h b/src/table/cns11643_1992_5.h
--- a/src/table/cns11643_1992_5.h +++ b/src/table/cns11643_1992_5.h @@ -661,8 +661,7 @@ const uint16_t *cns11643_1992_5_f_i[] = { }; -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; @@ -726,11 +725,11 @@ struct rxvt_codeset_conv_cns11643_1992_5 : rxvt_codeset_conv { ? 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 diff --git a/src/table/cns11643_1992_6.h b/src/table/cns11643_1992_6.h
--- a/src/table/cns11643_1992_6.h +++ b/src/table/cns11643_1992_6.h @@ -323,8 +323,7 @@ const uint16_t *cns11643_1992_6_f_i[] = { }; -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; @@ -405,11 +404,11 @@ struct rxvt_codeset_conv_cns11643_1992_6 : rxvt_codeset_conv { ? 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 diff --git a/src/table/cns11643_1992_7.h b/src/table/cns11643_1992_7.h
--- a/src/table/cns11643_1992_7.h +++ b/src/table/cns11643_1992_7.h @@ -193,8 +193,7 @@ const uint16_t *cns11643_1992_7_f_i[] = { }; -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; @@ -275,11 +274,11 @@ struct rxvt_codeset_conv_cns11643_1992_7 : rxvt_codeset_conv { ? 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 diff --git a/src/table/cns11643_1992_f.h b/src/table/cns11643_1992_f.h
--- a/src/table/cns11643_1992_f.h +++ b/src/table/cns11643_1992_f.h @@ -210,8 +210,7 @@ const uint16_t *cns11643_1992_f_f_i[] = { }; -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; @@ -402,11 +401,11 @@ struct rxvt_codeset_conv_cns11643_1992_f : rxvt_codeset_conv { ? 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 diff --git a/src/table/gb2312_1980_0.h b/src/table/gb2312_1980_0.h
--- a/src/table/gb2312_1980_0.h +++ b/src/table/gb2312_1980_0.h @@ -2191,8 +2191,7 @@ const uint16_t *gb2312_1980_0_f_i[] = { }; -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; @@ -2220,11 +2219,11 @@ struct rxvt_codeset_conv_gb2312_1980_0 : rxvt_codeset_conv { ? 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 diff --git a/src/table/iso8859_1.h b/src/table/iso8859_1.h
--- a/src/table/iso8859_1.h +++ b/src/table/iso8859_1.h @@ -4,15 +4,14 @@ #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 diff --git a/src/table/iso8859_10.h b/src/table/iso8859_10.h
--- a/src/table/iso8859_10.h +++ b/src/table/iso8859_10.h @@ -22,8 +22,7 @@ static const uint8_t iso8859_10_f_256[] = { 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) @@ -31,11 +30,11 @@ struct rxvt_codeset_conv_iso8859_10 : rxvt_codeset_conv { 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 diff --git a/src/table/iso8859_11.h b/src/table/iso8859_11.h
--- a/src/table/iso8859_11.h +++ b/src/table/iso8859_11.h @@ -12,18 +12,17 @@ static const uint8_t iso8859_11_f_3584[] = { 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 diff --git a/src/table/iso8859_13.h b/src/table/iso8859_13.h
--- a/src/table/iso8859_13.h +++ b/src/table/iso8859_13.h @@ -22,8 +22,7 @@ static const uint8_t iso8859_13_f_256[] = { 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; @@ -34,11 +33,11 @@ struct rxvt_codeset_conv_iso8859_13 : rxvt_codeset_conv { 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 diff --git a/src/table/iso8859_14.h b/src/table/iso8859_14.h
--- a/src/table/iso8859_14.h +++ b/src/table/iso8859_14.h @@ -39,8 +39,7 @@ static const uint8_t iso8859_14_f_7680[] = { 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]; @@ -49,11 +48,11 @@ struct rxvt_codeset_conv_iso8859_14 : rxvt_codeset_conv { 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 diff --git a/src/table/iso8859_15.h b/src/table/iso8859_15.h
--- a/src/table/iso8859_15.h +++ b/src/table/iso8859_15.h @@ -17,8 +17,7 @@ static const uint8_t iso8859_15_f_256[] = { 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) @@ -26,11 +25,11 @@ struct rxvt_codeset_conv_iso8859_15 : rxvt_codeset_conv { 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 diff --git a/src/table/iso8859_16.h b/src/table/iso8859_16.h
--- a/src/table/iso8859_16.h +++ b/src/table/iso8859_16.h @@ -22,8 +22,7 @@ static const uint8_t iso8859_16_f_256[] = { 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; @@ -37,11 +36,11 @@ struct rxvt_codeset_conv_iso8859_16 : rxvt_codeset_conv { 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 diff --git a/src/table/iso8859_2.h b/src/table/iso8859_2.h
--- a/src/table/iso8859_2.h +++ b/src/table/iso8859_2.h @@ -22,8 +22,7 @@ static const uint8_t iso8859_2_f_256[] = { 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; @@ -35,11 +34,11 @@ struct rxvt_codeset_conv_iso8859_2 : rxvt_codeset_conv { 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 diff --git a/src/table/iso8859_3.h b/src/table/iso8859_3.h
--- a/src/table/iso8859_3.h +++ b/src/table/iso8859_3.h @@ -22,8 +22,7 @@ static const uint8_t iso8859_3_f_256[] = { 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; @@ -32,11 +31,11 @@ struct rxvt_codeset_conv_iso8859_3 : rxvt_codeset_conv { 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 diff --git a/src/table/iso8859_4.h b/src/table/iso8859_4.h
--- a/src/table/iso8859_4.h +++ b/src/table/iso8859_4.h @@ -22,8 +22,7 @@ static const uint8_t iso8859_4_f_256[] = { 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; @@ -33,11 +32,11 @@ struct rxvt_codeset_conv_iso8859_4 : rxvt_codeset_conv { 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 diff --git a/src/table/iso8859_5.h b/src/table/iso8859_5.h
--- a/src/table/iso8859_5.h +++ b/src/table/iso8859_5.h @@ -12,8 +12,7 @@ static const uint8_t iso8859_5_f_1024[] = { 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; @@ -22,11 +21,11 @@ struct rxvt_codeset_conv_iso8859_5 : rxvt_codeset_conv { 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 diff --git a/src/table/iso8859_6.h b/src/table/iso8859_6.h
--- a/src/table/iso8859_6.h +++ b/src/table/iso8859_6.h @@ -11,8 +11,7 @@ static const uint8_t iso8859_6_f_1536[] = { 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; @@ -20,11 +19,11 @@ struct rxvt_codeset_conv_iso8859_6 : rxvt_codeset_conv { 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 diff --git a/src/table/iso8859_7.h b/src/table/iso8859_7.h
--- a/src/table/iso8859_7.h +++ b/src/table/iso8859_7.h @@ -15,8 +15,7 @@ static const uint8_t iso8859_7_f_768[] = { 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; @@ -26,11 +25,11 @@ struct rxvt_codeset_conv_iso8859_7 : rxvt_codeset_conv { 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 diff --git a/src/table/iso8859_8.h b/src/table/iso8859_8.h
--- a/src/table/iso8859_8.h +++ b/src/table/iso8859_8.h @@ -12,8 +12,7 @@ static const uint8_t iso8859_8_f_0[] = { 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; @@ -22,11 +21,11 @@ struct rxvt_codeset_conv_iso8859_8 : rxvt_codeset_conv { 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 diff --git a/src/table/iso8859_9.h b/src/table/iso8859_9.h
--- a/src/table/iso8859_9.h +++ b/src/table/iso8859_9.h @@ -19,19 +19,18 @@ static const uint8_t iso8859_9_f_256[] = { 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 diff --git a/src/table/jis0201_1976_0.h b/src/table/jis0201_1976_0.h
--- a/src/table/jis0201_1976_0.h +++ b/src/table/jis0201_1976_0.h @@ -4,18 +4,17 @@ #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 diff --git a/src/table/jis0208_1990_0.h b/src/table/jis0208_1990_0.h
--- a/src/table/jis0208_1990_0.h +++ b/src/table/jis0208_1990_0.h @@ -2239,22 +2239,22 @@ const uint16_t *jis0208_1990_0_f_i[] = { }; -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 diff --git a/src/table/jis0212_1990_0.h b/src/table/jis0212_1990_0.h
--- a/src/table/jis0212_1990_0.h +++ b/src/table/jis0212_1990_0.h @@ -2115,24 +2115,24 @@ const uint16_t *jis0212_1990_0_f_i[] = { }; -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 diff --git a/src/table/jis0213_1.h b/src/table/jis0213_1.h
--- a/src/table/jis0213_1.h +++ b/src/table/jis0213_1.h @@ -2501,8 +2501,7 @@ const uint16_t *jis0213_1_f_i[] = { }; -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; @@ -2539,11 +2538,11 @@ struct rxvt_codeset_conv_jis0213_1 : rxvt_codeset_conv { ? 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 diff --git a/src/table/jis0213_2.h b/src/table/jis0213_2.h
--- a/src/table/jis0213_2.h +++ b/src/table/jis0213_2.h @@ -2306,8 +2306,7 @@ const uint16_t *jis0213_2_f_i[] = { }; -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; @@ -2367,11 +2366,11 @@ struct rxvt_codeset_conv_jis0213_2 : rxvt_codeset_conv { ? 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 diff --git a/src/table/koi8_r.h b/src/table/koi8_r.h
--- a/src/table/koi8_r.h +++ b/src/table/koi8_r.h @@ -33,8 +33,7 @@ static const uint8_t koi8_r_f_9472[] = { 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; @@ -50,11 +49,11 @@ struct rxvt_codeset_conv_koi8_r : rxvt_codeset_conv { 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 diff --git a/src/table/koi8_u.h b/src/table/koi8_u.h
--- a/src/table/koi8_u.h +++ b/src/table/koi8_u.h @@ -37,8 +37,7 @@ static const uint8_t koi8_u_f_9472[] = { 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; @@ -54,11 +53,11 @@ struct rxvt_codeset_conv_koi8_u : rxvt_codeset_conv { 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 diff --git a/src/table/ksc5601_1987_0.h b/src/table/ksc5601_1987_0.h
--- a/src/table/ksc5601_1987_0.h +++ b/src/table/ksc5601_1987_0.h @@ -3472,8 +3472,7 @@ const uint16_t *ksc5601_1987_0_f_i[] = { }; -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; @@ -3485,11 +3484,11 @@ struct rxvt_codeset_conv_ksc5601_1987_0 : rxvt_codeset_conv { ? 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 diff --git a/src/table/viscii.h b/src/table/viscii.h
--- a/src/table/viscii.h +++ b/src/table/viscii.h @@ -43,8 +43,7 @@ static const uint8_t viscii_f_7680[] = { 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) @@ -54,11 +53,11 @@ struct rxvt_codeset_conv_viscii : rxvt_codeset_conv { 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
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 12:31:31 2024