ScummVM API documentation
view_item.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program 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
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef TITANIC_VIEW_ITEM_H
23 #define TITANIC_VIEW_ITEM_H
24 
25 #include "titanic/core/link_item.h"
26 #include "titanic/core/named_item.h"
27 #include "titanic/core/resource_key.h"
28 #include "titanic/messages/mouse_messages.h"
29 
30 namespace Titanic {
31 
32 class CViewItem : public CNamedItem {
33  DECLARE_MESSAGE_MAP;
34  bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
35  bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
36  bool MouseMoveMsg(CMouseMoveMsg *msg);
37  bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
38  bool MovementMsg(CMovementMsg *msg);
39 private:
40  CTreeItem *_buttonUpTargets[4];
41 private:
45  void setAngle(double angle);
46 
50  bool handleMouseMsg(CMouseMsg *msg, bool flag);
51 
55  void handleButtonUpMsg(CMouseButtonUpMsg *msg);
56 
61  CTreeItem *getItemAtPoint(const Point &pt);
62 protected:
63  int _field24;
64  CResourceKey _resourceKey;
65  Point _viewPos;
66 public:
67  int _viewNumber;
68  double _angle;
69 public:
70  CLASSDEF;
71  CViewItem();
72 
76  void save(SimpleFile *file, int indent) override;
77 
81  void load(SimpleFile *file) override;
82 
86  bool getResourceKey(CResourceKey *key);
87 
91  void leaveView(CViewItem *newView);
92 
96  void preEnterView(CViewItem *newView);
97 
101  void enterView(CViewItem *newView);
102 
106  CLinkItem *findLink(CViewItem *newView);
107 
112  CString getFullViewName() const;
113 
118  CString getNodeViewName() const;
119 
123  void getPosition(double &xp, double &yp, double &zp);
124 };
125 
126 } // End of namespace Titanic
127 
128 #endif /* TITANIC_NAMED_ITEM_H */
void preEnterView(CViewItem *newView)
Definition: resource_key.h:30
Definition: mouse_messages.h:117
Definition: mouse_messages.h:47
CString getNodeViewName() const
Definition: simple_file.h:49
void save(SimpleFile *file, int indent) override
Definition: named_item.h:33
Definition: tree_item.h:37
void getPosition(double &xp, double &yp, double &zp)
CString getFullViewName() const
void enterView(CViewItem *newView)
Definition: mouse_messages.h:32
bool getResourceKey(CResourceKey *key)
Definition: rect.h:45
Definition: arm.h:30
void leaveView(CViewItem *newView)
Definition: string.h:40
Definition: mouse_messages.h:87
void load(SimpleFile *file) override
Definition: mouse_messages.h:71
CLinkItem * findLink(CViewItem *newView)
Definition: messages.h:232
Definition: view_item.h:32