--- rxvt-unicode/src/rxvt.h 2006/01/09 23:00:07 1.193 +++ rxvt-unicode/src/rxvt.h 2006/01/13 07:03:48 1.203 @@ -5,6 +5,21 @@ #include "feature.h" +#if defined (ISO_14755) || defined (ENABLE_PERL) +# define ENABLE_OVERLAY 1 +#endif + +#if ENABLE_PERL +# define ENABLE_FRILLS 1 +# define ENABLE_COMBINING 1 +#endif + +#if ENABLE_FRILLS +# define ENABLE_XEMBED 1 +# define ENABLE_EWMH 1 +# define CURSOR_BLINK 1 +#endif + #include #include @@ -23,12 +38,6 @@ #include "rxvtperl.h" -#if ENABLE_FRILLS -# define ENABLE_XEMBED 1 -# define ENABLE_EWMH 1 -# define CURSOR_BLINK 1 -#endif - /* ***************************************************************************** * SYSTEM HACKS @@ -45,7 +54,7 @@ #endif #ifndef HAVE_XPOINTER -typedef char *XPointer; +typedef char *XPointer; #endif #ifdef HAVE_TERMIOS_H @@ -115,6 +124,24 @@ void rxvt_Draw_Triangle (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int type); void rxvt_usleep (int usecs); +///////////////////////////////////////////////////////////////////////////// + +// temporarily replace the process environment +extern char **environ; +extern char **rxvt_environ; // the original environ pointer + +inline void set_environ (stringvec *envv) +{ + if (envv) + environ = (char **)envv->begin (); +} + +inline void set_environ (char **envv) +{ + if (envv) + environ = envv; +} + /* ***************************************************************************** * STRUCTURES AND TYPEDEFS @@ -213,14 +240,6 @@ # define NO_MOUSE_REPORT_SCROLLBAR 1 #endif -#ifdef NO_RESOURCES -# undef USE_XGETDEFAULT -#endif - -#if defined (ISO_14755) || defined (ENABLE_PERL) -# define ENABLE_OVERLAY 1 -#endif - /* now look for other badly set stuff */ #if !defined (EACCESS) && defined(EAGAIN) @@ -440,10 +459,10 @@ XTerm_Color00 = 10, // not implemented, CLASH! XTerm_Color01 = 11, // not implemented XTerm_Color_cursor = 12, // change actual 'Cursor' color - XTerm_Color_pointer_fg = 13, // change actual 'Pointer' color - XTerm_Color_pointer_bg = 14, // not implemented - XTerm_Color05 = 15, // not implemented - XTerm_Color06 = 16, // not implemented + XTerm_Color_pointer_fg = 13, // change actual 'Pointer' fg color + XTerm_Color_pointer_bg = 14, // change actual 'Pointer' bg color + XTerm_Color05 = 15, // not implemented (tektronix fg) + XTerm_Color06 = 16, // not implemented (tektronix bg) XTerm_Color_RV = 17, // change actual 'Highlight' color XTerm_logfile = 46, // not implemented XTerm_font = 50, @@ -453,18 +472,21 @@ XTerm_emacs51 = 51, // reserved for emacs shell /* * rxvt extensions of XTerm OSCs: ESC ] Ps;Pt (ST|BEL) + * at least Rxvt_Color_BD and Rxvt_Color_UL clash with xterm */ - XTerm_Color_BD = 18, // change actual 'Bold' color - XTerm_Color_UL = 19, // change actual 'Underline' color - XTerm_Pixmap = 20, // new bg pixmap - XTerm_restoreFG = 39, // change default fg color - XTerm_restoreBG = 49, // change default bg color - XTerm_dumpscreen = 55, // dump scrollback and all of screen + Rxvt_Color_BD = 18, // change actual 'Bold' color + Rxvt_Color_UL = 19, // change actual 'Underline' color + Rxvt_Pixmap = 20, // new bg pixmap + Rxvt_restoreFG = 39, // change default fg color + Rxvt_restoreBG = 49, // change default bg color + Rxvt_dumpscreen = 55, // dump scrollback and all of screen URxvt_locale = 701, // change locale URxvt_Menu = 703, // set menu item URxvt_Color_IT = 704, // change actual 'Italic' colour URxvt_Color_tint = 705, // change actual tint colour + URxvt_Color_BD = 706, + URxvt_Color_UL = 707, URxvt_font = 710, URxvt_boldFont = 711, @@ -701,10 +723,10 @@ #define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth) #define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight) -#define OPTION(opt) (options & (opt)) -#define DEFAULT_OPTIONS (Opt_scrollBar | Opt_scrollTtyOutput \ - | Opt_jumpScroll | Opt_secondaryScreen \ - | Opt_pastableTabs | Opt_intensityStyles) +#define OPTION(opt) (options & (opt)) +#define DEFAULT_OPTIONS (Opt_scrollBar | Opt_scrollTtyOutput \ + | Opt_jumpScroll | Opt_secondaryScreen \ + | Opt_pastableTabs | Opt_intensityStyles) // for m >= -n, ensure remainder lies between 0..n-1 #define MOD(m,n) (((m) + (n)) % (n)) @@ -841,7 +863,7 @@ #define SET_LOCALE(locale) rxvt_set_locale (locale) extern bool rxvt_set_locale (const char *locale); -extern bool rxvt_push_locale (const char *locale); +extern void rxvt_push_locale (const char *locale); extern void rxvt_pop_locale (); /****************************************************************************/ @@ -975,14 +997,9 @@ struct rxvt_term : zero_initialized, rxvt_vars { 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; #endif -#if USE_XGETDEFAULT - XrmDatabase xrmdatabase; -#endif - struct mbstate mbstate; // current input multibyte state unsigned char want_refresh:1, @@ -1198,7 +1215,12 @@ // modifies first argument(!) void paste (char *data, unsigned int len); - void flush (); + long vt_emask, vt_emask_perl; + + void vt_select_input () + { + XSelectInput (display->display, vt, vt_emask | vt_emask_perl); + } #if TRANSPARENT void rootwin_cb (XEvent &xev); @@ -1206,6 +1228,7 @@ #endif void x_cb (XEvent &xev); + void flush (); xevent_watcher termwin_ev; xevent_watcher vt_ev; #ifdef HAVE_SCROLLBARS @@ -1265,6 +1288,7 @@ void init_secondary (); const char **init_resources (int argc, const char *const *argv); + const char *x_resource (const char *name); void init_env (); void set_locale (const char *locale); void init_xlocale ();