… | |
… | |
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 | |
|
|
99 | enum rxvt_privaction { IGNORE = 'i', SAVE = 's', RESTORE = 'r' };//TODO |
98 | |
100 | |
99 | /* |
101 | /* |
100 | ***************************************************************************** |
102 | ***************************************************************************** |
101 | * PROTOTYPES |
103 | * PROTOTYPES |
102 | ***************************************************************************** |
104 | ***************************************************************************** |
… | |
… | |
129 | char * rxvt_Str_trim (char *str); |
131 | char * rxvt_Str_trim (char *str); |
130 | int rxvt_Str_escaped (char *str); |
132 | int rxvt_Str_escaped (char *str); |
131 | char ** rxvt_splitcommastring (const char *cs); |
133 | char ** rxvt_splitcommastring (const char *cs); |
132 | void rxvt_freecommastring (char **cs); |
134 | void rxvt_freecommastring (char **cs); |
133 | char * rxvt_File_find (const char *file, const char *ext, const char *path); |
135 | char * rxvt_File_find (const char *file, const char *ext, const char *path); |
134 | void rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h); |
|
|
135 | void rxvt_Draw_Triangle (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int type); |
|
|
136 | void rxvt_usleep (int usecs); |
136 | void rxvt_usleep (int usecs); |
137 | |
137 | |
138 | ///////////////////////////////////////////////////////////////////////////// |
138 | ///////////////////////////////////////////////////////////////////////////// |
139 | |
139 | |
140 | // temporarily replace the process environment |
140 | // temporarily replace the process environment |
… | |
… | |
173 | typedef struct { |
173 | typedef 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 | |
|
|
179 | struct 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 | |
|
|
196 | rxvt_ptytty *rxvt_new_ptytty (); // create a new pty object |
|
|
197 | void 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 | */ |
… | |
… | |
338 | * | |
358 | * | |
339 | * +---< SB_WIDTH_NEXT |
359 | * +---< SB_WIDTH_NEXT |
340 | */ |
360 | */ |
341 | |
361 | |
342 | enum { |
362 | enum { |
343 | NO_REFRESH = 0 , /* Window not visible at all! */ |
363 | NO_REFRESH = 0, /* Window not visible at all! */ |
344 | FAST_REFRESH = 1<<0, /* Fully exposed window */ |
364 | FAST_REFRESH = 1, /* Fully exposed window */ |
345 | SLOW_REFRESH = 1<<1, /* Partially exposed window */ |
365 | SLOW_REFRESH = 2, /* Partially exposed window */ |
346 | SMOOTH_REFRESH = 1<<2, /* Do sync'ing to make it smooth */ |
|
|
347 | }; |
366 | }; |
348 | |
367 | |
349 | #ifdef NO_SECONDARY_SCREEN |
368 | #ifdef NO_SECONDARY_SCREEN |
350 | # define NSCREENS 0 |
369 | # define NSCREENS 0 |
351 | #else |
370 | #else |
… | |
… | |
702 | /* |
721 | /* |
703 | ***************************************************************************** |
722 | ***************************************************************************** |
704 | * MACRO DEFINES |
723 | * MACRO DEFINES |
705 | ***************************************************************************** |
724 | ***************************************************************************** |
706 | */ |
725 | */ |
|
|
726 | #define dLocal(type,name) type const name = this->name |
707 | #define dDisp Display *disp = display->display |
727 | #define dDisp Display *disp = this->display->display |
708 | |
728 | |
709 | /* convert pixel dimensions to row/column values. Everything as int32_t */ |
729 | /* convert pixel dimensions to row/column values. Everything as int32_t */ |
710 | #define Pixel2Col(x) Pixel2Width((int32_t)(x)) |
730 | #define Pixel2Col(x) Pixel2Width((int32_t)(x)) |
711 | #define Pixel2Row(y) Pixel2Height((int32_t)(y)) |
731 | #define Pixel2Row(y) Pixel2Height((int32_t)(y)) |
712 | #define Pixel2Width(x) ((int32_t)(x) / (int32_t)fwidth) |
732 | #define Pixel2Width(x) ((int32_t)(x) / (int32_t)fwidth) |
… | |
… | |
789 | |
809 | |
790 | #ifdef XPM_BACKGROUND |
810 | #ifdef XPM_BACKGROUND |
791 | # 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)) |
792 | #else |
812 | #else |
793 | # define XPMClearArea(a, b, c, d, e, f, g) |
813 | # 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 |
814 | #endif |
813 | |
815 | |
814 | #ifdef DEBUG_CMD |
816 | #ifdef DEBUG_CMD |
815 | # define D_CMD(x) fprintf x ; fputc('\n', stderr) |
817 | # define D_CMD(x) fprintf x ; fputc('\n', stderr) |
816 | #else |
818 | #else |
… | |
… | |
1100 | const char *key_delete; |
1102 | const char *key_delete; |
1101 | #endif |
1103 | #endif |
1102 | struct mouse_event MEvent; |
1104 | struct mouse_event MEvent; |
1103 | XComposeStatus compose; |
1105 | XComposeStatus compose; |
1104 | ttymode_t tio; |
1106 | 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; |
1107 | row_col_t oldcursor; |
1118 | #ifdef XPM_BACKGROUND |
1108 | #ifdef XPM_BACKGROUND |
1119 | bgPixmap_t bgPixmap; |
1109 | bgPixmap_t bgPixmap; |
1120 | XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */ |
1110 | XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */ |
1121 | #endif |
1111 | #endif |
… | |
… | |
1153 | |
1143 | |
1154 | const char *rs[NUM_RESOURCES]; |
1144 | const char *rs[NUM_RESOURCES]; |
1155 | /* command input buffering */ |
1145 | /* command input buffering */ |
1156 | char *cmdbuf_ptr, *cmdbuf_endp; |
1146 | char *cmdbuf_ptr, *cmdbuf_endp; |
1157 | char cmdbuf_base[CBUFSIZ]; |
1147 | char cmdbuf_base[CBUFSIZ]; |
|
|
1148 | |
|
|
1149 | rxvt_ptytty *pty; |
1158 | |
1150 | |
1159 | rxvt_salloc *talloc; // text line allocator |
1151 | rxvt_salloc *talloc; // text line allocator |
1160 | rxvt_salloc *ralloc; // rend line allocator |
1152 | rxvt_salloc *ralloc; // rend line allocator |
1161 | |
1153 | |
1162 | 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 |
… | |
… | |
1331 | void process_sgr_mode (unsigned int nargs, const int *arg); |
1323 | void process_sgr_mode (unsigned int nargs, const int *arg); |
1332 | void process_graphics (); |
1324 | void process_graphics (); |
1333 | // init.C |
1325 | // init.C |
1334 | void Get_Colours (); |
1326 | void Get_Colours (); |
1335 | void get_ourmods (); |
1327 | void get_ourmods (); |
1336 | // logging.C |
|
|
1337 | void makeutent (const char *pty, const char *hostname); |
|
|
1338 | void cleanutent (); |
|
|
1339 | // main.C |
1328 | // main.C |
1340 | void privileged_utmp (rxvt_privaction action); |
1329 | void privileged_utmp (rxvt_privaction action); |
1341 | bool set_fonts (); |
1330 | bool set_fonts (); |
1342 | 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); |
1343 | 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); |
… | |
… | |
1423 | 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; |
1424 | int scr_scroll_text (int row1, int row2, int count); |
1413 | int scr_scroll_text (int row1, int row2, int count); |
1425 | void scr_reset (); |
1414 | void scr_reset (); |
1426 | void scr_release (); |
1415 | void scr_release (); |
1427 | void scr_clear (bool really = false); |
1416 | void scr_clear (bool really = false); |
1428 | void scr_refresh (unsigned char refresh_type); |
1417 | void scr_refresh (); |
1429 | bool scr_refresh_rend (rend_t mask, rend_t value); |
1418 | bool scr_refresh_rend (rend_t mask, rend_t value); |
1430 | void scr_erase_screen (int mode); |
1419 | void scr_erase_screen (int mode); |
1431 | #if ENABLE_FRILLS |
1420 | #if ENABLE_FRILLS |
1432 | void scr_erase_savelines (); |
1421 | void scr_erase_savelines (); |
1433 | void scr_backindex (); |
1422 | void scr_backindex (); |
… | |
… | |
1497 | 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); |
1498 | #endif |
1487 | #endif |
1499 | |
1488 | |
1500 | #if defined(RXVT_SCROLLBAR) |
1489 | #if defined(RXVT_SCROLLBAR) |
1501 | // scrollbar-rxvt.C |
1490 | // 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); |
1491 | int scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len); |
1504 | #endif |
1492 | #endif |
1505 | |
1493 | |
1506 | #if defined(XTERM_SCROLLBAR) |
1494 | #if defined(XTERM_SCROLLBAR) |
1507 | // scrollbar-xterm.C |
1495 | // scrollbar-xterm.C |