--- rxvt-unicode/src/rxvt.h 2003/12/02 21:49:46 1.10 +++ rxvt-unicode/src/rxvt.h 2003/12/18 07:31:19 1.17 @@ -1,5 +1,5 @@ /* - * $Id: rxvt.h,v 1.10 2003/12/02 21:49:46 pcg Exp $ + * $Id: rxvt.h,v 1.17 2003/12/18 07:31:19 pcg Exp $ */ #ifndef _RXVT_H_ /* include once only */ @@ -17,6 +17,9 @@ #include "defaultfont.h" #include "rxvtcolor.h" #include "iom.h" +#include "salloc.h" + +#include /* ***************************************************************************** @@ -482,9 +485,6 @@ #if (MENUBAR_MAX) Rs_menu, #endif -#ifndef NO_BOLDFONT - Rs_boldFont, -#endif #ifdef GREEK_SUPPORT Rs_greek_keyboard, Rs_greektoggle_key, @@ -553,15 +553,11 @@ Rs_cursorBlink, Rs_pointerBlank, Rs_pointerBlankDelay, + Rs_imLocale, NUM_RESOURCES }; enum { - TIMEOUT_INCR = 0, - NUM_TIMEOUTS -}; - -enum { XA_COMPOUND_TEXT = 0, XA_MULTIPLE, XA_TARGETS, @@ -730,11 +726,6 @@ #define scrollbar_isUpDn() isupper (R->scrollBar.state) #define isScrollbarWindow(w) (R->scrollBar.state && (w) == R->scrollBar.win) -#define scrollbar_setIdle() R->scrollBar.state = 1 -#define scrollbar_setMotion() R->scrollBar.state = 'm' -#define scrollbar_setUp() R->scrollBar.state = 'U' -#define scrollbar_setDn() R->scrollBar.state = 'D' - #define scrollbarnext_dnval() (R->scrollBar.end + (R->scrollBar.width + 1)) #define scrollbarnext_upButton(y) ((y) > R->scrollBar.end \ && (y) <= scrollbarnext_dnval()) @@ -775,8 +766,8 @@ # define rxvt_get_fontwidest(font) ((font)->max_bounds.width) #endif -#define rxvt_Gr_ButtonPress(x,y) rxvt_Gr_ButtonReport (r, 'P',(x),(y)) -#define rxvt_Gr_ButtonRelease(x,y) rxvt_Gr_ButtonReport (r, 'R',(x),(y)) +#define rxvt_Gr_ButtonPress(x,y) rxvt_Gr_ButtonReport (R, 'P',(x),(y)) +#define rxvt_Gr_ButtonRelease(x,y) rxvt_Gr_ButtonReport (R, 'R',(x),(y)) #ifdef UTMP_SUPPORT # if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) @@ -844,13 +835,11 @@ #define BLINK_INTERVAL 0.5 struct mbstate { - unsigned char orig; - uint32_t reg; - int cnt; + mbstate_t mbs; mbstate () { - cnt = 0; + MEMSET (&mbs, 0, sizeof (mbs)); } }; @@ -876,7 +865,8 @@ hidden_pointer:1, #endif parsed_geometry:1, - seen_input:1; /* wether any input has been seen so far */ + seen_input:1, /* wether any input has been seen so far */ + enc_utf8:1; /* wether terminal reads/writes utf-8 */ unsigned char refresh_type, #ifdef UTMP_SUPPORT @@ -897,15 +887,15 @@ #endif short rvideo; int16_t num_scr; /* screen: number lines scrolled */ - uint16_t prev_ncol, /* screen: previous number of columns */ + uint16_t prev_ncol, /* screen: previous number of columns */ prev_nrow; /* screen: previous number of rows */ #ifdef RXVT_GRAPHICS - uint16_t gr_prev_start; + uint16_t gr_prev_start; #endif /* ---------- */ rend_t rstyle; /* ---------- */ - uint32_t pixcolor_set[NPIXCLR_SETS]; + uint32_t pixcolor_set[NPIXCLR_SETS]; /* ---------- */ #ifdef SELECTION_SCROLLING int scroll_selection_delay, @@ -1071,7 +1061,6 @@ #ifdef POINTER_BLANK struct timeval lastmotion; #endif - struct timeval timeout[NUM_TIMEOUTS]; /* these three don't need to be kept but do so to placate some mem checkers */ char *env_windowid; /* environmental variable WINDOWID */ @@ -1080,6 +1069,7 @@ char *env_colorfgbg; char *buffer; char *locale; + char *codeset; char charsets[4]; unsigned char *v_buffer; /* pointer to physical buffer */ unsigned int v_buflen; /* size of area to write */ @@ -1093,6 +1083,11 @@ unsigned char cmdbuf_base[BUFSIZ]; unsigned char kbuf[KBUFSZ]; + rxvt_salloc *ralloc; + rxvt_salloc *talloc; + + void paste (const unsigned char *data, unsigned int len); + void flush (); void check_cb (check_watcher &w); check_watcher check_ev; @@ -1101,6 +1096,8 @@ void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; void x_cb (io_watcher &w, short revents); io_watcher x_ev; + void incr_cb (time_watcher &w); time_watcher incr_ev; + #ifdef CURSOR_BLINK void blink_cb (time_watcher &w); time_watcher blink_ev; #endif @@ -1130,8 +1127,31 @@ void *operator new (size_t s); void operator delete (void *p, size_t s); + + void init_secondary (); + const char **init_resources (int argc, const char *const *argv); + void init_env (); + void set_locale (const char *locale); + void init_xlocale (); + void init_command (const char *const *argv); + int run_command (const char *const *argv); + int run_child (const char *const *argv); + + void color_aliases(int idx); + void recolour_cursor (); + + /* screen(!) */ + void scr_blank_line (text_t *et, rend_t *er, unsigned int width, rend_t efs); + void scr_blank_screen_mem (text_t **tp, rend_t **rp, unsigned int row, rend_t efs); + int scr_scroll_text (int row1, int row2, int count, int spec); + void scr_reset (); + void scr_reset_realloc (); + void scr_release (); }; +#define SET_LOCALE(locale) rxvt_set_locale (locale) +extern void rxvt_set_locale (const char *locale); + #ifndef __attribute__ # ifdef __GNUC__ # if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2)