vgui Class Reference

#include <vgui.h>

List of all members.


Detailed Description

Namespace with a singleton vgui_toolkit instance.

vgui is a namespace with a singleton vgui_toolkit instance which acts as an abstract factory. The static methods on vgui simply dispatch the call to the selected toolkit.

Order of things : 1. Registration. Toolkits available to the application are registered in a global list. Registration is done by the constructor of vgui_toolkit, so creating a vgui_toolkit amounts to registration. Sometimes this can be done at library initialization time but sometimes it can't, e.g. for static builds. In that case, a {tag function} must be called explicitly. See vgui_tag.* and vgui_register_all.cxx.

2. Choice of toolkit to use. Several toolkits may be available, and so a choice must be made as to which to use. The choice of toolkit is specified with the select() methods.

3. Initialization of toolkit. There is only one method for doing this, namely vgui::init(argc, argv); which needs a plausible command line. If no toolkit has been selected the init() function will try to choose one for you based on the given command line.

Definition at line 60 of file vgui.h.


Static Public Member Functions

static bool exists (char const *toolkit)
 Method for determining if a given toolkit is available.
static void select (char const *toolkit)
 Method for selecting a specific toolkit.
static bool select (int &argc, char **argv)
 Select a toolkit from command line arguments and environment variables.
static void init (int &argc, char **argv)
 Initialize the selected toolkit passing it the given command line.
static void uninit ()
 Uninitialize any previously initialized toolkit.
static vgui_windowproduce_window (int width, int height, vgui_menu const &menubar, vcl_string const &title="")
 Produce window with menubar.
static vgui_windowproduce_window (int width, int height, vcl_string const &title="")
 Produce window without menubar.
static vgui_dialog_implproduce_dialog (vcl_string const &name)
 Produce dialog box.
static
vgui_dialog_extensions_impl
produce_extension_dialog (vcl_string const &name)
 Produce dialog box.
static int run (vgui_tableau_sptr const &, int w, int h, vcl_string const &title="")
 Display this tableau and run till dead (no menubar).
static int run (vgui_tableau_sptr const &, int w, int h, vgui_menu const &menubar, vcl_string const &title="")
 Display this tableau and run till dead (with menubar).
static vgui_windowadapt (vgui_tableau_sptr const &, int w, int h, vcl_string const &title="")
 Create the vgui_window but don't run it (no menubar).
static vgui_windowadapt (vgui_tableau_sptr const &, int w, int h, vgui_menu const &, vcl_string const &title="")
 Create the vgui_window but don't run it (with menubar).
static int run ()
 Run until quit is called.
static void run_one_event ()
 Run the next event in the event queue.
static void run_till_idle ()
 Run all events in the event queue.
static void flush ()
 Remove all events from the event queue.
static void add_event (vgui_event const &)
 Add event to the event queue.
static void quit ()
 Quit application.
static bool quit_was_called ()
 Was quit called eariler?.

Static Public Attributes

static vgui_DLLDATA vcl_ostream out
 Needed for statusbar.

Static Private Attributes

static vgui_DLLDATA vgui_toolkitinstance_ = 0
 Selected toolkit instance.
static vgui_DLLDATA bool init_called = false
 True once init() has been called.
static vgui_DLLDATA bool quit_called = false
 True once quit() has been called.

Member Function Documentation

bool vgui::exists ( char const *  toolkit  )  [static]

Method for determining if a given toolkit is available.

Definition at line 66 of file vgui.cxx.

void vgui::select ( char const *  toolkit  )  [static]

Method for selecting a specific toolkit.

This will abort() if given a toolkit which is not available.

Definition at line 80 of file vgui.cxx.

bool vgui::select ( int &  argc,
char **  argv 
) [static]

Select a toolkit from command line arguments and environment variables.

First, the command line is scanned for --factory=xxx options.

If no such option is given, the environment variable 'vgui' is inspected.

If no such environment variable is set, no toolkit is selected and the function returns false. Else the return value is true.

Definition at line 97 of file vgui.cxx.

void vgui::init ( int &  argc,
char **  argv 
) [static]

Initialize the selected toolkit passing it the given command line.

Initialise the selected toolkit passing it the given command line.

Definition at line 128 of file vgui.cxx.

void vgui::uninit ( void   )  [static]

Uninitialize any previously initialized toolkit.

This will be called before application exit; the user normally need not call this.

Definition at line 203 of file vgui.cxx.

vgui_window * vgui::produce_window ( int  width,
int  height,
vgui_menu const &  menubar,
vcl_string const &  title = "" 
) [static]

Produce window with menubar.

Definition at line 215 of file vgui.cxx.

vgui_window * vgui::produce_window ( int  width,
int  height,
vcl_string const &  title = "" 
) [static]

Produce window without menubar.

Definition at line 230 of file vgui.cxx.

vgui_dialog_impl * vgui::produce_dialog ( vcl_string const &  name  )  [static]

Produce dialog box.

Definition at line 244 of file vgui.cxx.

vgui_dialog_extensions_impl * vgui::produce_extension_dialog ( vcl_string const &  name  )  [static]

Produce dialog box.

Definition at line 256 of file vgui.cxx.

int vgui::run ( vgui_tableau_sptr const &  tableau,
int  w,
int  h,
vcl_string const &  title = "" 
) [static]

Display this tableau and run till dead (no menubar).

Definition at line 341 of file vgui.cxx.

int vgui::run ( vgui_tableau_sptr const &  tableau,
int  w,
int  h,
vgui_menu const &  menubar,
vcl_string const &  title = "" 
) [static]

Display this tableau and run till dead (with menubar).

Definition at line 350 of file vgui.cxx.

vgui_window * vgui::adapt ( vgui_tableau_sptr const &  tableau,
int  w,
int  h,
vcl_string const &  title = "" 
) [static]

Create the vgui_window but don't run it (no menubar).

Definition at line 359 of file vgui.cxx.

vgui_window * vgui::adapt ( vgui_tableau_sptr const &  tableau,
int  w,
int  h,
vgui_menu const &  mb,
vcl_string const &  title = "" 
) [static]

Create the vgui_window but don't run it (with menubar).

Definition at line 370 of file vgui.cxx.

int vgui::run ( void   )  [static]

Run until quit is called.

Definition at line 287 of file vgui.cxx.

void vgui::run_one_event ( void   )  [static]

Run the next event in the event queue.

Definition at line 301 of file vgui.cxx.

void vgui::run_till_idle ( void   )  [static]

Run all events in the event queue.

Definition at line 311 of file vgui.cxx.

void vgui::flush ( void   )  [static]

Remove all events from the event queue.

Definition at line 321 of file vgui.cxx.

void vgui::add_event ( vgui_event const &  e  )  [static]

Add event to the event queue.

Definition at line 331 of file vgui.cxx.

void vgui::quit ( void   )  [static]

Quit application.

Definition at line 267 of file vgui.cxx.

bool vgui::quit_was_called (  )  [static]

Was quit called eariler?.

This is to help application-driven vgui programs determine when the user has requested the GUI to close.

Definition at line 279 of file vgui.cxx.


Member Data Documentation

vgui_toolkit * vgui::instance_ = 0 [static, private]

Selected toolkit instance.

Definition at line 63 of file vgui.h.

bool vgui::init_called = false [static, private]

True once init() has been called.

Definition at line 66 of file vgui.h.

bool vgui::quit_called = false [static, private]

True once quit() has been called.

Definition at line 69 of file vgui.h.

vcl_ostream vgui::out [static]

Needed for statusbar.

Definition at line 72 of file vgui.h.


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

Generated on Sun Nov 22 06:21:53 2009 for core/vgui by  doxygen 1.5.5