SO3Engine
|
#include <Hikari.h>
Public Types | |
typedef std::map< std::string, IFlashControl * > | ControlMap |
Public Member Functions | |
HikariManager () | |
~HikariManager () | |
void | destroy () |
void | destroyFlashControl (IFlashControl *controlToDestroy) |
void | deleteControls () |
std::string | getCurrentWorkingDirectory () |
void | destroyFlashControl (const std::string &controlName) |
void | destroyAllControls () |
IFlashControl * | getFlashControl (const std::string &controlName) const |
void | update () |
bool | isAnyFocused () |
void | defocusAll () |
bool | injectMouseMove (short x, short y, int btn, bool ontex=true) |
bool | injectMouseDown (int buttonID) |
bool | injectMouseUp (int buttonID) |
bool | injectMouseWheel (int relScroll) |
void | injectKeyEvent (UINT msg, WPARAM wParam, LPARAM lParam) |
void | setKeyboardHookEnabled (bool isEnabled) |
void | setFlashControl (IFlashControl *flashControl) |
void | setPath (const std::string &assetsDirectory="") |
bool | isKeyboardOnGUI () |
bool | focusControl (int x, int y, IFlashControl *selection=0) |
IFlashControl * | getFocusedControl () |
bool | isPointOverHikari (short x, short y) |
Static Public Member Functions | |
static HikariManager & | getSingleton () |
static HikariManager * | getSingletonPtr () |
Public Attributes | |
std::string | basePath |
HMODULE | flashLib |
IFlashControl * | focusedControl |
ControlMap | controls |
Protected Member Functions | |
IFlashControl * | getTopControl (int x, int y) |
Protected Attributes | |
Impl::KeyboardHook * | keyboardHook |
int | mouseXPos |
int | mouseYPos |
bool | mouseButtonRDown |
bool | mInjectingKeyboardToFlash |
Static Protected Attributes | |
static HikariManager * | mInstance = NULL |
Friends | |
class | IFlashControl |
class | Impl::KeyboardHook |
The HikariManager is used to HANDLE FlashControls and handle global events such as mouse-input propagation and the management of keyboard focus.
typedef std::map<std::string, IFlashControl*> Hikari::HikariManager::ControlMap |
HikariManager::HikariManager | ( | ) |
Instantiates the HikariManager singleton. You can access the singleton later using the HikariManager::Get and GetPointer.
assetsDirectory | Specifies the directory (relative to the path of the executable) that holds your .swf files. This is used by FlashControl::load. |
Definition at line 61 of file Hikari.cpp.
HikariManager::~HikariManager | ( | ) |
Explicitly destroys the HikariManager singleton and destroys any active FlashControls.
Definition at line 84 of file Hikari.cpp.
void HikariManager::defocusAll | ( | ) |
De-focuses any currently-focused FlashControl (removes keyboard focus).
Definition at line 239 of file Hikari.cpp.
void HikariManager::deleteControls | ( | ) |
Definition at line 171 of file Hikari.cpp.
void HikariManager::destroyAllControls | ( | ) |
Flags all FlashControls for destruction (to occur at the next update)
Definition at line 163 of file Hikari.cpp.
void HikariManager::destroyFlashControl | ( | const std::string & | controlName | ) |
Flags the specified FlashControl for destruction (to occur at the next update)
controlName | The name of the control to flag for destruction. |
Definition at line 156 of file Hikari.cpp.
void HikariManager::destroyFlashControl | ( | IFlashControl * | controlToDestroy | ) |
DEPRECATED ********************* DEPRECATED Flags the specified FlashControl for destruction (to occur at the next update)
controlToDestroy | The control to flag for destruction. |
Definition at line 144 of file Hikari.cpp.
bool HikariManager::focusControl | ( | int | x, |
int | y, | ||
IFlashControl * | selection = 0 |
||
) |
Definition at line 418 of file Hikari.cpp.
std::string HikariManager::getCurrentWorkingDirectory | ( | ) |
Definition at line 51 of file Hikari.cpp.
IFlashControl * HikariManager::getFlashControl | ( | const std::string & | controlName | ) | const |
Retrieves a previously-created FlashControl by name.
controlName | The name of the FlashControl to retrieve. |
Definition at line 183 of file Hikari.cpp.
IFlashControl * HikariManager::getFocusedControl | ( | ) |
Definition at line 224 of file Hikari.cpp.
|
static |
Retrieves the HikariManager singleton (must be instantiated first!)
Definition at line 118 of file Hikari.cpp.
|
static |
Retrieves a pointer to the HikariManager singleton.
Definition at line 126 of file Hikari.cpp.
|
protected |
Definition at line 493 of file Hikari.cpp.
void HikariManager::injectKeyEvent | ( | UINT | msg, |
WPARAM | wParam, | ||
LPARAM | lParam | ||
) |
Injects a keyboard-event to be handled by the focused FlashControl. You generally don't need to call this unless you've disabled the keyboard-hook and wish to inject keyboard/IME messages directly from your WindowProc.
msg | Specifies the message to be sent. |
wParam | Specifies additional message-specific information. |
lParam | Specifies additional message-specific information. |
Definition at line 388 of file Hikari.cpp.
bool HikariManager::injectMouseDown | ( | int | buttonID | ) |
Injects a global mouse-down to be handled by all FlashControl overlays.
buttonID | The MouseButtonID of the pressed button. |
Definition at line 290 of file Hikari.cpp.
bool HikariManager::injectMouseMove | ( | short | x, |
short | y, | ||
int | btn, | ||
bool | ontex = true |
||
) |
Injects a global mouse-move to be handled by all FlashControl overlays.
x | The absolute x-coordinate in screen-space. |
y | The absolute y-coordinate in screen-space. |
Definition at line 244 of file Hikari.cpp.
bool HikariManager::injectMouseUp | ( | int | buttonID | ) |
Injects a global mouse-up to be handled by all FlashControl overlays.
buttonID | The MouseButtonID of the released button. |
Definition at line 337 of file Hikari.cpp.
bool HikariManager::injectMouseWheel | ( | int | relScroll | ) |
Injects a global mouse-wheel event to be handled by all FlashControl overlays.
relScroll | The relative scroll amount of the mouse (in OIS, this is arg.state.Z.rel). |
Definition at line 374 of file Hikari.cpp.
bool HikariManager::isAnyFocused | ( | ) |
Returns whether or not any FlashControl is focused (and is capturing keyboard input).
Definition at line 233 of file Hikari.cpp.
bool HikariManager::isKeyboardOnGUI | ( | ) |
Definition at line 113 of file Hikari.cpp.
bool HikariManager::isPointOverHikari | ( | short | x, |
short | y | ||
) |
Definition at line 273 of file Hikari.cpp.
void HikariManager::setFlashControl | ( | IFlashControl * | flashControl | ) |
Definition at line 514 of file Hikari.cpp.
void HikariManager::setKeyboardHookEnabled | ( | bool | isEnabled | ) |
Sets whether or not the keyboard-hook is enabled and should automatically catch and forward all keyboard messages to the focused FlashControl. (Enabled by default)
isEnabled | Whether or not the keyboard-hook is enabled. |
Definition at line 401 of file Hikari.cpp.
void HikariManager::setPath | ( | const std::string & | assetsDirectory = "" | ) |
Definition at line 134 of file Hikari.cpp.
void HikariManager::update | ( | ) |
Gives each active FlashControl a chance to update and destroys any control that is flagged for destruction.
Definition at line 192 of file Hikari.cpp.
|
friend |
|
friend |
ControlMap Hikari::HikariManager::controls |
IFlashControl* Hikari::HikariManager::focusedControl |
|
protected |
|
protected |
|
staticprotected |