00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _uconf_hpp_
00022 #define _uconf_hpp_
00023
00024 #include <ubit/ustr.hpp>
00025 #include <ubit/ufont.hpp>
00026 namespace ubit {
00027
00028
00055 struct UOption {
00056 const char *begname, *endname;
00057 class UOptionArg* arg;
00058
00059 static class UOptionArg* Arg(bool& val);
00060 static class UOptionArg* Arg(int& val);
00061 static class UOptionArg* Arg(float& val);
00062 static class UOptionArg* Arg(UStr& val);
00063 static class UOptionArg* Arg(char*& val);
00064 static class UOptionArg* Arg(const char*& val);
00065 static void parseOptions(int& argc, char** argv, UOption* options);
00066 };
00067
00068
00071 class UConf {
00072 public:
00073 UConf();
00074 virtual ~UConf();
00075
00076 virtual void parseOptions(int& argc, char** argv, UOption* options);
00085 virtual void readProperties(const char* pathname);
00110 UProps* getProps(const char* category);
00112
00113 virtual void printHelp();
00115
00116
00117
00118 void useX11();
00119 void useGL();
00120 void use3D();
00129 void useGLRender() {useGL();}
00130
00131 void setBpp(int);
00139 UStr locale;
00141
00142 float scale;
00144
00145 int info_level;
00147
00148 UFontFamilyConf sans_serif, serif, monospace;
00150
00151 UFont* default_font;
00153
00154 UBackground default_background;
00156
00157 UPix* unknow_image;
00159
00160 UFont* selection_font;
00161 UColor* selection_color;
00162 UColor* selection_bgcolor;
00167
00168
00169 bool
00170 xsync, usync,
00172
00173 menu_grab,
00175
00176 postpone_delete,
00178
00179 soft_dbf,
00181
00182 transp_scrollbars,
00184
00185 softwins,
00187
00188 telepointers,
00190
00191 generic_textsel,
00193
00194 linear_gamma;
00196
00197
00198
00199
00200 int
00201 mouse_select_button,
00203
00204 mouse_menu_button,
00206
00207 mouse_alt_button;
00212 int click_radius;
00214
00215
00216
00217
00218 unsigned long multi_click_delay;
00220
00221 unsigned long auto_repeat_delay;
00223
00224 unsigned long open_tip_delay;
00226
00227 unsigned long open_submenu_delay;
00229
00230 unsigned long resize_window_delay;
00232
00233
00234
00235 UStr name;
00237
00238 UStr display;
00240
00241 int filebox_width, filebox_height, filebox_line_count;
00243
00244 private:
00245 friend class UDisp;
00246 friend class UNatDisp;
00247 friend class UAppli;
00248 friend class UAppliImpl;
00249 friend class UGlpane;
00250 friend class UFrame3d;
00251
00252 virtual void parseUbitOptions(int& argc, char** argv);
00253 bool freeze_options;
00254 bool using_gl, using_3d;
00255 int bpp;
00256 };
00257
00258 }
00259 #endif
00260
00261