--- rxvt-unicode/src/rxvt.h 2006/01/20 22:49:34 1.230 +++ rxvt-unicode/src/rxvt.h 2006/01/22 11:57:06 1.235 @@ -37,6 +37,7 @@ #include "rxvttoolkit.h" #include "iom.h" #include "salloc.h" +#include "libptytty.h" #include "rxvtperl.h" @@ -143,6 +144,7 @@ wchar_t * rxvt_mbstowcs (const char *str, int len = -1); char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); wchar_t * rxvt_utf8towcs (const char *str, int len = -1); +char * rxvt_strdup_cpp (const char *str); #define rxvt_strdup(s) ((s) ? strdup(s) : 0) @@ -160,7 +162,6 @@ char ** rxvt_splitcommastring (const char *cs) NOTHROW; void rxvt_freecommastring (char **cs) NOTHROW; char * rxvt_File_find (const char *file, const char *ext, const char *path) NOTHROW; -void rxvt_usleep (int usecs) NOTHROW; ///////////////////////////////////////////////////////////////////////////// @@ -170,13 +171,21 @@ inline void set_environ (stringvec *envv) { +#if ENABLE_PERL + assert (envv); +#else if (envv) +#endif environ = (char **)envv->begin (); } inline void set_environ (char **envv) { +#if ENABLE_PERL + assert (envv); +#else if (envv) +#endif environ = envv; } @@ -203,32 +212,6 @@ } bgPixmap_t; #endif -struct rxvt_ptytty { - int pty; // pty file descriptor; connected to rxvt - int tty; // tty file descriptor; connected to child - - rxvt_ptytty () - : pty(-1), tty(-1) - { - } - - virtual ~rxvt_ptytty () - { - } - - virtual bool get () = 0; -#if UTMP_SUPPORT - virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0; -#endif - - void close_tty (); - bool make_controlling_tty (); - void set_utf8_mode (bool on); -}; - -rxvt_ptytty *rxvt_new_ptytty (); // create a new pty object -void rxvt_ptytty_server (); // start the ptytty server process - /* * the 'essential' information for reporting Mouse Events * pared down from XButtonEvent @@ -1022,7 +1005,10 @@ selection_wait, selection_type; /* ---------- */ - short rvideo; + bool rvideo_state, rvideo_mode; +#ifndef NO_BELL + bool rvideo_bell; +#endif int num_scr; /* screen: number lines scrolled */ int prev_ncol, /* screen: previous number of columns */ prev_nrow; /* screen: previous number of rows */ @@ -1152,7 +1138,7 @@ char *cmdbuf_ptr, *cmdbuf_endp; char cmdbuf_base[CBUFSIZ]; - rxvt_ptytty *pty; + ptytty *pty; rxvt_salloc *talloc; // text line allocator rxvt_salloc *ralloc; // rend line allocator @@ -1197,9 +1183,7 @@ void check_cb (check_watcher &w); check_watcher check_ev; void destroy_cb (time_watcher &w); time_watcher destroy_ev; void flush_cb (time_watcher &w); time_watcher flush_ev; - void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; - void incr_cb (time_watcher &w) NOTHROW; time_watcher incr_ev; #ifdef CURSOR_BLINK @@ -1208,6 +1192,9 @@ #ifdef TEXT_BLINK void text_blink_cb (time_watcher &w); time_watcher text_blink_ev; #endif +#ifndef NO_BELL + void bell_cb (time_watcher &w); time_watcher bell_ev; +#endif #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING void cont_scroll_cb (time_watcher &w); time_watcher cont_scroll_ev; @@ -1236,7 +1223,14 @@ void destroy (); void emergency_cleanup (); - bool init (int argc, const char *const *argv); + bool init (int argc, const char *const *argv, stringvec *envv); + + bool init (stringvec *argv, stringvec *envv) + { + this->argv = argv; + return init (argv->size (), argv->begin (), envv); + } + bool init_vars (); bool pty_fill (); @@ -1449,7 +1443,7 @@ void scr_relative_origin (int mode) NOTHROW; void scr_insert_mode (int mode) NOTHROW; void scr_set_tab (int mode) NOTHROW; - void scr_rvideo_mode (int mode) NOTHROW; + void scr_rvideo_mode (bool on) NOTHROW; void scr_report_position () NOTHROW; void set_font_style () NOTHROW; void scr_charset_choose (int set) NOTHROW;