ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/rxvt-unicode/src/rxvt.h
(Generate patch)

Comparing cvsroot/rxvt-unicode/src/rxvt.h (file contents):
Revision 1.209 by root, Mon Jan 16 15:12:48 2006 UTC vs.
Revision 1.226 by ayin, Thu Jan 19 23:14:39 2006 UTC

106RETSIGTYPE rxvt_Exit_signal (int sig); 106RETSIGTYPE rxvt_Exit_signal (int sig);
107void rxvt_clean_exit (); 107void rxvt_clean_exit ();
108void * rxvt_malloc (size_t size); 108void * rxvt_malloc (size_t size);
109void * rxvt_calloc (size_t number, size_t size); 109void * rxvt_calloc (size_t number, size_t size);
110void * rxvt_realloc (void *ptr, size_t size); 110void * rxvt_realloc (void *ptr, size_t size);
111void rxvt_privileges (rxvt_privaction action);
112 111
113// util.C 112// util.C
114char * rxvt_wcstombs (const wchar_t *str, int len = -1); 113char * rxvt_wcstombs (const wchar_t *str, int len = -1);
115wchar_t * rxvt_mbstowcs (const char *str, int len = -1); 114wchar_t * rxvt_mbstowcs (const char *str, int len = -1);
116char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); 115char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1);
129char * rxvt_Str_trim (char *str); 128char * rxvt_Str_trim (char *str);
130int rxvt_Str_escaped (char *str); 129int rxvt_Str_escaped (char *str);
131char ** rxvt_splitcommastring (const char *cs); 130char ** rxvt_splitcommastring (const char *cs);
132void rxvt_freecommastring (char **cs); 131void rxvt_freecommastring (char **cs);
133char * rxvt_File_find (const char *file, const char *ext, const char *path); 132char * rxvt_File_find (const char *file, const char *ext, const char *path);
134void rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h);
135void rxvt_Draw_Triangle (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int type);
136void rxvt_usleep (int usecs); 133void rxvt_usleep (int usecs);
137 134
138///////////////////////////////////////////////////////////////////////////// 135/////////////////////////////////////////////////////////////////////////////
139 136
140// temporarily replace the process environment 137// temporarily replace the process environment
173typedef struct { 170typedef struct {
174 short w, h, x, y; 171 short w, h, x, y;
175 Pixmap pixmap; 172 Pixmap pixmap;
176} bgPixmap_t; 173} bgPixmap_t;
177#endif 174#endif
175
176struct rxvt_ptytty {
177 int pty; // pty file descriptor; connected to rxvt
178 int tty; // tty file descriptor; connected to child
179
180 rxvt_ptytty ()
181 : pty(-1), tty(-1)
182 {
183 }
184
185 virtual ~rxvt_ptytty ()
186 {
187 }
188
189 virtual bool get () = 0;
190#if UTMP_SUPPORT
191 virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0;
192#endif
193
194 void close_tty ();
195 bool make_controlling_tty ();
196 void set_utf8_mode (bool on);
197};
198
199rxvt_ptytty *rxvt_new_ptytty (); // create a new pty object
200void rxvt_ptytty_server (); // start the ptytty server process
178 201
179/* 202/*
180 * the 'essential' information for reporting Mouse Events 203 * the 'essential' information for reporting Mouse Events
181 * pared down from XButtonEvent 204 * pared down from XButtonEvent
182 */ 205 */
338 * | 361 * |
339 * +---< SB_WIDTH_NEXT 362 * +---< SB_WIDTH_NEXT
340 */ 363 */
341 364
342enum { 365enum {
343 NO_REFRESH = 0 , /* Window not visible at all! */ 366 NO_REFRESH = 0, /* Window not visible at all! */
344 FAST_REFRESH = 1<<0, /* Fully exposed window */ 367 FAST_REFRESH = 1, /* Fully exposed window */
345 SLOW_REFRESH = 1<<1, /* Partially exposed window */ 368 SLOW_REFRESH = 2, /* Partially exposed window */
346 SMOOTH_REFRESH = 1<<2, /* Do sync'ing to make it smooth */
347}; 369};
348 370
349#ifdef NO_SECONDARY_SCREEN 371#ifdef NO_SECONDARY_SCREEN
350# define NSCREENS 0 372# define NSCREENS 0
351#else 373#else
702/* 724/*
703 ***************************************************************************** 725 *****************************************************************************
704 * MACRO DEFINES 726 * MACRO DEFINES
705 ***************************************************************************** 727 *****************************************************************************
706 */ 728 */
729#define dLocal(type,name) type const name = this->name
707#define dDisp Display *disp = display->display 730#define dDisp Display *disp = this->display->display
708 731
709/* convert pixel dimensions to row/column values. Everything as int32_t */ 732/* convert pixel dimensions to row/column values. Everything as int32_t */
710#define Pixel2Col(x) Pixel2Width((int32_t)(x)) 733#define Pixel2Col(x) Pixel2Width((int32_t)(x))
711#define Pixel2Row(y) Pixel2Height((int32_t)(y)) 734#define Pixel2Row(y) Pixel2Height((int32_t)(y))
712#define Pixel2Width(x) ((int32_t)(x) / (int32_t)fwidth) 735#define Pixel2Width(x) ((int32_t)(x) / (int32_t)fwidth)
789 812
790#ifdef XPM_BACKGROUND 813#ifdef XPM_BACKGROUND
791# define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g)) 814# define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g))
792#else 815#else
793# define XPMClearArea(a, b, c, d, e, f, g) 816# define XPMClearArea(a, b, c, d, e, f, g)
794#endif
795
796#ifdef UTMP_SUPPORT
797# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX)
798# undef HAVE_UTMPX_H
799# undef HAVE_STRUCT_UTMPX
800# endif
801# if !defined(RXVT_UTMP_FILE) || !defined(HAVE_STRUCT_UTMP)
802# undef HAVE_UTMP_H
803# undef HAVE_STRUCT_UTMP
804# endif
805
806# ifdef HAVE_UTMPX_H
807# include <utmpx.h>
808# endif
809# ifdef HAVE_UTMP_H
810# include <utmp.h>
811# endif
812#endif 817#endif
813 818
814#ifdef DEBUG_CMD 819#ifdef DEBUG_CMD
815# define D_CMD(x) fprintf x ; fputc('\n', stderr) 820# define D_CMD(x) fprintf x ; fputc('\n', stderr)
816#else 821#else
1100 const char *key_delete; 1105 const char *key_delete;
1101#endif 1106#endif
1102 struct mouse_event MEvent; 1107 struct mouse_event MEvent;
1103 XComposeStatus compose; 1108 XComposeStatus compose;
1104 ttymode_t tio; 1109 ttymode_t tio;
1105#ifdef UTMP_SUPPORT
1106# ifdef HAVE_STRUCT_UTMP
1107 struct utmp ut;
1108# endif
1109# ifdef HAVE_STRUCT_UTMPX
1110 struct utmpx utx;
1111# endif
1112# if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX)
1113 char ut_id[5];
1114# endif
1115 int utmp_pos;
1116#endif
1117 row_col_t oldcursor; 1110 row_col_t oldcursor;
1118#ifdef XPM_BACKGROUND 1111#ifdef XPM_BACKGROUND
1119 bgPixmap_t bgPixmap; 1112 bgPixmap_t bgPixmap;
1120 XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */ 1113 XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */
1121#endif 1114#endif
1154 const char *rs[NUM_RESOURCES]; 1147 const char *rs[NUM_RESOURCES];
1155 /* command input buffering */ 1148 /* command input buffering */
1156 char *cmdbuf_ptr, *cmdbuf_endp; 1149 char *cmdbuf_ptr, *cmdbuf_endp;
1157 char cmdbuf_base[CBUFSIZ]; 1150 char cmdbuf_base[CBUFSIZ];
1158 1151
1152 rxvt_ptytty *pty;
1153
1159 rxvt_salloc *talloc; // text line allocator 1154 rxvt_salloc *talloc; // text line allocator
1160 rxvt_salloc *ralloc; // rend line allocator 1155 rxvt_salloc *ralloc; // rend line allocator
1161 1156
1162 static vector<rxvt_term *> termlist; // a vector of all running rxvt_term's 1157 static vector<rxvt_term *> termlist; // a vector of all running rxvt_term's
1163 1158
1193 xevent_watcher vt_ev; 1188 xevent_watcher vt_ev;
1194#ifdef HAVE_SCROLLBARS 1189#ifdef HAVE_SCROLLBARS
1195 xevent_watcher scrollbar_ev; 1190 xevent_watcher scrollbar_ev;
1196#endif 1191#endif
1197 1192
1193 void child_cb (child_watcher &w, int status); child_watcher child_ev;
1198 void check_cb (check_watcher &w); check_watcher check_ev; 1194 void check_cb (check_watcher &w); check_watcher check_ev;
1199 void destroy_cb (time_watcher &w); time_watcher destroy_ev; 1195 void destroy_cb (time_watcher &w); time_watcher destroy_ev;
1200 void flush_cb (time_watcher &w); time_watcher flush_ev; 1196 void flush_cb (time_watcher &w); time_watcher flush_ev;
1201 1197
1202 void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; 1198 void pty_cb (io_watcher &w, short revents); io_watcher pty_ev;
1232 1228
1233 void tt_winch (); 1229 void tt_winch ();
1234 1230
1235 rxvt_term (); 1231 rxvt_term ();
1236 ~rxvt_term (); 1232 ~rxvt_term ();
1237 void child_exit (); // child has exited, usually destroys
1238 void destroy (); 1233 void destroy ();
1239 void emergency_cleanup (); 1234 void emergency_cleanup ();
1240 1235
1241 bool init (int argc, const char *const *argv); 1236 bool init (int argc, const char *const *argv);
1242 bool init_vars (); 1237 bool init_vars ();
1331 void process_sgr_mode (unsigned int nargs, const int *arg); 1326 void process_sgr_mode (unsigned int nargs, const int *arg);
1332 void process_graphics (); 1327 void process_graphics ();
1333 // init.C 1328 // init.C
1334 void Get_Colours (); 1329 void Get_Colours ();
1335 void get_ourmods (); 1330 void get_ourmods ();
1336 // logging.C
1337 void makeutent (const char *pty, const char *hostname);
1338 void cleanutent ();
1339 // main.C 1331 // main.C
1340 void privileged_utmp (rxvt_privaction action);
1341 bool set_fonts (); 1332 bool set_fonts ();
1342 void set_string_property (Atom prop, const char *str, int len = -1); 1333 void set_string_property (Atom prop, const char *str, int len = -1);
1343 void set_utf8_property (Atom prop, const char *str, int len = -1); 1334 void set_utf8_property (Atom prop, const char *str, int len = -1);
1344 void set_title (const char *str); 1335 void set_title (const char *str);
1345 void set_icon_name (const char *str); 1336 void set_icon_name (const char *str);
1423 void scr_blank_screen_mem (line_t &l, rend_t efs) const; 1414 void scr_blank_screen_mem (line_t &l, rend_t efs) const;
1424 int scr_scroll_text (int row1, int row2, int count); 1415 int scr_scroll_text (int row1, int row2, int count);
1425 void scr_reset (); 1416 void scr_reset ();
1426 void scr_release (); 1417 void scr_release ();
1427 void scr_clear (bool really = false); 1418 void scr_clear (bool really = false);
1428 void scr_refresh (unsigned char refresh_type); 1419 void scr_refresh ();
1429 bool scr_refresh_rend (rend_t mask, rend_t value); 1420 bool scr_refresh_rend (rend_t mask, rend_t value);
1430 void scr_erase_screen (int mode); 1421 void scr_erase_screen (int mode);
1431#if ENABLE_FRILLS 1422#if ENABLE_FRILLS
1432 void scr_erase_savelines (); 1423 void scr_erase_savelines ();
1433 void scr_backindex (); 1424 void scr_backindex ();
1438 rxvt_fontset *scr_find_fontset (rend_t r = DEFAULT_RSTYLE); 1429 rxvt_fontset *scr_find_fontset (rend_t r = DEFAULT_RSTYLE);
1439 void scr_recolour (); 1430 void scr_recolour ();
1440 void scr_remap_chars (); 1431 void scr_remap_chars ();
1441 void scr_remap_chars (line_t &l); 1432 void scr_remap_chars (line_t &l);
1442 1433
1434 enum cursor_mode { SAVE, RESTORE };
1435
1443 void scr_poweron (); 1436 void scr_poweron ();
1444 void scr_cursor (int mode); 1437 void scr_cursor (cursor_mode mode);
1445 void scr_do_wrap (); 1438 void scr_do_wrap ();
1446 int scr_change_screen (int scrn); 1439 int scr_change_screen (int scrn);
1447 void scr_color (unsigned int color, int fgbg); 1440 void scr_color (unsigned int color, int fgbg);
1448 void scr_rendition (int set, int style); 1441 void scr_rendition (int set, int style);
1449 void scr_add_lines (const wchar_t *str, int len, int minlines = 0); 1442 void scr_add_lines (const wchar_t *str, int len, int minlines = 0);
1476 void scr_reverse_selection (); 1469 void scr_reverse_selection ();
1477 void scr_dump (int fd); 1470 void scr_dump (int fd);
1478 void selection_check (int check_more); 1471 void selection_check (int check_more);
1479 void selection_paste (Window win, Atom prop, bool delete_prop); 1472 void selection_paste (Window win, Atom prop, bool delete_prop);
1480 void selection_property (Window win, Atom prop); 1473 void selection_property (Window win, Atom prop);
1481 void selection_request (Time tm, int x, int y); 1474 void selection_request (Time tm, int selnum);
1482 int selection_request_other (Atom target, int selnum); 1475 int selection_request_other (Atom target, int selnum);
1483 void selection_clear (); 1476 void selection_clear ();
1484 void selection_make (Time tm); 1477 void selection_make (Time tm);
1485 bool selection_grab (Time tm); 1478 bool selection_grab (Time tm);
1486 void selection_start_colrow (int col, int row); 1479 void selection_start_colrow (int col, int row);
1497 int scrollbar_show_next (int update, int last_top, int last_bot, int scrollbar_len); 1490 int scrollbar_show_next (int update, int last_top, int last_bot, int scrollbar_len);
1498#endif 1491#endif
1499 1492
1500#if defined(RXVT_SCROLLBAR) 1493#if defined(RXVT_SCROLLBAR)
1501 // scrollbar-rxvt.C 1494 // scrollbar-rxvt.C
1502 void Draw_button (int x, int y, int state, int dirn);
1503 int scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len); 1495 int scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len);
1504#endif 1496#endif
1505 1497
1506#if defined(XTERM_SCROLLBAR) 1498#if defined(XTERM_SCROLLBAR)
1507 // scrollbar-xterm.C 1499 // scrollbar-xterm.C

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines