ScummVM API documentation
msg_scroll_new_ui.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_CORE_MSG_SCROLL_NEW_UI_H
23 #define NUVIE_CORE_MSG_SCROLL_NEW_UI_H
24 
25 #include "ultima/nuvie/misc/call_back.h"
26 #include "ultima/nuvie/gui/widgets/gui_widget.h"
27 #include "ultima/shared/std/containers.h"
28 #include "ultima/shared/std/string.h"
29 
30 namespace Ultima {
31 namespace Nuvie {
32 
33 using Std::list;
34 
35 class Configuration;
36 class Font;
37 class MsgScroll;
38 class Actor;
39 class CallBack;
40 
41 typedef enum {
42  SCROLL_UP,
43  SCROLL_DOWN,
44  SCROLL_ESCAPE
45 } MsgScrollEventType;
46 
47 class MsgScrollNewUI: public MsgScroll {
48 
49  CallBack *timer;
50 
51  Font *font_normal;
52  Font *font_garg;
53 
54  bool solid_bg;
55  uint8 bg_color;
56  uint8 border_color;
57  uint16 position;
58 
59  Std::string trailing_whitespace;
60 
61 public:
62 
63  MsgScrollNewUI(const Configuration *cfg, Screen *s);
64  ~MsgScrollNewUI() override;
65 
66  GUI_status callback(uint16 msg, GUI_CallBack *caller, void *data) override {
67  return GUI_PASS;
68  }
69  uint16 callback(uint16 msg, CallBack *caller, void *data) override;
70  bool can_display_prompt() const override {
71  return false;
72  }
73 
74  bool can_fit_token_on_msgline(MsgLine *msg_line, MsgText *token) override;
75 
76  void Display(bool full_redraw) override;
77 
78  void display_prompt() override {}
79 
80  void display_string(const Std::string &s, Font *f, bool include_on_map_window) override;
81 
82  void set_font(uint8 font_type) override;
83  bool is_garg_font() override;
84 
85  GUI_status KeyDown(const Common::KeyState &key) override;
86  GUI_status MouseDown(int x, int y, Shared::MouseButton button) override;
87 
88  void move_scroll_down() override {
89  scroll_movement_event(SCROLL_DOWN);
90  }
91  void move_scroll_up() override {
92  scroll_movement_event(SCROLL_UP);
93  }
94 
95 protected:
96 
97 
98  MsgLine *add_new_line() override;
99 
100 private:
101  GUI_status scroll_movement_event(MsgScrollEventType event);
102  uint16 count_empty_lines(const Std::string &s);
103 
104 };
105 
106 } // End of namespace Nuvie
107 } // End of namespace Ultima
108 
109 #endif
Definition: msg_scroll_new_ui.h:47
Definition: msg_scroll.h:93
Definition: configuration.h:61
Definition: list.h:39
Definition: msg_scroll.h:75
Definition: screen.h:41
Definition: detection.h:27
Definition: call_back.h:50
Definition: string.h:30
Definition: msg_scroll.h:54
Definition: keyboard.h:294
Definition: font.h:42
Definition: gui_callback.h:31