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