ScummVM API documentation
spinner.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 BLADERUNNER_SPINNER_H
23 #define BLADERUNNER_SPINNER_H
24 
25 #include "common/array.h"
26 #include "common/rect.h"
27 
28 namespace BladeRunner {
29 
30 class BladeRunnerEngine;
31 class SaveFileReadStream;
32 class SaveFileWriteStream;
33 class Shapes;
34 class UIImagePicker;
35 class VQAPlayer;
36 
37 class Spinner {
38  static const int kSpinnerDestinations = 10;
39 
40  struct Destination {
41  int id;
42  Common::Rect rect;
43  int shapeId;
44  int shapeIdOver;
45  };
46 
47  BladeRunnerEngine *_vm;
48  bool _isDestinationSelectable[kSpinnerDestinations];
49  bool _isOpen;
50  VQAPlayer *_vqaPlayer;
51  const Destination *_destinations;
52  int _selectedDestination;
53  Shapes *_shapes;
54  UIImagePicker *_imagePicker;
55 
56  int _actorId;
57  int _sentenceId;
58  uint32 _timeSpeakDescriptionStart;
59 
60 public:
62  ~Spinner();
63 
64  void setSelectableDestinationFlag(int destination, bool selectable);
65  bool querySelectableDestinationFlag(int destination) const;
66 
67  int chooseDestination(int vqaLoopId, bool immediately);
68 
69  void open();
70  bool isOpen() const;
71 
72  int handleMouseUp(int x, int y);
73  int handleMouseDown(int x, int y);
74 
75  void tick();
76  void setSelectedDestination(int destination);
77  void reset();
78  void resume();
79 
80  void destinationFocus(int destination);
81  void setupDescription(int actorId, int sentenceId);
82  void resetDescription();
83  void tickDescription();
84 
85  void save(SaveFileWriteStream &f);
86  void load(SaveFileReadStream &f);
87 
88 private:
89  static void mouseInCallback(int, void *);
90  static void mouseOutCallback(int, void *);
91  static void mouseDownCallback(int, void *);
92  static void mouseUpCallback(int, void *);
93  static const Destination *getDestinationsFar();
94  static const Destination *getDestinationsMedium();
95  static const Destination *getDestinationsNear();
96 };
97 
98 } // End of namespace BladeRunner
99 
100 #endif
Definition: savefile.h:88
Definition: spinner.h:37
Definition: actor.h:31
Definition: savefile.h:113
Definition: rect.h:144
Definition: vqa_player.h:45
Definition: ui_image_picker.h:40
Definition: bladerunner.h:113
Definition: shape.h:61