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 
17 #ifndef MIRAL_ZONE_H
18 #define MIRAL_ZONE_H
19 
20 #include <mir_toolkit/common.h>
21 
22 #include <mir/geometry/rectangle.h>
23 #include <mir/int_wrapper.h>
24 
25 #include <memory>
26 
27 namespace miral
28 {
29 using namespace mir::geometry;
30 
33 class Zone
34 {
35 public:
36 
37  Zone(Rectangle const& extents);
38  Zone(Zone const& other);
39  Zone& operator=(Zone const& other);
40  ~Zone();
41 
44  auto operator==(Zone const& other) const -> bool;
45 
49  auto is_same_zone(Zone const& other) const -> bool;
50 
52  auto extents() const -> Rectangle;
53 
56  void extents(Rectangle const& extents);
57 
58 private:
59  class Self;
60  std::unique_ptr<Self> self;
61 };
62 }
63 
64 #endif // MIRAL_ZONE_H
A rectangular area of the display. Not tied to a specific output.
Definition: zone.h:34
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:29
Mir Abstraction Layer.
Definition: floating_window_manager.h:29
Definition: rectangle.h:31

Copyright © 2012-2022 Canonical Ltd.
Generated on Tue May 24 14:35:34 UTC 2022
This documentation is licensed under the GPL version 2 or 3.