1 https://github.com/Pingus/pingus/commit/fef8cf6512fa4aa09e87643c22ef66de9ec7bb41.patch
3 From fef8cf6512fa4aa09e87643c22ef66de9ec7bb41 Mon Sep 17 00:00:00 2001
4 From: Ingo Ruhnke <grumbel@gmail.com>
5 Date: Sat, 26 Jul 2014 20:49:11 +0200
6 Subject: [PATCH] Switched to boost::signals2
10 src/editor/button.hpp | 4 ++--
11 src/editor/checkbox.hpp | 4 ++--
12 src/editor/combobox.hpp | 4 ++--
13 src/editor/file_list.hpp | 4 ++--
14 src/editor/inputbox.hpp | 6 +++---
15 src/editor/message_box.hpp | 2 +-
16 src/editor/object_selector.cpp | 4 ++--
17 src/editor/viewport.hpp | 4 ++--
18 src/pingus/components/check_box.hpp | 4 ++--
19 src/pingus/components/choice_box.hpp | 4 ++--
20 src/pingus/components/slider_box.hpp | 4 ++--
21 src/pingus/config_manager.hpp | 28 ++++++++++++++--------------
22 src/pingus/screens/option_menu.hpp | 4 ++--
23 14 files changed, 40 insertions(+), 41 deletions(-)
25 diff --git a/SConscript b/SConscript
26 index 758567f51..c4d25a8a9 100644
29 @@ -187,9 +187,8 @@ class Project:
30 'src/engine/input/xinput/xinput_device.cpp'])
32 def configure_boost(self):
33 - if not self.conf.CheckLibWithHeader('boost_signals', 'boost/signals.hpp', 'c++'):
34 - if not self.conf.CheckLibWithHeader('boost_signals-mt', 'boost/signals.hpp', 'c++'):
35 - self.fatal_error += " * library 'boost_signals' not found\n"
36 + if not self.conf.CheckHeader('boost/signals2.hpp', '<>', 'c++'):
37 + self.fatal_error += " * library 'boost_signals2' not found\n"
39 def configure_png(self):
40 if self.conf.CheckMyProgram('pkg-config'):
41 diff --git a/src/editor/button.hpp b/src/editor/button.hpp
42 index c85d7da9e..d89dfe669 100644
43 --- a/src/editor/button.hpp
44 +++ b/src/editor/button.hpp
46 #ifndef HEADER_PINGUS_EDITOR_BUTTON_HPP
47 #define HEADER_PINGUS_EDITOR_BUTTON_HPP
49 -#include <boost/signal.hpp>
50 +#include <boost/signals2.hpp>
52 #include "engine/gui/rect_component.hpp"
54 @@ -48,7 +48,7 @@ class Button : public GUI::RectComponent
55 void enable() { enabled = true; }
56 void disable() { enabled = false; }
58 - boost::signal<void()> on_click;
59 + boost::signals2::signal<void()> on_click;
62 Button (const Button&);
63 diff --git a/src/editor/checkbox.hpp b/src/editor/checkbox.hpp
64 index 7c3bc835f..66382d79b 100644
65 --- a/src/editor/checkbox.hpp
66 +++ b/src/editor/checkbox.hpp
68 #ifndef HEADER_PINGUS_EDITOR_CHECKBOX_HPP
69 #define HEADER_PINGUS_EDITOR_CHECKBOX_HPP
71 -#include <boost/signal.hpp>
72 +#include <boost/signals2.hpp>
74 #include "engine/gui/rect_component.hpp"
76 @@ -40,7 +40,7 @@ class Checkbox : public GUI::RectComponent
77 bool is_checked() const { return checked; }
78 void on_primary_button_press(int x, int y);
80 - boost::signal<void (bool)> on_change;
81 + boost::signals2::signal<void (bool)> on_change;
84 Checkbox (const Checkbox&);
85 diff --git a/src/editor/combobox.hpp b/src/editor/combobox.hpp
86 index 0ca742593..603556bd9 100644
87 --- a/src/editor/combobox.hpp
88 +++ b/src/editor/combobox.hpp
90 #ifndef HEADER_PINGUS_EDITOR_COMBOBOX_HPP
91 #define HEADER_PINGUS_EDITOR_COMBOBOX_HPP
93 -#include <boost/signal.hpp>
94 +#include <boost/signals2.hpp>
96 #include "engine/display/sprite.hpp"
97 #include "engine/gui/rect_component.hpp"
98 @@ -88,7 +88,7 @@ class Combobox : public GUI::RectComponent
100 void update_layout() {}
102 - boost::signal<void (const ComboItem&)> on_select;
103 + boost::signals2::signal<void (const ComboItem&)> on_select;
107 diff --git a/src/editor/file_list.hpp b/src/editor/file_list.hpp
108 index cc4bba2de..85efe6aa0 100644
109 --- a/src/editor/file_list.hpp
110 +++ b/src/editor/file_list.hpp
112 #ifndef HEADER_PINGUS_EDITOR_FILE_LIST_HPP
113 #define HEADER_PINGUS_EDITOR_FILE_LIST_HPP
115 -#include <boost/signal.hpp>
116 +#include <boost/signals2.hpp>
118 #include "engine/display/sprite.hpp"
119 #include "engine/gui/rect_component.hpp"
120 @@ -61,7 +61,7 @@ class FileList : public GUI::RectComponent
121 bool has_more_next_pages();
122 bool has_more_prev_pages();
124 - boost::signal<void (const System::DirectoryEntry&)> on_click;
125 + boost::signals2::signal<void (const System::DirectoryEntry&)> on_click;
128 int items_per_page();
129 diff --git a/src/editor/inputbox.hpp b/src/editor/inputbox.hpp
130 index cad9663ec..87321dbba 100644
131 --- a/src/editor/inputbox.hpp
132 +++ b/src/editor/inputbox.hpp
134 #ifndef HEADER_PINGUS_EDITOR_INPUTBOX_HPP
135 #define HEADER_PINGUS_EDITOR_INPUTBOX_HPP
137 -#include <boost/signal.hpp>
138 +#include <boost/signals2.hpp>
140 #include "engine/gui/rect_component.hpp"
142 @@ -40,8 +40,8 @@ class Inputbox : public GUI::RectComponent
144 void update_layout() {}
146 - boost::signal<void (const std::string&)> on_change;
147 - boost::signal<void (const std::string&)> on_enter;
148 + boost::signals2::signal<void (const std::string&)> on_change;
149 + boost::signals2::signal<void (const std::string&)> on_enter;
152 Inputbox (const Inputbox&);
153 diff --git a/src/editor/message_box.hpp b/src/editor/message_box.hpp
154 index 385387a61..d885767cf 100644
155 --- a/src/editor/message_box.hpp
156 +++ b/src/editor/message_box.hpp
157 @@ -45,7 +45,7 @@ class MessageBox : public GUI::GroupComponent
158 void on_cancel_button();
161 - boost::signal<void()> on_ok;
162 + boost::signals2::signal<void()> on_ok;
165 MessageBox(const MessageBox&);
166 diff --git a/src/editor/object_selector.cpp b/src/editor/object_selector.cpp
167 index 28e306826..f3a36b5e8 100644
168 --- a/src/editor/object_selector.cpp
169 +++ b/src/editor/object_selector.cpp
172 #include "editor/object_selector.hpp"
174 -#include <boost/signal.hpp>
175 +#include <boost/signals2.hpp>
177 #include "editor/generic_level_obj.hpp"
178 #include "editor/gui_style.hpp"
179 @@ -47,7 +47,7 @@ class ObjectSelectorButton : public GUI::RectComponent
183 - boost::signal<void()> on_click;
184 + boost::signals2::signal<void()> on_click;
187 ObjectSelectorButton(ObjectSelectorList* object_list_,
188 diff --git a/src/editor/viewport.hpp b/src/editor/viewport.hpp
189 index 1ae9eff7c..18868254d 100644
190 --- a/src/editor/viewport.hpp
191 +++ b/src/editor/viewport.hpp
193 #ifndef HEADER_PINGUS_EDITOR_VIEWPORT_HPP
194 #define HEADER_PINGUS_EDITOR_VIEWPORT_HPP
196 -#include <boost/signal.hpp>
197 +#include <boost/signals2.hpp>
200 #include "editor/selection.hpp"
201 @@ -148,7 +148,7 @@ class Viewport : public GUI::RectComponent
203 void clear_selection();
205 - boost::signal<void (const Selection&)> selection_changed;
206 + boost::signals2::signal<void (const Selection&)> selection_changed;
209 Viewport (const Viewport&);
210 diff --git a/src/pingus/components/check_box.hpp b/src/pingus/components/check_box.hpp
211 index 00e23b764..5bef50f6b 100644
212 --- a/src/pingus/components/check_box.hpp
213 +++ b/src/pingus/components/check_box.hpp
215 #ifndef HEADER_PINGUS_PINGUS_COMPONENTS_CHECK_BOX_HPP
216 #define HEADER_PINGUS_PINGUS_COMPONENTS_CHECK_BOX_HPP
218 -#include <boost/signal.hpp>
219 +#include <boost/signals2.hpp>
221 #include "engine/display/sprite.hpp"
222 #include "engine/gui/rect_component.hpp"
223 @@ -39,7 +39,7 @@ class CheckBox : public GUI::RectComponent
225 void set_state(bool v, bool send_signal);
227 - boost::signal<void (bool)> on_change;
228 + boost::signals2::signal<void (bool)> on_change;
231 CheckBox (const CheckBox&);
232 diff --git a/src/pingus/components/choice_box.hpp b/src/pingus/components/choice_box.hpp
233 index 49d6e1948..ef51b6dd2 100644
234 --- a/src/pingus/components/choice_box.hpp
235 +++ b/src/pingus/components/choice_box.hpp
237 #ifndef HEADER_PINGUS_PINGUS_COMPONENTS_CHOICE_BOX_HPP
238 #define HEADER_PINGUS_PINGUS_COMPONENTS_CHOICE_BOX_HPP
240 -#include <boost/signal.hpp>
241 +#include <boost/signals2.hpp>
243 #include "engine/gui/rect_component.hpp"
245 @@ -36,7 +36,7 @@ class ChoiceBox : public GUI::RectComponent
246 void add_choice(const std::string& str);
247 void set_current_choice(int choice);
249 - boost::signal<void (std::string)> on_change;
250 + boost::signals2::signal<void (std::string)> on_change;
253 ChoiceBox (const ChoiceBox&);
254 diff --git a/src/pingus/components/slider_box.hpp b/src/pingus/components/slider_box.hpp
255 index ae4d92406..75118eac2 100644
256 --- a/src/pingus/components/slider_box.hpp
257 +++ b/src/pingus/components/slider_box.hpp
259 #ifndef HEADER_PINGUS_PINGUS_COMPONENTS_SLIDER_BOX_HPP
260 #define HEADER_PINGUS_PINGUS_COMPONENTS_SLIDER_BOX_HPP
262 -#include <boost/signal.hpp>
263 +#include <boost/signals2.hpp>
265 #include "engine/gui/rect_component.hpp"
267 @@ -39,7 +39,7 @@ class SliderBox : public GUI::RectComponent
269 void set_value(int v);
271 - boost::signal<void (int)> on_change;
272 + boost::signals2::signal<void (int)> on_change;
275 SliderBox (const SliderBox&);
276 diff --git a/src/pingus/config_manager.hpp b/src/pingus/config_manager.hpp
277 index b07b83e65..4cf08e046 100644
278 --- a/src/pingus/config_manager.hpp
279 +++ b/src/pingus/config_manager.hpp
281 #ifndef HEADER_PINGUS_PINGUS_CONFIG_MANAGER_HPP
282 #define HEADER_PINGUS_PINGUS_CONFIG_MANAGER_HPP
284 -#include <boost/signal.hpp>
285 +#include <boost/signals2.hpp>
287 #include "math/size.hpp"
288 #include "pingus/options.hpp"
289 @@ -39,55 +39,55 @@ class ConfigManager
291 void set_master_volume(int);
292 int get_master_volume() const;
293 - boost::signal<void(int)> on_master_volume_change;
294 + boost::signals2::signal<void(int)> on_master_volume_change;
296 void set_sound_volume(int);
297 int get_sound_volume() const;
298 - boost::signal<void(int)> on_sound_volume_change;
299 + boost::signals2::signal<void(int)> on_sound_volume_change;
301 void set_music_volume(int);
302 int get_music_volume() const;
303 - boost::signal<void(int)> on_music_volume_change;
304 + boost::signals2::signal<void(int)> on_music_volume_change;
306 void set_fullscreen_resolution(const Size& size);
307 Size get_fullscreen_resolution() const;
308 - boost::signal<void(Size)> on_fullscreen_resolution_change;
309 + boost::signals2::signal<void(Size)> on_fullscreen_resolution_change;
311 void set_fullscreen(bool);
312 bool get_fullscreen() const;
313 - boost::signal<void(bool)> on_fullscreen_change;
314 + boost::signals2::signal<void(bool)> on_fullscreen_change;
316 void set_renderer(FramebufferType type);
317 FramebufferType get_renderer() const;
318 - boost::signal<void(FramebufferType)> on_renderer_change;
319 + boost::signals2::signal<void(FramebufferType)> on_renderer_change;
321 void set_resizable(bool);
322 bool get_resizable() const;
323 - boost::signal<void(bool)> on_resizable_change;
324 + boost::signals2::signal<void(bool)> on_resizable_change;
326 void set_mouse_grab(bool);
327 bool get_mouse_grab() const;
328 - boost::signal<void(bool)> on_mouse_grab_change;
329 + boost::signals2::signal<void(bool)> on_mouse_grab_change;
331 void set_print_fps(bool);
332 bool get_print_fps() const;
333 - boost::signal<void(bool)> on_print_fps_change;
334 + boost::signals2::signal<void(bool)> on_print_fps_change;
336 void set_language(const tinygettext::Language&);
337 tinygettext::Language get_language() const;
338 - boost::signal<void(const tinygettext::Language&)> on_language_change;
339 + boost::signals2::signal<void(const tinygettext::Language&)> on_language_change;
341 void set_software_cursor(bool);
342 bool get_software_cursor() const;
343 - boost::signal<void(bool)> on_software_cursor_change;
344 + boost::signals2::signal<void(bool)> on_software_cursor_change;
346 void set_auto_scrolling(bool);
347 bool get_auto_scrolling() const;
348 - boost::signal<void(bool)> on_auto_scrolling_change;
349 + boost::signals2::signal<void(bool)> on_auto_scrolling_change;
351 void set_drag_drop_scrolling(bool);
352 bool get_drag_drop_scrolling() const;
353 - boost::signal<void(bool)> on_drag_drop_scrolling_change;
354 + boost::signals2::signal<void(bool)> on_drag_drop_scrolling_change;
357 ConfigManager (const ConfigManager&);
358 diff --git a/src/pingus/screens/option_menu.hpp b/src/pingus/screens/option_menu.hpp
359 index 60b1578d2..154ef0f69 100644
360 --- a/src/pingus/screens/option_menu.hpp
361 +++ b/src/pingus/screens/option_menu.hpp
363 #ifndef HEADER_PINGUS_PINGUS_SCREENS_OPTION_MENU_HPP
364 #define HEADER_PINGUS_PINGUS_SCREENS_OPTION_MENU_HPP
366 -#include <boost/signals.hpp>
367 +#include <boost/signals2.hpp>
371 @@ -66,7 +66,7 @@ class OptionMenu : public GUIScreen
372 //Label* defaults_label;
373 //CheckBox* defaults_box;
375 - typedef std::vector<boost::signals::connection> Connections;
376 + typedef std::vector<boost::signals2::connection> Connections;
377 Connections connections;
379 tinygettext::Language m_language;