6 // Global objects for the user interface
11 #include "bcdisplayinfo.inc"
12 #include "bcfilebox.h"
13 #include "bcresources.inc"
14 #include "bcsignals.inc"
15 #include "bcsynchronous.inc"
16 #include "bcwindowbase.inc"
32 BC_Resources(); // The window parameter is used to get the display information initially
35 int initialize_display(BC_WindowBase
*window
);
39 int get_bg_color(); // window backgrounds
40 int get_bg_shadow1(); // border for windows
44 // Get window border size created by window manager
46 int get_left_border();
47 int get_right_border();
48 int get_bottom_border();
49 // Get synchronous thread for OpenGL
50 BC_Synchronous
* get_synchronous();
51 // Called by user after synchronous thread is created.
52 void set_synchronous(BC_Synchronous
*synchronous
);
54 static void set_signals(BC_Signals
*signal_handler
);
55 static BC_Signals
* get_signals();
57 // These values should be changed before the first window is created.
59 int bg_color
; // window backgrounds
60 int bg_shadow1
; // border for windows
64 int default_text_color
;
65 int disabled_text_color
;
70 int button_highlighted
;
74 int button_uphighlighted
;
77 int highlight_inverse
;
79 // 3D box colors for menus
85 // If these are nonzero, they override the menu backgrounds.
86 VFrame
*menu_popup_bg
;
87 VFrame
**menu_title_bg
;
89 VFrame
**popupmenu_images
;
93 // Menu bar text color
95 // color of popup title
97 // Right and left margin for text not including triangle space.
99 // Right margin for triangle not including text margin.
100 int popupmenu_triangle_margin
;
101 // color for item text
103 // Override the menu item background if nonzero.
104 VFrame
**menu_item_bg
;
107 // color for progress text
111 int menu_highlighted_fontcolor
;
113 // ms for double click
115 // ms for cursor flash
117 // ms for scroll repeats
121 int tooltip_bg_color
;
122 int tooltips_enabled
;
124 int audiovideo_color
;
126 // default color of text
128 // background color of textboxes and list boxes
133 int text_background_hi
;
134 int text_background_noborder_hi
;
139 int text_inactive_highlight
;
141 int text_background_noborder
;
143 // Optional background for highlighted text in toggle
144 VFrame
*toggle_highlight_bg
;
145 int toggle_text_margin
;
148 static VFrame
*bg_image
;
149 static VFrame
*menu_bg
;
153 VFrame
**cancel_images
;
154 VFrame
**filebox_text_images
;
155 VFrame
**filebox_icons_images
;
156 VFrame
**filebox_updir_images
;
157 VFrame
**filebox_newfolder_images
;
158 VFrame
**filebox_descend_images
;
159 VFrame
**filebox_delete_images
;
160 VFrame
**filebox_reload_images
;
162 // Generic button images
163 VFrame
**generic_button_images
;
164 // Generic button text margin
165 int generic_button_margin
;
166 VFrame
**usethis_button_images
;
169 VFrame
**checkbox_images
;
170 VFrame
**radial_images
;
171 VFrame
**label_images
;
173 VFrame
**tumble_data
;
181 VFrame
**listbox_button
;
182 VFrame
**listbox_expand
;
183 VFrame
**listbox_column
;
186 // Margin for titles in addition to listbox border
187 int listbox_title_margin
;
188 int listbox_title_color
;
189 int listbox_title_hotspot
;
191 int listbox_border2_hi
;
193 int listbox_border3_hi
;
196 // Selected row color
197 int listbox_selected
;
198 // Highlighted row color
199 int listbox_highlighted
;
200 // Inactive row color
201 int listbox_inactive
;
202 // Default text color
207 VFrame
**horizontal_slider_data
;
208 VFrame
**vertical_slider_data
;
209 VFrame
**hscroll_data
;
211 VFrame
**vscroll_data
;
212 // Minimum pixels in handle
213 int scroll_minhandle
;
221 int pot_x1
, pot_y1
, pot_r
;
222 // Amount of deflection of pot when down
224 int pot_needle_color
;
227 VFrame
**xmeter_images
, **ymeter_images
;
229 int meter_font_color
;
234 VFrame
**progress_images
;
236 // Motion required to start a drag
240 static suffix_to_type_t suffix_to_type
[TOTAL_SUFFIXES
];
241 static VFrame
*type_to_icon
[TOTAL_ICONS
];
242 // Display mode for fileboxes
244 // Filter currently used in filebox
245 char filebox_filter
[BCTEXTLEN
];
246 // History of submitted files
247 char filebox_history
[FILEBOX_HISTORY_SIZE
][BCTEXTLEN
];
251 // Column types for filebox
252 int filebox_columntype
[FILEBOX_COLUMNS
];
253 int filebox_columnwidth
[FILEBOX_COLUMNS
];
254 int filebox_sortcolumn
;
255 int filebox_sortorder
;
256 // Column types for filebox in directory mode
257 int dirbox_columntype
[FILEBOX_COLUMNS
];
258 int dirbox_columnwidth
[FILEBOX_COLUMNS
];
259 int dirbox_sortcolumn
;
260 int dirbox_sortorder
;
261 // Bottom margin between list and window
269 static char *large_font
;
270 static char *medium_font
;
271 static char *small_font
;
272 // Backup of fonts in case the first choices don't exist
273 static char *large_font2
;
274 static char *medium_font2
;
275 static char *small_font2
;
277 static char *large_fontset
;
278 static char *medium_fontset
;
279 static char *small_fontset
;
281 static char *large_font_xft
;
282 static char *medium_font_xft
;
283 static char *small_font_xft
;
285 // Backup of fonts in case the first choices don't exist
286 static char *large_font_xft2
;
287 static char *medium_font_xft2
;
288 static char *small_font_xft2
;
290 VFrame
**medium_7segment
;
293 int draw_clock_background
;
296 // This must be constitutive since applications access the private members here.
301 // Available display extensions
304 // If the program uses recursive_resizing
305 int recursive_resizing
;
306 // Work around X server bugs
308 // Seems to help if only 1 window is created at a time.
309 Mutex
*create_window_lock
;
312 // Test for availability of shared memory pixmaps
313 int init_shm(BC_WindowBase
*window
);
314 void init_sizes(BC_WindowBase
*window
);
315 static int x_error_handler(Display
*display
, XErrorEvent
*event
);
316 BC_DisplayInfo
*display_info
;
317 VFrame
**list_pointers
[100];
318 int list_lengths
[100];
323 // Pointer to signal handler class to run after ipc
324 static BC_Signals
*signal_handler
;
325 BC_Synchronous
*synchronous
;