ScummVM API documentation
resviewer.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 ASYLUM_VIEWS_RESVIEWER_H
23 #define ASYLUM_VIEWS_RESVIEWER_H
24 
25 #include "asylum/system/graphics.h"
26 
27 #include "asylum/eventhandler.h"
28 #include "asylum/shared.h"
29 
30 namespace Common {
31 class Keymap;
32 }
33 
34 namespace Asylum {
35 
36 class AsylumEngine;
37 
38 class ResourceViewer : public EventHandler {
39 public:
41  ~ResourceViewer() {};
42 
43  void setEventHandler(EventHandler *handler) { _handler = handler; }
44  bool setResourceId(ResourceId resourceId);
45  bool handleEvent(const AsylumEvent &evt);
46 
47 private:
48  AsylumEngine *_vm;
49  EventHandler *_handler;
50  Common::Keymap *_keymap;
51  ResourceId _resourceId;
52  GraphicResource _resource;
53  int _frameIndex;
54  uint _frameCount;
55  int _frameIncrement;
56  int16 _x, _y;
57  uint16 _width, _height;
58  bool _scroll;
59  int _resPack;
60  int _paletteIndex;
61  bool _animate;
62 
63  bool isPalette(ResourceId resourceId);
64  void drawPalette();
65  void drawResource();
66 
67  void action(const AsylumEvent &evt);
68  void update();
69 };
70 
71 } // End of namespace Asylum
72 
73 #endif // ASYLUM_VIEWS_RESVIEWER_H
Definition: keymap.h:66
Definition: asylum.h:53
Definition: eventhandler.h:43
Definition: algorithm.h:29
Definition: eventhandler.h:61
Definition: asylum.h:73
Definition: graphics.h:58
Definition: resviewer.h:38