MyGUI: MyGUI_PointerManager.h Source File

MyGUI 3.4.3

MyGUI_PointerManager.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_POINTER_MANAGER_H_
8#define MYGUI_POINTER_MANAGER_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Singleton.h"
12#include "MyGUI_EventPair.h"
13#include "MyGUI_IUnlinkWidget.h"
14#include "MyGUI_ImageBox.h"
15#include "MyGUI_IPointer.h"
16#include "MyGUI_BackwardCompatibility.h"
17
18namespace MyGUI
19{
20
21 class MYGUI_EXPORT PointerManager : public IUnlinkWidget, public MemberObsolete<PointerManager>
22 {
23 MYGUI_SINGLETON_DECLARATION(PointerManager);
24
25 public:
26 PointerManager();
27
28 void initialise();
29 void shutdown();
30
32 void setVisible(bool _visible);
34 bool isVisible() const;
35
39 void setPointer(std::string_view _name);
41 void resetToDefaultPointer();
42
44 const std::string& getDefaultPointer() const;
46 void setDefaultPointer(std::string_view _value);
47
49 const std::string& getLayerName() const;
51 void setLayerName(std::string_view _value);
52
54 IPointer* getByName(std::string_view _name) const;
55
56 /*events:*/
61 EventPairConvertStringView<
62 delegates::MultiDelegate<const std::string&>,
63 delegates::MultiDelegate<std::string_view>>
64 eventChangeMousePointer;
65
66 private:
67 void _unlinkWidget(Widget* _widget) override;
68 void _load(xml::ElementPtr _node, std::string_view _file, Version _version);
69
70 // создает виджет
71 Widget* baseCreateWidget(
72 WidgetStyle _style,
73 std::string_view _type,
74 std::string_view _skin,
75 const IntCoord& _coord,
76 Align _align,
77 std::string_view _layer,
78 std::string_view _name);
79
80 // удаляет всех детей
81 void _destroyAllChildWidget();
82
83 void Update();
84
85 void notifyFrameStart(float _time);
86 void notifyChangeMouseFocus(Widget* _widget);
87 void setPointer(std::string_view _name, Widget* _owner);
88
89 private:
90 // вектор всех детей виджетов
91 VectorWidgetPtr mWidgetChild;
92
93 std::string mDefaultName;
94 IntPoint mPoint;
95 IntPoint mOldPoint;
96 bool mVisible{false};
97 std::string mLayerName;
98 std::string mSkinName;
99
100 Widget* mWidgetOwner{nullptr};
101 ImageBox* mMousePointer{nullptr};
102 IPointer* mPointer{nullptr};
103 std::string mCurrentMousePointer;
104
105 bool mIsInitialise{false};
106 std::string mXmlPointerTagName;
107 std::string mXmlPropertyTagName;
108 std::string mXmlDefaultPointerValue;
109 };
110
111} // namespace MyGUI
112
113#endif // MYGUI_POINTER_MANAGER_H_
MyGUI_BackwardCompatibility.h
MyGUI_EventPair.h
MyGUI_IPointer.h
MyGUI_IUnlinkWidget.h
MyGUI_ImageBox.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI_Singleton.h
MYGUI_SINGLETON_DECLARATION
#define MYGUI_SINGLETON_DECLARATION(ClassName)
Definition MyGUI_Singleton.h:112
MyGUI::EventPairConvertStringView
Definition MyGUI_EventPair.h:213
MyGUI::IPointer
Definition MyGUI_IPointer.h:17
MyGUI::IUnlinkWidget
Definition MyGUI_IUnlinkWidget.h:17
MyGUI::MemberObsolete
Definition MyGUI_DeprecatedTypes.h:14
MyGUI::PointerManager::PointerManager
PointerManager(const PointerManager &)=delete
MyGUI::PointerManager::resetToDefaultPointer
void resetToDefaultPointer()
Definition MyGUI_PointerManager.cpp:157
MyGUI::PointerManager::setPointer
void setPointer(std::string_view _name)
Definition MyGUI_PointerManager.cpp:266
MyGUI::PointerManager::isVisible
bool isVisible() const
Definition MyGUI_PointerManager.cpp:271
MyGUI::PointerManager::getDefaultPointer
const std::string & getDefaultPointer() const
Definition MyGUI_PointerManager.cpp:276
MyGUI::PointerManager::setVisible
void setVisible(bool _visible)
Definition MyGUI_PointerManager.cpp:121
MyGUI::PointerManager::getLayerName
const std::string & getLayerName() const
Definition MyGUI_PointerManager.cpp:281
MyGUI::PointerManager::eventChangeMousePointer
EventPairConvertStringView< delegates::MultiDelegate< const std::string & >, delegates::MultiDelegate< std::string_view > > eventChangeMousePointer
Definition MyGUI_PointerManager.h:64
MyGUI::PointerManager::shutdown
void shutdown()
Definition MyGUI_PointerManager.cpp:62
MyGUI::PointerManager::setDefaultPointer
void setDefaultPointer(std::string_view _value)
Definition MyGUI_PointerManager.cpp:203
MyGUI::PointerManager::setLayerName
void setLayerName(std::string_view _value)
Definition MyGUI_PointerManager.cpp:211
MyGUI::PointerManager::getByName
IPointer * getByName(std::string_view _name) const
Definition MyGUI_PointerManager.cpp:233
MyGUI::PointerManager::initialise
void initialise()
Definition MyGUI_PointerManager.cpp:35
MyGUI::Version
Definition MyGUI_Version.h:18
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI::delegates::MultiDelegate
Definition MyGUI_Delegate.h:190
MyGUI::xml::ElementPtr
Element * ElementPtr
Definition MyGUI_XmlDocument.h:112
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::IntPoint
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:27
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
MyGUI::VectorWidgetPtr
std::vector< Widget * > VectorWidgetPtr
Definition MyGUI_WidgetDefines.h:20
MyGUI::Align
Definition MyGUI_Align.h:20
MyGUI::WidgetStyle
Definition MyGUI_WidgetStyle.h:19