Project

General

Profile

SO3Engine
Hikari.h
Go to the documentation of this file.
1/*
2 This file is part of Hikari, a library that allows developers
3 to use Flash in their Ogre3D applications.
4
5 Copyright (C) 2008 Adam J. Simmons
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20*/
21/****************************************************************************************************
22 ___ ___ .__ __ .__
23 / | \|__| | _______ _______|__|
24/ ~ \ | |/ /\__ \\_ __ \ |
25\ Y / | < / __ \| | \/ |
26 \___|_ /|__|__|_ \‍(____ /__| |__| v0.4
27 \/ \/ \/
28
29
30* Zed Games PC Development Team - Jaime Crespillo Vilchez (jcrespillo@zed.com)
31* Build: 0.1 - Date: 13/10/2008
32* Undocked version of Hikari Lib
33* Brief: Removed createFlashOverlay methods, added setFlashControl, new interface class IFlashControl
34******************************************************************************************************/
35#ifndef __Hikari_H__
36#define __Hikari_H__
37
38#ifndef WINVER
39#define WINVER 0x0501
40#endif
41
42#ifndef _WIN32_WINNT
43#define _WIN32_WINNT 0x0501
44#endif
45
46#ifndef _WIN32_WINDOWS
47#define _WIN32_WINDOWS 0x0501
48#endif
49
50#pragma warning( disable: 4251 )
51#pragma warning( disable: 4192 )
52#include "string.h"
53#include <map>
54#include <vector>
55#include <algorithm>
56#include <list>
57#include "IFlashControl.h"
58
59namespace Hikari {
60
61namespace Impl { class KeyboardHook; }
62
69
74class _HikariExport HikariManager
75{
76public:
86
91
95 static HikariManager& getSingleton();
96
100 static HikariManager* getSingletonPtr();
101
102 inline void destroy(){if(mInstance){delete mInstance;mInstance = NULL;}}
103
108 //IFlashControl* createFlashOverlay(const Hikari::stringBase& name, Hikari::viewportBase* viewport, int width, int height, const Position& position, Hikari::ushortBase zOrder = 0);
109
113 //IFlashControl* createFlashMaterial(const Hikari::stringBase& name, int width, int height);
114
120 void destroyFlashControl(IFlashControl* controlToDestroy);
121
122 void deleteControls();
123
124 std::string getCurrentWorkingDirectory();
130 void destroyFlashControl(const std::string& controlName);
131
135 void destroyAllControls();
136
144 IFlashControl* getFlashControl(const std::string& controlName) const;
145
150 void update();
151
155 bool isAnyFocused();
156
160 void defocusAll();
161
170 bool injectMouseMove(short x, short y, int btn, bool ontex = true);
171
179 bool injectMouseDown(int buttonID);
180
188 bool injectMouseUp(int buttonID);
189
197 bool injectMouseWheel(int relScroll);
198
234 void injectKeyEvent(UINT msg, WPARAM wParam, LPARAM lParam);
248 void setKeyboardHookEnabled(bool isEnabled);
249
251 // this is the SETTER method to comunicate Hikari with FlashControl
252 void setFlashControl(IFlashControl* flashControl);
253 void setPath(const std::string& assetsDirectory = "");
254 //
255 bool isKeyboardOnGUI();
256
257 std::string basePath;
258 bool focusControl(int x, int y, IFlashControl* selection = 0);
259 IFlashControl* getFocusedControl();
260 bool isPointOverHikari(short x, short y);
261 HMODULE flashLib;
263 typedef std::map<std::string, IFlashControl*> ControlMap;
265protected:
266
267
268 IFlashControl* getTopControl(int x, int y);
270
271 //
272
273
274 //
275
277
278 int mouseXPos, mouseYPos;
280 //unsigned short zOrderCounter;
281
283
284 friend class IFlashControl;
285 friend class Impl::KeyboardHook;
286};
287
288}
289#endif
unsigned int UINT
Definition SO3Android.h:58
std::string basePath
Definition Hikari.h:257
IFlashControl * focusedControl
Definition Hikari.h:262
Impl::KeyboardHook * keyboardHook
Definition Hikari.h:276
ControlMap controls
Definition Hikari.h:264
static HikariManager * mInstance
Definition Hikari.h:269
bool mInjectingKeyboardToFlash
Definition Hikari.h:282
std::map< std::string, IFlashControl * > ControlMap
Definition Hikari.h:263
MouseButtonID
Definition Hikari.h:64
@ LeftMouseButton
Definition Hikari.h:65
@ MiddleMouseButton
Definition Hikari.h:67
@ RightMouseButton
Definition Hikari.h:66