MirAL
window_manager_tools.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIRAL_WINDOW_MANAGER_TOOLS_H
20 #define MIRAL_WINDOW_MANAGER_TOOLS_H
21 
22 #include "miral/application.h"
23 #include "window_info.h"
24 
25 #include <mir/geometry/displacement.h>
26 
27 #include <functional>
28 #include <memory>
29 
30 namespace mir
31 {
32 namespace scene { class Surface; }
33 }
34 
35 namespace miral
36 {
37 class Window;
38 struct WindowInfo;
39 struct ApplicationInfo;
40 class WindowSpecification;
41 
42 class WindowManagerToolsImplementation;
43 
46 {
47 public:
48  explicit WindowManagerTools(WindowManagerToolsImplementation* tools);
50  WindowManagerTools& operator=(WindowManagerTools const&);
52 
63  auto count_applications() const -> unsigned int;
64 
69  void for_each_application(std::function<void(ApplicationInfo& info)> const& functor);
70 
76  auto find_application(std::function<bool(ApplicationInfo const& info)> const& predicate)
77  -> Application;
78 
84  auto info_for(std::weak_ptr<mir::scene::Session> const& session) const -> ApplicationInfo&;
85 
91  auto info_for(std::weak_ptr<mir::scene::Surface> const& surface) const -> WindowInfo&;
92 
98  auto info_for(Window const& window) const -> WindowInfo&;
99 
106  auto info_for_window_id(std::string const& id) const -> WindowInfo&;
107 
113  auto id_for_window(Window const& window) const -> std::string;
114 
116  void ask_client_to_close(Window const& window);
117 
119  auto active_window() const -> Window;
120 
126  auto select_active_window(Window const& hint) -> Window;
127 
129  void drag_active_window(mir::geometry::Displacement movement);
130 
132  void focus_next_application();
133 
135  void focus_next_within_application();
136 
138  auto window_at(mir::geometry::Point cursor) const -> Window;
139 
141  auto active_display() -> mir::geometry::Rectangle const;
142 
144  void raise_tree(Window const& root);
145 
147  void modify_window(WindowInfo& window_info, WindowSpecification const& modifications);
148 
150  void place_and_size_for_state(WindowSpecification& modifications, WindowInfo const& window_info) const;
159  void invoke_under_lock(std::function<void()> const& callback);
160 
161 private:
162  WindowManagerToolsImplementation* tools;
163 };
164 }
165 
166 #endif //MIRAL_WINDOW_MANAGER_TOOLS_H
Definition: active_outputs.h:25
Definition: application_info.h:31
Definition: window_info.h:30
Definition: window_specification.h:45
Handle class to manage a Mir surface. It may be null (e.g. default initialized)
Definition: window.h:37
std::shared_ptr< mir::scene::Session > Application
Definition: application.h:31
Window management functions for querying and updating MirAL&#39;s model.
Definition: window_manager_tools.h:45
Mir Abstraction Layer.
Definition: active_outputs.h:27

Copyright © 2016 Canonical Ltd.
Generated on Fri Sep 30 13:21:55 UTC 2016