SO3Engine
IFlashControl.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: new interface class IFlashControl to undock the Hikari core from control object
34******************************************************************************************************/
35
36#ifndef __IFlashControl_H__
37#define __IFlashControl_H__
38
39#include <windows.h>
40#include "Position.h"
41#include "Delegate.h"
43namespace ShockwaveFlashObjects { struct IShockwaveFlash; }
44struct IOleObject;
45struct IOleInPlaceObjectWindowless;
46
47//pre-definition of the Client-Side implementation class based on Abstract IFlashControl used by Hikari and
48//needed for FlashDelegate
49class FlashControl;
50
52namespace Hikari {
53 class IFlashControl;
55 namespace Impl {
56 class FlashSite;
57 class FlashHandler;
58 class RenderBuffer;
59 }
60
64
67
72class _HikariExport IFlashControl
73{
75 friend class Impl::FlashSite;
76 friend class Impl::FlashHandler;
77 friend class Impl::RenderBuffer;
78 friend class HikariManager;
79 friend struct Position;
80 friend class HikariManager;
81public:
82
87
88 ShockwaveFlashObjects::IShockwaveFlash* flashInterface;
89 IOleObject* oleObject;
90 IOleInPlaceObjectWindowless* windowlessObject;
91
92 HDC mainContext, altContext;
93 HBITMAP mainBitmap, altBitmap;
94 HGDIOBJ hOldMainBmp, hOldAltBmp;
95 BYTE *mainBuffer, *altBuffer;
96
97
99 std::string name;
104 int width;
108 bool isClean, isTotallyDirty;
122
124 IFlashControl():site(0), handler(0), renderBuffer(0), flashInterface(0), oleObject(0), windowlessObject(0), mainContext(0), altContext(0), mainBitmap(0), altBitmap(0), mainBuffer(0), altBuffer(0) {}
125 virtual ~IFlashControl(){}
127 virtual void setZOrder(unsigned short zorder) = 0;
128 virtual unsigned short getZOrder() = 0;
129 //virtual unsigned short getPanelZOrder() = 0;// maybe we will need for keeping the access to the HIKARI object´s model
130 virtual int getRelativeX(int absX) = 0;
131 virtual int getRelativeY(int absY) = 0;
132
134 virtual bool isPointOverMe(int screenX, int screenY) = 0;
135 virtual void invalidateTotally() = 0;
136 virtual void handleKeyEvent(UINT msg, WPARAM wParam, LPARAM lParam) = 0;
137 virtual void handleFlashCall(const std::wstring& xmlString) = 0;
138 virtual void update() = 0;
139 virtual void load(const std::string& movieFilename, HikariManager* hikariMgr,int type) = 0;
140 virtual void play() = 0;
141 virtual void stop() = 0;
142 virtual void rewind() = 0;
143 virtual void gotoFrame(long frameNum) = 0;
144 virtual void setLoop(bool shouldLoop) = 0;
145 virtual void setTransparent(bool isTransparent, bool useAlphaHack = false) = 0;
146 virtual void setQuality(short renderQuality) = 0;
147 virtual void setScaleMode(short scaleMode) = 0;
148 virtual void setDraggable(bool isDraggable) = 0;
149 virtual void setIgnoreTransparentPixels(bool shouldIgnore, float threshold = 0.04) = 0;
150 virtual const std::string & getName() const = 0;
151 virtual const std::string & getMaterialName() const = 0;
152 virtual void bind(const std::wstring& funcName, const FlashDelegate& callback) = 0;
153 virtual void unbind(const std::wstring& funcName) = 0;
154 virtual FlashValue callFunction(const std::wstring& funcName, const Arguments& args = Args()) = 0;
155 virtual void hide() = 0;
156 virtual void show() = 0;
157 virtual bool getVisibility() const = 0;
158 virtual void setOpacity(float opacity) = 0;
159 virtual void focus() = 0;
160 virtual void move(int deltaX, int deltaY) = 0;
161 virtual void getExtents(unsigned short &width, unsigned short &height) const = 0;
162 virtual void getUVScale(float &uScale, float &vScale) const = 0;
163 virtual void injectMouseMove(int xPos, int yPos, int btn) = 0;
164 virtual void injectMouseDown(int xPos, int yPos, int index) = 0;
165 virtual void injectMouseUp(int xPos, int yPos, int index) = 0;
166 virtual void injectMouseWheel(int relScroll, int xPos, int yPos) = 0;
167};
168
169
170}
171
172#endif
unsigned int UINT
Definition SO3Android.h:58
virtual unsigned short getZOrder()=0
virtual void setScaleMode(short scaleMode)=0
virtual void show()=0
virtual void setLoop(bool shouldLoop)=0
virtual void setIgnoreTransparentPixels(bool shouldIgnore, float threshold=0.04)=0
virtual void unbind(const std::wstring &funcName)=0
virtual void injectMouseMove(int xPos, int yPos, int btn)=0
virtual void injectMouseWheel(int relScroll, int xPos, int yPos)=0
virtual void rewind()=0
virtual void invalidateTotally()=0
virtual void hide()=0
virtual bool isPointOverMe(int screenX, int screenY)=0
virtual void bind(const std::wstring &funcName, const FlashDelegate &callback)=0
virtual void move(int deltaX, int deltaY)=0
virtual FlashValue callFunction(const std::wstring &funcName, const Arguments &args=Args())=0
virtual const std::string & getMaterialName() const =0
virtual void play()=0
virtual const std::string & getName() const =0
virtual void setDraggable(bool isDraggable)=0
Hikari::Impl::RenderBuffer * renderBuffer
virtual void focus()=0
virtual void load(const std::string &movieFilename, HikariManager *hikariMgr, int type)=0
virtual void injectMouseUp(int xPos, int yPos, int index)=0
virtual void injectMouseDown(int xPos, int yPos, int index)=0
virtual void update()=0
virtual void setQuality(short renderQuality)=0
IOleInPlaceObjectWindowless * windowlessObject
virtual int getRelativeX(int absX)=0
virtual void getExtents(unsigned short &width, unsigned short &height) const =0
virtual void handleFlashCall(const std::wstring &xmlString)=0
virtual void setOpacity(float opacity)=0
ShockwaveFlashObjects::IShockwaveFlash * flashInterface
virtual void getUVScale(float &uScale, float &vScale) const =0
Hikari::Impl::FlashSite * site
virtual void setZOrder(unsigned short zorder)=0
virtual bool getVisibility() const =0
virtual int getRelativeY(int absY)=0
virtual void stop()=0
Hikari::Impl::FlashHandler * handler
virtual void gotoFrame(long frameNum)=0
virtual void handleKeyEvent(UINT msg, WPARAM wParam, LPARAM lParam)=0
virtual void setTransparent(bool isTransparent, bool useAlphaHack=false)=0
Impl::fastdelegate::FastDelegate2< IFlashControl *, const Arguments &, FlashValue > FlashDelegate
_HikariExport std::vector< FlashValue > Arguments
Definition FlashValue.h:188