1
/* -- x11vnc_defs.c -- */
5
int overlay_present = 0;
7
int xrandr_base_event_type = 0;
9
int xfixes_base_event_type = 0;
10
int xtest_base_event_type = 0;
11
#if LIBVNCSERVER_HAVE_LIBXTRAP
12
XETC *trap_ctx = NULL;
14
int xtrap_base_event_type = 0;
15
int xdamage_base_event_type = 0;
17
/* date +'lastmod: %Y-%m-%d' */
18
char lastmod[] = "0.9.4 lastmod: 2008-01-24";
22
Display *dpy = NULL; /* the single display screen we connect to */
24
char *xauth_raw_data = NULL;
25
int xauth_raw_len = 0;
26
Window window = None, rootwin = None; /* polled window, root window (usu. same) */
27
Visual *default_visual = NULL; /* the default visual (unless -visual) */
28
int bpp = 0, depth = 0;
29
int indexed_color = 0;
30
int dpy_x = 0, dpy_y = 0; /* size of display */
31
int fb_x = 0, fb_y = 0, fb_b = 0; /* fb size and bpp guesses at display */
32
int off_x, off_y; /* offsets for -sid */
33
int wdpy_x, wdpy_y; /* for actual sizes in case of -clip */
34
int cdpy_x, cdpy_y, coff_x, coff_y; /* the -clip params */
35
int button_mask = 0; /* button state and info */
36
int button_mask_prev = 0;
39
long xselectinput_rootwin = 0;
41
unsigned int display_button_mask = 0;
42
unsigned int display_mod_mask = 0;
44
/* image structures */
45
XImage *scanline = NULL;
46
XImage *fullscreen = NULL;
47
XImage **tile_row = NULL; /* for all possible row runs */
48
XImage *snaprect = NULL; /* for XShmGetImage (fs_factor) */
49
XImage *snap = NULL; /* the full snap fb */
50
XImage *raw_fb_image = NULL; /* the raw fb */
52
/* corresponding shm structures */
53
XShmSegmentInfo scanline_shm;
54
XShmSegmentInfo fullscreen_shm;
55
XShmSegmentInfo *tile_row_shm; /* for all possible row runs */
56
XShmSegmentInfo snaprect_shm;
59
rfbScreenInfoPtr screen = NULL;
60
char *rfb_desktop_name = NULL;
61
char *http_dir = NULL;
62
char vnc_desktop_name[256];
63
char *main_fb = NULL; /* our copy of the X11 fb */
64
char *rfb_fb = NULL; /* same as main_fb unless transformation */
65
char *fake_fb = NULL; /* used under -padgeom */
66
char *snap_fb = NULL; /* used under -snapfb */
67
char *cmap8to24_fb = NULL; /* used under -8to24 */
69
char *raw_fb = NULL; /* when used should be main_fb */
70
char *raw_fb_addr = NULL;
71
int raw_fb_offset = 0;
76
int raw_fb_back_to_X = 0; /* kludge for testing rawfb -> X */
78
int rfb_bytes_per_line = 0;
79
int main_bytes_per_line = 0;
80
int rot_bytes_per_line = 0;
81
unsigned long main_red_mask = 0, main_green_mask = 0, main_blue_mask = 0;
82
unsigned short main_red_max = 0, main_green_max = 0, main_blue_max = 0;
83
unsigned short main_red_shift = 0, main_green_shift = 0, main_blue_shift = 0;
85
int raw_fb_bytes_per_line = 0;
87
/* scaling parameters */
88
char *scale_str = NULL;
89
double scale_fac = 1.0;
91
int scaling_blend = 1; /* for no blending option (very course) */
92
int scaling_nomult4 = 0; /* do not require width = n * 4 */
93
int scaling_pad = 0; /* pad out scaled sizes to fit denominator */
94
int scaling_interpolate = 0; /* use interpolation scheme when shrinking */
95
int scaled_x = 0, scaled_y = 0; /* dimensions of scaled display */
96
int scale_numer = 0, scale_denom = 0; /* n/m */
97
char *rotating_str = NULL;
99
int rotating_same = 0;
100
int rotating_cursors = 0;
103
char *scale_cursor_str = NULL;
104
double scale_cursor_fac = 1.0;
105
int scaling_cursor = 0;
106
int scaling_cursor_blend = 1;
107
int scaling_cursor_interpolate = 0;
108
int scale_cursor_numer = 0, scale_cursor_denom = 0;
110
/* size of the basic tile unit that is polled for changes: */
113
int ntiles, ntiles_x = 0, ntiles_y = 0;
115
/* arrays that indicate changed or checked tiles. */
116
unsigned char *tile_has_diff = NULL, *tile_tried = NULL, *tile_copied = NULL;
117
unsigned char *tile_has_xdamage_diff = NULL, *tile_row_has_xdamage_diff = NULL;
119
/* times of recent events */
120
time_t last_event = 0, last_input = 0, last_client = 0;
121
time_t last_local_input = 0;
122
time_t last_keyboard_input = 0, last_pointer_input = 0;
123
time_t last_fb_bytes_sent = 0;
124
double last_keyboard_time = 0.0;
125
double last_pointer_time = 0.0;
126
double last_pointer_click_time = 0.0;
127
double last_pointer_motion_time = 0.0;
128
double last_key_to_button_remap_time = 0.0;
129
double last_copyrect = 0.0;
130
double last_copyrect_fix = 0.0;
131
double last_wireframe = 0.0;
132
double servertime_diff = 0.0;
133
double x11vnc_start = 0.0;
134
double x11vnc_current = 0.0;
137
double last_get_wm_frame_time = 0.0;
138
Window last_get_wm_frame = None;
139
double last_bs_restore = 0.0;
140
double last_su_restore = 0.0;
141
double last_bs_save = 0.0;
142
double last_su_save = 0.0;
146
/* last client to move pointer */
147
rfbClientPtr last_pointer_client = NULL;
148
rfbClientPtr latest_client = NULL;
149
double last_client_gone = 0.0;
151
int waited_for_client = 0;
152
int findcreatedisplay = 0;
153
char *terminal_services_daemon = NULL;
155
int client_count = 0;
156
int clients_served = 0;
158
/* more transient kludge variables: */
159
int cursor_x = 0, cursor_y = 0; /* x and y from the viewer(s) */
160
int button_change_x = 0, button_change_y = 0;
161
int got_user_input = 0;
162
int got_pointer_input = 0;
163
int got_local_pointer_input = 0;
164
int got_pointer_calls = 0;
165
int got_keyboard_input = 0;
166
int got_keyboard_calls = 0;
167
int urgent_update = 0;
168
int last_keyboard_keycode = 0;
169
rfbBool last_rfb_down = FALSE;
170
rfbBool last_rfb_key_accepted = FALSE;
171
rfbKeySym last_rfb_keysym = 0;
172
double last_rfb_keytime = 0.0;
173
int fb_copy_in_progress = 0;
174
int drag_in_progress = 0;
176
int do_copy_screen = 0;
177
time_t damage_time = 0;
178
int damage_delay = 0;
181
char *program_name = NULL;
182
char *program_cmdline = NULL;