2
* Copyright © 2013 Canonical Ltd.
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.
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.
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/>.
16
* Authored by: Kevin DuBois <kevin.dubois@canonical.com>
19
#ifndef MIR_SCENE_SURFACE_DATA_STORAGE_H_
20
#define MIR_SCENE_SURFACE_DATA_STORAGE_H_
22
#include "surface_state.h"
33
class SurfaceData : public SurfaceState
36
SurfaceData(std::string const& name, geometry::Rectangle rect,
37
std::function<void()> change_cb,
40
//mc::CompositingCriteria
41
glm::mat4 const& transformation() const;
43
bool should_be_rendered_in(geometry::Rectangle const& rect) const;
44
bool shaped() const override;
47
std::string const& name() const;
48
geometry::Point position() const;
49
geometry::Size size() const;
50
bool contains(geometry::Point const& point) const;
52
//ms::MutableSurfaceState
53
void move_to(geometry::Point);
54
void resize(geometry::Size const& size);
56
void set_hidden(bool hidden);
57
void apply_alpha(float alpha);
58
void apply_rotation(float degrees, glm::vec3 const&);
59
void set_input_region(std::vector<geometry::Rectangle> const& input_rectangles);
62
std::mutex mutable guard;
63
std::function<void()> notify_change;
64
std::string surface_name;
65
geometry::Rectangle surface_rect;
66
glm::mat4 rotation_matrix;
67
mutable glm::mat4 transformation_matrix;
68
mutable geometry::Size transformation_size;
69
mutable bool transformation_dirty;
71
bool first_frame_posted;
73
const bool nonrectangular;
74
std::vector<geometry::Rectangle> input_rectangles;
79
#endif /* MIR_SCENE_SURFACE_DATA_STORAGE_H_ */