r877: Fix files that were missing from a make dist tarball.
[cinelerra_cv.git] / guicast / bcwindowbase.h
blob42668b4056a3d97dd1f49b3e9ff51c1d8777102a
1 #ifndef BCWINDOWBASE_H
2 #define BCWINDOWBASE_H
4 #if defined(HAVE_CONFIG_H)
5 #include "config.h"
6 #endif
8 // Window types
10 #define MAIN_WINDOW 0
11 #define SUB_WINDOW 1
12 #define POPUP_WINDOW 2
13 #ifdef HAVE_LIBXXF86VM
14 #define VIDMODE_SCALED_WINDOW 3
15 #endif
17 #define TOOLTIP_MARGIN 2
18 #define BC_INFINITY 65536
20 #include "arraylist.h"
21 #include "bcbar.inc"
22 #include "bcbitmap.inc"
23 #include "bcbutton.inc"
24 #include "bccapture.inc"
25 #include "bcclipboard.inc"
26 #include "bcdragwindow.inc"
27 #include "bcfilebox.inc"
28 #include "bclistbox.inc"
29 #include "bcmenubar.inc"
30 #include "bcmeter.inc"
31 #include "bcpan.inc"
32 #include "bcpbuffer.inc"
33 #include "bcpixmap.inc"
34 #include "bcpopup.inc"
35 #include "bcpopupmenu.inc"
36 #include "bcpot.inc"
37 #include "bcprogress.inc"
38 #include "bcrelocatablewidget.h"
39 #include "bcrepeater.inc"
40 #include "bcresources.inc"
41 #include "bcscrollbar.inc"
42 #include "bcslider.inc"
43 #include "bcsubwindow.inc"
44 #include "bcsynchronous.inc"
45 #include "bctextbox.inc"
46 #include "bctimer.inc"
47 #include "bctitle.inc"
48 #include "bctoggle.inc"
49 #include "bctumble.inc"
50 #include "bcwidgetgrid.inc"
51 #include "bcwindow.inc"
52 #include "bcwindowbase.inc"
53 #include "bcwindowevents.inc"
54 #include "condition.inc"
55 #include "bchash.inc"
56 #include "linklist.h"
57 #include "mutex.inc"
58 #include "vframe.inc"
61 #include <stdint.h>
62 #include <stdio.h>
63 #include <stdlib.h>
64 #include <X11/Xatom.h>
65 #ifdef HAVE_XFT
66 #include <X11/Xft/Xft.h>
67 #endif
68 #include <X11/Xlib.h>
69 #include <X11/Xutil.h>
70 #include <X11/keysym.h>
71 #include <X11/cursorfont.h>
72 #ifdef HAVE_LIBXXF86VM
73 #include <X11/extensions/xf86vmode.h>
74 #endif
75 #ifdef HAVE_GL
76 #include <GL/glx.h>
77 #endif
81 #ifdef HAVE_GL
82 //typedef void* GLXContext;
83 #endif
85 class BC_ResizeCall
87 public:
88 BC_ResizeCall(int w, int h);
89 int w, h;
93 // Windows, subwindows, popupwindows inherit from this
94 class BC_WindowBase : public BC_RelocatableWidget
96 public:
97 BC_WindowBase();
98 virtual ~BC_WindowBase();
100 friend class BC_Bar;
101 friend class BC_Bitmap;
102 friend class BC_Button;
103 friend class BC_GenericButton;
104 friend class BC_Capture;
105 friend class BC_Clipboard;
106 friend class BC_DragWindow;
107 friend class BC_FileBox;
108 friend class BC_FullScreen;
109 friend class BC_ListBox;
110 friend class BC_Menu;
111 friend class BC_MenuBar;
112 friend class BC_MenuItem;
113 friend class BC_MenuPopup;
114 friend class BC_Meter;
115 friend class BC_Pan;
116 friend class BC_PBuffer;
117 friend class BC_Pixmap;
118 friend class BC_PixmapSW;
119 friend class BC_Popup;
120 friend class BC_PopupMenu;
121 friend class BC_Pot;
122 friend class BC_ProgressBar;
123 friend class BC_Repeater;
124 friend class BC_Resources;
125 friend class BC_ScrollBar;
126 friend class BC_Slider;
127 friend class BC_SubWindow;
128 friend class BC_Synchronous;
129 friend class BC_TextBox;
130 friend class BC_Title;
131 friend class BC_Toggle;
132 friend class BC_Tumbler;
133 friend class BC_Window;
134 friend class BC_WindowEvents;
136 // Main loop
137 int run_window();
138 // Terminal event dispatchers
139 virtual int close_event();
140 virtual int resize_event(int w, int h);
141 virtual int repeat_event(int64_t duration) { return 0; };
142 virtual int focus_in_event() { return 0; };
143 virtual int focus_out_event() { return 0; };
144 virtual int button_press_event() { return 0; };
145 virtual int button_release_event() { return 0; };
146 virtual int cursor_motion_event() { return 0; };
147 virtual int cursor_leave_event();
148 virtual int cursor_enter_event();
149 virtual int keypress_event() { return 0; };
150 virtual int translation_event() { return 0; };
151 virtual int drag_start_event() { return 0; };
152 virtual int drag_motion_event() { return 0; };
153 virtual int drag_stop_event() { return 0; };
154 virtual int uses_text() { return 0; };
155 // Only if opengl is enabled
156 virtual int expose_event() { return 0; };
158 // Check if a hardware accelerated colormodel is available and reserve it
159 int accel_available(int color_model, int lock_it);
160 // Get color model adjusted for byte order and pixel size
161 int get_color_model();
162 // return the colormap pixel of the color for all bit depths
163 int get_color(int64_t color);
164 // return the currently selected color
165 int64_t get_color();
166 int show_window(int flush = 1);
167 int hide_window(int flush = 1);
168 int get_hidden();
169 int get_video_on();
170 // Shouldn't deference a pointer to delete a window if a parent is
171 // currently being deleted. This returns 1 if any parent is being deleted.
172 int get_deleting();
176 //============================= OpenGL functions ===============================
177 // OpenGL functions must be called from inside a BC_Synchronous command.
178 // Create openGL context and bind it to the current window.
179 // If it's called inside start_video/stop_video, the context is bound to the window.
180 // If it's called outside start_video/stop_video, the context is bound to the pixmap.
181 // Must be called at the beginning of any opengl routine to make sure
182 // the context is current.
183 // No locking is performed.
184 void enable_opengl();
185 void disable_opengl();
186 void flip_opengl();
188 // Calls the BC_Synchronous version of the function with the window_id.
189 // Not run in OpenGL thread because it has its own lock.
190 unsigned int get_shader(char *title, int *got_it);
191 void put_shader(unsigned int handle, char *title);
194 int flash(int x, int y, int w, int h, int flush = 1);
195 int flash(int flush = 1);
196 void flush();
197 void sync_display();
198 // Lock out other threads
199 int lock_window(char *location = 0);
200 int unlock_window();
201 int get_window_lock();
203 BC_MenuBar* add_menubar(BC_MenuBar *menu_bar);
204 BC_WindowBase* add_subwindow(BC_WindowBase *subwindow);
205 BC_WindowBase* add_tool(BC_WindowBase *subwindow);
206 BC_WidgetGrid* add_widgetgrid(BC_WidgetGrid *widgetgrid);
209 static BC_Resources* get_resources();
210 // User must create synchronous object first
211 static BC_Synchronous* get_synchronous();
213 // Dimensions
214 virtual int get_w();
215 virtual int get_h();
216 virtual int get_x();
217 virtual int get_y();
218 virtual int reposition_widgets(){ printf("foo1"); return 0; }
219 int get_root_w(int ignore_dualhead = 0, int lock_display = 0);
220 int get_root_h(int lock_display);
221 // Get current position
222 int get_abs_cursor_x(int lock_window);
223 int get_abs_cursor_y(int lock_window);
224 int get_relative_cursor_x();
225 int get_relative_cursor_y();
226 // Return 1 if cursor is over an unobscured part of this window.
227 // An argument is provided for excluding a drag popup
228 int get_cursor_over_window();
229 // For traversing windows... return 1 if this or any subwindow is win
230 int match_window(Window win);
232 // 1 or 0 if a button is down
233 int get_button_down();
234 // Number of button pressed 1 - 5
235 int get_buttonpress();
236 int get_has_focus();
237 int get_dragging();
238 int get_keypress();
239 // Get cursor position of last event
240 int get_cursor_x();
241 int get_cursor_y();
242 // Cursor position of drag start
243 int get_drag_x();
244 int get_drag_y();
245 int relative_cursor_x(BC_WindowBase *pov);
246 int relative_cursor_y(BC_WindowBase *pov);
247 int alt_down();
248 int shift_down();
249 int ctrl_down();
250 int get_double_click();
251 // Bottom right corner
252 int get_x2();
253 int get_y2();
254 int get_bg_color();
255 BC_Pixmap* get_bg_pixmap();
256 int get_text_ascent(int font);
257 int get_text_descent(int font);
258 int get_text_height(int font, char *text = 0);
259 int get_text_width(int font, char *text, int length = -1);
260 BC_Clipboard* get_clipboard();
261 void set_dragging(int value);
262 int set_w(int w);
263 int set_h(int h);
264 BC_WindowBase* get_top_level();
265 BC_WindowBase* get_parent();
266 // Event happened in this window
267 int is_event_win();
268 int cursor_inside();
269 // Deactivate everything and activate this subwindow
270 virtual int activate();
271 // Deactivate this subwindow
272 virtual int deactivate();
273 void set_active_subwindow(BC_WindowBase *subwindow);
274 // Get value of toggle value when dragging a selection
275 int get_toggle_value();
276 // Get if toggle is being dragged
277 int get_toggle_drag();
279 // Set the gc to the color
280 void set_color(int64_t color);
281 int get_bgcolor();
282 void set_font(int font);
283 // Set the cursor to a macro from cursors.h
284 // Set override if the caller is enabling hourglass or hiding the cursor
285 void set_cursor(int cursor, int override = 0);
286 // Set the cursor to a character in the X cursor library. Used by test.C
287 void set_x_cursor(int cursor);
288 int get_cursor();
289 // Shows the cursor after it's hidden by video playback
290 void unhide_cursor();
291 // Called by video updating routines to hide the cursor after a timeout
292 void update_video_cursor();
294 // Entry point for starting hourglass.
295 // Converts all cursors and saves the previous cursor.
296 void start_hourglass();
297 void stop_hourglass();
299 // Recursive part of hourglass commands.
300 void start_hourglass_recursive();
301 void stop_hourglass_recursive();
303 // Drawing
304 void copy_area(int x1, int y1, int x2, int y2, int w, int h, BC_Pixmap *pixmap = 0);
305 void clear_box(int x, int y, int w, int h, BC_Pixmap *pixmap = 0);
306 void draw_box(int x, int y, int w, int h, BC_Pixmap *pixmap = 0);
307 void draw_circle(int x, int y, int w, int h, BC_Pixmap *pixmap = 0);
308 void draw_disc(int x, int y, int w, int h, BC_Pixmap *pixmap = 0);
309 void draw_text(int x, int y, char *text, int length = -1, BC_Pixmap *pixmap = 0);
310 void draw_xft_text(int x,
311 int y,
312 char *text,
313 int length,
314 BC_Pixmap *pixmap,
315 int x2,
316 int k,
317 int y2,
318 int j,
319 int i);
320 void draw_center_text(int x, int y, char *text, int length = -1);
321 void draw_line(int x1, int y1, int x2, int y2, BC_Pixmap *pixmap = 0);
322 void draw_polygon(ArrayList<int> *x, ArrayList<int> *y, BC_Pixmap *pixmap = 0);
323 void draw_rectangle(int x, int y, int w, int h);
324 void draw_3segment(int x,
325 int y,
326 int w,
327 int h,
328 BC_Pixmap *left_image,
329 BC_Pixmap *mid_image,
330 BC_Pixmap *right_image,
331 BC_Pixmap *pixmap = 0);
332 void draw_3segment(int x,
333 int y,
334 int w,
335 int h,
336 VFrame *left_image,
337 VFrame *mid_image,
338 VFrame *right_image,
339 BC_Pixmap *pixmap = 0);
340 // For drawing a changing level
341 void draw_3segmenth(int x,
342 int y,
343 int w,
344 int total_x,
345 int total_w,
346 VFrame *image,
347 BC_Pixmap *pixmap);
348 void draw_3segmenth(int x,
349 int y,
350 int w,
351 int total_x,
352 int total_w,
353 BC_Pixmap *src,
354 BC_Pixmap *dst = 0);
355 void draw_3segmentv(int x,
356 int y,
357 int h,
358 int total_y,
359 int total_h,
360 BC_Pixmap *src,
361 BC_Pixmap *dst = 0);
362 void draw_3segmentv(int x,
363 int y,
364 int h,
365 int total_y,
366 int total_h,
367 VFrame *src,
368 BC_Pixmap *dst = 0);
369 // For drawing a single level
370 void draw_3segmenth(int x,
371 int y,
372 int w,
373 VFrame *image,
374 BC_Pixmap *pixmap = 0);
375 void draw_3segmenth(int x,
376 int y,
377 int w,
378 BC_Pixmap *src,
379 BC_Pixmap *dst = 0);
380 void draw_3segmentv(int x,
381 int y,
382 int h,
383 BC_Pixmap *src,
384 BC_Pixmap *dst = 0);
385 void draw_3segmentv(int x,
386 int y,
387 int h,
388 VFrame *src,
389 BC_Pixmap *dst = 0);
390 void draw_9segment(int x,
391 int y,
392 int w,
393 int h,
394 VFrame *src,
395 BC_Pixmap *dst = 0);
396 void draw_9segment(int x,
397 int y,
398 int w,
399 int h,
400 BC_Pixmap *src,
401 BC_Pixmap *dst = 0);
402 void draw_3d_box(int x,
403 int y,
404 int w,
405 int h,
406 int light1,
407 int light2,
408 int middle,
409 int shadow1,
410 int shadow2,
411 BC_Pixmap *pixmap = 0);
412 void draw_3d_border(int x, int y, int w, int h,
413 int light1, int light2, int shadow1, int shadow2);
414 void draw_colored_box(int x, int y, int w, int h, int down, int highlighted);
415 void draw_check(int x, int y);
416 void draw_triangle_down_flat(int x, int y, int w, int h);
417 void draw_triangle_up(int x, int y, int w, int h,
418 int light1, int light2, int middle, int shadow1, int shadow2);
419 void draw_triangle_down(int x, int y, int w, int h,
420 int light1, int light2, int middle, int shadow1, int shadow2);
421 void draw_triangle_left(int x, int y, int w, int h,
422 int light1, int light2, int middle, int shadow1, int shadow2);
423 void draw_triangle_right(int x, int y, int w, int h,
424 int light1, int light2, int middle, int shadow1, int shadow2);
425 // Set the gc to opaque
426 void set_opaque();
427 void set_inverse();
428 void set_background(VFrame *bitmap);
429 // Change the window title. The title is translated internally.
430 void set_title(char *text);
431 char* get_title();
432 void start_video();
433 void stop_video();
434 int get_id();
435 void set_done(int return_value);
436 // Get a bitmap to draw on the window with
437 BC_Bitmap* new_bitmap(int w, int h, int color_model = -1);
438 // Draw a bitmap on the window
439 void draw_bitmap(BC_Bitmap *bitmap,
440 int dont_wait,
441 int dest_x = 0,
442 int dest_y = 0,
443 int dest_w = 0,
444 int dest_h = 0,
445 int src_x = 0,
446 int src_y = 0,
447 int src_w = 0,
448 int src_h = 0,
449 BC_Pixmap *pixmap = 0);
450 void draw_pixel(int x, int y, BC_Pixmap *pixmap = 0);
451 // Draw a pixmap on the window
452 void draw_pixmap(BC_Pixmap *pixmap,
453 int dest_x = 0,
454 int dest_y = 0,
455 int dest_w = -1,
456 int dest_h = -1,
457 int src_x = 0,
458 int src_y = 0,
459 BC_Pixmap *dst = 0);
460 // Draw a vframe on the window
461 void draw_vframe(VFrame *frame,
462 int dest_x = 0,
463 int dest_y = 0,
464 int dest_w = -1,
465 int dest_h = -1,
466 int src_x = 0,
467 int src_y = 0,
468 int src_w = 0,
469 int src_h = 0,
470 BC_Pixmap *pixmap = 0);
471 void draw_border(char *text, int x, int y, int w, int h);
472 // Draw a region of the background
473 void draw_top_background(BC_WindowBase *parent_window, int x, int y, int w, int h, BC_Pixmap *pixmap = 0);
474 void draw_top_tiles(BC_WindowBase *parent_window, int x, int y, int w, int h);
475 void draw_background(int x, int y, int w, int h);
476 void draw_tiles(BC_Pixmap *tile,
477 int origin_x,
478 int origin_y,
479 int x,
480 int y,
481 int w,
482 int h);
483 void slide_left(int distance);
484 void slide_right(int distance);
485 void slide_up(int distance);
486 void slide_down(int distance);
488 int cycle_textboxes(int amount);
490 int raise_window(int do_flush = 1);
491 int set_tooltips(int tooltips_enabled);
492 int resize_window(int w, int h);
493 int reposition_widget(int x, int y, int w = -1, int h = -1);
494 int reposition_window(int x, int y, int w = -1, int h = -1);
495 // Cause a repeat event to be dispatched every duration.
496 // duration is milliseconds
497 int set_repeat(int64_t duration);
498 // Stop a repeat event from being dispatched.
499 int unset_repeat(int64_t duration);
500 int set_tooltip(char *text);
501 int show_tooltip(int w = -1, int h = -1);
502 int hide_tooltip();
503 int set_icon(VFrame *data);
504 int load_defaults(BC_Hash *defaults);
505 int save_defaults(BC_Hash *defaults);
507 #ifdef HAVE_LIBXXF86VM
508 // Mode switch methods.
509 void closest_vm(int *vm, int *width, int *height);
510 void scale_vm(int vm);
511 void restore_vm();
512 #endif
515 int test_keypress;
518 private:
519 // Create a window
520 virtual int create_window(BC_WindowBase *parent_window,
521 char *title,
522 int x,
523 int y,
524 int w,
525 int h,
526 int minw,
527 int minh,
528 int allow_resize,
529 int private_color,
530 int hide,
531 int bg_color,
532 char *display_name,
533 int window_type,
534 BC_Pixmap *bg_pixmap,
535 int group_it);
537 static Display* init_display(char *display_name);
538 // Get display from top level
539 Display* get_display();
540 int get_screen();
541 virtual int initialize();
542 int get_atoms();
543 void init_cursors();
544 int init_colors();
545 int init_window_shape();
546 static int evaluate_color_model(int client_byte_order, int server_byte_order, int depth);
547 int create_private_colors();
548 int create_color(int color);
549 int create_shared_colors();
550 // Get width of a single line. Used by get_text_width
551 int get_single_text_width(int font, char *text, int length);
552 int allocate_color_table();
553 int init_gc();
554 int init_fonts();
555 void init_xft();
556 int get_color_rgb8(int color);
557 int64_t get_color_rgb16(int color);
558 int64_t get_color_bgr16(int color);
559 int64_t get_color_bgr24(int color);
560 XFontStruct* get_font_struct(int font);
561 #ifdef HAVE_XFT
562 XftFont* get_xft_struct(int font);
563 #endif
564 Cursor get_cursor_struct(int cursor);
565 XFontSet get_fontset(int font);
566 XFontSet get_curr_fontset(void);
567 void set_fontset(int font);
568 int dispatch_event();
570 int get_key_masks(XEvent *event);
572 int trigger_tooltip();
573 int untrigger_tooltip();
574 void draw_tooltip();
575 int arm_repeat(int64_t duration);
576 // delete all repeater opjects for a close
577 int unset_all_repeaters();
579 // Block and get event from common events.
580 XEvent* get_event();
581 // Return number of events in table.
582 int get_event_count();
583 // Put event in common events.
584 void put_event(XEvent *event);
586 // Recursive event dispatchers
587 int dispatch_resize_event(int w, int h);
588 int dispatch_focus_in();
589 int dispatch_focus_out();
590 int dispatch_motion_event();
591 int dispatch_keypress_event();
592 int dispatch_repeat_event(int64_t duration);
593 int dispatch_repeat_event_master(int64_t duration);
594 int dispatch_button_press();
595 int dispatch_button_release();
596 int dispatch_cursor_leave();
597 int dispatch_cursor_enter();
598 int dispatch_translation_event();
599 int dispatch_drag_start();
600 int dispatch_drag_motion();
601 int dispatch_drag_stop();
602 int dispatch_expose_event();
604 // Get the port ID for a color model or return -1 for failure
605 int grab_port_id(BC_WindowBase *window, int color_model);
607 int find_next_textbox(BC_WindowBase **first_textbox, BC_WindowBase **next_textbox, int &result);
608 int find_prev_textbox(BC_WindowBase **last_textbox, BC_WindowBase **prev_textbox, int &result);
611 void translate_coordinates(Window src_w,
612 Window dest_w,
613 int src_x,
614 int src_y,
615 int *dest_x_return,
616 int *dest_y_return);
618 // Top level window above this window
619 BC_WindowBase* top_level;
620 // Window just above this window
621 BC_WindowBase* parent_window;
622 // list of window bases in this window
623 BC_SubWindowList* subwindows;
624 // list of window bases in this window
625 BC_WidgetGridList* widgetgrids;
626 // Position of window
627 int x, y, w, h;
628 // Default colors
629 int light1, light2, medium, dark1, dark2, bg_color;
630 // Type of window defined above
631 int window_type;
632 // Pointer to the active menubar in the window.
633 BC_MenuBar* active_menubar;
634 // pointer to the active popup menu in the window
635 BC_PopupMenu* active_popup_menu;
636 // pointer to the active subwindow
637 BC_WindowBase* active_subwindow;
639 // Window parameters
640 int allow_resize;
641 int hidden, private_color, bits_per_pixel, color_model;
642 int server_byte_order, client_byte_order;
643 // number of colors in color table
644 int total_colors;
645 // last color found in table
646 int current_color_value, current_color_pixel;
647 // table for every color allocated
648 int color_table[256][2];
649 // Turn on optimization
650 int video_on;
651 // Event handler completion
652 int done;
653 // Return value of event handler
654 int return_value;
655 // Motion event compression
656 int motion_events, last_motion_x, last_motion_y;
657 // window of buffered motion
658 Window last_motion_win;
659 // Resize event compression
660 int resize_events, last_resize_w, last_resize_h;
661 int translation_events, last_translate_x, last_translate_y;
662 int prev_x, prev_y;
663 // Since the window manager automatically translates the window at boot,
664 // use the first translation event to get correction factors
665 int translation_count;
666 int x_correction, y_correction;
667 // Key masks
668 int ctrl_mask, shift_mask, alt_mask;
669 // Cursor motion information
670 int cursor_x, cursor_y;
671 // Button status information
672 int button_down, button_number;
673 // When button was pressed and whether it qualifies as a double click
674 uint64_t button_time1, button_time2;
675 int double_click;
676 // Which button is down. 1, 2, 3, 4, 5
677 int button_pressed;
678 // Last key pressed
679 int key_pressed;
680 // During a selection drag involving toggles, set the same value for each toggle
681 int toggle_value;
682 int toggle_drag;
683 // Whether the window has the focus
684 int has_focus;
686 static BC_Resources resources;
687 // Array of repeaters for multiple repeating objects.
688 ArrayList<BC_Repeater*> repeaters;
689 // int64_t next_repeat_id;
690 // Text for tooltip if one exists
691 char tooltip_text[BCTEXTLEN];
692 // If the current window's tooltip is visible
693 int tooltip_on;
694 // Repeat ID of tooltip
695 // int64_t tooltip_id;
696 // Popup window for tooltip
697 BC_Popup *tooltip_popup;
698 // If this subwindow has already shown a tooltip since the last EnterNotify
699 int tooltip_done;
700 // If the tooltip shouldn't be hidden
701 int persistant_tooltip;
705 // Font sets
706 XFontSet largefontset, mediumfontset, smallfontset, curr_fontset;
708 // Fonts
709 int current_font;
710 XFontStruct *largefont, *mediumfont, *smallfont;
712 // Must be void so users don't need to include the wrong libpng version.
713 void *largefont_xft, *mediumfont_xft, *smallfont_xft;
716 int64_t current_color;
717 // Coordinate of drag start
718 int drag_x, drag_y;
719 // Boundaries the cursor must pass to start a drag
720 int drag_x1, drag_x2, drag_y1, drag_y2;
721 // Dragging is specific to the subwindow
722 int is_dragging;
723 // Don't delete the background pixmap
724 int shared_bg_pixmap;
725 char title[BCTEXTLEN];
727 // X Window parameters
728 int screen;
729 Window rootwin;
730 // windows previous events happened in
731 Window event_win, drag_win;
732 Visual *vis;
733 Colormap cmap;
734 // Display for all synchronous operations
735 Display *display;
736 // Display to send events on
737 Display *event_display;
738 Window win;
739 #ifdef HAVE_GL
740 // The first context to be created and the one whose texture id
741 // space is shared with the other contexts.
742 GLXContext gl_win_context;
743 #endif
744 int window_lock;
745 GC gc;
746 // Depth given by the X Server
747 int default_depth;
748 Atom DelWinXAtom;
749 Atom ProtoXAtom;
750 Atom RepeaterXAtom;
751 Atom SetDoneXAtom;
752 // Number of times start_hourglass was called
753 int hourglass_total;
754 // Cursor set by last set_cursor which wasn't an hourglass or transparent.
755 int current_cursor;
756 // If hourglass overrides current cursor. Only effective in top level.
757 int is_hourglass;
758 // If transparent overrides all cursors. Only effective in subwindow.
759 int is_transparent;
760 Cursor arrow_cursor;
761 Cursor cross_cursor;
762 Cursor ibeam_cursor;
763 Cursor vseparate_cursor;
764 Cursor hseparate_cursor;
765 Cursor move_cursor;
766 Cursor temp_cursor;
767 Cursor left_cursor;
768 Cursor right_cursor;
769 Cursor upright_arrow_cursor;
770 Cursor upleft_resize_cursor;
771 Cursor upright_resize_cursor;
772 Cursor downleft_resize_cursor;
773 Cursor downright_resize_cursor;
774 Cursor hourglass_cursor;
775 Cursor transparent_cursor;
777 int xvideo_port_id;
778 ArrayList<BC_ResizeCall*> resize_history;
779 // Back buffer
780 BC_Pixmap *pixmap;
781 // Background tile if tiled
782 BC_Pixmap *bg_pixmap;
783 // Icon
784 BC_Popup *icon_window;
785 BC_Pixmap *icon_pixmap;
786 // Temporary
787 BC_Bitmap *temp_bitmap;
788 // Clipboard
789 BC_Clipboard *clipboard;
790 #ifdef HAVE_LIBXXF86VM
791 // Mode switch information.
792 int vm_switched;
793 XF86VidModeModeInfo orig_modeline;
794 #endif
796 // Common events coming from X server and repeater.
797 ArrayList<XEvent*> common_events;
798 // Locks for common events
799 // Locking order:
800 // 1) event_condition
801 // 2) event_lock
802 Mutex *event_lock;
803 Condition *event_condition;
804 BC_WindowEvents *event_thread;
805 int is_deleting;
806 // Hide cursor when video is enabled
807 Timer *cursor_timer;
808 // unique ID of window.
809 int id;
814 #endif