Mir
zone.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2019 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  * Authored by: William Wold <william.wold@canonical.com>
17  */
18 
19 #ifndef MIRAL_ZONE_H
20 #define MIRAL_ZONE_H
21 
22 #include <mir_toolkit/common.h>
23 
24 #include <mir/geometry/rectangle.h>
25 #include <mir/int_wrapper.h>
26 
27 #include <memory>
28 
29 namespace miral
30 {
31 using namespace mir::geometry;
32 
35 class Zone
36 {
37 public:
38 
39  Zone(Rectangle const& extents);
40  Zone(Zone const& other);
41  Zone& operator=(Zone const& other);
42  ~Zone();
43 
46  auto operator==(Zone const& other) const -> bool;
47 
51  auto is_same_zone(Zone const& other) const -> bool;
52 
54  auto extents() const -> Rectangle;
55 
58  void extents(Rectangle const& extents);
59 
60 private:
61  class Self;
62  std::unique_ptr<Self> self;
63 };
64 }
65 
66 #endif // MIRAL_ZONE_H
A rectangular area of the display. Not tied to a specific output.
Definition: zone.h:36
auto is_same_zone(Zone const &other) const -> bool
Multiple zone objects with different extents may be the "same" zone. For example, the arguments of mi...
Zone & operator=(Zone const &other)
Copies private data by value.
auto extents() const -> Rectangle
The area of this zone in global display coordinates.
Zone(Rectangle const &extents)
Create a new zone with the given extents.
Zone(Zone const &other)
Makes a copy of the underlying private data.
auto operator==(Zone const &other) const -> bool
Returns false if any properties are different (even if they are the same zone) Will always return fal...
Basic geometry types. Types for dimensions, displacements, etc. and the operations that they support.
Definition: dimensions.h:31
Mir Abstraction Layer.
Definition: floating_window_manager.h:31
Definition: rectangle.h:34

Copyright © 2012-2022 Canonical Ltd.
Generated on Fri Feb 25 18:01:44 UTC 2022
This documentation is licensed under the GPL version 2 or 3.