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