Mir
surface_event_source.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_SCENE_SURFACE_EVENT_SOURCE_H_
20 #define MIR_SCENE_SURFACE_EVENT_SOURCE_H_
21 
25 
26 #include <memory>
27 
28 namespace mir
29 {
30 namespace scene
31 {
32 class Surface;
33 class OutputProperties;
34 class OutputPropertiesCache;
35 
37 {
38 public:
41  Surface const& surface,
42  OutputPropertiesCache const& outputs,
43  std::shared_ptr<frontend::EventSink> const& event_sink);
44 
45  void attrib_changed(MirSurfaceAttrib attrib, int value) override;
46  void resized_to(geometry::Size const& size) override;
47  void moved_to(geometry::Point const& top_left) override;
48  void orientation_set_to(MirOrientation orientation) override;
49  void client_surface_close_requested() override;
50  void keymap_changed(MirInputDeviceId id, std::string const& model, std::string const& layout,
51  std::string const& variant, std::string const& options) override;
52 
53 private:
54  frontend::SurfaceId const id;
55  Surface const& surface;
56  OutputPropertiesCache const& outputs;
57  std::weak_ptr<OutputProperties const> last_output;
58  std::shared_ptr<frontend::EventSink> const event_sink;
59 };
60 }
61 }
62 
63 #endif // MIR_SCENE_SURFACE_EVENT_SOURCE_H_
Definition: size.h:30
All things Mir.
Definition: atomic_callback.h:25
void keymap_changed(MirInputDeviceId id, std::string const &model, std::string const &layout, std::string const &variant, std::string const &options) override
Definition: surface_event_source.cpp:82
void attrib_changed(MirSurfaceAttrib attrib, int value) override
Definition: surface_event_source.cpp:67
Definition: point.h:30
void resized_to(geometry::Size const &size) override
Definition: surface_event_source.cpp:46
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:164
int64_t MirInputDeviceId
Definition: input_event.h:35
Definition: null_surface_observer.h:28
SurfaceEventSource(frontend::SurfaceId id, Surface const &surface, OutputPropertiesCache const &outputs, std::shared_ptr< frontend::EventSink > const &event_sink)
Definition: surface_event_source.cpp:34
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:34
Definition: surface_event_source.h:36
void client_surface_close_requested() override
Definition: surface_event_source.cpp:77
void orientation_set_to(MirOrientation orientation) override
Definition: surface_event_source.cpp:72
void moved_to(geometry::Point const &top_left) override
Definition: surface_event_source.cpp:51
Definition: surface.h:49
Definition: output_properties_cache.h:44
int const size
Definition: make_socket_rpc_channel.cpp:51

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016