#include <vgui.h>
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 59 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_window * | produce_window (int width, int height, vgui_menu const &menubar, vcl_string const &title="") |
| Produce window with menubar. | |
| static vgui_window * | produce_window (int width, int height, vcl_string const &title="") |
| Produce window without menubar. | |
| static vgui_dialog_impl * | produce_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_window * | adapt (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_window * | adapt (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_toolkit * | instance_ = 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. | |
|
||||||||||||||||||||||||
|
Create the vgui_window but don't run it (with menubar).
|
|
||||||||||||||||||||
|
Create the vgui_window but don't run it (no menubar).
|
|
|
Add event to the event queue.
|
|
|
Method for determining if a given toolkit is available.
|
|
|
Remove all events from the event queue.
|
|
||||||||||||
|
Initialize the selected toolkit passing it the given command line.
|
|
|
Produce dialog box.
|
|
|
Produce dialog box.
|
|
||||||||||||||||
|
Produce window without menubar.
|
|
||||||||||||||||||||
|
Produce window with menubar.
|
|
|
Quit application.
|
|
|
Was quit called eariler?. This is to help application-driven vgui programs determine when the user has requested the GUI to close. |
|
|
Run until quit is called.
|
|
||||||||||||||||||||||||
|
Display this tableau and run till dead (with menubar).
|
|
||||||||||||||||||||
|
Display this tableau and run till dead (no menubar).
|
|
|
Run the next event in the event queue.
|
|
|
Run all events in the event queue.
|
|
||||||||||||
|
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. |
|
|
Method for selecting a specific toolkit. This will abort() if given a toolkit which is not available. |
|
|
Uninitialize any previously initialized toolkit. This will be called before application exit; the user normally need not call this. |
|
|
True once init() has been called.
|
|
|
Selected toolkit instance.
|
|
|
Needed for statusbar.
|
|
|
True once quit() has been called.
|
1.4.4