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.458 by sf-exg, Sun Jan 1 17:43:47 2012 UTC vs.
Revision 1.470 by sf-exg, Tue Apr 10 15:08:47 2012 UTC

1#ifndef RXVT_H_ /* include once only */ 1#ifndef RXVT_H_ /* include once only */
2#define RXVT_H_ 2#define RXVT_H_
3 3
4#include <cstdio> 4#include <stdio.h>
5#include <cctype> 5#include <ctype.h>
6#include <cerrno> 6#include <errno.h>
7#include <cstdarg> 7#include <stdarg.h>
8#include <cstdlib> 8#include <stdlib.h>
9#ifdef HAVE_STDINT_H 9#ifdef HAVE_STDINT_H
10#include <stdint.h> 10#include <stdint.h>
11#endif 11#endif
12#include <sys/types.h> 12#include <sys/types.h>
13#include <unistd.h> 13#include <unistd.h>
14#include <cstring> 14#include <string.h>
15#include <assert.h> 15#include <assert.h>
16#ifdef HAVE_SYS_IOCTL_H 16#ifdef HAVE_SYS_IOCTL_H
17#include <sys/ioctl.h> 17#include <sys/ioctl.h>
18#endif 18#endif
19#ifdef HAVE_SYS_STRREDIR_H 19#ifdef HAVE_SYS_STRREDIR_H
20#include <sys/strredir.h> 20#include <sys/strredir.h>
21#endif 21#endif
22 22
23#if HAVE_CWCHAR
24# include <cwchar>
25#elif HAVE_WCHAR_H 23#if HAVE_WCHAR_H
26# include <wchar.h> 24# include <wchar.h>
27#else 25#else
28// stdlib.h might provide it 26// stdlib.h might provide it
29#endif 27#endif
30
31using namespace std;
32 28
33// we assume that Xlib.h defines XPointer, and it does since at least 1994... 29// we assume that Xlib.h defines XPointer, and it does since at least 1994...
34 30
35extern "C" { 31extern "C" {
36#include <X11/Xlib.h> 32#include <X11/Xlib.h>
73 69
74#include <X11/cursorfont.h> 70#include <X11/cursorfont.h>
75#include <X11/keysym.h> 71#include <X11/keysym.h>
76#include <X11/keysymdef.h> 72#include <X11/keysymdef.h>
77#include <X11/Xatom.h> 73#include <X11/Xatom.h>
78
79#ifdef HAVE_AFTERIMAGE
80# include <afterimage.h>
81# undef min
82# undef max
83#endif
84 74
85#ifdef HAVE_PIXBUF 75#ifdef HAVE_PIXBUF
86# include <gdk-pixbuf/gdk-pixbuf.h> 76# include <gdk-pixbuf/gdk-pixbuf.h>
87#endif 77#endif
88 78
870 * END······················= total_rows 860 * END······················= total_rows
871 */ 861 */
872 862
873struct TermWin_t 863struct TermWin_t
874{ 864{
865 int vt_width; /* actual window width [pixels] */
866 int vt_height; /* actual window height [pixels] */
875 int width; /* window width [pixels] */ 867 int width; /* window width [pixels] */
876 int height; /* window height [pixels] */ 868 int height; /* window height [pixels] */
877 int fwidth; /* font width [pixels] */ 869 int fwidth; /* font width [pixels] */
878 int fheight; /* font height [pixels] */ 870 int fheight; /* font height [pixels] */
879 int fbase; /* font ascent (baseline) [pixels] */ 871 int fbase; /* font ascent (baseline) [pixels] */
891 int view_start; /* scrollback view starts here */ 883 int view_start; /* scrollback view starts here */
892 int top_row; /* topmost row index of scrollback */ 884 int top_row; /* topmost row index of scrollback */
893 Window parent; /* parent identifier */ 885 Window parent; /* parent identifier */
894 Window vt; /* vt100 window */ 886 Window vt; /* vt100 window */
895 GC gc; /* GC for drawing */ 887 GC gc; /* GC for drawing */
896 Pixmap pixmap;
897 rxvt_drawable *drawable; 888 rxvt_drawable *drawable;
898 rxvt_fontset *fontset[4]; 889 rxvt_fontset *fontset[4];
899}; 890};
900 891
901/* 892/*
1028 hidden_pointer:1, 1019 hidden_pointer:1,
1029#endif 1020#endif
1030 enc_utf8:1, /* whether locale uses utf-8 */ 1021 enc_utf8:1, /* whether locale uses utf-8 */
1031 seen_input:1, /* whether we have seen some program output yet */ 1022 seen_input:1, /* whether we have seen some program output yet */
1032 seen_resize:1, /* whether we had a resize event */ 1023 seen_resize:1, /* whether we had a resize event */
1024 init_done:1,
1033 parsed_geometry:1; 1025 parsed_geometry:1;
1034 1026
1035 unsigned char refresh_type, 1027 unsigned char refresh_type,
1036#ifdef META8_OPTION 1028#ifdef META8_OPTION
1037 meta_char; /* Alt-key prefix */ 1029 meta_char; /* Alt-key prefix */
1071 allowedxerror; 1063 allowedxerror;
1072/* ---------- */ 1064/* ---------- */
1073 unsigned int ModLevel3Mask, 1065 unsigned int ModLevel3Mask,
1074 ModMetaMask, 1066 ModMetaMask,
1075 ModNumLockMask; 1067 ModNumLockMask;
1076 int old_width, /* last used width in screen resize */
1077 old_height; /* last used height in screen resize */
1078 unsigned long priv_modes, 1068 unsigned long priv_modes,
1079 SavedModes; 1069 SavedModes;
1080/* ---------- */ 1070/* ---------- */
1081 Atom *xa; 1071 Atom *xa;
1082/* ---------- */ 1072/* ---------- */
1092#ifdef HAVE_BG_PIXMAP 1082#ifdef HAVE_BG_PIXMAP
1093 void bg_init (); 1083 void bg_init ();
1094 void bg_destroy (); 1084 void bg_destroy ();
1095 1085
1096 enum { 1086 enum {
1097 //subset returned by make_transparency_pixmap
1098 BG_IS_VALID = 1 << 0, 1087 BG_IS_VALID = 1 << 0,
1099 BG_NEEDS_TINT = 1 << 1, 1088 BG_NEEDS_TINT = 1 << 1,
1100 BG_NEEDS_BLUR = 1 << 2, 1089 BG_NEEDS_BLUR = 1 << 2,
1101 1090
1102 BG_EFFECTS_FLAGS = BG_NEEDS_TINT | BG_NEEDS_BLUR, 1091 BG_EFFECTS_FLAGS = BG_NEEDS_TINT | BG_NEEDS_BLUR,
1106 BG_TILE = 1 << 14, 1095 BG_TILE = 1 << 14,
1107 BG_GEOMETRY_FLAGS = BG_KEEP_ASPECT | BG_ROOT_ALIGN | BG_TILE, 1096 BG_GEOMETRY_FLAGS = BG_KEEP_ASPECT | BG_ROOT_ALIGN | BG_TILE,
1108 1097
1109 BG_TINT_SET = 1 << 5, 1098 BG_TINT_SET = 1 << 5,
1110 BG_TINT_BITAND = 1 << 6, 1099 BG_TINT_BITAND = 1 << 6,
1111 BG_TINT_FLAGS = BG_NEEDS_TINT | BG_TINT_BITAND,
1112 1100
1113 BG_HAS_RENDER = 1 << 7, 1101 BG_HAS_RENDER = 1 << 7,
1114 BG_HAS_RENDER_CONV = 1 << 8, 1102 BG_HAS_RENDER_CONV = 1 << 8,
1115 BG_CLIENT_RENDER = 1 << 9, 1103 BG_CLIENT_RENDER = 1 << 9,
1116 1104
1122 1110
1123 unsigned int bg_flags; 1111 unsigned int bg_flags;
1124 1112
1125# ifdef BG_IMAGE_FROM_FILE 1113# ifdef BG_IMAGE_FROM_FILE
1126 void get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y); 1114 void get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y);
1127 bool render_image (unsigned long tr_flags); 1115 bool render_image (bool transparent);
1128 1116
1129 enum { 1117 enum {
1130 noScale = 0, 1118 noScale = 0,
1131 windowScale = 100, 1119 windowScale = 100,
1132 defaultScale = windowScale, 1120 defaultScale = windowScale,
1159 void set_tint_shade_flags (); 1147 void set_tint_shade_flags ();
1160 bool bg_set_tint (rxvt_color &new_tint); 1148 bool bg_set_tint (rxvt_color &new_tint);
1161 bool bg_set_shade (const char *shade_str); 1149 bool bg_set_shade (const char *shade_str);
1162 bool bg_set_blur (const char *geom); 1150 bool bg_set_blur (const char *geom);
1163 1151
1164 bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height); 1152 bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height, int depth);
1165 bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height); 1153 bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height);
1166 void tint_ximage (Visual *visual, XImage *ximage); 1154 void tint_ximage (Visual *visual, XImage *ximage);
1167 unsigned long make_transparency_pixmap (); 1155 bool make_transparency_pixmap ();
1168# endif 1156# endif
1169 1157
1170 ev_tstamp bg_valid_since; 1158 ev_tstamp bg_valid_since;
1171 1159
1172 Pixmap bg_pixmap; 1160 Pixmap bg_pixmap;
1180 1168
1181 bool bg_render (); 1169 bool bg_render ();
1182 void bg_invalidate () 1170 void bg_invalidate ()
1183 { 1171 {
1184 bg_flags &= ~BG_IS_VALID; 1172 bg_flags &= ~BG_IS_VALID;
1185 }
1186#endif
1187#ifdef HAVE_AFTERIMAGE
1188 ASImage *original_asim;
1189 ASVisual *asv;
1190 ASImageManager *asimman;
1191
1192 void init_asv ()
1193 {
1194 if (!asv)
1195 asv = create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL);
1196 } 1173 }
1197#endif 1174#endif
1198#ifdef HAVE_PIXBUF 1175#ifdef HAVE_PIXBUF
1199 GdkPixbuf *pixbuf; 1176 GdkPixbuf *pixbuf;
1200 bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, 1177 bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc,
1214 void scr_overlay_set (int x, int y, const char *s) NOTHROW; 1191 void scr_overlay_set (int x, int y, const char *s) NOTHROW;
1215 void scr_overlay_set (int x, int y, const wchar_t *s) NOTHROW; 1192 void scr_overlay_set (int x, int y, const wchar_t *s) NOTHROW;
1216#endif 1193#endif
1217 1194
1218 vector<void *> allocated; // free these memory blocks with free() 1195 vector<void *> allocated; // free these memory blocks with free()
1219
1220 char env_windowid[21]; /* environmental variable WINDOWID */
1221 char env_colorfgbg[sizeof ("COLORFGBG=default;default;bg") + 1];
1222 char *env_display; /* environmental variable DISPLAY */
1223 char *env_term; /* environmental variable TERM */
1224 1196
1225 char *locale; 1197 char *locale;
1226 char charsets[4]; 1198 char charsets[4];
1227 char *v_buffer; /* pointer to physical buffer */ 1199 char *v_buffer; /* pointer to physical buffer */
1228 unsigned int v_buflen; /* size of area to write */ 1200 unsigned int v_buflen; /* size of area to write */
1415 void set_mbstring_property (Atom prop, const char *str, int len = -1); 1387 void set_mbstring_property (Atom prop, const char *str, int len = -1);
1416 void set_utf8_property (Atom prop, const char *str, int len = -1); 1388 void set_utf8_property (Atom prop, const char *str, int len = -1);
1417 void set_title (const char *str); 1389 void set_title (const char *str);
1418 void set_icon_name (const char *str); 1390 void set_icon_name (const char *str);
1419 void set_window_color (int idx, const char *color); 1391 void set_window_color (int idx, const char *color);
1420 void set_colorfgbg (); 1392 char *get_colorfgbg ();
1421 bool set_color (rxvt_color &color, const char *name); 1393 bool set_color (rxvt_color &color, const char *name);
1422 void alias_color (int dst, int src); 1394 void alias_color (int dst, int src);
1423 void set_widthheight (unsigned int newwidth, unsigned int newheight); 1395 void set_widthheight (unsigned int newwidth, unsigned int newheight);
1424 void get_window_origin (int &x, int &y); 1396 void get_window_origin (int &x, int &y);
1425 Pixmap get_pixmap_property (Atom property); 1397 Pixmap get_pixmap_property (Atom property);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines