r854: Merge 2.1:
[cinelerra_cv/ct.git] / guicast / bcresources.h
bloba09b85ce48056c7bf3a1b5f50864d5b09a23c7a1
1 #ifndef BCRESOURCES_H
2 #define BCRESOURCES_H
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"
17 #include "vframe.inc"
19 #include <X11/Xlib.h>
21 typedef struct
23 char *suffix;
24 int icon_type;
25 } suffix_to_type_t;
29 class BC_Resources
31 public:
32 BC_Resources(); // The window parameter is used to get the display information initially
33 ~BC_Resources();
35 int initialize_display(BC_WindowBase *window);
37 // Get unique ID
38 int get_id();
39 int get_bg_color(); // window backgrounds
40 int get_bg_shadow1(); // border for windows
41 int get_bg_shadow2();
42 int get_bg_light1();
43 int get_bg_light2();
44 // Get window border size created by window manager
45 int get_top_border();
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);
53 // Pointer to signal handler class to run after ipc
54 static BC_Signals *signal_handler;
56 // These values should be changed before the first window is created.
57 // colors
58 int bg_color; // window backgrounds
59 int bg_shadow1; // border for windows
60 int bg_shadow2;
61 int bg_light1;
62 int bg_light2;
63 int default_text_color;
64 int disabled_text_color;
67 // beveled box colors
68 int button_light;
69 int button_highlighted;
70 int button_down;
71 int button_up;
72 int button_shadow;
73 int button_uphighlighted;
75 // highlighting
76 int highlight_inverse;
78 // 3D box colors for menus
79 int menu_light;
80 int menu_highlighted;
81 int menu_down;
82 int menu_up;
83 int menu_shadow;
84 // If these are nonzero, they override the menu backgrounds.
85 VFrame *menu_popup_bg;
86 VFrame **menu_title_bg;
87 VFrame *menu_bar_bg;
88 VFrame **popupmenu_images;
90 // Minimum menu width
91 int min_menu_w;
92 // Menu bar text color
93 int menu_title_text;
94 // color of popup title
95 int popup_title_text;
96 // Right and left margin for text not including triangle space.
97 int popupmenu_margin;
98 // Right margin for triangle not including text margin.
99 int popupmenu_triangle_margin;
100 // color for item text
101 int menu_item_text;
102 // Override the menu item background if nonzero.
103 VFrame **menu_item_bg;
106 // color for progress text
107 int progress_text;
110 int menu_highlighted_fontcolor;
112 // ms for double click
113 long double_click;
114 // ms for cursor flash
115 int blink_rate;
116 // ms for scroll repeats
117 int scroll_repeat;
118 // ms before tooltip
119 int tooltip_delay;
120 int tooltip_bg_color;
121 int tooltips_enabled;
123 int audiovideo_color;
125 // default color of text
126 int text_default;
127 // background color of textboxes and list boxes
128 int text_border1;
129 int text_border2;
130 int text_border2_hi;
131 int text_background;
132 int text_background_hi;
133 int text_background_noborder_hi;
134 int text_border3;
135 int text_border3_hi;
136 int text_border4;
137 int text_highlight;
138 int text_inactive_highlight;
139 // Not used
140 int text_background_noborder;
142 // Optional background for highlighted text in toggle
143 VFrame *toggle_highlight_bg;
144 int toggle_text_margin;
146 // Background images
147 static VFrame *bg_image;
148 static VFrame *menu_bg;
150 // Buttons
151 VFrame **ok_images;
152 VFrame **cancel_images;
153 VFrame **filebox_text_images;
154 VFrame **filebox_icons_images;
155 VFrame **filebox_updir_images;
156 VFrame **filebox_newfolder_images;
157 VFrame **filebox_descend_images;
158 VFrame **filebox_delete_images;
159 VFrame **filebox_reload_images;
161 // Generic button images
162 VFrame **generic_button_images;
163 // Generic button text margin
164 int generic_button_margin;
165 VFrame **usethis_button_images;
167 // Toggles
168 VFrame **checkbox_images;
169 VFrame **radial_images;
170 VFrame **label_images;
172 VFrame **tumble_data;
173 int tumble_duration;
175 // Horizontal bar
176 VFrame *bar_data;
178 // Listbox
179 VFrame *listbox_bg;
180 VFrame **listbox_button;
181 VFrame **listbox_expand;
182 VFrame **listbox_column;
183 VFrame *listbox_up;
184 VFrame *listbox_dn;
185 // Margin for titles in addition to listbox border
186 int listbox_title_margin;
187 int listbox_title_color;
188 int listbox_title_hotspot;
189 int listbox_border1;
190 int listbox_border2_hi;
191 int listbox_border2;
192 int listbox_border3_hi;
193 int listbox_border3;
194 int listbox_border4;
195 // Selected row color
196 int listbox_selected;
197 // Highlighted row color
198 int listbox_highlighted;
199 // Inactive row color
200 int listbox_inactive;
201 // Default text color
202 int listbox_text;
205 // Sliders
206 VFrame **horizontal_slider_data;
207 VFrame **vertical_slider_data;
208 VFrame **hscroll_data;
210 VFrame **vscroll_data;
211 // Minimum pixels in handle
212 int scroll_minhandle;
214 // Pans
215 VFrame **pan_data;
216 int pan_text_color;
218 // Pots
219 VFrame **pot_images;
220 int pot_x1, pot_y1, pot_r;
221 // Amount of deflection of pot when down
222 int pot_offset;
223 int pot_needle_color;
225 // Meters
226 VFrame **xmeter_images, **ymeter_images;
227 int meter_font;
228 int meter_font_color;
229 int meter_title_w;
230 int meter_3d;
232 // Progress bar
233 VFrame **progress_images;
235 // Motion required to start a drag
236 int drag_radius;
238 // Filebox
239 static suffix_to_type_t suffix_to_type[TOTAL_SUFFIXES];
240 static VFrame *type_to_icon[TOTAL_ICONS];
241 // Display mode for fileboxes
242 int filebox_mode;
243 // Filter currently used in filebox
244 char filebox_filter[BCTEXTLEN];
245 // History of submitted files
246 char filebox_history[FILEBOX_HISTORY_SIZE][BCTEXTLEN];
247 // filebox size
248 int filebox_w;
249 int filebox_h;
250 // Column types for filebox
251 int filebox_columntype[FILEBOX_COLUMNS];
252 int filebox_columnwidth[FILEBOX_COLUMNS];
253 int filebox_sortcolumn;
254 int filebox_sortorder;
255 // Column types for filebox in directory mode
256 int dirbox_columntype[FILEBOX_COLUMNS];
257 int dirbox_columnwidth[FILEBOX_COLUMNS];
258 int dirbox_sortcolumn;
259 int dirbox_sortorder;
260 // Bottom margin between list and window
261 int filebox_margin;
262 int dirbox_margin;
263 int directory_color;
264 int file_color;
267 // fonts
268 static char *large_font;
269 static char *medium_font;
270 static char *small_font;
271 // Backup of fonts in case the first choices don't exist
272 static char *large_font2;
273 static char *medium_font2;
274 static char *small_font2;
276 static char *large_fontset;
277 static char *medium_fontset;
278 static char *small_fontset;
280 static char *large_font_xft;
281 static char *medium_font_xft;
282 static char *small_font_xft;
284 VFrame **medium_7segment;
286 //clock
287 int draw_clock_background;
289 int use_fontset;
290 // This must be constitutive since applications access the private members here.
291 int use_xft;
295 // Available display extensions
296 int use_shm;
297 static int error;
298 // If the program uses recursive_resizing
299 int recursive_resizing;
300 // Work around X server bugs
301 int use_xvideo;
303 private:
304 // Test for availability of shared memory pixmaps
305 int init_shm(BC_WindowBase *window);
306 void init_sizes(BC_WindowBase *window);
307 static int x_error_handler(Display *display, XErrorEvent *event);
308 BC_DisplayInfo *display_info;
309 VFrame **list_pointers[100];
310 int list_lengths[100];
311 int list_total;
313 Mutex *id_lock;
315 BC_Synchronous *synchronous;
317 int id;
321 #endif