--- rxvt-unicode/src/rxvt.h 2006/01/16 17:11:12 1.210 +++ rxvt-unicode/src/rxvt.h 2006/01/19 20:30:36 1.225 @@ -108,7 +108,6 @@ void * rxvt_malloc (size_t size); void * rxvt_calloc (size_t number, size_t size); void * rxvt_realloc (void *ptr, size_t size); -void rxvt_privileges (rxvt_privaction action); // util.C char * rxvt_wcstombs (const wchar_t *str, int len = -1); @@ -174,6 +173,32 @@ } 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 @@ -338,10 +363,9 @@ */ enum { - NO_REFRESH = 0 , /* Window not visible at all! */ - FAST_REFRESH = 1<<0, /* Fully exposed window */ - SLOW_REFRESH = 1<<1, /* Partially exposed window */ - SMOOTH_REFRESH = 1<<2, /* Do sync'ing to make it smooth */ + NO_REFRESH = 0, /* Window not visible at all! */ + FAST_REFRESH = 1, /* Fully exposed window */ + SLOW_REFRESH = 2, /* Partially exposed window */ }; #ifdef NO_SECONDARY_SCREEN @@ -702,7 +726,8 @@ * MACRO DEFINES ***************************************************************************** */ -#define dDisp Display *disp = display->display +#define dLocal(type,name) type const name = this->name +#define dDisp Display *disp = this->display->display /* convert pixel dimensions to row/column values. Everything as int32_t */ #define Pixel2Col(x) Pixel2Width((int32_t)(x)) @@ -791,24 +816,6 @@ # define XPMClearArea(a, b, c, d, e, f, g) #endif -#ifdef UTMP_SUPPORT -# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) -# undef HAVE_UTMPX_H -# undef HAVE_STRUCT_UTMPX -# endif -# if !defined(RXVT_UTMP_FILE) || !defined(HAVE_STRUCT_UTMP) -# undef HAVE_UTMP_H -# undef HAVE_STRUCT_UTMP -# endif - -# ifdef HAVE_UTMPX_H -# include -# endif -# ifdef HAVE_UTMP_H -# include -# endif -#endif - #ifdef DEBUG_CMD # define D_CMD(x) fprintf x ; fputc('\n', stderr) #else @@ -1100,18 +1107,6 @@ struct mouse_event MEvent; XComposeStatus compose; ttymode_t tio; -#ifdef UTMP_SUPPORT -# ifdef HAVE_STRUCT_UTMP - struct utmp ut; -# endif -# ifdef HAVE_STRUCT_UTMPX - struct utmpx utx; -# endif -# if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX) - char ut_id[5]; -# endif - int utmp_pos; -#endif row_col_t oldcursor; #ifdef XPM_BACKGROUND bgPixmap_t bgPixmap; @@ -1154,6 +1149,8 @@ char *cmdbuf_ptr, *cmdbuf_endp; char cmdbuf_base[CBUFSIZ]; + rxvt_ptytty *pty; + rxvt_salloc *talloc; // text line allocator rxvt_salloc *ralloc; // rend line allocator @@ -1193,6 +1190,7 @@ xevent_watcher scrollbar_ev; #endif + void child_cb (child_watcher &w, int status); child_watcher child_ev; 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; @@ -1232,7 +1230,6 @@ rxvt_term (); ~rxvt_term (); - void child_exit (); // child has exited, usually destroys void destroy (); void emergency_cleanup (); @@ -1331,11 +1328,7 @@ // init.C void Get_Colours (); void get_ourmods (); - // logging.C - void makeutent (const char *pty, const char *hostname); - void cleanutent (); // main.C - void privileged_utmp (rxvt_privaction action); bool set_fonts (); void set_string_property (Atom prop, const char *str, int len = -1); void set_utf8_property (Atom prop, const char *str, int len = -1); @@ -1423,7 +1416,7 @@ void scr_reset (); void scr_release (); void scr_clear (bool really = false); - void scr_refresh (unsigned char refresh_type); + void scr_refresh (); bool scr_refresh_rend (rend_t mask, rend_t value); void scr_erase_screen (int mode); #if ENABLE_FRILLS @@ -1438,8 +1431,10 @@ void scr_remap_chars (); void scr_remap_chars (line_t &l); + enum cursor_mode { SAVE, RESTORE }; + void scr_poweron (); - void scr_cursor (int mode); + void scr_cursor (cursor_mode mode); void scr_do_wrap (); int scr_change_screen (int scrn); void scr_color (unsigned int color, int fgbg); @@ -1476,7 +1471,7 @@ void selection_check (int check_more); void selection_paste (Window win, Atom prop, bool delete_prop); void selection_property (Window win, Atom prop); - void selection_request (Time tm, int x, int y); + void selection_request (Time tm); int selection_request_other (Atom target, int selnum); void selection_clear (); void selection_make (Time tm); @@ -1497,7 +1492,6 @@ #if defined(RXVT_SCROLLBAR) // scrollbar-rxvt.C - void Draw_button (int x, int y, int state, int dirn); int scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len); #endif