ScummVM API documentation
draggable_view.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 NUVIE_VIEWS_INVENTORY_FONT_H
23 #define NUVIE_VIEWS_INVENTORY_FONT_H
24 
25 #include "ultima/nuvie/views/view.h"
26 #include "graphics/managed_surface.h"
27 
28 namespace Ultima {
29 namespace Nuvie {
30 
31 class Configuration;
32 class GUI_Button;
33 
34 class DraggableView: public View {
35 protected:
36  Graphics::ManagedSurface *bg_image;
37  uint32 bg_color_key;
38 
39 private:
40  bool drag, need_full_redraw_when_moved, always_need_full_redraw_when_moved;
41  int button_x, button_y;
42 
43 public:
44  DraggableView(const Configuration *config);
45  ~DraggableView() override;
46 
47  /* events, used for dragging the area. */
48  GUI_status MouseDown(int x, int y, Shared::MouseButton button) override;
49  GUI_status MouseUp(int x, int y, Shared::MouseButton button) override;
50  GUI_status MouseMotion(int x, int y, uint8 state) override;
51  void MoveRelative(int dx, int dy) override;
52 
53 protected:
54  void set_bg_color_key(uint8 r, uint8 g, uint8 b);
55  void force_full_redraw_if_needed();
56 };
57 
58 } // End of namespace Nuvie
59 } // End of namespace Ultima
60 
61 #endif
Definition: managed_surface.h:51
Definition: configuration.h:61
Definition: detection.h:27
Definition: view.h:42
Definition: draggable_view.h:34