--- rxvt-unicode/src/rxvt.h 2006/01/16 15:00:20 1.208 +++ rxvt-unicode/src/rxvt.h 2006/01/19 19:51:08 1.224 @@ -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); @@ -131,8 +130,6 @@ char ** rxvt_splitcommastring (const char *cs); void rxvt_freecommastring (char **cs); char * rxvt_File_find (const char *file, const char *ext, const char *path); -void rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h); -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); ///////////////////////////////////////////////////////////////////////////// @@ -160,7 +157,7 @@ */ struct grwin_t; -/* If we're using either the rxvt scrollbar or menu bars, keep the +/* If we're using either the rxvt scrollbar, keep the * scrollColor resource. */ #if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR) @@ -176,6 +173,28 @@ } bgPixmap_t; #endif +struct rxvt_ptytty { + int pty; // pty file descriptor; connected to rxvt + int tty; // tty file descriptor; connected to child + + 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 @@ -260,13 +279,6 @@ # define HAVE_SCROLLBARS 1 #endif -/* width of scrollBar shadow, must be 1 or 2 */ -#ifdef HALFSHADOW -# define MENU_SHADOW 1 -#else -# define MENU_SHADOW 2 -#endif - #define R_SB_ALIGN_CENTRE 0 #define R_SB_ALIGN_TOP 1 #define R_SB_ALIGN_BOTTOM 2 @@ -347,10 +359,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 @@ -483,7 +494,7 @@ 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, @@ -711,7 +722,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)) @@ -800,24 +812,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 @@ -1109,18 +1103,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; @@ -1163,6 +1145,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 @@ -1202,6 +1186,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; @@ -1241,7 +1226,6 @@ rxvt_term (); ~rxvt_term (); - void child_exit (); // child has exited, usually destroys void destroy (); void emergency_cleanup (); @@ -1340,11 +1324,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); @@ -1432,7 +1412,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 @@ -1447,8 +1427,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); @@ -1485,7 +1467,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); @@ -1506,7 +1488,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