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.128 by root, Sat Dec 11 23:01:36 2004 UTC vs.
Revision 1.149 by root, Thu Feb 17 15:07:48 2005 UTC

10#include <X11/cursorfont.h> 10#include <X11/cursorfont.h>
11#include <X11/keysym.h> 11#include <X11/keysym.h>
12#include <X11/keysymdef.h> 12#include <X11/keysymdef.h>
13#include <X11/Xatom.h> 13#include <X11/Xatom.h>
14#if ENABLE_FRILLS 14#if ENABLE_FRILLS
15#include <X11/Xmd.h> 15# include <X11/Xmd.h>
16#endif 16#endif
17 17
18#include "encoding.h" 18#include "encoding.h"
19#include "rxvtfont.h" 19#include "rxvtfont.h"
20#include "rxvttoolkit.h" 20#include "rxvttoolkit.h"
80/* 80/*
81 ***************************************************************************** 81 *****************************************************************************
82 * PROTOTYPES 82 * PROTOTYPES
83 ***************************************************************************** 83 *****************************************************************************
84 */ 84 */
85// main.C
85RETSIGTYPE rxvt_Child_signal (int sig); 86RETSIGTYPE rxvt_Child_signal (int sig);
86RETSIGTYPE rxvt_Exit_signal (int sig); 87RETSIGTYPE rxvt_Exit_signal (int sig);
87void rxvt_clean_exit (); 88void rxvt_clean_exit ();
88void * rxvt_malloc (size_t size); 89void * rxvt_malloc (size_t size);
89void * rxvt_calloc (size_t number, size_t size); 90void * rxvt_calloc (size_t number, size_t size);
90void * rxvt_realloc (void *ptr, size_t size); 91void * rxvt_realloc (void *ptr, size_t size);
92void rxvt_privileges (rxvt_privaction action);
93
94// util.C
91char * rxvt_wcstombs (const wchar_t *str, int len = -1); 95char * rxvt_wcstombs (const wchar_t *str, int len = -1);
92wchar_t * rxvt_mbstowcs (const char *str, int len = -1); 96wchar_t * rxvt_mbstowcs (const char *str, int len = -1);
93char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); 97char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1);
94wchar_t * rxvt_utf8towcs (const char *str, int len = -1); 98wchar_t * rxvt_utf8towcs (const char *str, int len = -1);
95char * rxvt_strdup (const char *str); 99char * rxvt_strdup (const char *str);
100
101// misc.C
96char * rxvt_r_basename (const char *str); 102char * rxvt_r_basename (const char *str);
97void rxvt_vlog (const char *fmt, va_list arg_ptr); 103void rxvt_vlog (const char *fmt, va_list arg_ptr);
98void rxvt_log (const char *fmt,...); 104void rxvt_log (const char *fmt,...);
99void rxvt_warn (const char *fmt,...); 105void rxvt_warn (const char *fmt,...);
100void rxvt_fatal (const char *fmt,...); 106void rxvt_fatal (const char *fmt,...);
106char ** rxvt_splitcommastring (const char *cs); 112char ** rxvt_splitcommastring (const char *cs);
107void rxvt_freecommastring (char **cs); 113void rxvt_freecommastring (char **cs);
108char * rxvt_File_find (const char *file, const char *ext, const char *path); 114char * rxvt_File_find (const char *file, const char *ext, const char *path);
109void rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h); 115void rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h);
110void rxvt_Draw_Triangle (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int type); 116void rxvt_Draw_Triangle (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int type);
111
112void rxvt_privileges (rxvt_privaction action);
113 117
114/* 118/*
115 ***************************************************************************** 119 *****************************************************************************
116 * STRUCTURES AND TYPEDEFS 120 * STRUCTURES AND TYPEDEFS
117 ***************************************************************************** 121 *****************************************************************************
500 Color_BD, 504 Color_BD,
501 Color_IT, 505 Color_IT,
502 Color_UL, 506 Color_UL,
503 Color_RV, 507 Color_RV,
504#endif 508#endif
509#if ENABLE_FRILLS
510 Color_underline,
511#endif
505#ifdef OPTION_HC 512#ifdef OPTION_HC
506 Color_HC, 513 Color_HC,
507#endif 514#endif
508#ifdef KEEP_SCROLLCOLOR 515#ifdef KEEP_SCROLLCOLOR
509 Color_scroll, 516 Color_scroll,
560#ifdef HAVE_SCROLLBARS 567#ifdef HAVE_SCROLLBARS
561 Rs_scrollBar, 568 Rs_scrollBar,
562 Rs_scrollBar_right, 569 Rs_scrollBar_right,
563 Rs_scrollBar_floating, 570 Rs_scrollBar_floating,
564 Rs_scrollBar_align, 571 Rs_scrollBar_align,
565#endif
566 Rs_scrollstyle, /* Rs_scrollBar_style */ 572 Rs_scrollstyle, /* Rs_scrollBar_style */
573 Rs_scrollBar_thickness,
574#endif
567 Rs_scrollTtyOutput, 575 Rs_scrollTtyOutput,
568 Rs_scrollTtyKeypress, 576 Rs_scrollTtyKeypress,
569 Rs_scrollWithBuffer, 577 Rs_scrollWithBuffer,
570 Rs_saveLines, 578 Rs_saveLines,
571 Rs_utmpInhibit, 579 Rs_utmpInhibit,
599#endif 607#endif
600#if ENABLE_FRILLS 608#if ENABLE_FRILLS
601 Rs_ext_bwidth, 609 Rs_ext_bwidth,
602 Rs_int_bwidth, 610 Rs_int_bwidth,
603 Rs_borderLess, 611 Rs_borderLess,
604#endif
605 Rs_scrollBar_thickness,
606#ifndef NO_LINESPACE
607 Rs_lineSpace, 612 Rs_lineSpace,
613 Rs_embed,
614 Rs_pty_fd,
608#endif 615#endif
609 Rs_cutchars, 616 Rs_cutchars,
610 Rs_modifier, 617 Rs_modifier,
611 Rs_answerbackstring, 618 Rs_answerbackstring,
612 Rs_tripleclickwords, 619 Rs_tripleclickwords,
613 Rs_insecure, 620 Rs_insecure,
614 Rs_cursorBlink, 621 Rs_cursorBlink,
615 Rs_pointerBlank, 622 Rs_pointerBlank,
616 Rs_pointerBlankDelay, 623 Rs_pointerBlankDelay,
617 Rs_imLocale, 624 Rs_imLocale,
625 Rs_imFont,
618 Rs_pastableTabs, 626 Rs_pastableTabs,
619#ifndef NO_SECONDARY_SCREEN 627#ifndef NO_SECONDARY_SCREEN
620 Rs_secondaryScreen, 628 Rs_secondaryScreen,
621 Rs_secondaryScroll, 629 Rs_secondaryScroll,
622#endif 630#endif
638 XA_TARGETS, 646 XA_TARGETS,
639 XA_TIMESTAMP, 647 XA_TIMESTAMP,
640 XA_VT_SELECTION, 648 XA_VT_SELECTION,
641 XA_INCR, 649 XA_INCR,
642 XA_WMDELETEWINDOW, 650 XA_WMDELETEWINDOW,
651 XA_CLIPBOARD,
652#if ENABLE_FRILLS
653 XA_NET_WM_PID,
654 XA_MOTIF_WM_HINTS,
655 XA_NET_WM_NAME,
656 XA_NET_WM_ICON_NAME,
657#endif
658#if USE_XIM
659 XA_WM_LOCALE_NAME,
660#endif
643#ifdef TRANSPARENT 661#if TRANSPARENT
644 XA_XROOTPMAPID, 662 XA_XROOTPMAP_ID,
645 XA_XSETROOTID, 663 XA_ESETROOT_PMAP_ID,
646#endif 664#endif
647#ifdef OFFIX_DND /* OffiX Dnd (drag 'n' drop) support */ 665#if OFFIX_DND /* OffiX Dnd (drag 'n' drop) support */
648 XA_DNDPROTOCOL, 666 XA_DNDPROTOCOL,
649 XA_DNDSELECTION, 667 XA_DNDSELECTION,
650#endif /* OFFIX_DND */ 668#endif
651 XA_CLIPBOARD,
652 NUM_XA 669 NUM_XA
653}; 670};
654 671
655/* DEC private modes */ 672/* DEC private modes */
656#define PrivMode_132 (1UL<<0) 673#define PrivMode_132 (1UL<<0)
683 priv_modes |= (bit); \ 700 priv_modes |= (bit); \
684 else \ 701 else \
685 priv_modes &= ~(bit) 702 priv_modes &= ~(bit)
686 703
687#ifdef ALLOW_132_MODE 704#ifdef ALLOW_132_MODE
688# define PrivMode_Default (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) 705# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK)
689#else 706#else
690# define PrivMode_Default (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor) 707# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor)
691#endif 708#endif
692 709
693// do not change these constants lightly, there are many interdependencies 710// do not change these constants lightly, there are many interdependencies
694#define IMBUFSIZ 128 // input modifier buffer sizes 711#define IMBUFSIZ 128 // input modifier buffer sizes
695#define KBUFSZ 512 // size of keyboard mapping buffer 712#define KBUFSZ 512 // size of keyboard mapping buffer
746#define strdup(x) strdup((const char *)(x)) 763#define strdup(x) strdup((const char *)(x))
747#define strlen(x) strlen((const char *)(x)) 764#define strlen(x) strlen((const char *)(x))
748#define strchr(x, y) strchr((const char *)(x), (int)(y)) 765#define strchr(x, y) strchr((const char *)(x), (int)(y))
749#define strrchr(x, y) strrchr((const char *)(x), (int)(y)) 766#define strrchr(x, y) strrchr((const char *)(x), (int)(y))
750 767
768#define dDisp Display *disp = display->display
769
751/* convert pixel dimensions to row/column values. Everything as int32_t */ 770/* convert pixel dimensions to row/column values. Everything as int32_t */
752#define Pixel2Col(x) Pixel2Width((int32_t)(x)) 771#define Pixel2Col(x) Pixel2Width((int32_t)(x))
753#define Pixel2Row(y) Pixel2Height((int32_t)(y)) 772#define Pixel2Row(y) Pixel2Height((int32_t)(y))
754#define Pixel2Width(x) ((int32_t)(x) / (int32_t)TermWin.fwidth) 773#define Pixel2Width(x) ((int32_t)(x) / (int32_t)TermWin.fwidth)
755#define Pixel2Height(y) ((int32_t)(y) / (int32_t)TermWin.fheight) 774#define Pixel2Height(y) ((int32_t)(y) / (int32_t)TermWin.fheight)
853# define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g)) 872# define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g))
854#else 873#else
855# define XPMClearArea(a, b, c, d, e, f, g) 874# define XPMClearArea(a, b, c, d, e, f, g)
856#endif 875#endif
857 876
858#ifndef STRICT_FONT_CHECKING
859# define rxvt_get_fontwidest(font) ((font)->max_bounds.width)
860#endif
861
862#define rxvt_Gr_ButtonPress(x,y) rxvt_Gr_ButtonReport (R, 'P',(x),(y))
863#define rxvt_Gr_ButtonRelease(x,y) rxvt_Gr_ButtonReport (R, 'R',(x),(y))
864
865#ifdef UTMP_SUPPORT 877#ifdef UTMP_SUPPORT
866# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) 878# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX)
867# undef HAVE_UTMPX_H 879# undef HAVE_UTMPX_H
868# undef HAVE_STRUCT_UTMPX 880# undef HAVE_STRUCT_UTMPX
869# endif 881# endif
941 953
942 operator mbstate_t *() { return &mbs; } 954 operator mbstate_t *() { return &mbs; }
943 void reset () { memset (&mbs, 0, sizeof (mbs)); } 955 void reset () { memset (&mbs, 0, sizeof (mbs)); }
944 mbstate () { reset (); } 956 mbstate () { reset (); }
945}; 957};
958
959#define UNICODE_MASK 0x1fffffUL
946 960
947#if UNICODE3 961#if UNICODE3
948# define COMPOSE_LO 0x40000000UL 962# define COMPOSE_LO 0x40000000UL
949# define COMPOSE_HI 0x400fffffUL 963# define COMPOSE_HI 0x400fffffUL
950# define IS_COMPOSE(n) ((int32_t)(n) >= COMPOSE_LO) 964# define IS_COMPOSE(n) ((int32_t)(n) >= COMPOSE_LO)
980 994
981extern class rxvt_composite_vec rxvt_composite; 995extern class rxvt_composite_vec rxvt_composite;
982#endif 996#endif
983 997
984 998
999#ifdef KEYSYM_RESOURCE
1000 class keyboard_manager;
1001#endif
1002
985struct rxvt_term : zero_initialized, rxvt_vars { 1003struct rxvt_term : zero_initialized, rxvt_vars {
986 log_callback *log_hook; // log error messages through this hook, if != 0 1004 log_callback *log_hook; // log error messages through this hook, if != 0
987 1005
988 struct mbstate mbstate; // current input multibyte state 1006 struct mbstate mbstate; // current input multibyte state
989 1007
1006 hidden_text:1, 1024 hidden_text:1,
1007#endif 1025#endif
1008#ifdef POINTER_BLANK 1026#ifdef POINTER_BLANK
1009 hidden_pointer:1, 1027 hidden_pointer:1,
1010#endif 1028#endif
1011// enc_utf8:1, /* wether locale uses utf-8 */ 1029 enc_utf8:1, /* wether locale uses utf-8 */
1012 seen_input:1, /* wether we have seen some program output yet */ 1030 seen_input:1, /* wether we have seen some program output yet */
1013 seen_resize:1, /* wether we had a resize event */ 1031 seen_resize:1, /* wether we had a resize event */
1014 parsed_geometry:1; 1032 parsed_geometry:1;
1015 1033
1016 unsigned char refresh_type, 1034 unsigned char refresh_type,
1062# ifdef POINTER_BLANK 1080# ifdef POINTER_BLANK
1063 pointerBlankDelay, 1081 pointerBlankDelay,
1064# endif 1082# endif
1065 allowedxerror; 1083 allowedxerror;
1066/* ---------- */ 1084/* ---------- */
1067 unsigned int ModMetaMask, 1085 unsigned int ModLevel3Mask,
1086 ModMetaMask,
1068 ModNumLockMask; 1087 ModNumLockMask;
1069 int old_width, /* last used width in screen resize */ 1088 int old_width, /* last used width in screen resize */
1070 old_height; /* last used height in screen resize */ 1089 old_height; /* last used height in screen resize */
1071 unsigned long priv_modes, 1090 unsigned long priv_modes,
1072 SavedModes; 1091 SavedModes;
1102#endif 1121#endif
1103/* ---------- */ 1122/* ---------- */
1104 Time selection_time, 1123 Time selection_time,
1105 selection_request_time; 1124 selection_request_time;
1106 pid_t cmd_pid; /* process id of child */ 1125 pid_t cmd_pid; /* process id of child */
1126 char * incr_buf;
1127 size_t incr_buf_size, incr_buf_fill;
1107/* ---------- */ 1128/* ---------- */
1108 Cursor leftptr_cursor; 1129 Cursor leftptr_cursor;
1109#ifdef POINTER_BLANK
1110 Cursor blank_cursor;
1111#endif
1112/* ---------- */ 1130/* ---------- */
1113#ifndef NO_BACKSPACE_KEY 1131#ifndef NO_BACKSPACE_KEY
1114 const char *key_backspace; 1132 const char *key_backspace;
1115#endif 1133#endif
1116#ifndef NO_DELETE_KEY 1134#ifndef NO_DELETE_KEY
1174 char *locale; 1192 char *locale;
1175 char charsets[4]; 1193 char charsets[4];
1176 unsigned char *v_buffer; /* pointer to physical buffer */ 1194 unsigned char *v_buffer; /* pointer to physical buffer */
1177 unsigned int v_buflen; /* size of area to write */ 1195 unsigned int v_buflen; /* size of area to write */
1178 stringvec *argv, *envv; /* if != 0, will be freed on destroy time */ 1196 stringvec *argv, *envv; /* if != 0, will be freed on destroy time */
1197
1179#ifdef KEYSYM_RESOURCE 1198#ifdef KEYSYM_RESOURCE
1180 const unsigned char *Keysym_map[256]; 1199 keyboard_manager *keyboard;
1181#endif 1200#endif
1201
1182 const char *rs[NUM_RESOURCES]; 1202 const char *rs[NUM_RESOURCES];
1183 /* command input buffering */ 1203 /* command input buffering */
1184 unsigned char *cmdbuf_ptr, *cmdbuf_endp; 1204 unsigned char *cmdbuf_ptr, *cmdbuf_endp;
1185 unsigned char cmdbuf_base[CBUFSIZ]; 1205 unsigned char cmdbuf_base[CBUFSIZ];
1186 1206
1198 void iso14755_51 (unicode_t ch, rend_t r = DEFAULT_RSTYLE); 1218 void iso14755_51 (unicode_t ch, rend_t r = DEFAULT_RSTYLE);
1199 void iso14755_54 (int x, int y); 1219 void iso14755_54 (int x, int y);
1200# endif 1220# endif
1201#endif 1221#endif
1202 1222
1223 // modifies first argument(!)
1203 void paste (const unsigned char *data, unsigned int len); 1224 void paste (unsigned char *data, unsigned int len);
1204 1225
1205 void flush (); 1226 void flush ();
1206 1227
1207#if TRANSPARENT 1228#if TRANSPARENT
1208 void rootwin_cb (XEvent &xev); 1229 void rootwin_cb (XEvent &xev);
1209 xevent_watcher rootwin_ev; 1230 xevent_watcher rootwin_ev;
1210#endif 1231#endif
1211 1232
1212 1233
1213 void sig_term (sig_watcher &w); sig_watcher sw_term; 1234 void sig_term (sig_watcher &w); sig_watcher sw_term, sw_int;
1214 void sig_chld (sig_watcher &w); sig_watcher sw_chld; 1235 void sig_chld (sig_watcher &w); sig_watcher sw_chld;
1215 1236
1216 void x_cb (XEvent &xev); 1237 void x_cb (XEvent &xev);
1217 xevent_watcher termwin_ev; 1238 xevent_watcher termwin_ev;
1218 xevent_watcher vt_ev; 1239 xevent_watcher vt_ev;
1254#endif 1275#endif
1255 void pointer_unblank (); 1276 void pointer_unblank ();
1256 1277
1257 void tt_printf (const char *fmt,...); 1278 void tt_printf (const char *fmt,...);
1258 void tt_write (const unsigned char *data, unsigned int len); 1279 void tt_write (const unsigned char *data, unsigned int len);
1280 void pty_write ();
1259 1281
1260 void tt_winch (); 1282 void tt_winch ();
1261 1283
1262 rxvt_term (); 1284 rxvt_term ();
1263 ~rxvt_term (); 1285 ~rxvt_term ();
1264 void destroy (); 1286 void destroy ();
1287 void emergency_cleanup ();
1265 1288
1266 bool init (int argc, const char *const *argv); 1289 bool init (int argc, const char *const *argv);
1267 bool init_vars (); 1290 bool init_vars ();
1268 1291
1269 bool pty_fill (); 1292 bool pty_fill ();
1448 void scr_bell (); 1471 void scr_bell ();
1449 void scr_printscreen (int fullhist); 1472 void scr_printscreen (int fullhist);
1450 void scr_reverse_selection (); 1473 void scr_reverse_selection ();
1451 void scr_dump (int fd); 1474 void scr_dump (int fd);
1452 void selection_check (int check_more); 1475 void selection_check (int check_more);
1453 int selection_paste (Window win, Atom prop, bool delete_prop); 1476 void selection_paste (Window win, Atom prop, bool delete_prop);
1454 void selection_property (Window win, Atom prop); 1477 void selection_property (Window win, Atom prop);
1455 void selection_request (Time tm, int x, int y); 1478 void selection_request (Time tm, int x, int y);
1456 int selection_request_other (Atom target, int selnum); 1479 int selection_request_other (Atom target, int selnum);
1457 void selection_clear (); 1480 void selection_clear ();
1458 void selection_make (Time tm); 1481 void selection_make (Time tm);
1493 1516
1494 // xdefaults.C 1517 // xdefaults.C
1495 void get_options (int argc, const char *const *argv); 1518 void get_options (int argc, const char *const *argv);
1496 int parse_keysym (const char *str, const char *arg); 1519 int parse_keysym (const char *str, const char *arg);
1497 void get_xdefaults (FILE *stream, const char *name); 1520 void get_xdefaults (FILE *stream, const char *name);
1498 void extract_resources (Display *display, const char *name); 1521 void extract_resources ();
1499 // xpm.C 1522 // xpm.C
1500 int scale_pixmap (const char *geom); 1523 int scale_pixmap (const char *geom);
1501 void resize_pixmap (); 1524 void resize_pixmap ();
1502 Pixmap set_bgPixmap (const char *file); 1525 Pixmap set_bgPixmap (const char *file);
1503}; 1526};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines