Mir
zone.h
Go to the documentation of this file.
1/*
2 * Copyright © 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
27namespace miral
28{
29using namespace mir::geometry;
30
31/// A rectangular area of the display.
32/// Not tied to a specific output.
33class Zone
34{
35public:
36
37 Zone(Rectangle const& extents); ///< Create a new zone with the given extents
38 Zone(Zone const& other); ///< Makes a copy of the underlying private data
39 Zone& operator=(Zone const& other); ///< Copies private data by value
40 ~Zone();
41
42 /// Returns true only if all properties including IDs match
43 auto operator==(Zone const& other) const -> bool;
44
45 /// Returns if true if zone IDs match, even if extents are different
46 auto is_same_zone(Zone const& other) const -> bool;
47
48 /// The area of this zone in global display coordinates
49 auto extents() const -> Rectangle;
50
51 /// Set the extents of this zone
52 /// Does not make this a different zone
53 void extents(Rectangle const& extents);
54
55 /// An arbitrary number that uniquely identifies this zone, reguardless of how it is resized and moved
56 /// \remark Since MirAL 3.6
57 auto id() const -> int;
58
59private:
60 class Self;
61 std::unique_ptr<Self> self;
62};
63}
64
65#endif // MIRAL_ZONE_H
A rectangular area of the display. Not tied to a specific output.
Definition: zone.h:34
void extents(Rectangle const &extents)
Set the extents of this zone Does not make this a different zone.
auto id() const -> int
An arbitrary number that uniquely identifies this zone, reguardless of how it is resized and moved.
auto is_same_zone(Zone const &other) const -> bool
Returns if true if zone IDs match, even if extents are different.
auto extents() const -> Rectangle
The area of this zone in global display coordinates.
Zone & operator=(Zone const &other)
Copies private data by value.
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 true only if all properties including IDs match.
Basic geometry types. Types for dimensions, displacements, etc. and the operations that they support.
Definition: size.h:27
Definition: runner.h:27
Mir Abstraction Layer.
Definition: runner.h:35

Copyright © 2012-2023 Canonical Ltd.
Generated on Tue 2 May 10:01:24 UTC 2023
This documentation is licensed under the GPL version 2 or 3.