Merge lp:~3v1n0/unity/lockscreen-media-accelerators into lp:unity
- lockscreen-media-accelerators
- Merge into trunk
Proposed by
Marco Trevisan (Treviño)
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Andrea Azzarone | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 4131 | ||||
Proposed branch: | lp:~3v1n0/unity/lockscreen-media-accelerators | ||||
Merge into: | lp:unity | ||||
Diff against target: |
657 lines (+196/-175) 11 files modified
lockscreen/LockScreenAcceleratorController.cpp (+143/-148) lockscreen/LockScreenAcceleratorController.h (+8/-3) lockscreen/LockScreenAccelerators.cpp (+5/-0) lockscreen/LockScreenAccelerators.h (+3/-1) lockscreen/LockScreenController.cpp (+3/-1) lockscreen/LockScreenController.h (+3/-1) plugins/unityshell/src/unityshell.cpp (+10/-10) tests/test_lockscreen_controller.cpp (+8/-4) unity-shared/GnomeKeyGrabber.cpp (+7/-5) unity-shared/GnomeKeyGrabberImpl.h (+2/-2) unity-shared/KeyGrabber.h (+4/-0) |
||||
To merge this branch: | bzr merge lp:~3v1n0/unity/lockscreen-media-accelerators | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrea Azzarone (community) | Approve | ||
PS Jenkins bot | continuous-integration | Pending | |
Review via email: mp+297978@code.launchpad.net |
Commit message
LockScreenAccel
This makes U-S-D to handle key events, without having to add some extra
custom code inside the lockscreen. It's all just about whitelisting the
wanted values.
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lockscreen/LockScreenAcceleratorController.cpp' | |||
2 | --- lockscreen/LockScreenAcceleratorController.cpp 2014-05-16 04:51:34 +0000 | |||
3 | +++ lockscreen/LockScreenAcceleratorController.cpp 2016-06-21 14:42:21 +0000 | |||
4 | @@ -1,6 +1,6 @@ | |||
5 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- |
6 | 2 | /* | 2 | /* |
8 | 3 | * Copyright (C) 2014 Canonical Ltd | 3 | * Copyright (C) 2014-2016 Canonical Ltd |
9 | 4 | * | 4 | * |
10 | 5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
11 | 6 | * it under the terms of the GNU General Public License version 3 as | 6 | * it under the terms of the GNU General Public License version 3 as |
12 | @@ -15,10 +15,12 @@ | |||
13 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
14 | 16 | * | 16 | * |
15 | 17 | * Authored by: William Hua <william.hua@canonical.com> | 17 | * Authored by: William Hua <william.hua@canonical.com> |
16 | 18 | * Marco Trevisan <marco.trevisan@canonical.com> | ||
17 | 18 | */ | 19 | */ |
18 | 19 | 20 | ||
19 | 20 | #include "LockScreenAcceleratorController.h" | 21 | #include "LockScreenAcceleratorController.h" |
20 | 21 | 22 | ||
21 | 23 | #include <NuxCore/Logger.h> | ||
22 | 22 | #include <UnityCore/GLibDBusProxy.h> | 24 | #include <UnityCore/GLibDBusProxy.h> |
23 | 23 | 25 | ||
24 | 24 | namespace unity | 26 | namespace unity |
25 | @@ -28,157 +30,150 @@ | |||
26 | 28 | 30 | ||
27 | 29 | namespace | 31 | namespace |
28 | 30 | { | 32 | { |
118 | 31 | const char* const MEDIA_KEYS_SCHEMA = "org.gnome.settings-daemon.plugins.media-keys"; | 33 | DECLARE_LOGGER(logger, "unity.lockscreen.accelerator.controller"); |
119 | 32 | const char* const MEDIA_KEYS_KEY_VOLUME_MUTE = "volume-mute"; | 34 | |
120 | 33 | const char* const MEDIA_KEYS_KEY_VOLUME_DOWN = "volume-down"; | 35 | const std::string MEDIA_KEYS_SCHEMA = "org.gnome.settings-daemon.plugins.media-keys"; |
121 | 34 | const char* const MEDIA_KEYS_KEY_VOLUME_UP = "volume-up"; | 36 | const std::vector<std::string> ALLOWED_MEDIA_KEYS = { |
122 | 35 | 37 | "logout", | |
123 | 36 | const char* const POWER_SCHEMA = "org.gnome.settings-daemon.plugins.power"; | 38 | "magnifier", |
124 | 37 | const char* const SUSPEND_BUTTON_ACTION_KEY = "button-suspend"; | 39 | "on-screen-keyboard", |
125 | 38 | const char* const SLEEP_BUTTON_ACTION_KEY = "button-sleep"; | 40 | "magnifier-zoom-in", |
126 | 39 | const char* const HIBERNATE_BUTTON_ACTION_KEY = "button-hibernate"; | 41 | "screenreader", |
127 | 40 | const char* const POWER_BUTTON_ACTION_KEY = "button-power"; | 42 | "pause", |
128 | 41 | const char* const POWER_KEY_SUSPEND = "XF86Suspend"; | 43 | "stop", |
129 | 42 | const char* const POWER_KEY_SLEEP = "XF86Sleep"; | 44 | "toggle-contrast", |
130 | 43 | const char* const POWER_KEY_HIBERNATE = "XF86Hibernate"; | 45 | "video-out", |
131 | 44 | const char* const POWER_KEY_POWEROFF = "XF86PowerOff"; | 46 | "volume-down", |
132 | 45 | 47 | "volume-mute", | |
133 | 46 | const char* const INPUT_SWITCH_SCHEMA = "org.gnome.desktop.wm.keybindings"; | 48 | "volume-up", |
134 | 47 | const char* const INPUT_SWITCH_KEY_PREVIOUS_SOURCE = "switch-input-source-backward"; | 49 | }; |
135 | 48 | const char* const INPUT_SWITCH_KEY_NEXT_SOURCE = "switch-input-source"; | 50 | |
136 | 49 | 51 | const std::string WM_KEYS_SCHEMA = "org.gnome.desktop.wm.keybindings"; | |
137 | 50 | const char* const INDICATOR_INTERFACE_ACTIONS = "org.gtk.Actions"; | 52 | const std::vector<std::string> ALLOWED_WM_KEYS = { |
138 | 51 | const char* const INDICATOR_METHOD_ACTIVATE = "Activate"; | 53 | "switch-input-source", |
139 | 52 | const char* const INDICATOR_SOUND_BUS_NAME = "com.canonical.indicator.sound"; | 54 | "switch-input-source-backward", |
140 | 53 | const char* const INDICATOR_SOUND_OBJECT_PATH = "/com/canonical/indicator/sound"; | 55 | }; |
141 | 54 | const char* const INDICATOR_SOUND_ACTION_MUTE = "mute"; | 56 | |
142 | 55 | const char* const INDICATOR_SOUND_ACTION_SCROLL = "scroll"; | 57 | const std::vector<std::string> ALLOWED_XF86_KEYS = { |
143 | 56 | const char* const INDICATOR_KEYBOARD_BUS_NAME = "com.canonical.indicator.keyboard"; | 58 | "XF86ScreenSaver", |
144 | 57 | const char* const INDICATOR_KEYBOARD_OBJECT_PATH = "/com/canonical/indicator/keyboard"; | 59 | "XF86Sleep", |
145 | 58 | const char* const INDICATOR_KEYBOARD_ACTION_SCROLL = "locked_scroll"; | 60 | "XF86Standby", |
146 | 59 | 61 | "XF86Suspend", | |
147 | 60 | void ActivateIndicator(std::string const& bus_name, | 62 | "XF86Hibernate", |
148 | 61 | std::string const& object_path, | 63 | "XF86PowerOff", |
149 | 62 | std::string const& action_name, | 64 | "XF86MonBrightnessUp", |
150 | 63 | glib::Variant const& parameters = glib::Variant()) | 65 | "XF86MonBrightnessDown", |
151 | 64 | { | 66 | "XF86KbdBrightnessUp", |
152 | 65 | GVariantBuilder builder; | 67 | "XF86KbdBrightnessDown", |
153 | 66 | 68 | "XF86KbdLightOnOff", | |
154 | 67 | g_variant_builder_init(&builder, G_VARIANT_TYPE("(sava{sv})")); | 69 | "XF86AudioMicMute", |
155 | 68 | g_variant_builder_add(&builder, "s", action_name.c_str()); | 70 | "XF86Touchpad", |
156 | 69 | 71 | }; | |
157 | 70 | if (parameters) | 72 | |
158 | 71 | g_variant_builder_add_parsed(&builder, "[%v]", static_cast<GVariant*>(parameters)); | 73 | bool IsKeyBindingAllowed(std::string const& key) |
159 | 72 | else | 74 | { |
160 | 73 | g_variant_builder_add_parsed(&builder, "@av []"); | 75 | if (std::find(begin(ALLOWED_XF86_KEYS), end(ALLOWED_XF86_KEYS), key) != end(ALLOWED_XF86_KEYS)) |
161 | 74 | 76 | return true; | |
162 | 75 | g_variant_builder_add_parsed(&builder, "@a{sv} []"); | 77 | |
163 | 76 | 78 | glib::Object<GSettings> media_settings(g_settings_new(MEDIA_KEYS_SCHEMA.c_str())); | |
164 | 77 | auto proxy = std::make_shared<glib::DBusProxy>(bus_name, object_path, INDICATOR_INTERFACE_ACTIONS); | 79 | Accelerator key_accelerator(key); |
165 | 78 | proxy->CallBegin(INDICATOR_METHOD_ACTIVATE, g_variant_builder_end(&builder), [proxy] (GVariant*, glib::Error const&) {}); | 80 | |
166 | 79 | } | 81 | for (auto const& setting : ALLOWED_MEDIA_KEYS) |
167 | 80 | 82 | { | |
168 | 81 | void MuteIndicatorSound() | 83 | Accelerator media_key(glib::String(g_settings_get_string(media_settings, setting.c_str())).Str()); |
169 | 82 | { | 84 | if (media_key == key_accelerator) |
170 | 83 | ActivateIndicator(INDICATOR_SOUND_BUS_NAME, | 85 | return true; |
171 | 84 | INDICATOR_SOUND_OBJECT_PATH, | 86 | } |
172 | 85 | INDICATOR_SOUND_ACTION_MUTE); | 87 | |
173 | 86 | } | 88 | glib::Object<GSettings> wm_settings(g_settings_new(WM_KEYS_SCHEMA.c_str())); |
174 | 87 | 89 | ||
175 | 88 | void ScrollIndicatorSound(int offset) | 90 | for (auto const& setting : ALLOWED_WM_KEYS) |
176 | 89 | { | 91 | { |
177 | 90 | ActivateIndicator(INDICATOR_SOUND_BUS_NAME, | 92 | glib::Variant accels(g_settings_get_value(wm_settings, setting.c_str()), glib::StealRef()); |
178 | 91 | INDICATOR_SOUND_OBJECT_PATH, | 93 | auto children = g_variant_n_children(accels); |
179 | 92 | INDICATOR_SOUND_ACTION_SCROLL, | 94 | |
180 | 93 | g_variant_new_int32(offset)); | 95 | if (children > 0) |
181 | 94 | } | 96 | { |
182 | 95 | 97 | glib::String value; | |
183 | 96 | void ScrollIndicatorKeyboard(int offset) | 98 | |
184 | 97 | { | 99 | for (auto i = 0u; i < children; ++i) |
185 | 98 | ActivateIndicator(INDICATOR_KEYBOARD_BUS_NAME, | 100 | { |
186 | 99 | INDICATOR_KEYBOARD_OBJECT_PATH, | 101 | g_variant_get_child(accels, 0, "s", &value); |
187 | 100 | INDICATOR_KEYBOARD_ACTION_SCROLL, | 102 | |
188 | 101 | g_variant_new_int32(-offset)); | 103 | if (Accelerator(value.Str()) == key_accelerator) |
189 | 102 | } | 104 | return true; |
190 | 103 | 105 | } | |
191 | 104 | void PowerAction(session::Manager::Ptr const& session, const char *action_key) | 106 | } |
192 | 105 | { | 107 | } |
193 | 106 | glib::Object<GSettings> settings(g_settings_new(POWER_SCHEMA)); | 108 | |
194 | 107 | auto const& action = glib::String(g_settings_get_string(settings, action_key)).Str(); | 109 | return false; |
195 | 108 | 110 | } | |
196 | 109 | if (action == "interactive") | 111 | |
108 | 110 | session->shutdown_requested.emit(session->HasInhibitors()); | ||
109 | 111 | else if (action == "shutdown") | ||
110 | 112 | session->reboot_requested.emit(session->HasInhibitors()); | ||
111 | 113 | else if (action == "suspend") | ||
112 | 114 | session->Suspend(); | ||
113 | 115 | else if (action == "hibernate") | ||
114 | 116 | session->Hibernate(); | ||
115 | 117 | else if (action == "blank") | ||
116 | 118 | session->ScreenSaverActivate(); | ||
117 | 119 | } | ||
197 | 120 | } // namespace | 112 | } // namespace |
198 | 121 | 113 | ||
200 | 122 | AcceleratorController::AcceleratorController(session::Manager::Ptr const& session) | 114 | AcceleratorController::AcceleratorController(key::Grabber::Ptr const& key_grabber) |
201 | 123 | : accelerators_(new Accelerators) | 115 | : accelerators_(new Accelerators) |
202 | 124 | { | 116 | { |
260 | 125 | auto settings = glib::Object<GSettings>(g_settings_new(MEDIA_KEYS_SCHEMA)); | 117 | for (auto const& action : key_grabber->GetActions()) |
261 | 126 | 118 | AddAction(action); | |
262 | 127 | auto accelerator = std::make_shared<Accelerator>(glib::String(g_settings_get_string(settings, MEDIA_KEYS_KEY_VOLUME_MUTE))); | 119 | |
263 | 128 | accelerator->activated.connect(std::function<void()>(MuteIndicatorSound)); | 120 | key_grabber->action_added.connect(sigc::mem_fun(this, &AcceleratorController::AddAction)); |
264 | 129 | accelerators_->Add(accelerator); | 121 | key_grabber->action_removed.connect(sigc::mem_fun(this, &AcceleratorController::RemoveAction)); |
265 | 130 | 122 | } | |
266 | 131 | accelerator = std::make_shared<Accelerator>(glib::String(g_settings_get_string(settings, MEDIA_KEYS_KEY_VOLUME_DOWN))); | 123 | |
267 | 132 | accelerator->activated.connect(std::bind(ScrollIndicatorSound, -1)); | 124 | void AcceleratorController::AddAction(CompAction const& action) |
268 | 133 | accelerators_->Add(accelerator); | 125 | { |
269 | 134 | 126 | if (action.type() != CompAction::BindingTypeKey) | |
270 | 135 | accelerator = std::make_shared<Accelerator>(glib::String(g_settings_get_string(settings, MEDIA_KEYS_KEY_VOLUME_UP))); | 127 | return; |
271 | 136 | accelerator->activated.connect(std::bind(ScrollIndicatorSound, +1)); | 128 | |
272 | 137 | accelerators_->Add(accelerator); | 129 | auto const& key = action.keyToString(); |
273 | 138 | 130 | ||
274 | 139 | accelerator = std::make_shared<Accelerator>(POWER_KEY_SUSPEND); | 131 | if (!IsKeyBindingAllowed(key)) |
275 | 140 | accelerator->activated.connect(std::bind(PowerAction, session, SUSPEND_BUTTON_ACTION_KEY)); | 132 | { |
276 | 141 | accelerators_->Add(accelerator); | 133 | LOG_DEBUG(logger) << "Action not allowed " << key; |
277 | 142 | 134 | return; | |
278 | 143 | accelerator = std::make_shared<Accelerator>(POWER_KEY_SLEEP); | 135 | } |
279 | 144 | accelerator->activated.connect(std::bind(PowerAction, session, SLEEP_BUTTON_ACTION_KEY)); | 136 | |
280 | 145 | accelerators_->Add(accelerator); | 137 | auto accelerator = std::make_shared<Accelerator>(key); |
281 | 146 | 138 | accelerator->activated.connect(sigc::bind(sigc::mem_fun(this, &AcceleratorController::OnActionActivated), action)); | |
282 | 147 | accelerator = std::make_shared<Accelerator>(POWER_KEY_HIBERNATE); | 139 | accelerators_->Add(accelerator); |
283 | 148 | accelerator->activated.connect(std::bind(PowerAction, session, HIBERNATE_BUTTON_ACTION_KEY)); | 140 | actions_accelerators_.push_back({action, accelerator}); |
284 | 149 | accelerators_->Add(accelerator); | 141 | |
285 | 150 | 142 | LOG_DEBUG(logger) << "Action added " << key; | |
286 | 151 | accelerator = std::make_shared<Accelerator>(POWER_KEY_POWEROFF); | 143 | } |
287 | 152 | accelerator->activated.connect(std::bind(PowerAction, session, POWER_BUTTON_ACTION_KEY)); | 144 | |
288 | 153 | accelerators_->Add(accelerator); | 145 | void AcceleratorController::RemoveAction(CompAction const& action) |
289 | 154 | 146 | { | |
290 | 155 | settings = glib::Object<GSettings>(g_settings_new(INPUT_SWITCH_SCHEMA)); | 147 | if (action.type() != CompAction::BindingTypeKey) |
291 | 156 | 148 | return; | |
292 | 157 | auto variant = glib::Variant(g_settings_get_value(settings, INPUT_SWITCH_KEY_PREVIOUS_SOURCE), glib::StealRef()); | 149 | |
293 | 158 | 150 | LOG_DEBUG(logger) << "Removing action " << action.keyToString(); | |
294 | 159 | if (g_variant_n_children(variant) > 0) | 151 | |
295 | 160 | { | 152 | for (auto it = begin(actions_accelerators_); it != end(actions_accelerators_);) |
296 | 161 | const gchar* string; | 153 | { |
297 | 162 | 154 | if (it->first == action) | |
298 | 163 | g_variant_get_child(variant, 0, "&s", &string); | 155 | { |
299 | 164 | 156 | accelerators_->Remove(it->second); | |
300 | 165 | accelerator = std::make_shared<Accelerator>(string); | 157 | it = actions_accelerators_.erase(it); |
301 | 166 | accelerator->activated.connect(std::bind(ScrollIndicatorKeyboard, -1)); | 158 | } |
302 | 167 | accelerators_->Add(accelerator); | 159 | else |
303 | 168 | } | 160 | { |
304 | 169 | 161 | ++it; | |
305 | 170 | variant = glib::Variant(g_settings_get_value(settings, INPUT_SWITCH_KEY_NEXT_SOURCE), glib::StealRef()); | 162 | } |
306 | 171 | 163 | } | |
307 | 172 | if (g_variant_n_children(variant) > 0) | 164 | } |
308 | 173 | { | 165 | |
309 | 174 | const gchar* string; | 166 | void AcceleratorController::OnActionActivated(CompAction& action) |
310 | 175 | 167 | { | |
311 | 176 | g_variant_get_child(variant, 0, "&s", &string); | 168 | LOG_DEBUG(logger) << "Activating action " << action.keyToString(); |
312 | 177 | 169 | ||
313 | 178 | accelerator = std::make_shared<Accelerator>(string); | 170 | CompOption::Vector options; |
314 | 179 | accelerator->activated.connect(std::bind(ScrollIndicatorKeyboard, +1)); | 171 | |
315 | 180 | accelerators_->Add(accelerator); | 172 | if (action.state() & CompAction::StateInitKey) |
316 | 181 | } | 173 | action.initiate()(&action, 0, options); |
317 | 174 | |||
318 | 175 | if (action.state() & CompAction::StateTermKey) | ||
319 | 176 | action.terminate()(&action, CompAction::StateTermTapped, options); | ||
320 | 182 | } | 177 | } |
321 | 183 | 178 | ||
322 | 184 | Accelerators::Ptr const& AcceleratorController::GetAccelerators() const | 179 | Accelerators::Ptr const& AcceleratorController::GetAccelerators() const |
323 | 185 | 180 | ||
324 | === modified file 'lockscreen/LockScreenAcceleratorController.h' | |||
325 | --- lockscreen/LockScreenAcceleratorController.h 2016-03-31 09:51:33 +0000 | |||
326 | +++ lockscreen/LockScreenAcceleratorController.h 2016-06-21 14:42:21 +0000 | |||
327 | @@ -20,7 +20,7 @@ | |||
328 | 20 | #ifndef UNITY_LOCKSCREEN_ACCELERATOR_CONTROLLER | 20 | #ifndef UNITY_LOCKSCREEN_ACCELERATOR_CONTROLLER |
329 | 21 | #define UNITY_LOCKSCREEN_ACCELERATOR_CONTROLLER | 21 | #define UNITY_LOCKSCREEN_ACCELERATOR_CONTROLLER |
330 | 22 | 22 | ||
332 | 23 | #include "UnityCore/SessionManager.h" | 23 | #include "unity-shared/KeyGrabber.h" |
333 | 24 | #include "LockScreenAccelerators.h" | 24 | #include "LockScreenAccelerators.h" |
334 | 25 | 25 | ||
335 | 26 | namespace unity | 26 | namespace unity |
336 | @@ -28,16 +28,21 @@ | |||
337 | 28 | namespace lockscreen | 28 | namespace lockscreen |
338 | 29 | { | 29 | { |
339 | 30 | 30 | ||
341 | 31 | class AcceleratorController | 31 | class AcceleratorController : public sigc::trackable |
342 | 32 | { | 32 | { |
343 | 33 | public: | 33 | public: |
344 | 34 | typedef std::shared_ptr<AcceleratorController> Ptr; | 34 | typedef std::shared_ptr<AcceleratorController> Ptr; |
345 | 35 | 35 | ||
347 | 36 | AcceleratorController(session::Manager::Ptr const&); | 36 | AcceleratorController(key::Grabber::Ptr const&); |
348 | 37 | 37 | ||
349 | 38 | Accelerators::Ptr const& GetAccelerators() const; | 38 | Accelerators::Ptr const& GetAccelerators() const; |
350 | 39 | 39 | ||
351 | 40 | private: | 40 | private: |
352 | 41 | void AddAction(CompAction const&); | ||
353 | 42 | void RemoveAction(CompAction const&); | ||
354 | 43 | void OnActionActivated(CompAction&); | ||
355 | 44 | |||
356 | 45 | std::vector<std::pair<CompAction, Accelerator::Ptr>> actions_accelerators_; | ||
357 | 41 | Accelerators::Ptr accelerators_; | 46 | Accelerators::Ptr accelerators_; |
358 | 42 | }; | 47 | }; |
359 | 43 | 48 | ||
360 | 44 | 49 | ||
361 | === modified file 'lockscreen/LockScreenAccelerators.cpp' | |||
362 | --- lockscreen/LockScreenAccelerators.cpp 2014-04-30 04:34:40 +0000 | |||
363 | +++ lockscreen/LockScreenAccelerators.cpp 2016-06-21 14:42:21 +0000 | |||
364 | @@ -417,6 +417,11 @@ | |||
365 | 417 | { | 417 | { |
366 | 418 | } | 418 | } |
367 | 419 | 419 | ||
368 | 420 | Accelerators::Vector Accelerators::GetAccelerators() const | ||
369 | 421 | { | ||
370 | 422 | return accelerators_; | ||
371 | 423 | } | ||
372 | 424 | |||
373 | 420 | void Accelerators::Clear() | 425 | void Accelerators::Clear() |
374 | 421 | { | 426 | { |
375 | 422 | accelerators_.clear(); | 427 | accelerators_.clear(); |
376 | 423 | 428 | ||
377 | === modified file 'lockscreen/LockScreenAccelerators.h' | |||
378 | --- lockscreen/LockScreenAccelerators.h 2014-05-12 19:28:48 +0000 | |||
379 | +++ lockscreen/LockScreenAccelerators.h 2016-06-21 14:42:21 +0000 | |||
380 | @@ -69,9 +69,11 @@ | |||
381 | 69 | { | 69 | { |
382 | 70 | public: | 70 | public: |
383 | 71 | typedef std::shared_ptr<Accelerators> Ptr; | 71 | typedef std::shared_ptr<Accelerators> Ptr; |
384 | 72 | typedef std::vector<Accelerator::Ptr> Vector; | ||
385 | 72 | 73 | ||
386 | 73 | Accelerators(); | 74 | Accelerators(); |
387 | 74 | 75 | ||
388 | 76 | Accelerators::Vector GetAccelerators() const; | ||
389 | 75 | void Clear(); | 77 | void Clear(); |
390 | 76 | 78 | ||
391 | 77 | void Add(Accelerator::Ptr const& accelerator); | 79 | void Add(Accelerator::Ptr const& accelerator); |
392 | @@ -83,7 +85,7 @@ | |||
393 | 83 | unsigned int modifiers); | 85 | unsigned int modifiers); |
394 | 84 | 86 | ||
395 | 85 | private: | 87 | private: |
397 | 86 | std::vector<Accelerator::Ptr> accelerators_; | 88 | Accelerators::Vector accelerators_; |
398 | 87 | 89 | ||
399 | 88 | PressedState pressed_state_; | 90 | PressedState pressed_state_; |
400 | 89 | }; | 91 | }; |
401 | 90 | 92 | ||
402 | === modified file 'lockscreen/LockScreenController.cpp' | |||
403 | --- lockscreen/LockScreenController.cpp 2016-04-15 05:32:41 +0000 | |||
404 | +++ lockscreen/LockScreenController.cpp 2016-06-21 14:42:21 +0000 | |||
405 | @@ -54,12 +54,14 @@ | |||
406 | 54 | 54 | ||
407 | 55 | Controller::Controller(DBusManager::Ptr const& dbus_manager, | 55 | Controller::Controller(DBusManager::Ptr const& dbus_manager, |
408 | 56 | session::Manager::Ptr const& session_manager, | 56 | session::Manager::Ptr const& session_manager, |
409 | 57 | key::Grabber::Ptr const& key_grabber, | ||
410 | 57 | UpstartWrapper::Ptr const& upstart_wrapper, | 58 | UpstartWrapper::Ptr const& upstart_wrapper, |
411 | 58 | ShieldFactoryInterface::Ptr const& shield_factory, | 59 | ShieldFactoryInterface::Ptr const& shield_factory, |
412 | 59 | bool test_mode) | 60 | bool test_mode) |
413 | 60 | : opacity([this] { return fade_animator_.GetCurrentValue(); }) | 61 | : opacity([this] { return fade_animator_.GetCurrentValue(); }) |
414 | 61 | , dbus_manager_(dbus_manager) | 62 | , dbus_manager_(dbus_manager) |
415 | 62 | , session_manager_(session_manager) | 63 | , session_manager_(session_manager) |
416 | 64 | , key_grabber_(key_grabber) | ||
417 | 63 | , upstart_wrapper_(upstart_wrapper) | 65 | , upstart_wrapper_(upstart_wrapper) |
418 | 64 | , shield_factory_(shield_factory) | 66 | , shield_factory_(shield_factory) |
419 | 65 | , suspend_inhibitor_manager_(std::make_shared<SuspendInhibitorManager>()) | 67 | , suspend_inhibitor_manager_(std::make_shared<SuspendInhibitorManager>()) |
420 | @@ -459,7 +461,7 @@ | |||
421 | 459 | indicators_ = std::make_shared<indicator::LockScreenDBusIndicators>(); | 461 | indicators_ = std::make_shared<indicator::LockScreenDBusIndicators>(); |
422 | 460 | upstart_wrapper_->Emit("desktop-lock"); | 462 | upstart_wrapper_->Emit("desktop-lock"); |
423 | 461 | 463 | ||
425 | 462 | accelerator_controller_ = std::make_shared<AcceleratorController>(session_manager_); | 464 | accelerator_controller_ = std::make_shared<AcceleratorController>(key_grabber_); |
426 | 463 | auto activate_key = WindowManager::Default().activate_indicators_key(); | 465 | auto activate_key = WindowManager::Default().activate_indicators_key(); |
427 | 464 | auto accelerator = std::make_shared<Accelerator>(activate_key.second, 0, activate_key.first); | 466 | auto accelerator = std::make_shared<Accelerator>(activate_key.second, 0, activate_key.first); |
428 | 465 | accelerator->activated.connect(std::bind(std::mem_fn(&Controller::ActivatePanel), this)); | 467 | accelerator->activated.connect(std::bind(std::mem_fn(&Controller::ActivatePanel), this)); |
429 | 466 | 468 | ||
430 | === modified file 'lockscreen/LockScreenController.h' | |||
431 | --- lockscreen/LockScreenController.h 2016-03-31 09:59:30 +0000 | |||
432 | +++ lockscreen/LockScreenController.h 2016-06-21 14:42:21 +0000 | |||
433 | @@ -30,6 +30,7 @@ | |||
434 | 30 | #include "SuspendInhibitorManager.h" | 30 | #include "SuspendInhibitorManager.h" |
435 | 31 | #include "ScreenSaverDBusManager.h" | 31 | #include "ScreenSaverDBusManager.h" |
436 | 32 | #include "unity-shared/BackgroundEffectHelper.h" | 32 | #include "unity-shared/BackgroundEffectHelper.h" |
437 | 33 | #include "unity-shared/KeyGrabber.h" | ||
438 | 33 | #include "unity-shared/UpstartWrapper.h" | 34 | #include "unity-shared/UpstartWrapper.h" |
439 | 34 | 35 | ||
440 | 35 | namespace unity | 36 | namespace unity |
441 | @@ -44,7 +45,7 @@ | |||
442 | 44 | public: | 45 | public: |
443 | 45 | typedef std::shared_ptr<Controller> Ptr; | 46 | typedef std::shared_ptr<Controller> Ptr; |
444 | 46 | 47 | ||
446 | 47 | Controller(DBusManager::Ptr const&, session::Manager::Ptr const&, | 48 | Controller(DBusManager::Ptr const&, session::Manager::Ptr const&, key::Grabber::Ptr const&, |
447 | 48 | UpstartWrapper::Ptr const& upstart_wrapper = std::make_shared<UpstartWrapper>(), | 49 | UpstartWrapper::Ptr const& upstart_wrapper = std::make_shared<UpstartWrapper>(), |
448 | 49 | ShieldFactoryInterface::Ptr const& shield_factory = std::make_shared<ShieldFactory>(), | 50 | ShieldFactoryInterface::Ptr const& shield_factory = std::make_shared<ShieldFactory>(), |
449 | 50 | bool test_mode = false); | 51 | bool test_mode = false); |
450 | @@ -84,6 +85,7 @@ | |||
451 | 84 | 85 | ||
452 | 85 | DBusManager::Ptr dbus_manager_; | 86 | DBusManager::Ptr dbus_manager_; |
453 | 86 | session::Manager::Ptr session_manager_; | 87 | session::Manager::Ptr session_manager_; |
454 | 88 | key::Grabber::Ptr key_grabber_; | ||
455 | 87 | indicator::Indicators::Ptr indicators_; | 89 | indicator::Indicators::Ptr indicators_; |
456 | 88 | AcceleratorController::Ptr accelerator_controller_; | 90 | AcceleratorController::Ptr accelerator_controller_; |
457 | 89 | UpstartWrapper::Ptr upstart_wrapper_; | 91 | UpstartWrapper::Ptr upstart_wrapper_; |
458 | 90 | 92 | ||
459 | === modified file 'plugins/unityshell/src/unityshell.cpp' | |||
460 | --- plugins/unityshell/src/unityshell.cpp 2016-06-06 14:28:29 +0000 | |||
461 | +++ plugins/unityshell/src/unityshell.cpp 2016-06-21 14:42:21 +0000 | |||
462 | @@ -4081,24 +4081,24 @@ | |||
463 | 4081 | ShowFirstRunHints(); | 4081 | ShowFirstRunHints(); |
464 | 4082 | 4082 | ||
465 | 4083 | // Setup Session Controller | 4083 | // Setup Session Controller |
473 | 4084 | auto manager = std::make_shared<session::GnomeManager>(); | 4084 | auto session = std::make_shared<session::GnomeManager>(); |
474 | 4085 | manager->lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested)); | 4085 | session->lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested)); |
475 | 4086 | manager->prompt_lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested)); | 4086 | session->prompt_lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested)); |
476 | 4087 | manager->locked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenLocked)); | 4087 | session->locked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenLocked)); |
477 | 4088 | manager->unlocked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenUnlocked)); | 4088 | session->unlocked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenUnlocked)); |
478 | 4089 | session_dbus_manager_ = std::make_shared<session::DBusManager>(manager); | 4089 | session_dbus_manager_ = std::make_shared<session::DBusManager>(session); |
479 | 4090 | session_controller_ = std::make_shared<session::Controller>(manager); | 4090 | session_controller_ = std::make_shared<session::Controller>(session); |
480 | 4091 | LOG_INFO(logger) << "InitUnityComponents-Session " << timer.ElapsedSeconds() << "s"; | 4091 | LOG_INFO(logger) << "InitUnityComponents-Session " << timer.ElapsedSeconds() << "s"; |
481 | 4092 | Introspectable::AddChild(session_controller_.get()); | 4092 | Introspectable::AddChild(session_controller_.get()); |
482 | 4093 | 4093 | ||
483 | 4094 | // Setup Lockscreen Controller | 4094 | // Setup Lockscreen Controller |
486 | 4095 | screensaver_dbus_manager_ = std::make_shared<lockscreen::DBusManager>(manager); | 4095 | screensaver_dbus_manager_ = std::make_shared<lockscreen::DBusManager>(session); |
487 | 4096 | lockscreen_controller_ = std::make_shared<lockscreen::Controller>(screensaver_dbus_manager_, manager); | 4096 | lockscreen_controller_ = std::make_shared<lockscreen::Controller>(screensaver_dbus_manager_, session, menus_->KeyGrabber()); |
488 | 4097 | UpdateActivateIndicatorsKey(); | 4097 | UpdateActivateIndicatorsKey(); |
489 | 4098 | LOG_INFO(logger) << "InitUnityComponents-Lockscreen " << timer.ElapsedSeconds() << "s"; | 4098 | LOG_INFO(logger) << "InitUnityComponents-Lockscreen " << timer.ElapsedSeconds() << "s"; |
490 | 4099 | 4099 | ||
491 | 4100 | if (g_file_test((DesktopUtilities::GetUserRuntimeDirectory()+local::LOCKED_STAMP).c_str(), G_FILE_TEST_EXISTS)) | 4100 | if (g_file_test((DesktopUtilities::GetUserRuntimeDirectory()+local::LOCKED_STAMP).c_str(), G_FILE_TEST_EXISTS)) |
493 | 4101 | manager->PromptLockScreen(); | 4101 | session->PromptLockScreen(); |
494 | 4102 | 4102 | ||
495 | 4103 | auto on_launcher_size_changed = [this] (nux::Area* area, int w, int h) { | 4103 | auto on_launcher_size_changed = [this] (nux::Area* area, int w, int h) { |
496 | 4104 | /* The launcher geometry includes 1px used to draw the right/top margin | 4104 | /* The launcher geometry includes 1px used to draw the right/top margin |
497 | 4105 | 4105 | ||
498 | === modified file 'tests/test_lockscreen_controller.cpp' | |||
499 | --- tests/test_lockscreen_controller.cpp 2015-12-05 07:03:25 +0000 | |||
500 | +++ tests/test_lockscreen_controller.cpp 2016-06-21 14:42:21 +0000 | |||
501 | @@ -33,6 +33,7 @@ | |||
502 | 33 | #include "unity-shared/DashStyle.h" | 33 | #include "unity-shared/DashStyle.h" |
503 | 34 | #include "unity-shared/PanelStyle.h" | 34 | #include "unity-shared/PanelStyle.h" |
504 | 35 | #include "unity-shared/UScreen.h" | 35 | #include "unity-shared/UScreen.h" |
505 | 36 | #include "mock_key_grabber.h" | ||
506 | 36 | #include "test_mock_session_manager.h" | 37 | #include "test_mock_session_manager.h" |
507 | 37 | #include "test_uscreen_mock.h" | 38 | #include "test_uscreen_mock.h" |
508 | 38 | #include "test_utils.h" | 39 | #include "test_utils.h" |
509 | @@ -80,19 +81,21 @@ | |||
510 | 80 | TestLockScreenController() | 81 | TestLockScreenController() |
511 | 81 | : animation_controller(tick_source) | 82 | : animation_controller(tick_source) |
512 | 82 | , session_manager(std::make_shared<NiceMock<session::MockManager>>()) | 83 | , session_manager(std::make_shared<NiceMock<session::MockManager>>()) |
513 | 84 | , key_grabber(std::make_shared<key::MockGrabber::Nice>()) | ||
514 | 83 | , dbus_manager(std::make_shared<DBusManager>(session_manager)) | 85 | , dbus_manager(std::make_shared<DBusManager>(session_manager)) |
515 | 84 | , upstart_wrapper(std::make_shared<UpstartWrapper>()) | 86 | , upstart_wrapper(std::make_shared<UpstartWrapper>()) |
516 | 85 | , shield_factory(std::make_shared<ShieldFactoryMock>()) | 87 | , shield_factory(std::make_shared<ShieldFactoryMock>()) |
518 | 86 | , controller(dbus_manager, session_manager, upstart_wrapper, shield_factory) | 88 | , controller(dbus_manager, session_manager, key_grabber, upstart_wrapper, shield_factory) |
519 | 87 | {} | 89 | {} |
520 | 88 | 90 | ||
521 | 89 | struct ControllerWrap : Controller | 91 | struct ControllerWrap : Controller |
522 | 90 | { | 92 | { |
523 | 91 | ControllerWrap(DBusManager::Ptr const& dbus_manager, | 93 | ControllerWrap(DBusManager::Ptr const& dbus_manager, |
524 | 92 | session::Manager::Ptr const& session_manager, | 94 | session::Manager::Ptr const& session_manager, |
525 | 95 | key::Grabber::Ptr const& key_grabber, | ||
526 | 93 | UpstartWrapper::Ptr const& upstart_wrapper, | 96 | UpstartWrapper::Ptr const& upstart_wrapper, |
527 | 94 | ShieldFactoryInterface::Ptr const& shield_factory) | 97 | ShieldFactoryInterface::Ptr const& shield_factory) |
529 | 95 | : Controller(dbus_manager, session_manager, upstart_wrapper, shield_factory, /* test_mode */ true) | 98 | : Controller(dbus_manager, session_manager, key_grabber, upstart_wrapper, shield_factory, /* test_mode */ true) |
530 | 96 | {} | 99 | {} |
531 | 97 | 100 | ||
532 | 98 | using Controller::shields_; | 101 | using Controller::shields_; |
533 | @@ -107,6 +110,7 @@ | |||
534 | 107 | unity::panel::Style panel_style; | 110 | unity::panel::Style panel_style; |
535 | 108 | unity::lockscreen::Settings lockscreen_settings; | 111 | unity::lockscreen::Settings lockscreen_settings; |
536 | 109 | session::MockManager::Ptr session_manager; | 112 | session::MockManager::Ptr session_manager; |
537 | 113 | key::MockGrabber::Ptr key_grabber; | ||
538 | 110 | DBusManager::Ptr dbus_manager; | 114 | DBusManager::Ptr dbus_manager; |
539 | 111 | unity::UpstartWrapper::Ptr upstart_wrapper; | 115 | unity::UpstartWrapper::Ptr upstart_wrapper; |
540 | 112 | 116 | ||
541 | @@ -123,7 +127,7 @@ | |||
542 | 123 | { | 127 | { |
543 | 124 | size_t before = uscreen.changed.size(); | 128 | size_t before = uscreen.changed.size(); |
544 | 125 | { | 129 | { |
546 | 126 | Controller dummy(dbus_manager, session_manager); | 130 | Controller dummy(dbus_manager, session_manager, key_grabber); |
547 | 127 | } | 131 | } |
548 | 128 | ASSERT_EQ(before, uscreen.changed.size()); | 132 | ASSERT_EQ(before, uscreen.changed.size()); |
549 | 129 | 133 | ||
550 | @@ -135,7 +139,7 @@ | |||
551 | 135 | { | 139 | { |
552 | 136 | size_t before = session_manager->unlock_requested.size(); | 140 | size_t before = session_manager->unlock_requested.size(); |
553 | 137 | { | 141 | { |
555 | 138 | Controller dummy(dbus_manager, session_manager); | 142 | Controller dummy(dbus_manager, session_manager, key_grabber); |
556 | 139 | } | 143 | } |
557 | 140 | ASSERT_EQ(before, session_manager->unlock_requested.size()); | 144 | ASSERT_EQ(before, session_manager->unlock_requested.size()); |
558 | 141 | 145 | ||
559 | 142 | 146 | ||
560 | === modified file 'unity-shared/GnomeKeyGrabber.cpp' | |||
561 | --- unity-shared/GnomeKeyGrabber.cpp 2016-05-30 16:10:12 +0000 | |||
562 | +++ unity-shared/GnomeKeyGrabber.cpp 2016-06-21 14:42:21 +0000 | |||
563 | @@ -70,8 +70,9 @@ | |||
564 | 70 | std::string const DBUS_NAME = "com.canonical.Unity.Test.GnomeKeyGrabber"; | 70 | std::string const DBUS_NAME = "com.canonical.Unity.Test.GnomeKeyGrabber"; |
565 | 71 | } | 71 | } |
566 | 72 | 72 | ||
569 | 73 | GnomeGrabber::Impl::Impl(bool test_mode) | 73 | GnomeGrabber::Impl::Impl(Grabber* parent, bool test_mode) |
570 | 74 | : screen_(screen) | 74 | : parent_(parent) |
571 | 75 | , screen_(screen) | ||
572 | 75 | , shell_server_(test_mode ? testing::DBUS_NAME : shell::DBUS_NAME) | 76 | , shell_server_(test_mode ? testing::DBUS_NAME : shell::DBUS_NAME) |
573 | 76 | , settings_(g_settings_new(SETTINGS_NAME.c_str())) | 77 | , settings_(g_settings_new(SETTINGS_NAME.c_str())) |
574 | 77 | , current_action_id_(0) | 78 | , current_action_id_(0) |
575 | @@ -123,6 +124,7 @@ | |||
576 | 123 | actions_ids_.push_back(action_id); | 124 | actions_ids_.push_back(action_id); |
577 | 124 | actions_.push_back(action); | 125 | actions_.push_back(action); |
578 | 125 | actions_customers_.push_back(1); | 126 | actions_customers_.push_back(1); |
579 | 127 | parent_->action_added.emit(action); | ||
580 | 126 | return true; | 128 | return true; |
581 | 127 | } | 129 | } |
582 | 128 | 130 | ||
583 | @@ -178,6 +180,7 @@ | |||
584 | 178 | LOG_DEBUG(logger) << "RemoveAction (\"" << action->keyToString() << "\")"; | 180 | LOG_DEBUG(logger) << "RemoveAction (\"" << action->keyToString() << "\")"; |
585 | 179 | 181 | ||
586 | 180 | screen_->removeAction(action); | 182 | screen_->removeAction(action); |
587 | 183 | parent_->action_removed.emit(*action); | ||
588 | 181 | actions_.erase(actions_.begin() + index); | 184 | actions_.erase(actions_.begin() + index); |
589 | 182 | actions_ids_.erase(actions_ids_.begin() + index); | 185 | actions_ids_.erase(actions_ids_.begin() + index); |
590 | 183 | actions_customers_.erase(actions_customers_.begin() + index); | 186 | actions_customers_.erase(actions_customers_.begin() + index); |
591 | @@ -259,7 +262,6 @@ | |||
592 | 259 | action.setState(CompAction::StateInitKey | CompAction::StateTermKey); | 262 | action.setState(CompAction::StateInitKey | CompAction::StateTermKey); |
593 | 260 | action.setTerminate([this, action_id](CompAction* action, CompAction::State state, CompOption::Vector& options) { | 263 | action.setTerminate([this, action_id](CompAction* action, CompAction::State state, CompOption::Vector& options) { |
594 | 261 | auto key = action->keyToString(); | 264 | auto key = action->keyToString(); |
595 | 262 | |||
596 | 263 | LOG_DEBUG(logger) << "released \"" << key << "\""; | 265 | LOG_DEBUG(logger) << "released \"" << key << "\""; |
597 | 264 | 266 | ||
598 | 265 | if (state & CompAction::StateTermTapped) | 267 | if (state & CompAction::StateTermTapped) |
599 | @@ -353,11 +355,11 @@ | |||
600 | 353 | // Public implementation | 355 | // Public implementation |
601 | 354 | 356 | ||
602 | 355 | GnomeGrabber::GnomeGrabber() | 357 | GnomeGrabber::GnomeGrabber() |
604 | 356 | : impl_(new Impl()) | 358 | : impl_(new Impl(this)) |
605 | 357 | {} | 359 | {} |
606 | 358 | 360 | ||
607 | 359 | GnomeGrabber::GnomeGrabber(TestMode const& dummy) | 361 | GnomeGrabber::GnomeGrabber(TestMode const& dummy) |
609 | 360 | : impl_(new Impl(true)) | 362 | : impl_(new Impl(this, true)) |
610 | 361 | {} | 363 | {} |
611 | 362 | 364 | ||
612 | 363 | GnomeGrabber::~GnomeGrabber() | 365 | GnomeGrabber::~GnomeGrabber() |
613 | 364 | 366 | ||
614 | === modified file 'unity-shared/GnomeKeyGrabberImpl.h' | |||
615 | --- unity-shared/GnomeKeyGrabberImpl.h 2016-05-30 15:54:34 +0000 | |||
616 | +++ unity-shared/GnomeKeyGrabberImpl.h 2016-06-21 14:42:21 +0000 | |||
617 | @@ -37,7 +37,7 @@ | |||
618 | 37 | 37 | ||
619 | 38 | struct GnomeGrabber::Impl | 38 | struct GnomeGrabber::Impl |
620 | 39 | { | 39 | { |
622 | 40 | Impl(bool test_mode = false); | 40 | Impl(Grabber*, bool test_mode = false); |
623 | 41 | ~Impl(); | 41 | ~Impl(); |
624 | 42 | 42 | ||
625 | 43 | uint32_t NextActionID(); | 43 | uint32_t NextActionID(); |
626 | @@ -55,9 +55,9 @@ | |||
627 | 55 | void ActivateDBusAction(CompAction const& action, uint32_t id, uint32_t device, uint32_t timestamp) const; | 55 | void ActivateDBusAction(CompAction const& action, uint32_t id, uint32_t device, uint32_t timestamp) const; |
628 | 56 | 56 | ||
629 | 57 | bool IsActionPostponed(CompAction const& action) const; | 57 | bool IsActionPostponed(CompAction const& action) const; |
630 | 58 | |||
631 | 59 | void UpdateWhitelist(); | 58 | void UpdateWhitelist(); |
632 | 60 | 59 | ||
633 | 60 | Grabber* parent_; | ||
634 | 61 | CompScreen* screen_; | 61 | CompScreen* screen_; |
635 | 62 | 62 | ||
636 | 63 | glib::DBusServer shell_server_; | 63 | glib::DBusServer shell_server_; |
637 | 64 | 64 | ||
638 | === modified file 'unity-shared/KeyGrabber.h' | |||
639 | --- unity-shared/KeyGrabber.h 2015-09-29 13:06:46 +0000 | |||
640 | +++ unity-shared/KeyGrabber.h 2016-06-21 14:42:21 +0000 | |||
641 | @@ -21,6 +21,7 @@ | |||
642 | 21 | #define __UNITY_KEY_GRABBER__ | 21 | #define __UNITY_KEY_GRABBER__ |
643 | 22 | 22 | ||
644 | 23 | #include <core/core.h> | 23 | #include <core/core.h> |
645 | 24 | #include <sigc++/signal.h> | ||
646 | 24 | 25 | ||
647 | 25 | namespace unity | 26 | namespace unity |
648 | 26 | { | 27 | { |
649 | @@ -36,6 +37,9 @@ | |||
650 | 36 | virtual bool RemoveAction(CompAction const&) = 0; | 37 | virtual bool RemoveAction(CompAction const&) = 0; |
651 | 37 | virtual bool RemoveAction(uint32_t id) = 0; | 38 | virtual bool RemoveAction(uint32_t id) = 0; |
652 | 38 | 39 | ||
653 | 40 | sigc::signal<void, CompAction const&> action_added; | ||
654 | 41 | sigc::signal<void, CompAction const&> action_removed; | ||
655 | 42 | |||
656 | 39 | virtual CompAction::Vector& GetActions() = 0; | 43 | virtual CompAction::Vector& GetActions() = 0; |
657 | 40 | }; | 44 | }; |
658 | 41 | 45 |
LGTM.