00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
#ifndef _uconf_hpp_
00026
#define _uconf_hpp_
00027
00028
00029
00054 struct UOption {
00055
const char *begname, *endname;
00056
class UOptionArg* arg;
00057
00058
static class UOptionArg* Arg(
bool& val);
00059
static class UOptionArg* Arg(
int& val);
00060
static class UOptionArg* Arg(
char*& val);
00061
static class UOptionArg* Arg(
const char*& val);
00062 };
00063
00064
00067 class UConf {
00068
public:
00069
enum GraphicsEngine {X11, OGL};
00070
00071 UConf::UConf(
int& _argc,
char** _argv,
UOption* client_options = null);
00072
00073
00074
00075
const char*
disp_name;
00077
00078
const char* app_name;
00079
00080
const char*
locale;
00082
00083 enum GraphicsEngine
graphics_engine;
00085
00086
int truecolor_depth;
00098
00099
bool
00100
double_buffering,
00101 linear_gamma,
00102
transp_scrollbars,
00103
softwins,
00104
telepointers,
00105
iconic,
00106
sync,
00107
menu_grab,
00108
scrollbar_grab,
00109
force_winfocus;
00110
00111
00112
00113
class UStyle* defaultStyle;
00114 UPix*
unknown_image;
00115
00117 int app_lscale;
00118
00120 u_dim
max_app_width,
max_app_height;
00121
00122
int scrollpane_mode;
00123 u_dim scrollpane_bar_size;
00124
00125 class UWidth&
filebox_width;
00126 class UHeight&
filebox_height;
00127 int filebox_line_count;
00128
00129 u_dim mouse_click_radius;
00130 u_time
mouse_click_delay;
00131 u_time
auto_open_menu_delay;
00132
00133 class UColor*
default_selection_color;
00134 class UColor*
default_selection_bgcolor;
00135 class UFont*
default_selection_font;
00136
00137
00138
00139
float app_xyscale;
00140
00141
private:
00142
friend class UAppli;
00143
friend class UDisp;
00144
00145
struct Profile {
00146
const char* name;
00147 void (*apply)(
UConf&);
00148 Profile(
const char* _name,
void (*_apply)(
UConf&));
00149 };
00150
00151
int app_argc;
00152
char** app_argv;
00153
00154
static std::vector<UConf::Profile> profiles;
00155
static bool init;
00156
00157
UConf(
const UConf&);
00158
UConf& operator=(
const UConf&);
00159
00160
static bool initDefaultProfiles();
00161
static void addProfile(
const char* name,
void (*apply)(
UConf&));
00162
00163
bool setProfile(
const char* name);
00164
void saveArgs(
int _argc,
char** _argv);
00165
void parseOptions(
int& argc,
char** argv,
UOption* client_options);
00166 };
00167
00168
#endif
00169
00170