00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00035 #ifndef __SO3_OBJ_WIN_WIDGET_H__
00036 #define __SO3_OBJ_WIN_WIDGET_H__
00037
00038 #include "..\SCOLBasic\SO3Std.h"
00039 #include "SO3Widget.h"
00040 #include "objstr.h"
00041
00042 namespace SO3
00043 {
00044
00045 #define SO3_OBJ_WINDOW_WIDGET_TYPE "ObjWindowWidget"
00046
00047 class SObjWindowWidget : public SWidget
00048 {
00049 public:
00050 protected:
00051 private:
00052 unsigned int iLastWidth;
00053 unsigned int iLastHeight;
00054 bool bLastAlphaState;
00055 void* pixelsData;
00056
00057 public:
00061 SObjWindowWidget(SScene* targetScene, std::string bitmapWidgetName, int xPos, int yPos, unsigned short widgetWidth, unsigned short widgetHeight, SViewPort* targetViewport, unsigned int widgetZOrder);
00062
00066 SObjWindowWidget(SScene* targetScene, std::string bitmapWidgetName, int xPos, int yPos, unsigned short widgetWidth, unsigned short widgetHeight, SViewPort* targetViewport);
00067
00071 SObjWindowWidget(SScene* targetScene, std::string bitmapWidgetName, unsigned short widgetWidth, unsigned short widgetHeight, SMaterial* targetMaterial, unsigned short targetTechnique, unsigned short targetPass, unsigned short targetTextureUnit);
00072
00076 void CommonConstructorSequence();
00077
00081 ~SObjWindowWidget();
00082
00086 virtual void LoadURL(const std::string& url);
00087
00091 virtual void LoadFile(const std::string& file);
00092
00096 void UpdateRawData(const void* objWindowBuffer);
00097
00101 virtual void InjectMouseMove(int xPos, int yPos, MouseButtonId button);
00102
00106 virtual void InjectMouseWheel(int scrollX, int scrollY, int relativeScroll);
00107
00111 virtual void InjectMouseDown(int xPos, int yPos, MouseButtonId button);
00112
00116 virtual void InjectMouseUp(int xPos, int yPos, MouseButtonId button);
00117
00121 virtual void InjectKeyEvent(UINT msg, WindowHandle hwnd, WPARAM wParam, LPARAM lParam);
00122
00126 virtual void InjectTextEvent(std::string utf8);
00127
00131 virtual void RunScriptFunction(std::string functionName, std::vector<std::string> argumentList);
00132
00136 virtual void loadResource(Ogre::Resource* resource);
00137 protected:
00141 virtual void SetFocusImpl(bool focusOnWidget);
00142
00146 virtual void SetTransparencyImpl(bool enableTransparency);
00147
00151 virtual void SetKeyboardEnableImpl(bool enableKeyboardOnWidget);
00152
00156 virtual void SetMouseEnableImpl(bool enableMouseOnWidget);
00157
00161 virtual void SetSizeImpl(unsigned short newWidth, unsigned short newHeight);
00162
00166 virtual int GetPixelUnder(int posX, int posY);
00167 private:
00168 void CheckSizeAndAlloc(unsigned int newWidth, unsigned int newHeight, bool alpha);
00169
00170 };
00171
00172 }
00173
00174 #endif