SO3Engine
|
SO3WidgetManager.cpp
Go to the documentation of this file.
86 WidgetFactoryList::iterator iWidgetFactorySearched = widgetFactoryList.find(newWidgetFactory->GetType());
88 widgetFactoryList.insert(WidgetFactoryList::value_type(newWidgetFactory->GetType(), newWidgetFactory));
90 OGRE_EXCEPT(Ogre::Exception::ERR_DUPLICATE_ITEM, "Cannot add factory for widget \""+ newWidgetFactory->GetType() +"\", factory already exists in widget manager!", "SWidgetManager::AddWidgetFactory");
100 WidgetFactoryList::iterator iWidgetFactorySearched = widgetFactoryList.find(existingWidgetFactoryName);
107SWidget* SWidgetManager::CreateWidget(SScene* targetScene, const std::string& widgetName, const int& xPos, const int& yPos, const unsigned short& width, const unsigned short& height, SViewPort* targetViewport, const unsigned int& widgetZOrder, const std::string& widgetType)
116 newWidget = iWidgetFactorySearched->second->CreateWidget(targetScene, widgetName, xPos, yPos, width, height, targetViewport, widgetZOrder);
124 OGRE_EXCEPT(Ogre::Exception::ERR_DUPLICATE_ITEM, "Cannot create a widget named \""+ widgetName +"\", a widget with the same name already exists!", "SWidgetManager::CreateWidget");
132SWidget* SWidgetManager::CreateWidget(SScene* targetScene, const std::string& widgetName, const int& xPos, const int& yPos, const unsigned short& width, const unsigned short& height, SViewPort* targetViewport, const std::string& widgetType)
141 newWidget = iWidgetFactorySearched->second->CreateWidget(targetScene, widgetName, xPos, yPos, width, height, targetViewport);
145 OGRE_EXCEPT(Ogre::Exception::ERR_DUPLICATE_ITEM, "Cannot create a widget named \""+ widgetName +"\", a widget with the same name already exists!", "SWidgetManager::CreateWidget");
153SWidget* SWidgetManager::CreateWidget(SScene* targetScene, const std::string& widgetName, const unsigned short& width, const unsigned short& height, SMaterial* targetMaterial, const unsigned short& targetTechnique, const unsigned short& targetPass, const unsigned short& targetTextureUnit, const std::string& widgetType)
162 newWidget = iWidgetFactorySearched->second->CreateWidget(targetScene, widgetName, width, height, targetMaterial, targetTechnique, targetPass, targetTextureUnit);
166 OGRE_EXCEPT(Ogre::Exception::ERR_DUPLICATE_ITEM, "Cannot create a widget named \""+ widgetName +"\", a widget with the same name already exists!", "SWidgetManager::CreateWidget");
176 WidgetFactoryList::iterator iWidgetFactorySearched = widgetFactoryList.find(existingWidget->GetType());
206 OGRE_EXCEPT(Ogre::Exception::ERR_ITEM_NOT_FOUND, "Cannot delete a widget named \""+ widgetName +"\", widget not found!", "SWidgetManager::DeleteWidget");
209 OGRE_EXCEPT(Ogre::Exception::ERR_ITEM_NOT_FOUND, "Cannot delete a widget with factory \""+ existingWidget->GetType() +"\", factory does not exists in widget manager!", "SWidgetManager::DeleteWidget");
212void SWidgetManager::InjectMouseMove(SWindow* originWindow, const int& xPos, const int& yPos, const MouseButtonId& button)
231 //MMechostr(MSKDEBUG, ">> InjectMouseMove from %i : %i to %i : %i\n", xPos, yPos, px - widgetPosition.x, py - widgetPosition.y);
237 SPointInt injectPosition = ConvertTextureUvToWidgetCoordinates(widgetUnder, raycast.uvResult.x, raycast.uvResult.y);
262void SWidgetManager::InjectMouseWheel(SWindow* originWindow, const int& scrollX, const int& scrollY, const int& relativeScroll)
267 // Point(0,0) is returned if it's not an overlayed widget, so it's safe to call GetPosition everytime.
269 focusedWidget->InjectMouseWheel(scrollX - widgetPosition.x, scrollY - widgetPosition.y, relativeScroll);
274void SWidgetManager::InjectMouseDown(SWindow* originWindow, const int& xPos, const int& yPos, const MouseButtonId& button)
295 //MMechostr(MSKDEBUG, ">> InjectMouseDown from %i : %i to %i : %i\n", xPos, yPos, px - widgetPosition.x, py - widgetPosition.y);
309void SWidgetManager::InjectMouseUp(SWindow* originWindow, const int& xPos, const int& yPos, const MouseButtonId& button)
325 //MMechostr(MSKDEBUG, ">> InjectMouseUp from %i : %i to %i : %i\n", xPos, yPos, px - widgetPosition.x, py - widgetPosition.y);
339void SWidgetManager::InjectTouchAdd(SWindow* originWindow, const int& xPos, const int& yPos, const int& touchid)
351 inputList.insert(WidgetInputList::value_type(touchid, INPUTInfo(touchid, px, py, focusedWidget)));
391 if (iTouchListSearched->second.widget->isOverlayed || iTouchListSearched->second.widget->is2DRect)
395 _FireTouchRemoveWidgetEvent(iTouchListSearched->second.widget, iTouchListSearched->second.x - widgetPosition.x, iTouchListSearched->second.y - widgetPosition.y, touchid);
399 SRaycastResult raycast = originWindow->IndRayCast(iTouchListSearched->second.x, iTouchListSearched->second.y);
400 SPointInt injectPosition = ConvertTextureUvToWidgetCoordinates(focusedWidget, raycast.uvResult.x, raycast.uvResult.y);
412void SWidgetManager::InjectTouchUpdate(SWindow* originWindow, const int& xPos, const int& yPos, const int& vx, const int& vy, const int& touchid)
436 _FireTouchUpdateWidgetEvent(widgetUnder, px - widgetPosition.x, py - widgetPosition.y, vx, vy, touchid);
450void SWidgetManager::InjectMouseMove(SWidget* widget, const SRaycastResult& raycast, const MouseButtonId& button, const int& id)
492void SWidgetManager::InjectMouseDown(SWidget* widget, const SRaycastResult& raycast, const MouseButtonId& button, const int& id)
500 SPointInt injectPosition = ConvertTextureUvToWidgetCoordinates(focusedWidget, raycast.uvResult.x, raycast.uvResult.y);
517void SWidgetManager::InjectMouseWheel(SWidget* widget, const SRaycastResult& raycast, const int& relativeScroll, const int& id)
525 SPointInt injectPosition = ConvertTextureUvToWidgetCoordinates(focusedWidget, raycast.uvResult.x, raycast.uvResult.y);
531void SWidgetManager::InjectMouseUp(const SRaycastResult& raycast, const MouseButtonId& button, const int& id)
550void SWidgetManager::InjectTouchAdd(SWidget* widget, const SRaycastResult& raycast, const int& touchid)
564void SWidgetManager::InjectTouchRemove(SWidget* widget, const SRaycastResult& raycast, const int& touchid)
575void SWidgetManager::InjectTouchUpdate(SWidget* widget, const SRaycastResult& raycast, const int& touchid)
617void SWidgetManager::InjectKeyEvent(const UINT& msg, const ScolWindowHandle& hwnd, const WPARAM& wParam, const LPARAM& lParam)
635 // The map orders the elements by their keys using a stored function key_compare, which simply does a less-than comparison.
645 widgetListForeground.insert(std::multimap<unsigned short, SWidget*>::value_type(iWidgetList->second->GetZOrder(), iWidgetList->second));
647 widgetListNotForeground.insert(std::multimap<unsigned short, SWidget*>::value_type(iWidgetList->second->GetZOrder(), iWidgetList->second));
751SWidget* SWidgetManager::GetWidgetUnder(SWindow* originWindow, const int& posX, const int& posY, const int& id)
923void SWidgetManager::_FireMouseMoveWidgetEvent(SWidget* targetedWidget, const int& mousePosX, const int& mousePosY, const MouseButtonId& mouseButton, const int& id)
933void SWidgetManager::_FireMouseDownWidgetEvent(SWidget* targetedWidget, const int& mousePosX, const int& mousePosY, const MouseButtonId& mouseButton, const int& id)
943void SWidgetManager::_FireMouseUpWidgetEvent(SWidget* targetedWidget, const int& mousePosX, const int& mousePosY, const MouseButtonId& mouseButton, const int& id)
953void SWidgetManager::_FireMouseWheelWidgetEvent(SWidget* targetedWidget, const int& mousePosX, const int& mousePosY, const int& relativeScroll, const int& id)
963void SWidgetManager::_FireTouchAddWidgetEvent(SWidget* targetedWidget, const int& mousePosX, const int& mousePosY, const int& touchid)
973void SWidgetManager::_FireTouchRemoveWidgetEvent(SWidget* targetedWidget, const int& mousePosX, const int& mousePosY, const int& touchid)
983void SWidgetManager::_FireTouchUpdateWidgetEvent(SWidget* targetedWidget, const int& mousePosX, const int& mousePosY, const int& vx, const int& vy, const int& touchid)
993void SWidgetManager::_FireKeyWidgetEvent(SWidget* targetedWidget, const UINT& msg, const ScolWindowHandle& hwnd, const UINT& wParam, const LONG& lParam)
1013void SWidgetManager::_FireScriptWidgetEvent(SWidget* targetedWidget, const SScriptFunction& functionCalled)
1043void SWidgetManager::_FireOnLoadError(SWidget* targetedWidget, const int& errorCode, const std::string& failedUrl)
1053SPointInt SWidgetManager::ConvertTextureUvToWidgetCoordinates(SWidget* targetedWidget, const float& uCoor, const float& vCoor)
Definition SO3WidgetManager.h:43
Definition SO3Material.h:43
Definition SO3RayCast.h:41
Definition SO3Scene.h:125
Definition SO3ScriptFunction.h:33
Definition SO3ViewPort.h:56
Definition SO3WidgetFactory.h:44
Definition SO3Widget.h:51
virtual void InjectMouseDown(const int &xPos, const int &yPos, const MouseButtonId &button)=0
virtual void InjectMouseMove(const int &xPos, const int &yPos, const MouseButtonId &button)=0
virtual void InjectTouchAdd(const int &xPos, const int &yPos, const int &touchid)=0
virtual void SetFocusImpl(const bool &focusOnWidget)=0
virtual void InjectTextEvent(const std::string &utf8)=0
virtual void InjectMouseWheel(const int &scrollX, const int &scrollY, const int &relativeScroll)=0
virtual void InjectMouseUp(const int &xPos, const int &yPos, const MouseButtonId &button)=0
virtual bool CheckPixelAlpha(const int &posX, const int &posY)=0
virtual void InjectTouchRemove(const int &touchid)=0
virtual void InjectTouchUpdate(const int &xPos, const int &yPos, const int &vx, const int &vy, const int &touchid)=0
virtual void InjectKeyEvent(const UINT &msg, const ScolWindowHandle &hwnd, const WPARAM &wParam, const LPARAM &lParam)=0
Definition SO3WidgetListener.h:44
Definition SO3WidgetManager.h:98
void _FireOnLoadStart(SWidget *targetedWidget)
Definition SO3WidgetManager.cpp:1023
void AddWidgetListener(SWidgetListener *newWidgetListener)
Definition SO3WidgetManager.cpp:860
void UpdateWidgetsZOrder()
Definition SO3WidgetManager.cpp:633
void InjectMouseUp(SWindow *originWindow, const int &xPos, const int &yPos, const MouseButtonId &button)
Definition SO3WidgetManager.cpp:309
void _FireScriptWidgetEvent(SWidget *targetedWidget, const SScriptFunction &functionCalled)
Definition SO3WidgetManager.cpp:1013
void InjectMouseMove(SWindow *originWindow, const int &xPos, const int &yPos, const MouseButtonId &button)
Definition SO3WidgetManager.cpp:212
void InjectTouchRemove(SWindow *originWindow, const int &touchid)
Definition SO3WidgetManager.cpp:380
void _FireOnLoadError(SWidget *targetedWidget, const int &errorCode, const std::string &failedUrl)
Definition SO3WidgetManager.cpp:1043
std::map< std::string, SWidget * > WidgetList
Definition SO3WidgetManager.h:100
void InjectMouseWheel(SWindow *originWindow, const int &scrollX, const int &scrollY, const int &relativeScroll)
Definition SO3WidgetManager.cpp:262
void InjectMouseDown(SWindow *originWindow, const int &xPos, const int &yPos, const MouseButtonId &button)
Definition SO3WidgetManager.cpp:274
void RemoveWidgetListener(SWidgetListener *existingWidgetListener)
Definition SO3WidgetManager.cpp:868
void AddWidgetFactory(SWidgetFactory *newWidgetFactory)
Definition SO3WidgetManager.cpp:84
void DeleteWidget(SWidget *existingWidget)
Definition SO3WidgetManager.cpp:174
SWidget * GetFocusedWidget()
Definition SO3WidgetManager.cpp:746
void InjectTouchAdd(SWindow *originWindow, const int &xPos, const int &yPos, const int &touchid)
Definition SO3WidgetManager.cpp:339
void RemoveWidgetFactory(SWidgetFactory *existingWidgetFactory)
Definition SO3WidgetManager.cpp:93
void UpdateFocusedWidget(SWidget *focusTargetedWidget)
Definition SO3WidgetManager.cpp:723
void InjectKeyEvent(const UINT &msg, const ScolWindowHandle &hwnd, const WPARAM &wParam, const LPARAM &lParam)
Definition SO3WidgetManager.cpp:617
void InjectTouchUpdate(SWindow *originWindow, const int &xPos, const int &yPos, const int &vx, const int &vy, const int &touchid)
Definition SO3WidgetManager.cpp:412
SWidget * CreateWidget(SScene *targetScene, const std::string &widgetName, const int &xPos, const int &yPos, const unsigned short &width, const unsigned short &height, SViewPort *targetViewport, const unsigned int &widgetZOrder, const std::string &widgetType)
Definition SO3WidgetManager.cpp:107
void InjectTextEvent(const std::string &text)
Definition SO3WidgetManager.cpp:627
void _FireOnLoadEnd(SWidget *targetedWidget)
Definition SO3WidgetManager.cpp:1033
static SWidgetManager & getSingleton()
Definition SO3WidgetManager.cpp:53
static SWidgetManager * getSingletonPtr()
Definition SO3WidgetManager.cpp:48
Definition SO3Window.h:45
SRaycastResult IndRayCast(const int &pixelsX, const int &pixelsY)
Definition SO3Window.cpp:1223
Definition OgreNewt_Debugger.h:21
Definition SO3DataScol.h:38
Generated by 1.9.8