uconf.hpp

00001 /* ==================================================== ======== ======= *
00002 *
00003 *  uconf.hpp : configuration of the UAppli
00004 *  Ubit Project
00005 *  Author: Eric Lecolinet
00006 *  Part of the Ubit Toolkit: A Brick Construction Game Model for Creating GUIs
00007 *  (C) 1999-2006 / EricLecolinet / ENST Paris / http://www.enst.fr/~elc/ubit
00008 *
00009 * ***********************************************************************
00010 * COPYRIGHT NOTICE :
00011 * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE
00012 * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
00013 * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU
00014 * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION;
00015 * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
00016 * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
00017 * ***********************************************************************
00018 * ==================================================== [(c)Elc] ======= *
00019 * ==================================================== ======== ======= */
00020 
00021 #ifndef _uconf_hpp_
00022 #define _uconf_hpp_
00023 //pragma ident  "@(#)uconf.hpp  ubit:05.05.00"
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   // mouse buttons
00199 
00200   int
00201     mouse_select_button,
00203 
00204     mouse_menu_button,
00206 
00207     mouse_alt_button;
00212   int click_radius;  // (pas unsigned, les dist ne le sont jamais)
00214 
00215   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00216   // delays
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   // - impl. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 /* ==================================================== [TheEnd] ======= */
00261 /* ==================================================== [(c)Elc] ======= */

Generated on Mon Jan 29 00:20:37 2007 for Ubit by  doxygen 1.4.7