#include <uconf.hpp>
Public Member Functions | |
virtual void | parseOptions (int &argc, char **argv, UOption *options) |
retrieves options from the command line. | |
virtual void | readProperties (const char *pathname) |
retrieves properties from a configuration file. | |
UProps * | getProps (const char *category) |
see readProperties(). | |
virtual void | printHelp () |
prints Ubit help on cout. | |
void | useX11 () |
void | useGL () |
void | use3D () |
specifies if X11, OpenGL or U3D is used for rendering. | |
void | useGLRender () |
obsolete. | |
void | setBpp (int) |
specifies the prefered number of bits for pixels (default = 24). | |
Public Attributes | |
UStr | locale |
locale of the application (default = "" : the environment locale) | |
float | scale |
scaling factor for rendering the application (default = 1,0). | |
int | info_level |
level of info messages (none if == 0). | |
UFontFamilyConf | sans_serif |
UFontFamilyConf | serif |
UFontFamilyConf | monospace |
configuration of standard fonts. | |
UFont * | default_font |
the default font of the application (default = UFont::sans_serif). | |
UBackground | default_background |
the default background of the application. | |
UPix * | unknow_image |
the image that appears instead of an unknown image (when applicable). | |
UFont * | selection_font |
UColor * | selection_color |
UColor * | selection_bgcolor |
attributes of the text selection. | |
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 UBrick 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 | transp_scrollbars |
scrollbars are transparent and superimposed (default: false). | |
bool | softwins |
windows are rendered as "soft windows" in the main frame (default: false). | |
bool | telepointers |
telepointers are shown when the appli is displayed on several X servers. | |
bool | generic_textsel |
any object can select text (default: false). | |
bool | linear_gamma |
enables gamma correction on Solaris (obsolete). | |
int | mouse_select_button |
standard button (default = left btn = UEvent::MButton1). | |
int | mouse_menu_button |
button that opens contextual menus (default = right btn or Ctrl-btn on the Mac = UEvent::MButton3). | |
int | mouse_alt_button |
alternate button (default = middle btn or Alt-btn on the Mac = UEvent::MButton2). | |
int | click_radius |
unsigned long | multi_click_delay |
< UOn::mclick is not generated if the mouse if moved more than this distance. max delay (in millisec) between 2 mouse clicks to generate a multiple click (UOn::mbiclick, etc). | |
unsigned long | auto_repeat_delay |
delay (in millisec) before UMode::autoRepeat becomes active. | |
unsigned long | open_tip_delay |
delay (in millisec) before a UTip is opened. | |
unsigned long | open_submenu_delay |
delay (in millisec) before a cascaded UMenu is opened. | |
unsigned long | resize_window_delay |
delay (in millisec) before a UWindow is resized (when it is retailed by the user). | |
UStr | name |
name of the application (default = "": will be set to argv[0]). | |
UStr | display |
name of the X11 display (default = "": the local X server is used) | |
int | filebox_width |
int | filebox_height |
int | filebox_line_count |
Impl: default is 400, 230, 10. | |
Friends | |
class | UDisp |
class | UNatDisp |
class | UAppli |
class | UAppliImpl |
class | UGlpane |
class | UFrame3d |
virtual void ubit::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:
virtual void ubit::UConf::readProperties | ( | const char * | pathname | ) | [virtual] |
retrieves properties 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 properties can be retrieved as follows in the program:
UProps* props = UAppli::conf.getProps("local"); if (props) { UStr* color = props->getProp("color"); UStr* sizes = props->getProp("sizes"); } etc...
void ubit::UConf::setBpp | ( | int | ) |
specifies the prefered number of bits for pixels (default = 24).
Note that:
void ubit::UConf::use3D | ( | ) |
specifies if X11, OpenGL or U3D is used for rendering.
Notes:
alternate button (default = middle btn or Alt-btn on the Mac = UEvent::MButton2).
used for pasting_text, DND and scroll_to_pointed_position in scrollbars.
attributes of the text selection.
these values can be set to null in which case they have no effect