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.228 by root, Fri Jan 20 10:35:25 2006 UTC vs.
Revision 1.234 by root, Sun Jan 22 00:48:13 2006 UTC

35#include "encoding.h" 35#include "encoding.h"
36#include "rxvtfont.h" 36#include "rxvtfont.h"
37#include "rxvttoolkit.h" 37#include "rxvttoolkit.h"
38#include "iom.h" 38#include "iom.h"
39#include "salloc.h" 39#include "salloc.h"
40#include "libptytty.h"
40 41
41#include "rxvtperl.h" 42#include "rxvtperl.h"
42 43
43// try to avoid some macros to decrease code size, on some systems 44// try to avoid some macros to decrease code size, on some systems
44#if ENABLE_MINIMAL 45#if ENABLE_MINIMAL
141// misc.C 142// misc.C
142char * rxvt_wcstombs (const wchar_t *str, int len = -1); 143char * rxvt_wcstombs (const wchar_t *str, int len = -1);
143wchar_t * rxvt_mbstowcs (const char *str, int len = -1); 144wchar_t * rxvt_mbstowcs (const char *str, int len = -1);
144char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); 145char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1);
145wchar_t * rxvt_utf8towcs (const char *str, int len = -1); 146wchar_t * rxvt_utf8towcs (const char *str, int len = -1);
147char * rxvt_strdup_cpp (const char *str);
146 148
147#define rxvt_strdup(s) ((s) ? strdup(s) : 0) 149#define rxvt_strdup(s) ((s) ? strdup(s) : 0)
148 150
149char * rxvt_r_basename (const char *str) NOTHROW; 151char * rxvt_r_basename (const char *str) NOTHROW;
150void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; 152void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW;
158char * rxvt_Str_trim (char *str) NOTHROW; 160char * rxvt_Str_trim (char *str) NOTHROW;
159int rxvt_Str_escaped (char *str) NOTHROW; 161int rxvt_Str_escaped (char *str) NOTHROW;
160char ** rxvt_splitcommastring (const char *cs) NOTHROW; 162char ** rxvt_splitcommastring (const char *cs) NOTHROW;
161void rxvt_freecommastring (char **cs) NOTHROW; 163void rxvt_freecommastring (char **cs) NOTHROW;
162char * rxvt_File_find (const char *file, const char *ext, const char *path) NOTHROW; 164char * rxvt_File_find (const char *file, const char *ext, const char *path) NOTHROW;
163void rxvt_usleep (int usecs) NOTHROW;
164 165
165///////////////////////////////////////////////////////////////////////////// 166/////////////////////////////////////////////////////////////////////////////
166 167
167// temporarily replace the process environment 168// temporarily replace the process environment
168extern char **environ; 169extern char **environ;
200typedef struct { 201typedef struct {
201 short w, h, x, y; 202 short w, h, x, y;
202 Pixmap pixmap; 203 Pixmap pixmap;
203} bgPixmap_t; 204} bgPixmap_t;
204#endif 205#endif
205
206struct rxvt_ptytty {
207 int pty; // pty file descriptor; connected to rxvt
208 int tty; // tty file descriptor; connected to child
209
210 rxvt_ptytty ()
211 : pty(-1), tty(-1)
212 {
213 }
214
215 virtual ~rxvt_ptytty ()
216 {
217 }
218
219 virtual bool get () = 0;
220#if UTMP_SUPPORT
221 virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0;
222#endif
223
224 void close_tty ();
225 bool make_controlling_tty ();
226 void set_utf8_mode (bool on);
227};
228
229rxvt_ptytty *rxvt_new_ptytty (); // create a new pty object
230void rxvt_ptytty_server (); // start the ptytty server process
231 206
232/* 207/*
233 * the 'essential' information for reporting Mouse Events 208 * the 'essential' information for reporting Mouse Events
234 * pared down from XButtonEvent 209 * pared down from XButtonEvent
235 */ 210 */
664#endif 639#endif
665#if TRANSPARENT 640#if TRANSPARENT
666 XA_XROOTPMAP_ID, 641 XA_XROOTPMAP_ID,
667 XA_ESETROOT_PMAP_ID, 642 XA_ESETROOT_PMAP_ID,
668#endif 643#endif
669#if OFFIX_DND /* OffiX Dnd (drag 'n' drop) support */
670 XA_DNDPROTOCOL,
671 XA_DNDSELECTION,
672#endif
673#if ENABLE_XEMBED 644#if ENABLE_XEMBED
674 XA_XEMBED, 645 XA_XEMBED,
675 XA_XEMBED_INFO, 646 XA_XEMBED_INFO,
676#endif 647#endif
677 NUM_XA 648 NUM_XA
1000#if defined(XPM_BACKGROUND) || defined(TRANSPARENT) 971#if defined(XPM_BACKGROUND) || defined(TRANSPARENT)
1001 am_transparent:1, /* is a transparent term */ 972 am_transparent:1, /* is a transparent term */
1002 am_pixmap_trans:1, /* transparency w/known root pixmap */ 973 am_pixmap_trans:1, /* transparency w/known root pixmap */
1003#endif 974#endif
1004 current_screen:1, /* primary or secondary */ 975 current_screen:1, /* primary or secondary */
1005 hate_those_clicks:1, /* a.k.a. keep mark position */
1006 num_scr_allow:1, 976 num_scr_allow:1,
1007 bypass_keystate:1, 977 bypass_keystate:1,
1008#ifdef CURSOR_BLINK 978#ifdef CURSOR_BLINK
1009 hidden_cursor:1, 979 hidden_cursor:1,
1010#endif 980#endif
1025#endif 995#endif
1026 scrollbar_align, 996 scrollbar_align,
1027 selection_wait, 997 selection_wait,
1028 selection_type; 998 selection_type;
1029/* ---------- */ 999/* ---------- */
1000 bool rvideo_state, rvideo_mode;
1001#ifndef NO_BELL
1030 short rvideo; 1002 bool rvideo_bell;
1003#endif
1031 int num_scr; /* screen: number lines scrolled */ 1004 int num_scr; /* screen: number lines scrolled */
1032 int prev_ncol, /* screen: previous number of columns */ 1005 int prev_ncol, /* screen: previous number of columns */
1033 prev_nrow; /* screen: previous number of rows */ 1006 prev_nrow; /* screen: previous number of rows */
1034/* ---------- */ 1007/* ---------- */
1035 rend_t rstyle; 1008 rend_t rstyle;
1155 const char *rs[NUM_RESOURCES]; 1128 const char *rs[NUM_RESOURCES];
1156 /* command input buffering */ 1129 /* command input buffering */
1157 char *cmdbuf_ptr, *cmdbuf_endp; 1130 char *cmdbuf_ptr, *cmdbuf_endp;
1158 char cmdbuf_base[CBUFSIZ]; 1131 char cmdbuf_base[CBUFSIZ];
1159 1132
1160 rxvt_ptytty *pty; 1133 ptytty *pty;
1161 1134
1162 rxvt_salloc *talloc; // text line allocator 1135 rxvt_salloc *talloc; // text line allocator
1163 rxvt_salloc *ralloc; // rend line allocator 1136 rxvt_salloc *ralloc; // rend line allocator
1164 1137
1165 static vector<rxvt_term *> termlist; // a vector of all running rxvt_term's 1138 static vector<rxvt_term *> termlist; // a vector of all running rxvt_term's
1200 1173
1201 void child_cb (child_watcher &w, int status); child_watcher child_ev; 1174 void child_cb (child_watcher &w, int status); child_watcher child_ev;
1202 void check_cb (check_watcher &w); check_watcher check_ev; 1175 void check_cb (check_watcher &w); check_watcher check_ev;
1203 void destroy_cb (time_watcher &w); time_watcher destroy_ev; 1176 void destroy_cb (time_watcher &w); time_watcher destroy_ev;
1204 void flush_cb (time_watcher &w); time_watcher flush_ev; 1177 void flush_cb (time_watcher &w); time_watcher flush_ev;
1205
1206 void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; 1178 void pty_cb (io_watcher &w, short revents); io_watcher pty_ev;
1207
1208 void incr_cb (time_watcher &w) NOTHROW; time_watcher incr_ev; 1179 void incr_cb (time_watcher &w) NOTHROW; time_watcher incr_ev;
1209 1180
1210#ifdef CURSOR_BLINK 1181#ifdef CURSOR_BLINK
1211 void cursor_blink_cb (time_watcher &w); time_watcher cursor_blink_ev; 1182 void cursor_blink_cb (time_watcher &w); time_watcher cursor_blink_ev;
1212#endif 1183#endif
1213#ifdef TEXT_BLINK 1184#ifdef TEXT_BLINK
1214 void text_blink_cb (time_watcher &w); time_watcher text_blink_ev; 1185 void text_blink_cb (time_watcher &w); time_watcher text_blink_ev;
1186#endif
1187#ifndef NO_BELL
1188 void bell_cb (time_watcher &w); time_watcher bell_ev;
1215#endif 1189#endif
1216 1190
1217#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1191#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
1218 void cont_scroll_cb (time_watcher &w); time_watcher cont_scroll_ev; 1192 void cont_scroll_cb (time_watcher &w); time_watcher cont_scroll_ev;
1219#endif 1193#endif
1239 rxvt_term (); 1213 rxvt_term ();
1240 ~rxvt_term (); 1214 ~rxvt_term ();
1241 void destroy (); 1215 void destroy ();
1242 void emergency_cleanup (); 1216 void emergency_cleanup ();
1243 1217
1244 bool init (int argc, const char *const *argv); 1218 bool init (int argc, const char *const *argv, stringvec *envv);
1219
1220 bool init (stringvec *argv, stringvec *envv)
1221 {
1222 this->argv = argv;
1223 return init (argv->size (), argv->begin (), envv);
1224 }
1225
1245 bool init_vars (); 1226 bool init_vars ();
1246 1227
1247 bool pty_fill (); 1228 bool pty_fill ();
1248 1229
1249 void make_current () const // make this the "currently active" urxvt instance 1230 void make_current () const // make this the "currently active" urxvt instance
1452 void scr_cursor_visible (int mode) NOTHROW; 1433 void scr_cursor_visible (int mode) NOTHROW;
1453 void scr_autowrap (int mode) NOTHROW; 1434 void scr_autowrap (int mode) NOTHROW;
1454 void scr_relative_origin (int mode) NOTHROW; 1435 void scr_relative_origin (int mode) NOTHROW;
1455 void scr_insert_mode (int mode) NOTHROW; 1436 void scr_insert_mode (int mode) NOTHROW;
1456 void scr_set_tab (int mode) NOTHROW; 1437 void scr_set_tab (int mode) NOTHROW;
1457 void scr_rvideo_mode (int mode) NOTHROW; 1438 void scr_rvideo_mode (bool on) NOTHROW;
1458 void scr_report_position () NOTHROW; 1439 void scr_report_position () NOTHROW;
1459 void set_font_style () NOTHROW; 1440 void set_font_style () NOTHROW;
1460 void scr_charset_choose (int set) NOTHROW; 1441 void scr_charset_choose (int set) NOTHROW;
1461 void scr_charset_set (int set, unsigned int ch) NOTHROW; 1442 void scr_charset_set (int set, unsigned int ch) NOTHROW;
1462 void scr_move_to (int y, int len) NOTHROW; 1443 void scr_move_to (int y, int len) NOTHROW;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines