Mir
window_specification.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 2 or 3 as
6  * 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 
17 #ifndef MIRAL_WINDOW_SPECIFICATION_H
18 #define MIRAL_WINDOW_SPECIFICATION_H
19 
20 #include <mir_toolkit/common.h>
21 
24 #include <mir/optional_value.h>
25 #include <mir/int_wrapper.h>
26 
27 #include <memory>
28 
29 namespace mir
30 {
31 namespace scene { class Surface; }
32 namespace shell { struct SurfaceSpecification; }
33 }
34 
35 namespace miral
36 {
37 using namespace mir::geometry;
38 namespace detail { struct SessionsBufferStreamIdTag; }
40 
42 {
43 public:
44  enum class InputReceptionMode
45  {
46  normal,
47  receives_all_input
48  };
49 
50  struct AspectRatio { unsigned width; unsigned height; };
51 
55 
56  WindowSpecification(mir::shell::SurfaceSpecification const& spec);
57 
59 
60  auto top_left() const -> mir::optional_value<Point> const&;
61  auto size() const -> mir::optional_value<Size> const&;
62  auto name() const -> mir::optional_value<std::string> const&;
63  auto output_id() const -> mir::optional_value<int> const&;
64  auto type() const -> mir::optional_value<MirWindowType> const&;
65  auto state() const -> mir::optional_value<MirWindowState> const&;
66  auto preferred_orientation() const -> mir::optional_value<MirOrientationMode> const&;
67  auto aux_rect() const -> mir::optional_value<Rectangle> const&;
68  auto placement_hints() const -> mir::optional_value<MirPlacementHints> const&;
69  auto window_placement_gravity() const -> mir::optional_value<MirPlacementGravity> const&;
70  auto aux_rect_placement_gravity() const -> mir::optional_value<MirPlacementGravity> const&;
71  auto aux_rect_placement_offset() const -> mir::optional_value<Displacement> const&;
72  auto min_width() const -> mir::optional_value<Width> const&;
73  auto min_height() const -> mir::optional_value<Height> const&;
74  auto max_width() const -> mir::optional_value<Width> const&;
75  auto max_height() const -> mir::optional_value<Height> const&;
76  auto width_inc() const -> mir::optional_value<DeltaX> const&;
77  auto height_inc() const -> mir::optional_value<DeltaY> const&;
78  auto min_aspect() const -> mir::optional_value<AspectRatio> const&;
79  auto max_aspect() const -> mir::optional_value<AspectRatio> const&;
80 
81  auto parent() const -> mir::optional_value<std::weak_ptr<mir::scene::Surface>> const&;
82  auto input_shape() const -> mir::optional_value<std::vector<Rectangle>> const&;
83  auto input_mode() const -> mir::optional_value<InputReceptionMode> const&;
84  auto shell_chrome() const -> mir::optional_value<MirShellChrome> const&;
85  auto confine_pointer() const -> mir::optional_value<MirPointerConfinementState> const&;
86  auto userdata() const -> mir::optional_value<std::shared_ptr<void>> const&;
87 
88  auto top_left() -> mir::optional_value<Point>&;
93  auto size() -> mir::optional_value<Size>&;
94  auto name() -> mir::optional_value<std::string>&;
95  auto output_id() -> mir::optional_value<int>&;
96  auto type() -> mir::optional_value<MirWindowType>&;
97  auto state() -> mir::optional_value<MirWindowState>&;
98  auto preferred_orientation() -> mir::optional_value<MirOrientationMode>&;
101  auto aux_rect() -> mir::optional_value<Rectangle>&;
102  auto placement_hints() -> mir::optional_value<MirPlacementHints>&;
103  auto window_placement_gravity() -> mir::optional_value<MirPlacementGravity>&;
104  auto aux_rect_placement_gravity() -> mir::optional_value<MirPlacementGravity>&;
105  auto aux_rect_placement_offset() -> mir::optional_value<Displacement>&;
106 
109  auto min_width() -> mir::optional_value<Width>&;
110  auto min_height() -> mir::optional_value<Height>&;
111  auto max_width() -> mir::optional_value<Width>&;
112  auto max_height() -> mir::optional_value<Height>&;
113  auto width_inc() -> mir::optional_value<DeltaX>&;
114  auto height_inc() -> mir::optional_value<DeltaY>&;
115  auto min_aspect() -> mir::optional_value<AspectRatio>&;
116  auto max_aspect() -> mir::optional_value<AspectRatio>&;
118 
119  auto parent() -> mir::optional_value<std::weak_ptr<mir::scene::Surface>>&;
120  auto input_shape() -> mir::optional_value<std::vector<Rectangle>>&;
121  auto input_mode() -> mir::optional_value<InputReceptionMode>&;
122  auto shell_chrome() -> mir::optional_value<MirShellChrome>&;
123  auto confine_pointer() -> mir::optional_value<MirPointerConfinementState>&;
124  auto userdata() -> mir::optional_value<std::shared_ptr<void>>&;
125 
128  auto depth_layer() const -> mir::optional_value<MirDepthLayer> const&;
129  auto depth_layer() -> mir::optional_value<MirDepthLayer>&;
131 
137  auto attached_edges() const -> mir::optional_value<MirPlacementGravity> const&;
138  auto attached_edges() -> mir::optional_value<MirPlacementGravity>&;
140 
146  auto exclusive_rect() const -> mir::optional_value<mir::optional_value<mir::geometry::Rectangle>> const&;
147  auto exclusive_rect() -> mir::optional_value<mir::optional_value<mir::geometry::Rectangle>>&;
149 
153  auto application_id() const -> mir::optional_value<std::string> const&;
154  auto application_id() -> mir::optional_value<std::string>&;
156 
160  auto server_side_decorated() const -> mir::optional_value<bool> const&;
161  auto server_side_decorated() -> mir::optional_value<bool>&;
163 
167  auto focus_mode() const -> mir::optional_value<MirFocusMode> const&;
168  auto focus_mode() -> mir::optional_value<MirFocusMode>&;
170 
171 private:
172  friend auto make_surface_spec(WindowSpecification const& miral_spec) -> mir::shell::SurfaceSpecification;
173  struct Self;
174  std::unique_ptr<Self> self;
175 };
176 }
177 
178 #endif //MIRAL_WINDOW_SPECIFICATION_H
Definition: int_wrapper.h:26
Definition: dimensions.h:34
Definition: window_specification.h:42
InputReceptionMode
Definition: window_specification.h:45
WindowSpecification(WindowSpecification const &that)
WindowSpecification(mir::shell::SurfaceSpecification const &spec)
auto operator=(WindowSpecification const &that) -> WindowSpecification &
auto top_left() const -> mir::optional_value< Point > const &
MirFocusMode
Focus mode controls how a surface gains and loses focus.
Definition: common.h:423
MirPointerConfinementState
Pointer Confinement.
Definition: common.h:385
MirWindowType
Definition: common.h:56
MirShellChrome
Shell chrome.
Definition: common.h:376
MirWindowState
Definition: common.h:71
MirPlacementGravity
Reference point for aligning a surface relative to a rectangle.
Definition: common.h:236
MirPlacementHints
Positioning hints for aligning a window relative to a rectangle.
Definition: common.h:291
MirDepthLayer
Depth layer controls Z ordering of surfaces.
Definition: common.h:410
MirOrientationMode
Definition: common.h:209
Basic geometry types. Types for dimensions, displacements, etc. and the operations that they support.
Definition: dimensions.h:29
Definition: splash_session.h:22
Mir Abstraction Layer.
Definition: floating_window_manager.h:29
mir::IntWrapper< detail::SessionsBufferStreamIdTag > BufferStreamId
Definition: window_specification.h:39
Definition: displacement.h:30
Definition: point.h:30
Definition: rectangle.h:31
Definition: size.h:30
Definition: window_specification.h:50
unsigned height
Definition: window_specification.h:50

Copyright © 2012-2022 Canonical Ltd.
Generated on śro, 1 cze 2022, 16:52:55 UTC
This documentation is licensed under the GPL version 2 or 3.