--- rxvt-unicode/src/rxvt.h 2003/12/18 05:45:11 1.16 +++ rxvt-unicode/src/rxvt.h 2004/01/17 01:20:01 1.21 @@ -1,9 +1,5 @@ -/* - * $Id: rxvt.h,v 1.16 2003/12/18 05:45:11 pcg Exp $ - */ - -#ifndef _RXVT_H_ /* include once only */ -#define _RXVT_H_ +#ifndef RXVT_H_ /* include once only */ +#define RXVT_H_ #include "rxvtlib.h" @@ -19,6 +15,8 @@ #include "iom.h" #include "salloc.h" +#include + /* ***************************************************************************** * SYSTEM HACKS @@ -662,17 +660,17 @@ #define STRRCHR(x, y) strrchr((const char *)(x), (int)(y)) /* convert pixel dimensions to row/column values. Everything as int32_t */ -#define Pixel2Col(x) Pixel2Width((int32_t)(x) - (int32_t)R->TermWin.int_bwidth) -#define Pixel2Row(y) Pixel2Height((int32_t)(y) - (int32_t)R->TermWin.int_bwidth) -#define Pixel2Width(x) ((int32_t)(x) / (int32_t)R->TermWin.fwidth) -#define Pixel2Height(y) ((int32_t)(y) / (int32_t)R->TermWin.fheight) -#define Col2Pixel(col) ((int32_t)Width2Pixel(col) + (int32_t)R->TermWin.int_bwidth) -#define Row2Pixel(row) ((int32_t)Height2Pixel(row) + (int32_t)R->TermWin.int_bwidth) -#define Width2Pixel(n) ((int32_t)(n) * (int32_t)R->TermWin.fwidth) -#define Height2Pixel(n) ((int32_t)(n) * (int32_t)R->TermWin.fheight) +#define Pixel2Col(x) Pixel2Width((int32_t)(x) - (int32_t)TermWin.int_bwidth) +#define Pixel2Row(y) Pixel2Height((int32_t)(y) - (int32_t)TermWin.int_bwidth) +#define Pixel2Width(x) ((int32_t)(x) / (int32_t)TermWin.fwidth) +#define Pixel2Height(y) ((int32_t)(y) / (int32_t)TermWin.fheight) +#define Col2Pixel(col) ((int32_t)Width2Pixel(col) + (int32_t)TermWin.int_bwidth) +#define Row2Pixel(row) ((int32_t)Height2Pixel(row) + (int32_t)TermWin.int_bwidth) +#define Width2Pixel(n) ((int32_t)(n) * (int32_t)TermWin.fwidth) +#define Height2Pixel(n) ((int32_t)(n) * (int32_t)TermWin.fheight) -#define TermWin_TotalWidth() ((int32_t)R->TermWin.width + 2 * (int32_t)R->TermWin.int_bwidth) -#define TermWin_TotalHeight() ((int32_t)R->TermWin.height + 2 * (int32_t)R->TermWin.int_bwidth) +#define TermWin_TotalWidth() ((int32_t)TermWin.width + 2 * (int32_t)TermWin.int_bwidth) +#define TermWin_TotalHeight() ((int32_t)TermWin.height + 2 * (int32_t)TermWin.int_bwidth) #define Xscreen DefaultScreen(R->Xdisplay) #define Xroot DefaultRootWindow(R->Xdisplay) @@ -714,7 +712,7 @@ #define ISSET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] & (1 << ((x) % NPIXCLR_BITS))) #ifdef HAVE_SCROLLBARS -# define scrollbar_TotalWidth() (R->scrollBar.width + R->sb_shadow * 2) +# define scrollbar_TotalWidth() (scrollBar.width + sb_shadow * 2) #else # define scrollbar_TotalWidth() (0) #endif @@ -745,7 +743,7 @@ #if (MENUBAR_MAX > 1) /* rendition style flags */ -# define menuBar_height() (R->TermWin.fheight + SHADOW) +# define menuBar_height() (TermWin.fheight + SHADOW) # define menuBar_TotalHeight() (menuBar_height() + SHADOW + menuBar_margin) # define isMenuBarWindow(w) ((w) == R->menuBar.win) #else @@ -833,13 +831,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)); } }; @@ -865,7 +861,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 @@ -886,15 +883,15 @@ #endif short rvideo; int16_t num_scr; /* screen: number lines scrolled */ - uint16_t prev_ncol, /* screen: previous number of columns */ + unsigned int 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, @@ -1080,7 +1077,6 @@ /* command input buffering */ unsigned char *cmdbuf_ptr, *cmdbuf_endp; unsigned char cmdbuf_base[BUFSIZ]; - unsigned char kbuf[KBUFSZ]; rxvt_salloc *ralloc; rxvt_salloc *talloc; @@ -1130,6 +1126,7 @@ 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); @@ -1137,6 +1134,24 @@ void color_aliases(int idx); void recolour_cursor (); + void create_windows (int argc, const char *const *argv); + void resize_all_windows (unsigned int width, unsigned int height, int ignoreparent); + void window_calc (unsigned int width, unsigned int height); + void set_preedit_area (XRectangle * preedit_rect, XRectangle * status_rect, XRectangle * needed_rect); + +#if USE_XIM + void set_size (XRectangle *size); + void set_position (XPoint *pos); + void set_color (unsigned long *fg, unsigned long *bg); +#endif + + void resize_scrollbar (); + + void pixel_position (int *x, int *y); + + void selection_click (int clicks, int x, int y); + void selection_extend (int x, int y, int flag); + void selection_rotate (int x, int y); /* screen(!) */ void scr_blank_line (text_t *et, rend_t *er, unsigned int width, rend_t efs); @@ -1145,6 +1160,11 @@ void scr_reset (); void scr_reset_realloc (); void scr_release (); + void scr_clear (); + void scr_refresh (unsigned char refresh_type); + void scr_erase_screen (int mode); + void scr_touch (bool refresh); + void scr_expose (int x, int y, int width, int height, bool refresh); }; #define SET_LOCALE(locale) rxvt_set_locale (locale)