r956: README.BUILD - add more library recommendations
[cinelerra_cv/ct.git] / guicast / bcresources.h
blob147c1057b1b12073ad71c542dee4e85655bf01d5
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 // Set signal handler
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.
58 // colors
59 int bg_color; // window backgrounds
60 int bg_shadow1; // border for windows
61 int bg_shadow2;
62 int bg_light1;
63 int bg_light2;
64 int default_text_color;
65 int disabled_text_color;
68 // beveled box colors
69 int button_light;
70 int button_highlighted;
71 int button_down;
72 int button_up;
73 int button_shadow;
74 int button_uphighlighted;
76 // highlighting
77 int highlight_inverse;
79 // 3D box colors for menus
80 int menu_light;
81 int menu_highlighted;
82 int menu_down;
83 int menu_up;
84 int menu_shadow;
85 // If these are nonzero, they override the menu backgrounds.
86 VFrame *menu_popup_bg;
87 VFrame **menu_title_bg;
88 VFrame *menu_bar_bg;
89 VFrame **popupmenu_images;
91 // Minimum menu width
92 int min_menu_w;
93 // Menu bar text color
94 int menu_title_text;
95 // color of popup title
96 int popup_title_text;
97 // Right and left margin for text not including triangle space.
98 int popupmenu_margin;
99 // Right margin for triangle not including text margin.
100 int popupmenu_triangle_margin;
101 // color for item text
102 int menu_item_text;
103 // Override the menu item background if nonzero.
104 VFrame **menu_item_bg;
107 // color for progress text
108 int progress_text;
111 int menu_highlighted_fontcolor;
113 // ms for double click
114 long double_click;
115 // ms for cursor flash
116 int blink_rate;
117 // ms for scroll repeats
118 int scroll_repeat;
119 // ms before tooltip
120 int tooltip_delay;
121 int tooltip_bg_color;
122 int tooltips_enabled;
124 int audiovideo_color;
126 // default color of text
127 int text_default;
128 // background color of textboxes and list boxes
129 int text_border1;
130 int text_border2;
131 int text_border2_hi;
132 int text_background;
133 int text_background_hi;
134 int text_background_noborder_hi;
135 int text_border3;
136 int text_border3_hi;
137 int text_border4;
138 int text_highlight;
139 int text_inactive_highlight;
140 // Not used
141 int text_background_noborder;
143 // Optional background for highlighted text in toggle
144 VFrame *toggle_highlight_bg;
145 int toggle_text_margin;
147 // Background images
148 static VFrame *bg_image;
149 static VFrame *menu_bg;
151 // Buttons
152 VFrame **ok_images;
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;
168 // Toggles
169 VFrame **checkbox_images;
170 VFrame **radial_images;
171 VFrame **label_images;
173 VFrame **tumble_data;
174 int tumble_duration;
176 // Horizontal bar
177 VFrame *bar_data;
179 // Listbox
180 VFrame *listbox_bg;
181 VFrame **listbox_button;
182 VFrame **listbox_expand;
183 VFrame **listbox_column;
184 VFrame *listbox_up;
185 VFrame *listbox_dn;
186 // Margin for titles in addition to listbox border
187 int listbox_title_margin;
188 int listbox_title_color;
189 int listbox_title_hotspot;
190 int listbox_border1;
191 int listbox_border2_hi;
192 int listbox_border2;
193 int listbox_border3_hi;
194 int listbox_border3;
195 int listbox_border4;
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
203 int listbox_text;
206 // Sliders
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;
215 // Pans
216 VFrame **pan_data;
217 int pan_text_color;
219 // Pots
220 VFrame **pot_images;
221 int pot_x1, pot_y1, pot_r;
222 // Amount of deflection of pot when down
223 int pot_offset;
224 int pot_needle_color;
226 // Meters
227 VFrame **xmeter_images, **ymeter_images;
228 int meter_font;
229 int meter_font_color;
230 int meter_title_w;
231 int meter_3d;
233 // Progress bar
234 VFrame **progress_images;
236 // Motion required to start a drag
237 int drag_radius;
239 // Filebox
240 static suffix_to_type_t suffix_to_type[TOTAL_SUFFIXES];
241 static VFrame *type_to_icon[TOTAL_ICONS];
242 // Display mode for fileboxes
243 int filebox_mode;
244 // Filter currently used in filebox
245 char filebox_filter[BCTEXTLEN];
246 // History of submitted files
247 char filebox_history[FILEBOX_HISTORY_SIZE][BCTEXTLEN];
248 // filebox size
249 int filebox_w;
250 int filebox_h;
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
262 int filebox_margin;
263 int dirbox_margin;
264 int directory_color;
265 int file_color;
268 // fonts
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;
292 //clock
293 int draw_clock_background;
295 int use_fontset;
296 // This must be constitutive since applications access the private members here.
297 int use_xft;
301 // Available display extensions
302 int use_shm;
303 static int error;
304 // If the program uses recursive_resizing
305 int recursive_resizing;
306 // Work around X server bugs
307 int use_xvideo;
308 // Seems to help if only 1 window is created at a time.
309 Mutex *create_window_lock;
311 private:
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];
319 int list_total;
321 Mutex *id_lock;
323 // Pointer to signal handler class to run after ipc
324 static BC_Signals *signal_handler;
325 BC_Synchronous *synchronous;
327 int id;
331 #endif