… | |
… | |
314 | enum { |
314 | enum { |
315 | PRIMARY = 0, |
315 | PRIMARY = 0, |
316 | SECONDARY |
316 | SECONDARY |
317 | }; |
317 | }; |
318 | |
318 | |
319 | enum { |
|
|
320 | SBYTE = 0, |
|
|
321 | WBYTE |
|
|
322 | }; |
|
|
323 | |
|
|
324 | |
|
|
325 | #define RS_None 0 /* Normal */ |
319 | #define RS_None 0 /* Normal */ |
326 | |
320 | |
327 | #define RS_fgMask 0x000001FFu /* 512 colors */ |
321 | #define RS_fgMask 0x000001FFu /* 512 colors */ |
328 | #define RS_bgMask 0x0003FE00u /* 512 colors */ |
322 | #define RS_bgMask 0x0003FE00u /* 512 colors */ |
329 | #define RS_Bold 0x00040000u /* bold */ |
323 | #define RS_Bold 0x00040000u /* bold */ |
330 | #define RS_Blink 0x00080000u /* blink */ |
324 | #define RS_Blink 0x00080000u /* blink */ |
331 | #define RS_RVid 0x00100000u /* reverse video */ |
325 | #define RS_RVid 0x00100000u /* reverse video */ |
332 | #define RS_Uline 0x00200000u /* underline */ |
326 | #define RS_Uline 0x00200000u /* underline */ |
333 | |
327 | |
334 | #define RS_wide 0x00400000u /* only multibyte characters */ |
|
|
335 | #define IS_WIDE(r) ((r) & RS_wide) |
|
|
336 | |
|
|
337 | #define RS_fontMask 0xff000000u /* plenty(?) of fonts */ |
328 | #define RS_fontMask 0xffc00000u /* plenty(?) of fonts */ |
338 | #define RS_fontShift 24 |
329 | #define RS_fontShift 22 |
339 | |
330 | |
340 | #define RS_baseattrMask (RS_Bold|RS_Blink|RS_RVid|RS_Uline) |
331 | #define RS_baseattrMask (RS_Bold|RS_Blink|RS_RVid|RS_Uline) |
341 | #define RS_attrMask (RS_baseattrMask|RS_fontMask|RS_wide) |
332 | #define RS_attrMask (RS_baseattrMask|RS_fontMask) |
342 | |
333 | |
343 | #define Sel_none 0 /* Not waiting */ |
334 | #define Sel_none 0 /* Not waiting */ |
344 | #define Sel_normal 0x01 /* normal selection */ |
335 | #define Sel_normal 0x01 /* normal selection */ |
345 | #define Sel_incr 0x02 /* incremental selection */ |
336 | #define Sel_incr 0x02 /* incremental selection */ |
346 | #define Sel_direct 0x00 |
337 | #define Sel_direct 0x00 |
… | |
… | |
451 | TOTAL_COLORS = NRS_COLORS /* */ |
442 | TOTAL_COLORS = NRS_COLORS /* */ |
452 | #endif |
443 | #endif |
453 | }; |
444 | }; |
454 | |
445 | |
455 | #define Color_Bits 9 |
446 | #define Color_Bits 9 |
456 | #define NPIXCLR_SETS 9 /* (256 + 14) bits / 32 bits */ |
447 | #define NPIXCLR_SETS ((TOTAL_COLORS + 31) / 32) |
457 | #define NPIXCLR_BITS 32 |
448 | #define NPIXCLR_BITS 32 |
458 | |
449 | |
459 | #define DEFAULT_RSTYLE (RS_None | (Color_fg) | (Color_bg<<Color_Bits)) |
450 | #define DEFAULT_RSTYLE (RS_None | (Color_fg) | (Color_bg<<Color_Bits)) |
460 | |
451 | |
461 | /* |
452 | /* |
462 | * Resource list |
453 | * Resource list |
463 | */ |
454 | */ |
464 | enum { |
455 | enum { |
… | |
… | |
617 | #else |
608 | #else |
618 | # define PrivMode_Default \ |
609 | # define PrivMode_Default \ |
619 | (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor) |
610 | (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor) |
620 | #endif |
611 | #endif |
621 | |
612 | |
622 | #ifdef PREFER_24BIT |
|
|
623 | # define XDEPTH R->Xdepth |
613 | #define XDEPTH R->Xdepth |
624 | # define XCMAP R->Xcmap |
614 | #define XCMAP R->Xcmap |
625 | # define XVISUAL R->Xvisual |
615 | #define XVISUAL R->Xvisual |
626 | #else |
616 | |
627 | # ifdef DEBUG_DEPTH |
|
|
628 | # define XDEPTH DEBUG_DEPTH |
|
|
629 | # else |
|
|
630 | # define XDEPTH DefaultDepth(R->Xdisplay,Xscreen) |
|
|
631 | # define XCMAP DefaultColormap(R->Xdisplay,Xscreen) |
|
|
632 | # define XVISUAL DefaultVisual(R->Xdisplay,Xscreen) |
|
|
633 | # endif |
|
|
634 | #endif |
|
|
635 | #define IMBUFSIZ 128 /* input modifier buffer sizes */ |
617 | #define IMBUFSIZ 128 /* input modifier buffer sizes */ |
636 | #ifndef BUFSIZ |
618 | #ifndef BUFSIZ |
637 | # define BUFSIZ 4096 |
619 | # define BUFSIZ 4096 |
638 | #endif |
620 | #endif |
639 | #define KBUFSZ 512 /* size of keyboard mapping buffer */ |
621 | #define KBUFSZ 512 /* size of keyboard mapping buffer */ |
640 | |
622 | |
641 | /* |
623 | /* |
642 | ***************************************************************************** |
624 | ***************************************************************************** |
643 | * MACRO DEFINES |
625 | * MACRO DEFINES |
644 | ***************************************************************************** |
626 | ***************************************************************************** |
… | |
… | |
670 | #define Height2Pixel(n) ((int32_t)(n) * (int32_t)TermWin.fheight) |
652 | #define Height2Pixel(n) ((int32_t)(n) * (int32_t)TermWin.fheight) |
671 | |
653 | |
672 | #define TermWin_TotalWidth() ((int32_t)TermWin.width + 2 * (int32_t)TermWin.int_bwidth) |
654 | #define TermWin_TotalWidth() ((int32_t)TermWin.width + 2 * (int32_t)TermWin.int_bwidth) |
673 | #define TermWin_TotalHeight() ((int32_t)TermWin.height + 2 * (int32_t)TermWin.int_bwidth) |
655 | #define TermWin_TotalHeight() ((int32_t)TermWin.height + 2 * (int32_t)TermWin.int_bwidth) |
674 | |
656 | |
675 | #define Xscreen DefaultScreen(R->Xdisplay) |
|
|
676 | #define Xroot DefaultRootWindow(R->Xdisplay) |
657 | #define Xroot DefaultRootWindow(R->Xdisplay) |
677 | |
658 | |
678 | /* how to build & extract colors and attributes */ |
659 | /* how to build & extract colors and attributes */ |
679 | #define GET_BASEFG(x) (((x) & RS_fgMask)) |
660 | #define GET_BASEFG(x) (((x) & RS_fgMask)) |
680 | #define GET_BASEBG(x) (((x) & RS_bgMask)>>Color_Bits) |
661 | #define GET_BASEBG(x) (((x) & RS_bgMask)>>Color_Bits) |
… | |
… | |
707 | #define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | (fg)) |
688 | #define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | (fg)) |
708 | #define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg)<<Color_Bits)) |
689 | #define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg)<<Color_Bits)) |
709 | #define SET_ATTR(x,a) (((x) & ~RS_attrMask)| (a)) |
690 | #define SET_ATTR(x,a) (((x) & ~RS_attrMask)| (a)) |
710 | |
691 | |
711 | #define SET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] |= (1 << ((x) % NPIXCLR_BITS))) |
692 | #define SET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] |= (1 << ((x) % NPIXCLR_BITS))) |
712 | #define ISSET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] & (1 << ((x) % NPIXCLR_BITS))) |
693 | #define ISSET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] & (1 << ((x) % NPIXCLR_BITS))) |
713 | |
694 | |
714 | #ifdef HAVE_SCROLLBARS |
695 | #ifdef HAVE_SCROLLBARS |
715 | # define scrollbar_TotalWidth() (scrollBar.width + sb_shadow * 2) |
696 | # define scrollbar_TotalWidth() (scrollBar.width + sb_shadow * 2) |
716 | #else |
697 | #else |
717 | # define scrollbar_TotalWidth() (0) |
698 | # define scrollbar_TotalWidth() (0) |
… | |
… | |
944 | #endif |
925 | #endif |
945 | ttymode; |
926 | ttymode; |
946 | unsigned long PrivateModes, |
927 | unsigned long PrivateModes, |
947 | SavedModes; |
928 | SavedModes; |
948 | /* ---------- */ |
929 | /* ---------- */ |
949 | #ifdef PREFER_24BIT |
|
|
950 | Visual *Xvisual; |
|
|
951 | #endif |
|
|
952 | /* ---------- */ |
|
|
953 | Atom xa[NUM_XA]; |
930 | Atom xa[NUM_XA]; |
954 | /* ---------- */ |
931 | /* ---------- */ |
955 | #ifdef MENUBAR |
932 | #ifdef MENUBAR |
956 | GC menubarGC; |
933 | GC menubarGC; |
957 | #endif |
934 | #endif |