--- rxvt-unicode/src/rxvt.h 2004/12/13 07:18:52 1.130 +++ rxvt-unicode/src/rxvt.h 2005/02/21 19:26:07 1.153 @@ -12,7 +12,7 @@ #include #include #if ENABLE_FRILLS -#include +# include #endif #include "encoding.h" @@ -21,6 +21,11 @@ #include "iom.h" #include "salloc.h" +#if ENABLE_FRILLS +# define ENABLE_XEMBED 1 +# define ENABLE_EWMH 1 +#endif + /* ***************************************************************************** * SYSTEM HACKS @@ -82,17 +87,23 @@ * PROTOTYPES ***************************************************************************** */ +// main.C RETSIGTYPE rxvt_Child_signal (int sig); RETSIGTYPE rxvt_Exit_signal (int sig); void rxvt_clean_exit (); void * rxvt_malloc (size_t size); void * rxvt_calloc (size_t number, size_t size); void * rxvt_realloc (void *ptr, size_t size); +void rxvt_privileges (rxvt_privaction action); + +// util.C char * rxvt_wcstombs (const wchar_t *str, int len = -1); wchar_t * rxvt_mbstowcs (const char *str, int len = -1); char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); wchar_t * rxvt_utf8towcs (const char *str, int len = -1); char * rxvt_strdup (const char *str); + +// misc.C char * rxvt_r_basename (const char *str); void rxvt_vlog (const char *fmt, va_list arg_ptr); void rxvt_log (const char *fmt,...); @@ -109,8 +120,6 @@ void rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h); void rxvt_Draw_Triangle (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int type); -void rxvt_privileges (rxvt_privaction action); - /* ***************************************************************************** * STRUCTURES AND TYPEDEFS @@ -175,6 +184,31 @@ } MWMHints; #endif +#if ENABLE_XEMBED +// XEMBED messages +# define XEMBED_EMBEDDED_NOTIFY 0 +# define XEMBED_WINDOW_ACTIVATE 1 +# define XEMBED_WINDOW_DEACTIVATE 2 +# define XEMBED_REQUEST_FOCUS 3 +# define XEMBED_FOCUS_IN 4 +# define XEMBED_FOCUS_OUT 5 +# define XEMBED_FOCUS_NEXT 6 +# define XEMBED_FOCUS_PREV 7 + +# define XEMBED_MODALITY_ON 10 +# define XEMBED_MODALITY_OFF 11 +# define XEMBED_REGISTER_ACCELERATOR 12 +# define XEMBED_UNREGISTER_ACCELERATOR 13 +# define XEMBED_ACTIVATE_ACCELERATOR 14 + +// XEMBED detail code +# define XEMBED_FOCUS_CURRENT 0 +# define XEMBED_FOCUS_FIRST 1 +# define XEMBED_FOCUS_LAST 2 + +# define XEMBED_MAPPED (1 << 0) +#endif + /* ***************************************************************************** * NORMAL DEFINES @@ -440,15 +474,19 @@ XTerm_restoreFG = 39, // change default fg color XTerm_restoreBG = 49, // change default bg color XTerm_dumpscreen = 55, // dump scrollback and all of screen - XTerm_locale = 701, // change locale - XTerm_Menu = 703, // set menu item - XTerm_Color_IT = 704, // change actual 'Italic' colour - XTerm_Color_tint = 705, // change actual tint colour + + URxvt_locale = 701, // change locale + URxvt_Menu = 703, // set menu item + URxvt_Color_IT = 704, // change actual 'Italic' colour + URxvt_Color_tint = 705, // change actual tint colour URxvt_font = 710, URxvt_boldFont = 711, URxvt_italicFont = 712, URxvt_boldItalicFont = 713, + + URxvt_view_up = 720, + URxvt_view_down = 721, }; /* Words starting with `Color_' are colours. Others are counts */ @@ -502,6 +540,9 @@ Color_UL, Color_RV, #endif +#if ENABLE_FRILLS + Color_underline, +#endif #ifdef OPTION_HC Color_HC, #endif @@ -562,8 +603,9 @@ Rs_scrollBar_right, Rs_scrollBar_floating, Rs_scrollBar_align, -#endif Rs_scrollstyle, /* Rs_scrollBar_style */ + Rs_scrollBar_thickness, +#endif Rs_scrollTtyOutput, Rs_scrollTtyKeypress, Rs_scrollWithBuffer, @@ -601,10 +643,11 @@ Rs_ext_bwidth, Rs_int_bwidth, Rs_borderLess, -#endif - Rs_scrollBar_thickness, -#ifndef NO_LINESPACE Rs_lineSpace, + Rs_pty_fd, +#endif +#if ENABLE_XEMBED + Rs_embed, #endif Rs_cutchars, Rs_modifier, @@ -615,6 +658,7 @@ Rs_pointerBlank, Rs_pointerBlankDelay, Rs_imLocale, + Rs_imFont, Rs_pastableTabs, #ifndef NO_SECONDARY_SCREEN Rs_secondaryScreen, @@ -639,16 +683,33 @@ XA_TIMESTAMP, XA_VT_SELECTION, XA_INCR, - XA_WMDELETEWINDOW, -#ifdef TRANSPARENT - XA_XROOTPMAPID, - XA_XSETROOTID, + XA_WM_PROTOCOLS, + XA_WM_DELETE_WINDOW, + XA_CLIPBOARD, +#if ENABLE_FRILLS + XA_MOTIF_WM_HINTS, +#endif +#if ENABLE_EWMH + XA_NET_WM_PID, + XA_NET_WM_NAME, + XA_NET_WM_ICON_NAME, + XA_NET_WM_PING, #endif -#ifdef OFFIX_DND /* OffiX Dnd (drag 'n' drop) support */ +#if USE_XIM + XA_WM_LOCALE_NAME, +#endif +#if TRANSPARENT + XA_XROOTPMAP_ID, + XA_ESETROOT_PMAP_ID, +#endif +#if OFFIX_DND /* OffiX Dnd (drag 'n' drop) support */ XA_DNDPROTOCOL, XA_DNDSELECTION, -#endif /* OFFIX_DND */ - XA_CLIPBOARD, +#endif +#if ENABLE_XEMBED + XA_XEMBED, + XA_XEMBED_INFO, +#endif NUM_XA }; @@ -685,9 +746,9 @@ priv_modes &= ~(bit) #ifdef ALLOW_132_MODE -# define PrivMode_Default (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) +# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) #else -# define PrivMode_Default (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor) +# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor) #endif // do not change these constants lightly, there are many interdependencies @@ -748,6 +809,8 @@ #define strchr(x, y) strchr((const char *)(x), (int)(y)) #define strrchr(x, y) strrchr((const char *)(x), (int)(y)) +#define dDisp Display *disp = display->display + /* convert pixel dimensions to row/column values. Everything as int32_t */ #define Pixel2Col(x) Pixel2Width((int32_t)(x)) #define Pixel2Row(y) Pixel2Height((int32_t)(y)) @@ -855,13 +918,6 @@ # define XPMClearArea(a, b, c, d, e, f, g) #endif -#ifndef STRICT_FONT_CHECKING -# define rxvt_get_fontwidest(font) ((font)->max_bounds.width) -#endif - -#define rxvt_Gr_ButtonPress(x,y) rxvt_Gr_ButtonReport (R, 'P',(x),(y)) -#define rxvt_Gr_ButtonRelease(x,y) rxvt_Gr_ButtonReport (R, 'R',(x),(y)) - #ifdef UTMP_SUPPORT # if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) # undef HAVE_UTMPX_H @@ -944,6 +1000,8 @@ mbstate () { reset (); } }; +#define UNICODE_MASK 0x1fffffUL + #if UNICODE3 # define COMPOSE_LO 0x40000000UL # define COMPOSE_HI 0x400fffffUL @@ -982,6 +1040,10 @@ #endif +#ifdef KEYSYM_RESOURCE + class keyboard_manager; +#endif + struct rxvt_term : zero_initialized, rxvt_vars { log_callback *log_hook; // log error messages through this hook, if != 0 @@ -1008,7 +1070,7 @@ #ifdef POINTER_BLANK hidden_pointer:1, #endif -// enc_utf8:1, /* wether locale uses utf-8 */ + enc_utf8:1, /* wether locale uses utf-8 */ seen_input:1, /* wether we have seen some program output yet */ seen_resize:1, /* wether we had a resize event */ parsed_geometry:1; @@ -1064,7 +1126,8 @@ # endif allowedxerror; /* ---------- */ - unsigned int ModMetaMask, + unsigned int ModLevel3Mask, + ModMetaMask, ModNumLockMask; int old_width, /* last used width in screen resize */ old_height; /* last used height in screen resize */ @@ -1108,9 +1171,6 @@ size_t incr_buf_size, incr_buf_fill; /* ---------- */ Cursor leftptr_cursor; -#ifdef POINTER_BLANK - Cursor blank_cursor; -#endif /* ---------- */ #ifndef NO_BACKSPACE_KEY const char *key_backspace; @@ -1178,9 +1238,11 @@ unsigned char *v_buffer; /* pointer to physical buffer */ unsigned int v_buflen; /* size of area to write */ stringvec *argv, *envv; /* if != 0, will be freed on destroy time */ + #ifdef KEYSYM_RESOURCE - const unsigned char *Keysym_map[256]; + keyboard_manager *keyboard; #endif + const char *rs[NUM_RESOURCES]; /* command input buffering */ unsigned char *cmdbuf_ptr, *cmdbuf_endp; @@ -1202,7 +1264,8 @@ # endif #endif - void paste (const unsigned char *data, unsigned int len); + // modifies first argument(!) + void paste (unsigned char *data, unsigned int len); void flush (); @@ -1212,7 +1275,7 @@ #endif - void sig_term (sig_watcher &w); sig_watcher sw_term; + void sig_term (sig_watcher &w); sig_watcher sw_term, sw_int; void sig_chld (sig_watcher &w); sig_watcher sw_chld; void x_cb (XEvent &xev); @@ -1265,6 +1328,7 @@ rxvt_term (); ~rxvt_term (); void destroy (); + void emergency_cleanup (); bool init (int argc, const char *const *argv); bool init_vars (); @@ -1328,6 +1392,8 @@ void mouse_report (XButtonEvent &ev); void button_press (XButtonEvent &ev); void button_release (XButtonEvent &ev); + void focus_in (); + void focus_out (); int check_our_parents (); #ifdef PRINTPIPE FILE *popen_printer (); @@ -1410,6 +1476,7 @@ void scr_refresh (unsigned char refresh_type); bool scr_refresh_rend (rend_t mask, rend_t value); void scr_erase_screen (int mode); + void scr_erase_savelines (); void scr_touch (bool refresh); void scr_expose (int x, int y, int width, int height, bool refresh); rxvt_fontset *scr_find_fontset (rend_t r = DEFAULT_RSTYLE); @@ -1498,7 +1565,7 @@ void get_options (int argc, const char *const *argv); int parse_keysym (const char *str, const char *arg); void get_xdefaults (FILE *stream, const char *name); - void extract_resources (Display *display, const char *name); + void extract_resources (); // xpm.C int scale_pixmap (const char *geom); void resize_pixmap ();