Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

uconf.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  uconf.hpp : configuration of the UAppli
00004  *  Ubit Project  [Elc][2003]
00005  *  Author: Eric Lecolinet
00006  *
00007  *  Part of the Ubit Toolkit: A Brick Construction Game Model for Creating GUIs
00008  *
00009  *  (C) 1999-2003 Eric Lecolinet @ ENST Paris
00010  *  WWW: http://www.enst.fr/~elc/ubit   Email: elc@enst.fr (subject: ubit)
00011  *
00012  * ***********************************************************************
00013  * COPYRIGHT NOTICE : 
00014  * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE 
00015  * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 
00016  * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU 
00017  * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; 
00018  * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
00019  * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
00020  * ***********************************************************************
00021  *
00022  * ==================================================== [Elc:03] ======= *
00023  * ==================================================== ======== ======= */
00024 
00025 #ifndef _uconf_hpp_
00026 #define _uconf_hpp_
00027 //pragma ident  "@(#)uconf.hpp  ubit:03.06.04"
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;  // not impl
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 /* ==================================================== [TheEnd] ======= */
00170 /* ==================================================== [Elc:03] ======= */

Generated on Thu May 19 12:40:16 2005 for Ubit[Eric.Lecolinet@enst.fr] by  doxygen 1.4.2