Game Develop Core: EventsEditorItemsAreas.h Source File

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
EventsEditorItemsAreas.h
Go to the documentation of this file.
1
6 #if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
7 #ifndef EVENTSEDITORITEMSAREAS_H
8 #define EVENTSEDITORITEMSAREAS_H
9 #include <wx/gdicmn.h>
10 #include <boost/weak_ptr.hpp>
11 #include <boost/unordered_map.hpp>
12 #include <vector>
13 #include <utility>
14 namespace gd { class BaseEvent; }
15 namespace gd { class Instruction; }
16 namespace gd { class Expression; }
17
18 namespace gd
19 {
20
27 class GD_CORE_API EventItem
28 {
29 public:
30 EventItem(boost::shared_ptr<gd::BaseEvent> event_, std::vector<boost::shared_ptr<gd::BaseEvent> > * eventsList_, unsigned int positionInList_ );
31 EventItem();
32 ~EventItem() {};
33
34 bool operator==(const gd::EventItem & other) const;
35
36 boost::shared_ptr<gd::BaseEvent> event;
37 std::vector<boost::shared_ptr<gd::BaseEvent> > * eventsList;
38 unsigned int positionInList;
39 };
40 size_t hash_value(const gd::EventItem & a);
41
46 class GD_CORE_API InstructionItem
47 {
48 public:
52 InstructionItem(gd::Instruction * instruction_, bool isCondition, std::vector<gd::Instruction>* instructionList_, unsigned int positionInList_, gd::BaseEvent * event );
53 InstructionItem();
54 ~InstructionItem() {};
55
56 bool operator==(const gd::InstructionItem & other) const;
57
58 gd::Instruction * instruction;
59 bool isCondition;
60 std::vector<gd::Instruction>* instructionList;
61 unsigned int positionInList;
62 gd::BaseEvent * event;
63 };
64 size_t hash_value(const gd::InstructionItem & a);
65
70 class GD_CORE_API InstructionListItem
71 {
72 public:
76 InstructionListItem(bool isConditionList, std::vector<gd::Instruction>* instructionList_, gd::BaseEvent * event );
77 InstructionListItem();
78 ~InstructionListItem() {};
79
80 bool operator==(const InstructionListItem & other) const;
81
82 bool isConditionList;
83 std::vector<gd::Instruction>* instructionList;
84 gd::BaseEvent * event;
85 };
86 size_t hash_value(const InstructionListItem & a);
87
92 class GD_CORE_API ParameterItem
93 {
94 public:
95 ParameterItem(gd::Expression * parameter_, gd::BaseEvent * event);
96 ParameterItem();
97 ~ParameterItem() {};
98
99 bool operator==(const ParameterItem & other) const;
100
101 gd::Expression * parameter;
102 gd::BaseEvent * event;
103 };
104 size_t hash_value(const ParameterItem & a);
105
110 class GD_CORE_API FoldingItem
111 {
112 public:
113 FoldingItem(gd::BaseEvent * event);
114 FoldingItem();
115 ~FoldingItem() {};
116
117 bool operator==(const FoldingItem & other) const;
118
119 gd::BaseEvent * event;
120 };
121 size_t hash_value(const FoldingItem & a);
122
129 class GD_CORE_API EventsEditorItemsAreas
130 {
131 public:
132
136 void AddInstructionArea(wxRect area, gd::InstructionItem & instruction);
137
141 void AddParameterArea(wxRect area, ParameterItem & parameter);
142
146 void AddEventArea(wxRect area, gd::EventItem & event);
147
151 void AddFoldingItem(wxRect area, FoldingItem & event);
152
156 void AddInstructionListArea(wxRect area, InstructionListItem & item);
157
161 bool IsOnEvent(int x, int y);
162
166 EventItem GetEventAt(int x, int y);
167
171 wxRect GetAreaOfEventAt(int x, int y);
172
176 bool IsOnInstruction(int x, int y);
177
181 gd::InstructionItem GetInstructionAt(int x, int y);
182
186 bool IsOnInstructionList(int x, int y);
187
191 InstructionListItem GetInstructionListAt(int x, int y);
192
196 wxRect GetAreaOfInstructionAt(int x, int y);
197
201 wxRect GetAreaOfInstructionListAt(int x, int y);
202
206 bool IsOnParameter(int x, int y);
207
211 ParameterItem GetParameterAt(int x, int y);
212
216 wxRect GetAreaOfParameterAt(int x, int y);
217
221 bool IsOnFoldingItem(int x, int y);
222
226 FoldingItem GetFoldingItemAt(int x, int y);
227
231 void Clear();
232
236 EventsEditorItemsAreas() {};
237
241 virtual ~EventsEditorItemsAreas() {};
242
243 std::vector< std::pair<wxRect, EventItem > > eventsAreas;
244 std::vector< std::pair<wxRect, gd::InstructionItem > > instructionsAreas;
245 std::vector< std::pair<wxRect, ParameterItem > > parametersAreas;
246 std::vector< std::pair<wxRect, FoldingItem > > foldingAreas;
247 std::vector< std::pair<wxRect, InstructionListItem > > instructionListsAreas;
248
249 private:
250 };
251
252 }
253 #endif // EVENTSEDITORITEMSAREAS_H
254 #endif