… | |
… | |
73 | #endif |
73 | #endif |
74 | |
74 | |
75 | #include <termios.h> |
75 | #include <termios.h> |
76 | typedef struct termios ttymode_t; |
76 | typedef struct termios ttymode_t; |
77 | |
77 | |
|
|
78 | #ifdef HAVE_AFTERIMAGE |
|
|
79 | # include <afterimage.h> |
|
|
80 | #undef min |
|
|
81 | #undef max |
78 | #ifdef XPM_BACKGROUND |
82 | #elif defined(XPM_BACKGROUND) |
79 | # ifdef XPM_INC_X11 |
83 | # ifdef XPM_INC_X11 |
80 | # include <X11/xpm.h> |
84 | # include <X11/xpm.h> |
81 | # else |
85 | # else |
82 | # include <xpm.h> |
86 | # include <xpm.h> |
83 | # endif |
87 | # endif |
… | |
… | |
177 | #endif |
181 | #endif |
178 | |
182 | |
179 | #ifdef XPM_BACKGROUND |
183 | #ifdef XPM_BACKGROUND |
180 | typedef struct { |
184 | typedef struct { |
181 | short w, h, x, y; |
185 | short w, h, x, y; |
|
|
186 | bool auto_resize ; |
182 | Pixmap pixmap; |
187 | Pixmap pixmap; |
183 | } bgPixmap_t; |
188 | } bgPixmap_t; |
184 | #endif |
189 | #endif |
185 | |
190 | |
186 | /* |
191 | /* |
… | |
… | |
687 | #define Col2Pixel(col) ((int32_t)Width2Pixel(col)) |
692 | #define Col2Pixel(col) ((int32_t)Width2Pixel(col)) |
688 | #define Row2Pixel(row) ((int32_t)Height2Pixel(row)) |
693 | #define Row2Pixel(row) ((int32_t)Height2Pixel(row)) |
689 | #define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth) |
694 | #define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth) |
690 | #define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight) |
695 | #define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight) |
691 | |
696 | |
692 | #define OPTION(opt) (options & (opt)) |
|
|
693 | #define DEFAULT_OPTIONS (Opt_scrollBar \ |
|
|
694 | | Opt_scrollTtyOutput \ |
|
|
695 | | Opt_jumpScroll \ |
|
|
696 | | Opt_secondaryScreen \ |
|
|
697 | | Opt_secondaryScroll \ |
|
|
698 | | Opt_pastableTabs \ |
|
|
699 | | Opt_intensityStyles) |
|
|
700 | |
|
|
701 | // for m >= -n, ensure remainder lies between 0..n-1 |
697 | // for m >= -n, ensure remainder lies between 0..n-1 |
702 | #define MOD(m,n) (((m) + (n)) % (n)) |
698 | #define MOD(m,n) (((m) + (n)) % (n)) |
703 | |
699 | |
704 | #define LINENO(n) MOD (term_start + int(n), total_rows) |
700 | #define LINENO(n) MOD (term_start + int(n), total_rows) |
705 | #define ROW(n) row_buf [LINENO (n)] |
701 | #define ROW(n) row_buf [LINENO (n)] |
… | |
… | |
905 | struct mbstate mbstate; // current input multibyte state |
901 | struct mbstate mbstate; // current input multibyte state |
906 | |
902 | |
907 | unsigned char want_refresh:1, |
903 | unsigned char want_refresh:1, |
908 | #ifdef TRANSPARENT |
904 | #ifdef TRANSPARENT |
909 | want_full_refresh:1, /* awaiting full screen refresh */ |
905 | want_full_refresh:1, /* awaiting full screen refresh */ |
910 | #endif |
|
|
911 | #if defined(XPM_BACKGROUND) || defined(TRANSPARENT) |
|
|
912 | am_transparent:1, /* is a transparent term */ |
906 | am_transparent:1, /* is a transparent term */ |
913 | am_pixmap_trans:1, /* transparency w/known root pixmap */ |
907 | am_pixmap_trans:1, /* transparency w/known root pixmap */ |
914 | #endif |
908 | #endif |
915 | current_screen:1, /* primary or secondary */ |
909 | current_screen:1, /* primary or secondary */ |
916 | num_scr_allow:1, |
910 | num_scr_allow:1, |
… | |
… | |
1027 | XComposeStatus compose; |
1021 | XComposeStatus compose; |
1028 | ttymode_t tio; |
1022 | ttymode_t tio; |
1029 | row_col_t oldcursor; |
1023 | row_col_t oldcursor; |
1030 | #ifdef XPM_BACKGROUND |
1024 | #ifdef XPM_BACKGROUND |
1031 | bgPixmap_t bgPixmap; |
1025 | bgPixmap_t bgPixmap; |
|
|
1026 | #ifdef HAVE_AFTERIMAGE |
|
|
1027 | ASImageManager *asimman; |
|
|
1028 | ASImage *original_asim; |
|
|
1029 | struct { unsigned int width, height; } xpmAttr; /* all we need is width/height */ |
|
|
1030 | #else |
1032 | XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */ |
1031 | XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */ |
|
|
1032 | #endif |
1033 | #endif |
1033 | #endif |
1034 | |
1034 | |
1035 | #if ENABLE_OVERLAY |
1035 | #if ENABLE_OVERLAY |
1036 | int ov_x, ov_y, ov_w, ov_h; // overlay dimensions |
1036 | int ov_x, ov_y, ov_w, ov_h; // overlay dimensions |
1037 | text_t **ov_text; |
1037 | text_t **ov_text; |
… | |
… | |
1098 | } |
1098 | } |
1099 | |
1099 | |
1100 | #if TRANSPARENT || ENABLE_PERL |
1100 | #if TRANSPARENT || ENABLE_PERL |
1101 | void rootwin_cb (XEvent &xev); |
1101 | void rootwin_cb (XEvent &xev); |
1102 | xevent_watcher rootwin_ev; |
1102 | xevent_watcher rootwin_ev; |
|
|
1103 | #endif |
|
|
1104 | #if TRANSPARENT |
|
|
1105 | void check_our_parents_cb (time_watcher &w); |
|
|
1106 | time_watcher check_our_parents_ev; |
1103 | #endif |
1107 | #endif |
1104 | |
1108 | |
1105 | void x_cb (XEvent &xev); |
1109 | void x_cb (XEvent &xev); |
1106 | void flush (); |
1110 | void flush (); |
1107 | xevent_watcher termwin_ev; |
1111 | xevent_watcher termwin_ev; |
… | |
… | |
1296 | { |
1300 | { |
1297 | int base = GET_BASEFG (r); |
1301 | int base = GET_BASEFG (r); |
1298 | #ifndef NO_BRIGHTCOLOR |
1302 | #ifndef NO_BRIGHTCOLOR |
1299 | if (r & RS_Bold |
1303 | if (r & RS_Bold |
1300 | # if ENABLE_STYLES |
1304 | # if ENABLE_STYLES |
1301 | && OPTION (Opt_intensityStyles) |
1305 | && option (Opt_intensityStyles) |
1302 | # endif |
1306 | # endif |
1303 | && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) |
1307 | && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) |
1304 | base += minBrightCOLOR - minCOLOR; |
1308 | base += minBrightCOLOR - minCOLOR; |
1305 | #endif |
1309 | #endif |
1306 | return base; |
1310 | return base; |
… | |
… | |
1310 | { |
1314 | { |
1311 | int base = GET_BASEBG (r); |
1315 | int base = GET_BASEBG (r); |
1312 | #ifndef NO_BRIGHTCOLOR |
1316 | #ifndef NO_BRIGHTCOLOR |
1313 | if (r & RS_Blink |
1317 | if (r & RS_Blink |
1314 | # if ENABLE_STYLES |
1318 | # if ENABLE_STYLES |
1315 | && OPTION (Opt_intensityStyles) |
1319 | && option (Opt_intensityStyles) |
1316 | # endif |
1320 | # endif |
1317 | && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) |
1321 | && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) |
1318 | base += minBrightCOLOR - minCOLOR; |
1322 | base += minBrightCOLOR - minCOLOR; |
1319 | #endif |
1323 | #endif |
1320 | return base; |
1324 | return base; |
1321 | } |
1325 | } |
1322 | |
1326 | |
1323 | bool option (uint32_t opt) const NOTHROW |
1327 | bool option (uint8_t opt) const NOTHROW |
1324 | { |
1328 | { |
1325 | return OPTION (opt); |
1329 | return options[opt >> 3] & (1 << (opt & 7)); |
1326 | } |
1330 | } |
1327 | |
1331 | |
1328 | void set_option (uint32_t opt, bool set) NOTHROW |
1332 | void set_option (uint8_t opt, bool set = true) NOTHROW |
1329 | { |
1333 | { |
1330 | if (set) |
1334 | if (set) |
1331 | options |= opt; |
1335 | options[opt >> 3] |= (1 << (opt & 7)); |
1332 | else |
1336 | else |
1333 | options &= ~opt; |
1337 | options[opt >> 3] &= ~(1 << (opt & 7)); |
1334 | } |
1338 | } |
1335 | |
1339 | |
1336 | void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; |
1340 | void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; |
1337 | void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; |
1341 | void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; |
1338 | int scr_scroll_text (int row1, int row2, int count) NOTHROW; |
1342 | int scr_scroll_text (int row1, int row2, int count) NOTHROW; |