--- rxvt-unicode/src/rxvt.h 2006/01/25 02:53:13 1.243 +++ rxvt-unicode/src/rxvt.h 2006/07/05 22:46:14 1.258 @@ -34,6 +34,7 @@ #endif #include "encoding.h" +#include "rxvtutil.h" #include "rxvtfont.h" #include "rxvttoolkit.h" #include "iom.h" @@ -100,27 +101,6 @@ /****************************************************************************/ -#ifndef __attribute__ -# if __GNUC__ -# if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2) -# define __attribute__(x) -# endif -# endif -# define __attribute__(x) -#endif - -#define NORETURN __attribute__ ((noreturn)) -#define UNUSED __attribute__ ((unused)) - -// increases code size unless -fno-enforce-eh-specs -#if __GNUC__ -# define NOTHROW -# define THROW(x) -#else -# define NOTHROW throw() -# define THROW(x) throw x -#endif - // exception thrown on fatal (per-instance) errors class rxvt_failure_exception { }; @@ -434,6 +414,9 @@ #define RS_RVid 0x00020000UL // reverse video #define RS_Uline 0x00040000UL // underline +// toggle this to force redraw, must be != RS_Careful +#define RS_redraw 0x01000000UL + // 5 custom bits for extensions #define RS_customCount 32 #define RS_customMask 0x00f80000UL @@ -512,6 +495,7 @@ Rxvt_dumpscreen = 55, // dump scrollback and all of screen URxvt_locale = 701, // change locale + URxvt_version = 702, // request version URxvt_Color_IT = 704, // change actual 'Italic' colour URxvt_Color_tint = 705, // change actual tint colour @@ -606,9 +590,6 @@ #define Color_Bits 7 // 0 .. maxTermCOLOR -#define NPIXCLR_SETS ((TOTAL_COLORS + 31) / 32) -#define NPIXCLR_BITS 32 - /* * Resource list */ @@ -701,12 +682,11 @@ ***************************************************************************** */ #define dLocal(type,name) type const name = this->name -#define dDisp Display *disp = this->display->display // for speed reasons, we assume that all latin1 characters -// are single-width (the first unicdoe combining character +// are single-width (the first unicode combining character // is actually 0x300, but ascii is what matters most). -#define WCWIDTH(c) ((c) < 0x100 ? 1 : wcwidth (c)) +#define WCWIDTH(c) ((c) & ~0xff ? wcwidth (c) : 1) /* convert pixel dimensions to row/column values. Everything as int32_t */ #define Pixel2Col(x) Pixel2Width((int32_t)(x)) @@ -750,8 +730,8 @@ #define RS_SAME(a,b) (!(((a) ^ (b)) & ~RS_Careful)) -#define SET_PIXCOLOR(x) (pixcolor_set[(x) / NPIXCLR_BITS] |= (1 << ((x) % NPIXCLR_BITS))) -#define ISSET_PIXCOLOR(x) (pixcolor_set[(x) / NPIXCLR_BITS] & (1 << ((x) % NPIXCLR_BITS))) +#define PIXCOLOR_NAME(idx) rs[Rs_color + (idx)] +#define ISSET_PIXCOLOR(idx) (!!rs[Rs_color + (idx)]) #if ENABLE_STYLES # define FONTSET(style) fontset[GET_STYLE (style)] @@ -795,8 +775,8 @@ # define XPMClearArea(a, b, c, d, e, f, g) #endif -typedef callback1 log_callback; -typedef callback1 getfd_callback; +typedef callback log_callback; +typedef callback getfd_callback; #define SET_LOCALE(locale) rxvt_set_locale (locale) extern bool rxvt_set_locale (const char *locale) NOTHROW; @@ -871,7 +851,7 @@ # define IS_COMPOSE(n) ((int32_t)(n) >= COMPOSE_LO) #else # if ENABLE_PERL -# define COMPOSE_LO 0xe000UL // our _own_ routiens don't like (illegal) surrogates +# define COMPOSE_LO 0xe000UL // our _own_ functions don't like (illegal) surrogates # define COMPOSE_HI 0xf8ffUL // in utf-8, so use private use area only # else # define COMPOSE_LO 0xd800UL @@ -910,11 +890,17 @@ /****************************************************************************/ #ifdef KEYSYM_RESOURCE - class keyboard_manager; +class keyboard_manager; #endif -struct rxvt_term : zero_initialized, rxvt_vars { - log_callback *log_hook; // log error messages through this hook, if != 0 +struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen { + + // special markers with magic addresses + static const char resval_undef []; // options specifically unset + static const char resval_on []; // boolean options switched on + static const char resval_off []; // or off + + log_callback *log_hook; // log error messages through this hook, if != 0 getfd_callback *getfd_hook; // convert remote to local fd, if != 0 #if ENABLE_PERL rxvt_perl_term perl; @@ -964,8 +950,6 @@ /* ---------- */ rend_t rstyle; /* ---------- */ - uint32_t pixcolor_set[NPIXCLR_SETS]; -/* ---------- */ #ifdef SELECTION_SCROLLING int scroll_selection_lines; enum page_dirn scroll_selection_dir; @@ -1113,7 +1097,7 @@ void vt_select_input () const NOTHROW { - XSelectInput (display->display, vt, vt_emask | vt_emask_perl | vt_emask_xim); + XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim); } #if TRANSPARENT @@ -1224,13 +1208,14 @@ bool IMisRunning (); void IMSendSpot (); bool IM_get_IC (const char *modifiers); - void IMSetStatusPosition (); + void IMSetPosition (); #endif void resize_scrollbar (); // command.C - void lookup_key (XKeyEvent &ev); + void key_press (XKeyEvent &ev); + void key_release (XKeyEvent &ev); unsigned int cmd_write (const char *str, unsigned int count); wchar_t next_char () NOTHROW; @@ -1244,6 +1229,7 @@ void button_release (XButtonEvent &ev); void focus_in (); void focus_out (); + void update_fade_color (unsigned int idx); int check_our_parents (); #ifdef PRINTPIPE FILE *popen_printer (); @@ -1275,7 +1261,8 @@ void set_icon_name (const char *str); void set_window_color (int idx, const char *color); void set_colorfgbg (); - int rXParseAllocColor (rxvt_color * screen_in_out, const char *colour); + bool set_color (rxvt_color &color, const char *name); + void alias_color (int dst, int src); void set_widthheight (unsigned int newwidth, unsigned int newheight); // screen.C