Mir
Loading...
Searching...
No Matches
surface.h
Go to the documentation of this file.
1/*
2 * Copyright (C) Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by
6 * the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#ifndef MIROIL_SURFACE_H
17#define MIROIL_SURFACE_H
18#include <memory>
19#include <unordered_map>
20#include <mir_toolkit/mir_input_device_types.h>
21#include <mir_toolkit/common.h>
22#include <mir/graphics/renderable.h>
23
24namespace mir {
25 namespace scene { class Surface; }
26 namespace graphics { class CursorImage; }
27 namespace compositor { class BufferStream; }
28}
29
30namespace miroil {
31
32class SurfaceObserver;
33class SurfaceObserverImpl;
34
35using CompositorID = void const*;
36
38{
39public:
40 Surface(std::shared_ptr<mir::scene::Surface> wrapped);
41 ~Surface() = default;
42
43 mir::scene::Surface *get_wrapped() const;
44 void add_observer(std::shared_ptr<miroil::SurfaceObserver> const& observer);
45 void remove_observer(std::shared_ptr<miroil::SurfaceObserver> const& observer);
46
47 int buffers_ready_for_compositor(void const* compositor_id) const;
49
50
52 void set_orientation(MirOrientation orientation);
53
54 void set_confine_pointer_state(MirPointerConfinementState state);
55 std::shared_ptr<mir::scene::Surface> parent() const;
56 /// Top-left corner (of the window frame if present)
58 bool visible() const;
59
60 // TODO a legacy of old interactions and needs removing
61 int configure(MirWindowAttrib attrib, int value);
62 // TODO a legacy of old interactions and needs removing
63 int query(MirWindowAttrib attrib) const;
64 // TODO a legacy of old interactions and needs removing
65 void set_keymap(MirInputDeviceId id, std::string const& model, std::string const& layout,
66 std::string const& variant, std::string const& options);
67
68private:
69 std::shared_ptr<mir::scene::Surface> wrapped;
70 std::unordered_map<std::shared_ptr<miroil::SurfaceObserver>, std::shared_ptr<miroil::SurfaceObserverImpl>> observers;
71};
72
73}
74
75#endif
Definition surface.h:38
mir::graphics::RenderableList generate_renderables(miroil::CompositorID id) const
~Surface()=default
int configure(MirWindowAttrib attrib, int value)
bool is_confined_to_window()
void set_orientation(MirOrientation orientation)
void set_confine_pointer_state(MirPointerConfinementState state)
std::shared_ptr< mir::scene::Surface > parent() const
void remove_observer(std::shared_ptr< miroil::SurfaceObserver > const &observer)
int query(MirWindowAttrib attrib) const
void add_observer(std::shared_ptr< miroil::SurfaceObserver > const &observer)
Surface(std::shared_ptr< mir::scene::Surface > wrapped)
mir::geometry::Point top_left() const
Top-left corner (of the window frame if present)
void set_keymap(MirInputDeviceId id, std::string const &model, std::string const &layout, std::string const &variant, std::string const &options)
mir::scene::Surface * get_wrapped() const
bool visible() const
int buffers_ready_for_compositor(void const *compositor_id) const
Definition surface_observer.h:34
int64_t MirInputDeviceId
Definition mir_input_device_types.h:27
Definition runner.h:27
Definition compositor.h:21

Copyright © 2012-2023 Canonical Ltd.
Generated on Tue Dec 19 15:16:05 UTC 2023
This documentation is licensed under the GPL version 2 or 3.