MirAL
window_info.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_INFO_H
20 #define MIRAL_WINDOW_INFO_H
21 
22 #include "miral/window.h"
24 
25 #include <mir/geometry/rectangles.h>
26 #include <mir/optional_value.h>
27 
28 namespace miral
29 {
30 struct WindowInfo
31 {
33 
34  WindowInfo();
35  WindowInfo(Window const& window, WindowSpecification const& params);
36  ~WindowInfo();
37  WindowInfo(WindowInfo const& that);
38  WindowInfo& operator=(WindowInfo const& that);
39 
40  bool can_be_active() const;
41 
42  bool can_morph_to(MirSurfaceType new_type) const;
43 
44  bool must_have_parent() const;
45 
46  bool must_not_have_parent() const;
47 
48  bool is_visible() const;
49 
50  static bool needs_titlebar(MirSurfaceType type);
51 
52  void constrain_resize(mir::geometry::Point& requested_pos, mir::geometry::Size& requested_size) const;
53 
54  auto window() const -> Window&;
55 
56  bool has_name() const;
57  auto name() const -> std::string;
58  void name(std::string const& name);
59 
60  auto type() const -> MirSurfaceType;
61  void type(MirSurfaceType type);
62 
63  auto state() const -> MirSurfaceState;
64  void state(MirSurfaceState state);
65 
66  auto restore_rect() const -> mir::geometry::Rectangle;
67  void restore_rect(mir::geometry::Rectangle const& restore_rect);
68 
69  auto parent() const -> Window;
70  void parent(Window const& parent);
71 
72  auto children() const -> std::vector <Window> const&;
73  void add_child(Window const& child);
74  void remove_child(Window const& child);
75 
76  auto min_width() const -> mir::geometry::Width;
77  void min_width(mir::geometry::Width min_width);
78 
79  auto min_height() const -> mir::geometry::Height;
80  void min_height(mir::geometry::Height min_height);
81 
82  auto max_width() const -> mir::geometry::Width;
83  void max_width(mir::geometry::Width max_width);
84 
85  auto max_height() const -> mir::geometry::Height;
86  void max_height(mir::geometry::Height max_height);
87 
88  auto width_inc() const -> mir::geometry::DeltaX;
89  void width_inc(mir::geometry::DeltaX width_inc);
90 
91  auto height_inc() const -> mir::geometry::DeltaY;
92  void height_inc(mir::geometry::DeltaY height_inc);
93 
94  auto min_aspect() const -> AspectRatio;
95  void min_aspect(AspectRatio min_aspect);
96 
97  auto max_aspect() const -> AspectRatio;
98  void max_aspect(AspectRatio max_aspect);
99 
100  bool has_output_id() const;
101  auto output_id() const -> int;
102  void output_id(mir::optional_value<int> output_id);
103 
104  auto preferred_orientation() const -> MirOrientationMode;
105  void preferred_orientation(MirOrientationMode preferred_orientation);
106 
108  void confine_pointer(MirPointerConfinementState confinement);
109 
111  auto userdata() const -> std::shared_ptr<void>;
112  void userdata(std::shared_ptr<void> userdata);
113 
114 private:
115  struct Self;
116  std::unique_ptr<Self> const self;
117 };
118 }
119 
120 #endif //MIRAL_WINDOW_INFO_H
Definition: active_outputs.h:25
auto max_height() const -> mir::geometry::Height
auto preferred_orientation() const -> MirOrientationMode
auto max_width() const -> mir::geometry::Width
auto confine_pointer() const -> MirPointerConfinementState
auto window() const -> Window &
auto output_id() const -> int
STL namespace.
void remove_child(Window const &child)
bool can_be_active() const
bool is_visible() const
bool has_output_id() const
Definition: window_specification.h:63
auto max_aspect() const -> AspectRatio
MirPointerConfinementState
Definition: mir_forward_compatibility.h:123
Definition: window_info.h:30
auto type() const -> MirSurfaceType
Definition: window_specification.h:45
static bool needs_titlebar(MirSurfaceType type)
void constrain_resize(mir::geometry::Point &requested_pos, mir::geometry::Size &requested_size) const
auto state() const -> MirSurfaceState
Handle class to manage a Mir surface. It may be null (e.g. default initialized)
Definition: window.h:37
auto min_width() const -> mir::geometry::Width
auto width_inc() const -> mir::geometry::DeltaX
auto restore_rect() const -> mir::geometry::Rectangle
bool can_morph_to(MirSurfaceType new_type) const
auto min_aspect() const -> AspectRatio
auto height_inc() const -> mir::geometry::DeltaY
bool has_name() const
auto parent() const -> Window
WindowInfo & operator=(WindowInfo const &that)
auto children() const -> std::vector< Window > const &
auto min_height() const -> mir::geometry::Height
bool must_have_parent() const
auto userdata() const -> std::shared_ptr< void >
This can be used by client code to store window manager specific information.
auto name() const -> std::string
Mir Abstraction Layer.
Definition: active_outputs.h:27
void add_child(Window const &child)
bool must_not_have_parent() const

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