r854: Merge 2.1:
[cinelerra_cv/ct.git] / guicast / bcwindowbase.h
blobeeecf27bfab8d3a3388062c3c7d4ac0eda8bc930
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 int flash(int x, int y, int w, int h, int flush = 1);
189 int flash(int flush = 1);
190 void flush();
191 void sync_display();
192 // Lock out other threads
193 int lock_window(char *location = 0);
194 int unlock_window();
195 int get_window_lock();
197 BC_MenuBar* add_menubar(BC_MenuBar *menu_bar);
198 BC_WindowBase* add_subwindow(BC_WindowBase *subwindow);
199 BC_WindowBase* add_tool(BC_WindowBase *subwindow);
200 BC_WidgetGrid* add_widgetgrid(BC_WidgetGrid *widgetgrid);
203 static BC_Resources* get_resources();
204 // User must create synchronous object first
205 static BC_Synchronous* get_synchronous();
207 // Dimensions
208 virtual int get_w();
209 virtual int get_h();
210 virtual int get_x();
211 virtual int get_y();
212 virtual int reposition_widgets(){ printf("foo1"); return 0; }
213 int get_root_w(int ignore_dualhead = 0, int lock_display = 0);
214 int get_root_h(int lock_display);
215 // Get current position
216 int get_abs_cursor_x(int lock_window);
217 int get_abs_cursor_y(int lock_window);
218 int get_relative_cursor_x();
219 int get_relative_cursor_y();
220 // Return 1 if cursor is over an unobscured part of this window.
221 // An argument is provided for excluding a drag popup
222 int get_cursor_over_window();
223 // For traversing windows... return 1 if this or any subwindow is win
224 int match_window(Window win);
226 // 1 or 0 if a button is down
227 int get_button_down();
228 // Number of button pressed 1 - 5
229 int get_buttonpress();
230 int get_has_focus();
231 int get_dragging();
232 int get_keypress();
233 // Get cursor position of last event
234 int get_cursor_x();
235 int get_cursor_y();
236 // Cursor position of drag start
237 int get_drag_x();
238 int get_drag_y();
239 int relative_cursor_x(BC_WindowBase *pov);
240 int relative_cursor_y(BC_WindowBase *pov);
241 int alt_down();
242 int shift_down();
243 int ctrl_down();
244 int get_double_click();
245 // Bottom right corner
246 int get_x2();
247 int get_y2();
248 int get_bg_color();
249 BC_Pixmap* get_bg_pixmap();
250 int get_text_ascent(int font);
251 int get_text_descent(int font);
252 int get_text_height(int font, char *text = 0);
253 int get_text_width(int font, char *text, int length = -1);
254 BC_Clipboard* get_clipboard();
255 void set_dragging(int value);
256 int set_w(int w);
257 int set_h(int h);
258 BC_WindowBase* get_top_level();
259 BC_WindowBase* get_parent();
260 // Event happened in this window
261 int is_event_win();
262 int cursor_inside();
263 // Deactivate everything and activate this subwindow
264 virtual int activate();
265 // Deactivate this subwindow
266 virtual int deactivate();
267 void set_active_subwindow(BC_WindowBase *subwindow);
268 // Get value of toggle value when dragging a selection
269 int get_toggle_value();
270 // Get if toggle is being dragged
271 int get_toggle_drag();
273 // Set the gc to the color
274 void set_color(int64_t color);
275 int get_bgcolor();
276 void set_font(int font);
277 // Set the cursor to a macro from cursors.h
278 // Set override if the caller is enabling hourglass or hiding the cursor
279 void set_cursor(int cursor, int override = 0);
280 // Set the cursor to a character in the X cursor library. Used by test.C
281 void set_x_cursor(int cursor);
282 int get_cursor();
283 // Shows the cursor after it's hidden by video playback
284 void unhide_cursor();
285 // Called by video updating routines to hide the cursor after a timeout
286 void update_video_cursor();
288 // Entry point for starting hourglass.
289 // Converts all cursors and saves the previous cursor.
290 void start_hourglass();
291 void stop_hourglass();
293 // Recursive part of hourglass commands.
294 void start_hourglass_recursive();
295 void stop_hourglass_recursive();
297 // Drawing
298 void copy_area(int x1, int y1, int x2, int y2, int w, int h, BC_Pixmap *pixmap = 0);
299 void clear_box(int x, int y, int w, int h, BC_Pixmap *pixmap = 0);
300 void draw_box(int x, int y, int w, int h, BC_Pixmap *pixmap = 0);
301 void draw_circle(int x, int y, int w, int h, BC_Pixmap *pixmap = 0);
302 void draw_disc(int x, int y, int w, int h, BC_Pixmap *pixmap = 0);
303 void draw_text(int x, int y, char *text, int length = -1, BC_Pixmap *pixmap = 0);
304 void draw_center_text(int x, int y, char *text, int length = -1);
305 void draw_line(int x1, int y1, int x2, int y2, BC_Pixmap *pixmap = 0);
306 void draw_polygon(ArrayList<int> *x, ArrayList<int> *y, BC_Pixmap *pixmap = 0);
307 void draw_rectangle(int x, int y, int w, int h);
308 void draw_3segment(int x,
309 int y,
310 int w,
311 int h,
312 BC_Pixmap *left_image,
313 BC_Pixmap *mid_image,
314 BC_Pixmap *right_image,
315 BC_Pixmap *pixmap = 0);
316 void draw_3segment(int x,
317 int y,
318 int w,
319 int h,
320 VFrame *left_image,
321 VFrame *mid_image,
322 VFrame *right_image,
323 BC_Pixmap *pixmap = 0);
324 // For drawing a changing level
325 void draw_3segmenth(int x,
326 int y,
327 int w,
328 int total_x,
329 int total_w,
330 VFrame *image,
331 BC_Pixmap *pixmap);
332 void draw_3segmenth(int x,
333 int y,
334 int w,
335 int total_x,
336 int total_w,
337 BC_Pixmap *src,
338 BC_Pixmap *dst = 0);
339 void draw_3segmentv(int x,
340 int y,
341 int h,
342 int total_y,
343 int total_h,
344 BC_Pixmap *src,
345 BC_Pixmap *dst = 0);
346 void draw_3segmentv(int x,
347 int y,
348 int h,
349 int total_y,
350 int total_h,
351 VFrame *src,
352 BC_Pixmap *dst = 0);
353 // For drawing a single level
354 void draw_3segmenth(int x,
355 int y,
356 int w,
357 VFrame *image,
358 BC_Pixmap *pixmap = 0);
359 void draw_3segmenth(int x,
360 int y,
361 int w,
362 BC_Pixmap *src,
363 BC_Pixmap *dst = 0);
364 void draw_3segmentv(int x,
365 int y,
366 int h,
367 BC_Pixmap *src,
368 BC_Pixmap *dst = 0);
369 void draw_3segmentv(int x,
370 int y,
371 int h,
372 VFrame *src,
373 BC_Pixmap *dst = 0);
374 void draw_9segment(int x,
375 int y,
376 int w,
377 int h,
378 VFrame *src,
379 BC_Pixmap *dst = 0);
380 void draw_9segment(int x,
381 int y,
382 int w,
383 int h,
384 BC_Pixmap *src,
385 BC_Pixmap *dst = 0);
386 void draw_3d_box(int x,
387 int y,
388 int w,
389 int h,
390 int light1,
391 int light2,
392 int middle,
393 int shadow1,
394 int shadow2,
395 BC_Pixmap *pixmap = 0);
396 void draw_3d_border(int x, int y, int w, int h,
397 int light1, int light2, int shadow1, int shadow2);
398 void draw_colored_box(int x, int y, int w, int h, int down, int highlighted);
399 void draw_check(int x, int y);
400 void draw_triangle_down_flat(int x, int y, int w, int h);
401 void draw_triangle_up(int x, int y, int w, int h,
402 int light1, int light2, int middle, int shadow1, int shadow2);
403 void draw_triangle_down(int x, int y, int w, int h,
404 int light1, int light2, int middle, int shadow1, int shadow2);
405 void draw_triangle_left(int x, int y, int w, int h,
406 int light1, int light2, int middle, int shadow1, int shadow2);
407 void draw_triangle_right(int x, int y, int w, int h,
408 int light1, int light2, int middle, int shadow1, int shadow2);
409 // Set the gc to opaque
410 void set_opaque();
411 void set_inverse();
412 void set_background(VFrame *bitmap);
413 // Change the window title. The title is translated internally.
414 void set_title(char *text);
415 char* get_title();
416 void start_video();
417 void stop_video();
418 int get_id();
419 void set_done(int return_value);
420 // Get a bitmap to draw on the window with
421 BC_Bitmap* new_bitmap(int w, int h, int color_model = -1);
422 // Draw a bitmap on the window
423 void draw_bitmap(BC_Bitmap *bitmap,
424 int dont_wait,
425 int dest_x = 0,
426 int dest_y = 0,
427 int dest_w = 0,
428 int dest_h = 0,
429 int src_x = 0,
430 int src_y = 0,
431 int src_w = 0,
432 int src_h = 0,
433 BC_Pixmap *pixmap = 0);
434 void draw_pixel(int x, int y, BC_Pixmap *pixmap = 0);
435 // Draw a pixmap on the window
436 void draw_pixmap(BC_Pixmap *pixmap,
437 int dest_x = 0,
438 int dest_y = 0,
439 int dest_w = -1,
440 int dest_h = -1,
441 int src_x = 0,
442 int src_y = 0,
443 BC_Pixmap *dst = 0);
444 // Draw a vframe on the window
445 void draw_vframe(VFrame *frame,
446 int dest_x = 0,
447 int dest_y = 0,
448 int dest_w = -1,
449 int dest_h = -1,
450 int src_x = 0,
451 int src_y = 0,
452 int src_w = 0,
453 int src_h = 0,
454 BC_Pixmap *pixmap = 0);
455 void draw_border(char *text, int x, int y, int w, int h);
456 // Draw a region of the background
457 void draw_top_background(BC_WindowBase *parent_window, int x, int y, int w, int h, BC_Pixmap *pixmap = 0);
458 void draw_top_tiles(BC_WindowBase *parent_window, int x, int y, int w, int h);
459 void draw_background(int x, int y, int w, int h);
460 void draw_tiles(BC_Pixmap *tile,
461 int origin_x,
462 int origin_y,
463 int x,
464 int y,
465 int w,
466 int h);
467 void slide_left(int distance);
468 void slide_right(int distance);
469 void slide_up(int distance);
470 void slide_down(int distance);
472 int cycle_textboxes(int amount);
474 int raise_window(int do_flush = 1);
475 int set_tooltips(int tooltips_enabled);
476 int resize_window(int w, int h);
477 int reposition_widget(int x, int y, int w = -1, int h = -1);
478 int reposition_window(int x, int y, int w = -1, int h = -1);
479 // Cause a repeat event to be dispatched every duration.
480 // duration is milliseconds
481 int set_repeat(int64_t duration);
482 // Stop a repeat event from being dispatched.
483 int unset_repeat(int64_t duration);
484 int set_tooltip(char *text);
485 int show_tooltip(int w = -1, int h = -1);
486 int hide_tooltip();
487 int set_icon(VFrame *data);
488 int load_defaults(BC_Hash *defaults);
489 int save_defaults(BC_Hash *defaults);
491 #ifdef HAVE_LIBXXF86VM
492 // Mode switch methods.
493 void closest_vm(int *vm, int *width, int *height);
494 void scale_vm(int vm);
495 void restore_vm();
496 #endif
499 int test_keypress;
502 private:
503 // Create a window
504 virtual int create_window(BC_WindowBase *parent_window,
505 char *title,
506 int x,
507 int y,
508 int w,
509 int h,
510 int minw,
511 int minh,
512 int allow_resize,
513 int private_color,
514 int hide,
515 int bg_color,
516 char *display_name,
517 int window_type,
518 BC_Pixmap *bg_pixmap,
519 int group_it);
521 static Display* init_display(char *display_name);
522 // Get display from top level
523 Display* get_display();
524 int get_screen();
525 virtual int initialize();
526 int get_atoms();
527 void init_cursors();
528 int init_colors();
529 int init_window_shape();
530 static int evaluate_color_model(int client_byte_order, int server_byte_order, int depth);
531 int create_private_colors();
532 int create_color(int color);
533 int create_shared_colors();
534 // Get width of a single line. Used by get_text_width
535 int get_single_text_width(int font, char *text, int length);
536 int allocate_color_table();
537 int init_gc();
538 int init_fonts();
539 int get_color_rgb8(int color);
540 int64_t get_color_rgb16(int color);
541 int64_t get_color_bgr16(int color);
542 int64_t get_color_bgr24(int color);
543 XFontStruct* get_font_struct(int font);
544 #ifdef HAVE_XFT
545 XftFont* get_xft_struct(int font);
546 #endif
547 Cursor get_cursor_struct(int cursor);
548 XFontSet get_fontset(int font);
549 XFontSet get_curr_fontset(void);
550 void set_fontset(int font);
551 int dispatch_event();
553 int get_key_masks(XEvent *event);
555 int trigger_tooltip();
556 int untrigger_tooltip();
557 void draw_tooltip();
558 int arm_repeat(int64_t duration);
559 // delete all repeater opjects for a close
560 int unset_all_repeaters();
562 // Block and get event from common events.
563 XEvent* get_event();
564 // Return number of events in table.
565 int get_event_count();
566 // Put event in common events.
567 void put_event(XEvent *event);
569 // Recursive event dispatchers
570 int dispatch_resize_event(int w, int h);
571 int dispatch_focus_in();
572 int dispatch_focus_out();
573 int dispatch_motion_event();
574 int dispatch_keypress_event();
575 int dispatch_repeat_event(int64_t duration);
576 int dispatch_repeat_event_master(int64_t duration);
577 int dispatch_button_press();
578 int dispatch_button_release();
579 int dispatch_cursor_leave();
580 int dispatch_cursor_enter();
581 int dispatch_translation_event();
582 int dispatch_drag_start();
583 int dispatch_drag_motion();
584 int dispatch_drag_stop();
585 int dispatch_expose_event();
587 // Get the port ID for a color model or return -1 for failure
588 int grab_port_id(BC_WindowBase *window, int color_model);
590 int find_next_textbox(BC_WindowBase **first_textbox, BC_WindowBase **next_textbox, int &result);
591 int find_prev_textbox(BC_WindowBase **last_textbox, BC_WindowBase **prev_textbox, int &result);
594 void translate_coordinates(Window src_w,
595 Window dest_w,
596 int src_x,
597 int src_y,
598 int *dest_x_return,
599 int *dest_y_return);
601 // Top level window above this window
602 BC_WindowBase* top_level;
603 // Window just above this window
604 BC_WindowBase* parent_window;
605 // list of window bases in this window
606 BC_SubWindowList* subwindows;
607 // list of window bases in this window
608 BC_WidgetGridList* widgetgrids;
609 // Position of window
610 int x, y, w, h;
611 // Default colors
612 int light1, light2, medium, dark1, dark2, bg_color;
613 // Type of window defined above
614 int window_type;
615 // Pointer to the active menubar in the window.
616 BC_MenuBar* active_menubar;
617 // pointer to the active popup menu in the window
618 BC_PopupMenu* active_popup_menu;
619 // pointer to the active subwindow
620 BC_WindowBase* active_subwindow;
622 // Window parameters
623 int allow_resize;
624 int hidden, private_color, bits_per_pixel, color_model;
625 int server_byte_order, client_byte_order;
626 // number of colors in color table
627 int total_colors;
628 // last color found in table
629 int current_color_value, current_color_pixel;
630 // table for every color allocated
631 int color_table[256][2];
632 // Turn on optimization
633 int video_on;
634 // Event handler completion
635 int done;
636 // Return value of event handler
637 int return_value;
638 // Motion event compression
639 int motion_events, last_motion_x, last_motion_y;
640 // window of buffered motion
641 Window last_motion_win;
642 // Resize event compression
643 int resize_events, last_resize_w, last_resize_h;
644 int translation_events, last_translate_x, last_translate_y;
645 int prev_x, prev_y;
646 // Since the window manager automatically translates the window at boot,
647 // use the first translation event to get correction factors
648 int translation_count;
649 int x_correction, y_correction;
650 // Key masks
651 int ctrl_mask, shift_mask, alt_mask;
652 // Cursor motion information
653 int cursor_x, cursor_y;
654 // Button status information
655 int button_down, button_number;
656 // When button was pressed and whether it qualifies as a double click
657 uint64_t button_time1, button_time2;
658 int double_click;
659 // Which button is down. 1, 2, 3, 4, 5
660 int button_pressed;
661 // Last key pressed
662 int key_pressed;
663 // During a selection drag involving toggles, set the same value for each toggle
664 int toggle_value;
665 int toggle_drag;
666 // Whether the window has the focus
667 int has_focus;
669 static BC_Resources resources;
670 // Array of repeaters for multiple repeating objects.
671 ArrayList<BC_Repeater*> repeaters;
672 // int64_t next_repeat_id;
673 // Text for tooltip if one exists
674 char tooltip_text[BCTEXTLEN];
675 // If the current window's tooltip is visible
676 int tooltip_on;
677 // Repeat ID of tooltip
678 // int64_t tooltip_id;
679 // Popup window for tooltip
680 BC_Popup *tooltip_popup;
681 // If this subwindow has already shown a tooltip since the last EnterNotify
682 int tooltip_done;
683 // If the tooltip shouldn't be hidden
684 int persistant_tooltip;
688 // Font sets
689 XFontSet largefontset, mediumfontset, smallfontset, curr_fontset;
691 // Fonts
692 int current_font;
693 XFontStruct *largefont, *mediumfont, *smallfont;
695 // Xft
696 // XftDraw *xft_drawable;
697 // XftFont *largefont_xft, *mediumfont_xft, *smallfont_xft;
698 // Must be void so users don't need to include the wrong libpng version.
699 void *xft_drawable;
700 void *largefont_xft, *mediumfont_xft, *smallfont_xft;
703 int64_t current_color;
704 // Coordinate of drag start
705 int drag_x, drag_y;
706 // Boundaries the cursor must pass to start a drag
707 int drag_x1, drag_x2, drag_y1, drag_y2;
708 // Dragging is specific to the subwindow
709 int is_dragging;
710 // Don't delete the background pixmap
711 int shared_bg_pixmap;
712 char title[BCTEXTLEN];
714 // X Window parameters
715 int screen;
716 Window rootwin;
717 // windows previous events happened in
718 Window event_win, drag_win;
719 Visual *vis;
720 Colormap cmap;
721 // Display for all synchronous operations
722 Display *display;
723 // Display to send events on
724 Display *event_display;
725 Window win;
726 #ifdef HAVE_GL
727 // The first context to be created and the one whose texture id
728 // space is shared with the other contexts.
729 GLXContext gl_win_context;
730 #endif
731 int window_lock;
732 GC gc;
733 // Depth given by the X Server
734 int default_depth;
735 Atom DelWinXAtom;
736 Atom ProtoXAtom;
737 Atom RepeaterXAtom;
738 Atom SetDoneXAtom;
739 // Number of times start_hourglass was called
740 int hourglass_total;
741 // Cursor set by last set_cursor which wasn't an hourglass or transparent.
742 int current_cursor;
743 // If hourglass overrides current cursor. Only effective in top level.
744 int is_hourglass;
745 // If transparent overrides all cursors. Only effective in subwindow.
746 int is_transparent;
747 Cursor arrow_cursor;
748 Cursor cross_cursor;
749 Cursor ibeam_cursor;
750 Cursor vseparate_cursor;
751 Cursor hseparate_cursor;
752 Cursor move_cursor;
753 Cursor temp_cursor;
754 Cursor left_cursor;
755 Cursor right_cursor;
756 Cursor upright_arrow_cursor;
757 Cursor upleft_resize_cursor;
758 Cursor upright_resize_cursor;
759 Cursor downleft_resize_cursor;
760 Cursor downright_resize_cursor;
761 Cursor hourglass_cursor;
762 Cursor transparent_cursor;
764 int xvideo_port_id;
765 ArrayList<BC_ResizeCall*> resize_history;
766 // Back buffer
767 BC_Pixmap *pixmap;
768 // Background tile if tiled
769 BC_Pixmap *bg_pixmap;
770 // Icon
771 BC_Popup *icon_window;
772 BC_Pixmap *icon_pixmap;
773 // Temporary
774 BC_Bitmap *temp_bitmap;
775 // Clipboard
776 BC_Clipboard *clipboard;
777 #ifdef HAVE_LIBXXF86VM
778 // Mode switch information.
779 int vm_switched;
780 XF86VidModeModeInfo orig_modeline;
781 #endif
783 // Common events coming from X server and repeater.
784 ArrayList<XEvent*> common_events;
785 // Locks for common events
786 // Locking order:
787 // 1) event_condition
788 // 2) event_lock
789 Mutex *event_lock;
790 Condition *event_condition;
791 BC_WindowEvents *event_thread;
792 int is_deleting;
793 // Hide cursor when video is enabled
794 Timer *cursor_timer;
795 // unique ID of window.
796 int id;
801 #endif