ubit
Public Member Functions | Public Attributes | Protected Attributes | Friends | List of all members
ubit::UConf Class Reference

configuration of the UAppli. More...

#include <uconf.hpp>

Public Member Functions

void useGL (bool=true)
 specifies whether OpenGL is used for rendering graphics. More...
 
void useFreeType (bool=true)
 specifies whether FreeType is used for rendering fonts. More...
 
void setDepthBuffer (int size)
 specifies if a depth buffer should be used and the desired size. More...
 
void setStencilBuffer (int size)
 specifies if a stencil buffer should be used and the desired size. More...
 
void setBpp (int bpp)
 specifies the prefered number of Bits Per Pixels. More...
 
void setLocale (const UStr &s)
 changes the locale [default = "" meaning: use default locale].
 
void setScale (float v)
 changes the scaling factor of the whole application [default = 1].
 
void setVerbose (int v)
 set verbose mode [default = false].
 
void setDefaultBackground (const UBackground &)
 changes the default background.
 
void setTransparentScrollbars (bool)
 
virtual void printHelp ()
 prints Ubit help on cout.
 
bool isUsingGL () const
 
bool isUsingFreeType () const
 
bool isVerbose () const
 
int getVerbosity () const
 
const UStrgetLocale () const
 current locale.
 
float getScale () const
 global scale of the application.
 
int getMouseSelectButton () const
 No of the standard button [default = left btn].
 
int getMouseMenuButton () const
 No of the button that opens contextual menus [default = right btn or Ctrl-btn on the Mac].
 
int getMouseAltButton () const
 No of the alternate button [default = middle btn or Alt-btn on the Mac]. More...
 
virtual void parseOptions (int &argc, char **argv, UOption *options)
 retrieves options from the command line. More...
 
virtual void readAttributes (const char *pathname)
 retrieves attributes from a configuration file. More...
 
UAttrListgetAttributes (const char *category)
 see readAttributes().
 

Public Attributes

bool xsync
 
bool usync
 enables synchronous graphics rendering for X11 and Ubit [default: false].
 
bool menu_grab
 enables mouse grabs when opening menus [default: true].
 
bool postpone_delete
 delete operations of objects that derive from UNode are postponed until the main loop returns [default: true].
 
bool soft_dbf
 enables soft double buffering when X11 is used for rendering graphics [default: true].
 
bool soft_wins
 
bool soft_menus
 windows/menus are rendered as "soft windows" (i.e. simulated) [default: false].
 
bool transp_scrollbars
 scrollbars are transparent and superimposed [default: false].
 
bool tele_pointers
 telepointers are shown when the appli is displayed on several X servers.
 
bool generic_textsel
 any object can select text [default: false].
 
int click_radius
 
unsigned long multi_click_delay
 < UOn::mclick is not generated if the mouse if moved more than this distance. More...
 
unsigned long auto_repeat_delay
 delay (in ms) before autoRepeat becomes active (see UElem::setAutoRepeat()).
 
unsigned long open_tip_delay
 delay (in ms) before a UTip is opened.
 
unsigned long open_submenu_delay
 delay (in ms) before a cascaded UMenu is opened.
 

Protected Attributes

bool freeze_options
 
const char *const windowing_toolkit
 
bool is_using_gl
 
bool is_using_freetype
 
int bpp
 
int depth_size
 
int stencil_size
 
int verbosity
 
float scale
 
int filebox_width
 
int filebox_height
 
int filebox_line_count
 
const int & mouse_select_button
 
const int & mouse_menu_button
 
const int & mouse_alt_button
 
UStr locale
 
UStr display
 
UFontdefault_font
 
UPixunknow_image
 
UFontselection_font
 
UColorselection_color
 
UColorselection_bgcolor
 
UBackgrounddefault_background
 

Friends

class UDisp
 
class UAppli
 
class UAppliImpl
 
class UUpdateContext
 
class UEventFlow
 
class UElem
 
class UBox
 
class UWin
 
class UEdit
 
class UIma
 
class UPix
 
class UGraph
 
class UFont
 
class UFontDesc
 
class UHardFont
 
class UFilebox
 
class UGlcanvas
 
class U3Dcanvas
 

Detailed Description

configuration of the UAppli.

Member Function Documentation

§ getMouseAltButton()

int ubit::UConf::getMouseAltButton ( ) const
inline

No of the alternate button [default = middle btn or Alt-btn on the Mac].

for pasting_text, DND and scroll_to_pointed_position in scrollbars.

§ parseOptions()

void UConf::parseOptions ( int &  argc,
char **  argv,
UOption options 
)
virtual

retrieves options from the command line.

this function parses the command line (ie. argc, argv) to retrieve options that are specified in the 'options' argument which is a NULL terminated table of UOption elements:

See also
UOption for details. Note: parseOptions() is called by UAppli::UAppli() if its 'options' argument is not null.

§ readAttributes()

void UConf::readAttributes ( const char *  pathname)
virtual

retrieves attributes from a configuration file.

'pathname' specifies a file that has a CSS syntax which can start with a ~ (eg. ~/.uremote). For instance, if this file exists and contains:

    local {
      color: red;
      sizes: 8,10,12;
    }
    remote {
      color: blue;
      sizes: 18,20,24;
    }
  

these attributes can be retrieved as follows in the program:

    UAttrList* alist = UAppli::conf.getAttributes("local");
    if (alist) {
       UStr* color = alist->getAttr("color");
       UStr* sizes = alist->getAttr("sizes");
    }
    etc...
*

§ setBpp()

void UConf::setBpp ( int  bpp)

specifies the prefered number of Bits Per Pixels.

default is 24 bits, a value of 0 means "use default". In any case, the requested BPP is a hint: the closest available BPP will be used

§ setDepthBuffer()

void UConf::setDepthBuffer ( int  size)

specifies if a depth buffer should be used and the desired size.

typical values are 0 (no depth buffer) or 16. The size that is actually used is implementation dependent (e.g. GLUT uses a default value if 'size' > 0)

§ setStencilBuffer()

void UConf::setStencilBuffer ( int  size)

specifies if a stencil buffer should be used and the desired size.

The size that is actually used is implementation dependent.

§ useFreeType()

void UConf::useFreeType ( bool  state = true)

specifies whether FreeType is used for rendering fonts.

the current implementation of FreeType requires OpenGL. This function should not be called after the creation of the UAppli.

§ useGL()

void UConf::useGL ( bool  state = true)

specifies whether OpenGL is used for rendering graphics.

OpenGL rendering is used by default. This can be changed by calling this function BEFORE the UAppli is created or by launching the application with the -no-gl option

Member Data Documentation

§ multi_click_delay

unsigned long ubit::UConf::multi_click_delay

< UOn::mclick is not generated if the mouse if moved more than this distance.

max delay (in ms) between 2 mouse clicks to generate a multiple click.


The documentation for this class was generated from the following files: