diff --git a/src/conio/ciolib.c b/src/conio/ciolib.c index b9120d6370076f049306873ff30de0df12ccbf8f..0cac18b53008709dc8b92b2c8e38e289db9d3987 100644 --- a/src/conio/ciolib.c +++ b/src/conio/ciolib.c @@ -287,7 +287,11 @@ static int try_curses_init(int mode) cio_api.setvideoflags=curs_setvideoflags; cio_api.getvideoflags=curs_getvideoflags; #if defined(NCURSES_VERSION_MAJOR) || defined (__NetBSD__) +#if NCURSES_REENTRANT + // TODO: set_escdelay() is used for this. +#else cio_api.escdelay=&ESCDELAY; +#endif #endif cio_api.setfont = curs_setfont; cio_api.getfont = curs_getfont; diff --git a/src/syncterm/ripper.c b/src/syncterm/ripper.c index cc5b14b5caca394eaf339f24246020676d8a6459..d50224196f9e8bf503d94fd71fee4e63f890b9ff 100644 --- a/src/syncterm/ripper.c +++ b/src/syncterm/ripper.c @@ -38,6 +38,8 @@ // TODO: Output parsing... (yech) // TODO: Actually make the graphics viewport work properly +#ifdef HAS_VSTAT + enum rip_state { RIP_STATE_BOL // Beginning of the line , @@ -15744,10 +15746,62 @@ ansi_only(BYTE *buf, unsigned count) return out - buf; } +static void +handle_mouse_button(struct rip_button_style *but) +{ + if (but->flags.radiogroup) + puts("TODO: Handle radio group"); + if (but->flags.cbgroup) + puts("TODO: Handle checkbox group"); + if (but->flags.explode) + puts("TODO: Handle explode flag"); + handle_command_str(but->command); + + /* + * The docs says this happens before the command str, but the + * behaviour of popups disagrees. + * + * Also, the command str can free() all this stuff! + */ + if (rip.mfields) { + if (but->flags.resetafter) + rv_reset("RESET", NULL); + } +} + +static void +shadow_palette(void) +{ + uint32_t palette[16]; + int i; + + if (get_modepalette(palette)) { + for (i = 0; i < 16; i++) + palette[i] += 16; + set_modepalette(palette); + } +} + +static void +normal_palette(void) +{ + uint32_t palette[16]; + int i; + + if (get_modepalette(palette)) { + for (i = 0; i < 16; i++) + palette[i] -= 16; + set_modepalette(palette); + } +} + +#endif + // This may end up stuffing up to three bytes into the buffer... size_t parse_rip(BYTE *origbuf, unsigned blen, unsigned maxlen) { +#ifdef HAS_VSTAT unsigned pos = 0; size_t rip_start = maxlen + 1; bool copy = false; @@ -16039,12 +16093,29 @@ parse_rip(BYTE *origbuf, unsigned blen, unsigned maxlen) } if (rip.text_disabled) return ansi_only(origbuf, blen); +#endif return blen; } +void +suspend_rip(bool suspend) +{ +#ifdef HAS_VSTAT + if (suspend) { + if (rip.enabled) + rip_suspended = true; + } + else { + if (rip.enabled) + rip_suspended = false; + } +#endif +} + void init_rip(struct bbslist *bbs) { +#ifdef HAS_VSTAT FREE_AND_NULL(rip.xmap); FREE_AND_NULL(rip.ymap); FREE_AND_NULL(rip.xunmap); @@ -16095,58 +16166,24 @@ init_rip(struct bbslist *bbs) set_ega_palette(); normal_palette(); } -} - -void -suspend_rip(bool suspend) -{ - if (suspend) { - if (rip.enabled) - rip_suspended = true; - } - else { - if (rip.enabled) - rip_suspended = false; - } +#endif } int rip_kbhit(void) { +#ifdef HAS_VSTAT if (rip.enabled) if (ripbuf) return 1; - - +#endif return kbhit(); } -static void -handle_mouse_button(struct rip_button_style *but) -{ - if (but->flags.radiogroup) - puts("TODO: Handle radio group"); - if (but->flags.cbgroup) - puts("TODO: Handle checkbox group"); - if (but->flags.explode) - puts("TODO: Handle explode flag"); - handle_command_str(but->command); - - /* - * The docs says this happens before the command str, but the - * behaviour of popups disagrees. - * - * Also, the command str can free() all this stuff! - */ - if (rip.mfields) { - if (but->flags.resetafter) - rv_reset("RESET", NULL); - } -} - int rip_getch(void) { +#ifdef HAS_VSTAT int ch; struct mouse_event mevent; int oldhold = hold_update; @@ -16314,30 +16351,7 @@ rip_getch(void) normal_palette(); hold_update = oldhold; return ch; -} - -static void -shadow_palette(void) -{ - uint32_t palette[16]; - int i; - - if (get_modepalette(palette)) { - for (i = 0; i < 16; i++) - palette[i] += 16; - set_modepalette(palette); - } -} - -static void -normal_palette(void) -{ - uint32_t palette[16]; - int i; - - if (get_modepalette(palette)) { - for (i = 0; i < 16; i++) - palette[i] -= 16; - set_modepalette(palette); - } +#else + return getch(); +#endif } diff --git a/src/syncterm/term.c b/src/syncterm/term.c index d7de504ba58f28836e60a784f40f5c2ea9d2526c..140ee2011451cd01fda2b07c8a9bae9e6f066a68 100644 --- a/src/syncterm/term.c +++ b/src/syncterm/term.c @@ -3430,9 +3430,7 @@ apc_handler(char *strbuf, size_t slen, void *apcd) paste_pixmap(strbuf, slen, fn, apcd); } - // TODO: Copy PPM to memory // TODO: Copy PBM mask to memory - // TODO: Multiple (at least two) memory buffers } void