#include <buttonRegistry.h>
Public Member Functions | |
bool | register_button (ButtonHandle &button_handle, const string &name, char ascii_equivalent= '\0') |
Registers a new ButtonHandle with the indicated name, and if specified, the indicated ASCII equivalent. | |
ButtonHandle | get_button (const string &name) |
Finds a ButtonHandle in the registry matching the indicated name. | |
ButtonHandle | find_ascii_button (char ascii_equivalent) const |
Finds a ButtonHandle in the registry matching the indicated ASCII equivalent character. | |
string | get_name (ButtonHandle button) const |
Returns the name of the indicated button. | |
void | write (ostream &out) const |
Static Public Member Functions | |
ButtonRegistry * | ptr () |
Returns the pointer to the global ButtonRegistry object. | |
Private Types | |
typedef pvector< RegistryNode * > | HandleRegistry |
typedef pmap< string, RegistryNode * > | NameRegistry |
Private Member Functions | |
ButtonRegistry () | |
RegistryNode * | look_up (ButtonHandle button) const |
Static Private Member Functions | |
void | init_global_pointer () |
Constructs the ButtonRegistry object for the first time. | |
Private Attributes | |
HandleRegistry | _handle_registry |
NameRegistry | _name_registry |
Static Private Attributes | |
ButtonRegistry * | _global_pointer = NULL |
There should be only one ButtonRegistry class during the lifetime of the application.
Definition at line 46 of file buttonRegistry.h.
|
Definition at line 81 of file buttonRegistry.h. |
|
Definition at line 84 of file buttonRegistry.h. |
|
Definition at line 207 of file buttonRegistry.cxx. References _handle_registry, ButtonHandle::_index, nassertr, and NULL. |
|
Finds a ButtonHandle in the registry matching the indicated ASCII equivalent character. If there is no such ButtonHandle, returns ButtonHandle::none(). Definition at line 162 of file buttonRegistry.cxx. Referenced by KeyboardButton::ascii_key(). |
|
Finds a ButtonHandle in the registry matching the indicated name. If there is no such ButtonHandle, registers a new one and returns it. Definition at line 136 of file buttonRegistry.cxx. References _handle_registry, ButtonHandle::none(), and NULL. |
|
Returns the name of the indicated button.
Definition at line 63 of file buttonRegistry.I. |
|
Constructs the ButtonRegistry object for the first time.
Definition at line 230 of file buttonRegistry.cxx. Referenced by ButtonRegistry::RegistryNode::RegistryNode(). |
|
Definition at line 243 of file buttonRegistry.cxx. Referenced by ptr(). |
|
Returns the pointer to the global ButtonRegistry object.
Definition at line 47 of file buttonRegistry.I. References ButtonRegistry::RegistryNode::_name, INLINE, look_up(), nassertr, and NULL. Referenced by KeyboardButton::ascii_key(), and MouseButton::three(). |
|
Registers a new ButtonHandle with the indicated name, and if specified, the indicated ASCII equivalent. Returns true if the button was registered, or false it was already registered; in either case, the new ButtonHandle is loaded into the first parameter. This defines a new kind of button matching the indicated name. The ButtonHandle can then be passed around to devices as a button in its own right. Definition at line 60 of file buttonRegistry.cxx. Referenced by MouseButton::three(). |
|
Definition at line 178 of file buttonRegistry.cxx. References _handle_registry, and NULL. |
|
Definition at line 32 of file buttonRegistry.cxx. |
|
Definition at line 82 of file buttonRegistry.h. Referenced by ButtonRegistry(), get_button(), and write(). |
|
Definition at line 85 of file buttonRegistry.h. |