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 |
Detailed Description
The HikariManager is used to HANDLE FlashControls and handle global events such as mouse-input propagation and the management of keyboard focus.
Member Typedef Documentation
◆ ControlMap
typedef std::map<std::string, IFlashControl*> Hikari::HikariManager::ControlMap |
Constructor & Destructor Documentation
◆ HikariManager()
HikariManager::HikariManager | ( | ) |
Instantiates the HikariManager singleton. You can access the singleton later using the HikariManager::Get and GetPointer.
- Parameters
-
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::~HikariManager | ( | ) |
Explicitly destroys the HikariManager singleton and destroys any active FlashControls.
Definition at line 84 of file Hikari.cpp.
Member Function Documentation
◆ defocusAll()
void HikariManager::defocusAll | ( | ) |
De-focuses any currently-focused FlashControl (removes keyboard focus).
Definition at line 239 of file Hikari.cpp.
◆ deleteControls()
void HikariManager::deleteControls | ( | ) |
Definition at line 171 of file Hikari.cpp.
◆ destroy()
◆ destroyAllControls()
void HikariManager::destroyAllControls | ( | ) |
Flags all FlashControls for destruction (to occur at the next update)
Definition at line 163 of file Hikari.cpp.
◆ destroyFlashControl() [1/2]
void HikariManager::destroyFlashControl | ( | const std::string & | controlName | ) |
Flags the specified FlashControl for destruction (to occur at the next update)
- Parameters
-
controlName The name of the control to flag for destruction.
Definition at line 156 of file Hikari.cpp.
◆ destroyFlashControl() [2/2]
void HikariManager::destroyFlashControl | ( | IFlashControl * | controlToDestroy | ) |
DEPRECATED ********************* DEPRECATED Flags the specified FlashControl for destruction (to occur at the next update)
- Parameters
-
controlToDestroy The control to flag for destruction.
Definition at line 144 of file Hikari.cpp.
◆ focusControl()
bool HikariManager::focusControl | ( | int | x, |
int | y, | ||
IFlashControl * | selection = 0 |
||
) |
Definition at line 418 of file Hikari.cpp.
◆ getCurrentWorkingDirectory()
std::string HikariManager::getCurrentWorkingDirectory | ( | ) |
Definition at line 51 of file Hikari.cpp.
◆ getFlashControl()
IFlashControl * HikariManager::getFlashControl | ( | const std::string & | controlName | ) | const |
Retrieves a previously-created FlashControl by name.
- Parameters
-
controlName The name of the FlashControl to retrieve.
- Returns
- If it is found, returns a pointer to the FlashControl, else returns 0.
Definition at line 183 of file Hikari.cpp.
◆ getFocusedControl()
IFlashControl * HikariManager::getFocusedControl | ( | ) |
Definition at line 224 of file Hikari.cpp.
◆ getSingleton()
|
static |
Retrieves the HikariManager singleton (must be instantiated first!)
Definition at line 118 of file Hikari.cpp.
◆ getSingletonPtr()
|
static |
Retrieves a pointer to the HikariManager singleton.
Definition at line 126 of file Hikari.cpp.
◆ getTopControl()
|
protected |
Definition at line 493 of file Hikari.cpp.
◆ injectKeyEvent()
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.
- Parameters
-
msg Specifies the message to be sent. wParam Specifies additional message-specific information. lParam Specifies additional message-specific information.
- Note
- You should only forward the following window messages using this function:
- WM_KEYDOWN
- WM_KEYUP
- WM_CHAR
- WM_DEADCHAR
- WM_SYSKEYDOWN
- WM_SYSKEYUP
- WM_SYSDEADCHAR
- WM_SYSCHAR
- WM_IME_CHAR
- WM_IME_COMPOSITION
- WM_IME_COMPOSITIONFULL
- WM_IME_CONTROL
- WM_IME_ENDCOMPOSITION
- WM_IME_KEYDOWN
- WM_IME_KEYUP
- WM_IME_NOTIFY
- WM_IME_REQUEST
- WM_IME_SELECT
- WM_IME_SETCONTEXT
- WM_IME_STARTCOMPOSITION
- WM_HELP
- WM_CANCELMODE
Definition at line 388 of file Hikari.cpp.
◆ injectMouseDown()
bool HikariManager::injectMouseDown | ( | int | buttonID | ) |
Injects a global mouse-down to be handled by all FlashControl overlays.
- Parameters
-
buttonID The MouseButtonID of the pressed button.
- Returns
- Returns true if the mouse event was handled by a FlashControl overlay, else returns false.
Definition at line 290 of file Hikari.cpp.
◆ injectMouseMove()
bool HikariManager::injectMouseMove | ( | short | x, |
short | y, | ||
int | btn, | ||
bool | ontex = true |
||
) |
Injects a global mouse-move to be handled by all FlashControl overlays.
- Parameters
-
x The absolute x-coordinate in screen-space. y The absolute y-coordinate in screen-space.
- Returns
- Returns true if the coordinates are over a FlashControl overlay, else returns false.
Definition at line 244 of file Hikari.cpp.
◆ injectMouseUp()
bool HikariManager::injectMouseUp | ( | int | buttonID | ) |
Injects a global mouse-up to be handled by all FlashControl overlays.
- Parameters
-
buttonID The MouseButtonID of the released button.
- Returns
- Returns true if the mouse event was handled by a FlashControl overlay, else returns false.
Definition at line 337 of file Hikari.cpp.
◆ injectMouseWheel()
bool HikariManager::injectMouseWheel | ( | int | relScroll | ) |
Injects a global mouse-wheel event to be handled by all FlashControl overlays.
- Parameters
-
relScroll The relative scroll amount of the mouse (in OIS, this is arg.state.Z.rel).
- Returns
- Returns true if the mouse event was handled by a FlashControl overlay, else returns false.
Definition at line 374 of file Hikari.cpp.
◆ isAnyFocused()
bool HikariManager::isAnyFocused | ( | ) |
Returns whether or not any FlashControl is focused (and is capturing keyboard input).
Definition at line 233 of file Hikari.cpp.
◆ isKeyboardOnGUI()
bool HikariManager::isKeyboardOnGUI | ( | ) |
Definition at line 113 of file Hikari.cpp.
◆ isPointOverHikari()
bool HikariManager::isPointOverHikari | ( | short | x, |
short | y | ||
) |
Definition at line 273 of file Hikari.cpp.
◆ setFlashControl()
void HikariManager::setFlashControl | ( | IFlashControl * | flashControl | ) |
Definition at line 514 of file Hikari.cpp.
◆ setKeyboardHookEnabled()
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)
- Parameters
-
isEnabled Whether or not the keyboard-hook is enabled.
- Note
- For some reason, IME doesn't work properly using the the keyboard hook to catch keyboard messages and so, as a workaround, you can disable the keyboard-hook and forward keyboard/IME messages directly to Hikari from your main window's WindowProc.
Definition at line 401 of file Hikari.cpp.
◆ setPath()
void HikariManager::setPath | ( | const std::string & | assetsDirectory = "" | ) |
Definition at line 134 of file Hikari.cpp.
◆ update()
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.
Friends And Related Symbol Documentation
◆ IFlashControl
|
friend |
◆ Impl::KeyboardHook
|
friend |
Member Data Documentation
◆ basePath
◆ controls
ControlMap Hikari::HikariManager::controls |
◆ flashLib
◆ focusedControl
IFlashControl* Hikari::HikariManager::focusedControl |
◆ keyboardHook
|
protected |
◆ mInjectingKeyboardToFlash
|
protected |
◆ mInstance
|
staticprotected |
◆ mouseButtonRDown
◆ mouseXPos
◆ mouseYPos
The documentation for this class was generated from the following files:
- include/External/hikari/Hikari.h
- src/External/hikari/Hikari.cpp
Generated by 1.9.8