Mir
server_example_window_management.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 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 MIR_EXAMPLES_WINDOW_MANAGEMENT_H_
20 #define MIR_EXAMPLES_WINDOW_MANAGEMENT_H_
21 
23 #include "mir/scene/session.h"
24 #include "mir/scene/surface.h"
28 #include "mir_toolkit/common.h"
29 
30 #include <memory>
31 
34 
35 namespace mir
36 {
37 class Server;
38 
39 namespace examples
40 {
42  public virtual scene::PlacementStrategy,
43  public virtual scene::SurfaceConfigurator
44 {
45 public:
46 
47  virtual void add_surface(
48  std::shared_ptr<scene::Surface> const& surface,
49  scene::Session* session) = 0;
50 
51  virtual void remove_surface(
52  std::weak_ptr<scene::Surface> const& surface,
53  scene::Session* session) = 0;
54 
55  virtual void add_session(std::shared_ptr<scene::Session> const& session) = 0;
56 
57  virtual void remove_session(std::shared_ptr<scene::Session> const& session) = 0;
58 
59  virtual void add_display(geometry::Rectangle const& area) = 0;
60 
61  virtual void remove_display(geometry::Rectangle const& area) = 0;
62 
63  virtual void click(geometry::Point cursor) = 0;
64 
65  virtual void drag(geometry::Point cursor) = 0;
66 
67  virtual void resize(geometry::Point cursor) = 0;
68 
69  virtual void toggle(MirSurfaceState state) = 0;
70 };
71 
72 class EventTracker;
73 
75 {
76 public:
77  explicit WindowManagmentFactory(Server& server) : server{server} {}
78 
79  auto window_manager() -> std::shared_ptr<WindowManager>;
80 
81 private:
82  Server& server;
83  std::weak_ptr<WindowManager> wm;
84  std::shared_ptr<EventTracker> et;
85 };
86 
87 extern char const* const wm_option;
88 extern char const* const wm_description;
89 }
90 }
91 
92 #endif
virtual void add_session(std::shared_ptr< scene::Session > const &session)=0
All things Mir.
Definition: buffer_stream.h:37
char const *const wm_description
Definition: server_example_window_management.cpp:51
Customise and run a Mir server.
Definition: server.h:68
Definition: point.h:30
auto window_manager() -> std::shared_ptr< WindowManager >
Definition: server_example_window_management.cpp:678
Definition: session.h:34
virtual void remove_display(geometry::Rectangle const &area)=0
virtual void remove_surface(std::weak_ptr< scene::Surface > const &surface, scene::Session *session)=0
virtual void drag(geometry::Point cursor)=0
MirSurfaceState
Definition: common.h:66
Definition: server_example_window_management.h:74
virtual void toggle(MirSurfaceState state)=0
WindowManagmentFactory(Server &server)
Definition: server_example_window_management.h:77
virtual void click(geometry::Point cursor)=0
Definition: placement_strategy.h:30
Definition: server_example_window_management.h:41
Definition: rectangle.h:33
Definition: surface_configurator.h:33
virtual void add_surface(std::shared_ptr< scene::Surface > const &surface, scene::Session *session)=0
virtual void resize(geometry::Point cursor)=0
virtual void add_display(geometry::Rectangle const &area)=0
char const *const wm_option
Definition: server_example_window_management.cpp:50
virtual void remove_session(std::shared_ptr< scene::Session > const &session)=0

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015