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

Comparing rxvt-unicode/src/rxvt.h (file contents):
Revision 1.208 by root, Mon Jan 16 15:00:20 2006 UTC vs.
Revision 1.220 by root, Tue Jan 17 15:17:39 2006 UTC

93#ifndef STDIN_FILENO 93#ifndef STDIN_FILENO
94# define STDIN_FILENO 0 94# define STDIN_FILENO 0
95# define STDOUT_FILENO 1 95# define STDOUT_FILENO 1
96# define STDERR_FILENO 2 96# define STDERR_FILENO 2
97#endif 97#endif
98
99enum rxvt_privaction { IGNORE = 'i', SAVE = 's', RESTORE = 'r' };//TODO
98 100
99/* 101/*
100 ***************************************************************************** 102 *****************************************************************************
101 * PROTOTYPES 103 * PROTOTYPES
102 ***************************************************************************** 104 *****************************************************************************
129char * rxvt_Str_trim (char *str); 131char * rxvt_Str_trim (char *str);
130int rxvt_Str_escaped (char *str); 132int rxvt_Str_escaped (char *str);
131char ** rxvt_splitcommastring (const char *cs); 133char ** rxvt_splitcommastring (const char *cs);
132void rxvt_freecommastring (char **cs); 134void rxvt_freecommastring (char **cs);
133char * rxvt_File_find (const char *file, const char *ext, const char *path); 135char * 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); 136void rxvt_usleep (int usecs);
137 137
138///////////////////////////////////////////////////////////////////////////// 138/////////////////////////////////////////////////////////////////////////////
139 139
140// temporarily replace the process environment 140// temporarily replace the process environment
158 * STRUCTURES AND TYPEDEFS 158 * STRUCTURES AND TYPEDEFS
159 ***************************************************************************** 159 *****************************************************************************
160 */ 160 */
161struct grwin_t; 161struct grwin_t;
162 162
163/* If we're using either the rxvt scrollbar or menu bars, keep the 163/* If we're using either the rxvt scrollbar, keep the
164 * scrollColor resource. 164 * scrollColor resource.
165 */ 165 */
166#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR) 166#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR)
167# define KEEP_SCROLLCOLOR 1 167# define KEEP_SCROLLCOLOR 1
168#else 168#else
173typedef struct { 173typedef struct {
174 short w, h, x, y; 174 short w, h, x, y;
175 Pixmap pixmap; 175 Pixmap pixmap;
176} bgPixmap_t; 176} bgPixmap_t;
177#endif 177#endif
178
179struct rxvt_ptytty {
180 int pty; // pty file descriptor; connected to rxvt
181 int tty; // tty file descriptor; connected to child
182
183 virtual ~rxvt_ptytty ()
184 {
185 //
186 }
187
188 virtual bool get () = 0;
189 virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0;
190
191 void close_tty ();
192 bool make_controlling_tty ();
193 void set_utf8_mode (bool on);
194};
195
196rxvt_ptytty *rxvt_new_ptytty (); // create a new pty object
197void rxvt_ptytty_server (); // start the ptytty server process
178 198
179/* 199/*
180 * the 'essential' information for reporting Mouse Events 200 * the 'essential' information for reporting Mouse Events
181 * pared down from XButtonEvent 201 * pared down from XButtonEvent
182 */ 202 */
256 276
257#define scrollBar_esc 30 277#define scrollBar_esc 30
258 278
259#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR) 279#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR)
260# define HAVE_SCROLLBARS 1 280# define HAVE_SCROLLBARS 1
261#endif
262
263/* width of scrollBar shadow, must be 1 or 2 */
264#ifdef HALFSHADOW
265# define MENU_SHADOW 1
266#else
267# define MENU_SHADOW 2
268#endif 281#endif
269 282
270#define R_SB_ALIGN_CENTRE 0 283#define R_SB_ALIGN_CENTRE 0
271#define R_SB_ALIGN_TOP 1 284#define R_SB_ALIGN_TOP 1
272#define R_SB_ALIGN_BOTTOM 2 285#define R_SB_ALIGN_BOTTOM 2
345 * | 358 * |
346 * +---< SB_WIDTH_NEXT 359 * +---< SB_WIDTH_NEXT
347 */ 360 */
348 361
349enum { 362enum {
350 NO_REFRESH = 0 , /* Window not visible at all! */ 363 NO_REFRESH = 0, /* Window not visible at all! */
351 FAST_REFRESH = 1<<0, /* Fully exposed window */ 364 FAST_REFRESH = 1, /* Fully exposed window */
352 SLOW_REFRESH = 1<<1, /* Partially exposed window */ 365 SLOW_REFRESH = 2, /* Partially exposed window */
353 SMOOTH_REFRESH = 1<<2, /* Do sync'ing to make it smooth */
354}; 366};
355 367
356#ifdef NO_SECONDARY_SCREEN 368#ifdef NO_SECONDARY_SCREEN
357# define NSCREENS 0 369# define NSCREENS 0
358#else 370#else
481 Rxvt_restoreFG = 39, // change default fg color 493 Rxvt_restoreFG = 39, // change default fg color
482 Rxvt_restoreBG = 49, // change default bg color 494 Rxvt_restoreBG = 49, // change default bg color
483 Rxvt_dumpscreen = 55, // dump scrollback and all of screen 495 Rxvt_dumpscreen = 55, // dump scrollback and all of screen
484 496
485 URxvt_locale = 701, // change locale 497 URxvt_locale = 701, // change locale
486 URxvt_Menu = 703, // set menu item 498
487 URxvt_Color_IT = 704, // change actual 'Italic' colour 499 URxvt_Color_IT = 704, // change actual 'Italic' colour
488 URxvt_Color_tint = 705, // change actual tint colour 500 URxvt_Color_tint = 705, // change actual tint colour
489 URxvt_Color_BD = 706, 501 URxvt_Color_BD = 706,
490 URxvt_Color_UL = 707, 502 URxvt_Color_UL = 707,
491 503
709/* 721/*
710 ***************************************************************************** 722 *****************************************************************************
711 * MACRO DEFINES 723 * MACRO DEFINES
712 ***************************************************************************** 724 *****************************************************************************
713 */ 725 */
726#define dLocal(type,name) type const name = this->name
714#define dDisp Display *disp = display->display 727#define dDisp Display *disp = this->display->display
715 728
716/* convert pixel dimensions to row/column values. Everything as int32_t */ 729/* convert pixel dimensions to row/column values. Everything as int32_t */
717#define Pixel2Col(x) Pixel2Width((int32_t)(x)) 730#define Pixel2Col(x) Pixel2Width((int32_t)(x))
718#define Pixel2Row(y) Pixel2Height((int32_t)(y)) 731#define Pixel2Row(y) Pixel2Height((int32_t)(y))
719#define Pixel2Width(x) ((int32_t)(x) / (int32_t)fwidth) 732#define Pixel2Width(x) ((int32_t)(x) / (int32_t)fwidth)
796 809
797#ifdef XPM_BACKGROUND 810#ifdef XPM_BACKGROUND
798# define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g)) 811# define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g))
799#else 812#else
800# define XPMClearArea(a, b, c, d, e, f, g) 813# define XPMClearArea(a, b, c, d, e, f, g)
801#endif
802
803#ifdef UTMP_SUPPORT
804# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX)
805# undef HAVE_UTMPX_H
806# undef HAVE_STRUCT_UTMPX
807# endif
808# if !defined(RXVT_UTMP_FILE) || !defined(HAVE_STRUCT_UTMP)
809# undef HAVE_UTMP_H
810# undef HAVE_STRUCT_UTMP
811# endif
812
813# ifdef HAVE_UTMPX_H
814# include <utmpx.h>
815# endif
816# ifdef HAVE_UTMP_H
817# include <utmp.h>
818# endif
819#endif 814#endif
820 815
821#ifdef DEBUG_CMD 816#ifdef DEBUG_CMD
822# define D_CMD(x) fprintf x ; fputc('\n', stderr) 817# define D_CMD(x) fprintf x ; fputc('\n', stderr)
823#else 818#else
1107 const char *key_delete; 1102 const char *key_delete;
1108#endif 1103#endif
1109 struct mouse_event MEvent; 1104 struct mouse_event MEvent;
1110 XComposeStatus compose; 1105 XComposeStatus compose;
1111 ttymode_t tio; 1106 ttymode_t tio;
1112#ifdef UTMP_SUPPORT
1113# ifdef HAVE_STRUCT_UTMP
1114 struct utmp ut;
1115# endif
1116# ifdef HAVE_STRUCT_UTMPX
1117 struct utmpx utx;
1118# endif
1119# if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX)
1120 char ut_id[5];
1121# endif
1122 int utmp_pos;
1123#endif
1124 row_col_t oldcursor; 1107 row_col_t oldcursor;
1125#ifdef XPM_BACKGROUND 1108#ifdef XPM_BACKGROUND
1126 bgPixmap_t bgPixmap; 1109 bgPixmap_t bgPixmap;
1127 XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */ 1110 XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */
1128#endif 1111#endif
1160 1143
1161 const char *rs[NUM_RESOURCES]; 1144 const char *rs[NUM_RESOURCES];
1162 /* command input buffering */ 1145 /* command input buffering */
1163 char *cmdbuf_ptr, *cmdbuf_endp; 1146 char *cmdbuf_ptr, *cmdbuf_endp;
1164 char cmdbuf_base[CBUFSIZ]; 1147 char cmdbuf_base[CBUFSIZ];
1148
1149 rxvt_ptytty *pty;
1165 1150
1166 rxvt_salloc *talloc; // text line allocator 1151 rxvt_salloc *talloc; // text line allocator
1167 rxvt_salloc *ralloc; // rend line allocator 1152 rxvt_salloc *ralloc; // rend line allocator
1168 1153
1169 static vector<rxvt_term *> termlist; // a vector of all running rxvt_term's 1154 static vector<rxvt_term *> termlist; // a vector of all running rxvt_term's
1338 void process_sgr_mode (unsigned int nargs, const int *arg); 1323 void process_sgr_mode (unsigned int nargs, const int *arg);
1339 void process_graphics (); 1324 void process_graphics ();
1340 // init.C 1325 // init.C
1341 void Get_Colours (); 1326 void Get_Colours ();
1342 void get_ourmods (); 1327 void get_ourmods ();
1343 // logging.C
1344 void makeutent (const char *pty, const char *hostname);
1345 void cleanutent ();
1346 // main.C 1328 // main.C
1347 void privileged_utmp (rxvt_privaction action); 1329 void privileged_utmp (rxvt_privaction action);
1348 bool set_fonts (); 1330 bool set_fonts ();
1349 void set_string_property (Atom prop, const char *str, int len = -1); 1331 void set_string_property (Atom prop, const char *str, int len = -1);
1350 void set_utf8_property (Atom prop, const char *str, int len = -1); 1332 void set_utf8_property (Atom prop, const char *str, int len = -1);
1430 void scr_blank_screen_mem (line_t &l, rend_t efs) const; 1412 void scr_blank_screen_mem (line_t &l, rend_t efs) const;
1431 int scr_scroll_text (int row1, int row2, int count); 1413 int scr_scroll_text (int row1, int row2, int count);
1432 void scr_reset (); 1414 void scr_reset ();
1433 void scr_release (); 1415 void scr_release ();
1434 void scr_clear (bool really = false); 1416 void scr_clear (bool really = false);
1435 void scr_refresh (unsigned char refresh_type); 1417 void scr_refresh ();
1436 bool scr_refresh_rend (rend_t mask, rend_t value); 1418 bool scr_refresh_rend (rend_t mask, rend_t value);
1437 void scr_erase_screen (int mode); 1419 void scr_erase_screen (int mode);
1438#if ENABLE_FRILLS 1420#if ENABLE_FRILLS
1439 void scr_erase_savelines (); 1421 void scr_erase_savelines ();
1440 void scr_backindex (); 1422 void scr_backindex ();
1504 int scrollbar_show_next (int update, int last_top, int last_bot, int scrollbar_len); 1486 int scrollbar_show_next (int update, int last_top, int last_bot, int scrollbar_len);
1505#endif 1487#endif
1506 1488
1507#if defined(RXVT_SCROLLBAR) 1489#if defined(RXVT_SCROLLBAR)
1508 // scrollbar-rxvt.C 1490 // scrollbar-rxvt.C
1509 void Draw_button (int x, int y, int state, int dirn);
1510 int scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len); 1491 int scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len);
1511#endif 1492#endif
1512 1493
1513#if defined(XTERM_SCROLLBAR) 1494#if defined(XTERM_SCROLLBAR)
1514 // scrollbar-xterm.C 1495 // scrollbar-xterm.C

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines