00001 #ifndef BCRESOURCES_H 00002 #define BCRESOURCES_H 00003 00004 00005 00006 // Global objects for the user interface 00007 00008 00009 00010 00011 #include "bcdisplayinfo.inc" 00012 #include "bcfilebox.h" 00013 #include "bcresources.inc" 00014 #include "bcsignals.inc" 00015 #include "bcsynchronous.inc" 00016 #include "bcwindowbase.inc" 00017 #include "vframe.inc" 00018 00019 #include <X11/Xlib.h> 00020 00021 typedef struct 00022 { 00023 char *suffix; 00024 int icon_type; 00025 } suffix_to_type_t; 00026 00027 00028 00029 class BC_Resources 00030 { 00031 public: 00032 BC_Resources(); // The window parameter is used to get the display information initially 00033 ~BC_Resources(); 00034 00035 int initialize_display(BC_WindowBase *window); 00036 00037 // Get unique ID 00038 int get_id(); 00039 int get_bg_color(); // window backgrounds 00040 int get_bg_shadow1(); // border for windows 00041 int get_bg_shadow2(); 00042 int get_bg_light1(); 00043 int get_bg_light2(); 00044 // Get window border size created by window manager 00045 int get_top_border(); 00046 int get_left_border(); 00047 int get_right_border(); 00048 int get_bottom_border(); 00049 // Get synchronous thread for OpenGL 00050 BC_Synchronous* get_synchronous(); 00051 // Called by user after synchronous thread is created. 00052 void set_synchronous(BC_Synchronous *synchronous); 00053 // Set signal handler 00054 static void set_signals(BC_Signals *signal_handler); 00055 static BC_Signals* get_signals(); 00056 00057 // These values should be changed before the first window is created. 00058 // colors 00059 int bg_color; // window backgrounds 00060 int bg_shadow1; // border for windows 00061 int bg_shadow2; 00062 int bg_light1; 00063 int bg_light2; 00064 int default_text_color; 00065 int disabled_text_color; 00066 00067 00068 // beveled box colors 00069 int button_light; 00070 int button_highlighted; 00071 int button_down; 00072 int button_up; 00073 int button_shadow; 00074 int button_uphighlighted; 00075 00076 // highlighting 00077 int highlight_inverse; 00078 00079 // 3D box colors for menus 00080 int menu_light; 00081 int menu_highlighted; 00082 int menu_down; 00083 int menu_up; 00084 int menu_shadow; 00085 // If these are nonzero, they override the menu backgrounds. 00086 VFrame *menu_popup_bg; 00087 VFrame **menu_title_bg; 00088 VFrame *menu_bar_bg; 00089 VFrame **popupmenu_images; 00090 00091 // Minimum menu width 00092 int min_menu_w; 00093 // Menu bar text color 00094 int menu_title_text; 00095 // color of popup title 00096 int popup_title_text; 00097 // Right and left margin for text not including triangle space. 00098 int popupmenu_margin; 00099 // Right margin for triangle not including text margin. 00100 int popupmenu_triangle_margin; 00101 // color for item text 00102 int menu_item_text; 00103 // Override the menu item background if nonzero. 00104 VFrame **menu_item_bg; 00105 00106 00107 // color for progress text 00108 int progress_text; 00109 00110 00111 int menu_highlighted_fontcolor; 00112 00113 // ms for double click 00114 long double_click; 00115 // ms for cursor flash 00116 int blink_rate; 00117 // ms for scroll repeats 00118 int scroll_repeat; 00119 // ms before tooltip 00120 int tooltip_delay; 00121 int tooltip_bg_color; 00122 int tooltips_enabled; 00123 00124 int audiovideo_color; 00125 00126 // default color of text 00127 int text_default; 00128 // background color of textboxes and list boxes 00129 int text_border1; 00130 int text_border2; 00131 int text_border2_hi; 00132 int text_background; 00133 int text_background_hi; 00134 int text_background_noborder_hi; 00135 int text_border3; 00136 int text_border3_hi; 00137 int text_border4; 00138 int text_highlight; 00139 int text_inactive_highlight; 00140 // Not used 00141 int text_background_noborder; 00142 00143 // Optional background for highlighted text in toggle 00144 VFrame *toggle_highlight_bg; 00145 int toggle_text_margin; 00146 00147 // Background images 00148 static VFrame *bg_image; 00149 static VFrame *menu_bg; 00150 00151 // Buttons 00152 VFrame **ok_images; 00153 VFrame **cancel_images; 00154 VFrame **filebox_text_images; 00155 VFrame **filebox_icons_images; 00156 VFrame **filebox_updir_images; 00157 VFrame **filebox_newfolder_images; 00158 VFrame **filebox_descend_images; 00159 VFrame **filebox_delete_images; 00160 VFrame **filebox_reload_images; 00161 00162 // Generic button images 00163 VFrame **generic_button_images; 00164 // Generic button text margin 00165 int generic_button_margin; 00166 VFrame **usethis_button_images; 00167 00168 // Toggles 00169 VFrame **checkbox_images; 00170 VFrame **radial_images; 00171 VFrame **label_images; 00172 00173 VFrame **tumble_data; 00174 int tumble_duration; 00175 00176 // Horizontal bar 00177 VFrame *bar_data; 00178 00179 // Listbox 00180 VFrame *listbox_bg; 00181 VFrame **listbox_button; 00182 VFrame **listbox_expand; 00183 VFrame **listbox_column; 00184 VFrame *listbox_up; 00185 VFrame *listbox_dn; 00186 // Margin for titles in addition to listbox border 00187 int listbox_title_margin; 00188 int listbox_title_color; 00189 int listbox_title_hotspot; 00190 int listbox_border1; 00191 int listbox_border2_hi; 00192 int listbox_border2; 00193 int listbox_border3_hi; 00194 int listbox_border3; 00195 int listbox_border4; 00196 // Selected row color 00197 int listbox_selected; 00198 // Highlighted row color 00199 int listbox_highlighted; 00200 // Inactive row color 00201 int listbox_inactive; 00202 // Default text color 00203 int listbox_text; 00204 00205 00206 // Sliders 00207 VFrame **horizontal_slider_data; 00208 VFrame **vertical_slider_data; 00209 VFrame **hscroll_data; 00210 00211 VFrame **vscroll_data; 00212 // Minimum pixels in handle 00213 int scroll_minhandle; 00214 00215 // Pans 00216 VFrame **pan_data; 00217 int pan_text_color; 00218 00219 // Pots 00220 VFrame **pot_images; 00221 int pot_x1, pot_y1, pot_r; 00222 // Amount of deflection of pot when down 00223 int pot_offset; 00224 int pot_needle_color; 00225 00226 // Meters 00227 VFrame **xmeter_images, **ymeter_images; 00228 int meter_font; 00229 int meter_font_color; 00230 int meter_title_w; 00231 int meter_3d; 00232 00233 // Progress bar 00234 VFrame **progress_images; 00235 00236 // Motion required to start a drag 00237 int drag_radius; 00238 00239 // Filebox 00240 static suffix_to_type_t suffix_to_type[TOTAL_SUFFIXES]; 00241 static VFrame *type_to_icon[TOTAL_ICONS]; 00242 // Display mode for fileboxes 00243 int filebox_mode; 00244 // Filter currently used in filebox 00245 char filebox_filter[BCTEXTLEN]; 00246 // History of submitted files 00247 char filebox_history[FILEBOX_HISTORY_SIZE][BCTEXTLEN]; 00248 // filebox size 00249 int filebox_w; 00250 int filebox_h; 00251 // Column types for filebox 00252 int filebox_columntype[FILEBOX_COLUMNS]; 00253 int filebox_columnwidth[FILEBOX_COLUMNS]; 00254 int filebox_sortcolumn; 00255 int filebox_sortorder; 00256 // Column types for filebox in directory mode 00257 int dirbox_columntype[FILEBOX_COLUMNS]; 00258 int dirbox_columnwidth[FILEBOX_COLUMNS]; 00259 int dirbox_sortcolumn; 00260 int dirbox_sortorder; 00261 // Bottom margin between list and window 00262 int filebox_margin; 00263 int dirbox_margin; 00264 int directory_color; 00265 int file_color; 00266 00267 00268 // fonts 00269 static char *large_font; 00270 static char *medium_font; 00271 static char *small_font; 00272 // Backup of fonts in case the first choices don't exist 00273 static char *large_font2; 00274 static char *medium_font2; 00275 static char *small_font2; 00276 00277 static char *large_fontset; 00278 static char *medium_fontset; 00279 static char *small_fontset; 00280 00281 static char *large_font_xft; 00282 static char *medium_font_xft; 00283 static char *small_font_xft; 00284 00285 // Backup of fonts in case the first choices don't exist 00286 static char *large_font_xft2; 00287 static char *medium_font_xft2; 00288 static char *small_font_xft2; 00289 00290 VFrame **medium_7segment; 00291 00292 //clock 00293 int draw_clock_background; 00294 00295 int use_fontset; 00296 // This must be constitutive since applications access the private members here. 00297 int use_xft; 00298 00299 00300 00301 // Available display extensions 00302 int use_shm; 00303 static int error; 00304 // If the program uses recursive_resizing 00305 int recursive_resizing; 00306 // Work around X server bugs 00307 int use_xvideo; 00308 // Seems to help if only 1 window is created at a time. 00309 Mutex *create_window_lock; 00310 00311 private: 00312 // Test for availability of shared memory pixmaps 00313 int init_shm(BC_WindowBase *window); 00314 void init_sizes(BC_WindowBase *window); 00315 static int x_error_handler(Display *display, XErrorEvent *event); 00316 BC_DisplayInfo *display_info; 00317 VFrame **list_pointers[100]; 00318 int list_lengths[100]; 00319 int list_total; 00320 00321 Mutex *id_lock; 00322 00323 // Pointer to signal handler class to run after ipc 00324 static BC_Signals *signal_handler; 00325 BC_Synchronous *synchronous; 00326 00327 int id; 00328 }; 00329 00330 00331 #endif
1.5.5