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 "mir/compositor/compositing_criteria.h"
23
#include "mir/input/surface.h"
24
#include "mutable_surface_state.h"
35
class SurfaceData : public compositor::CompositingCriteria, public input::Surface,
36
public MutableSurfaceState
39
SurfaceData(std::string const& name, geometry::Rectangle rect,
40
std::function<void()> change_cb,
43
//mc::CompositingCriteria
44
glm::mat4 const& transformation() const;
46
bool should_be_rendered_in(geometry::Rectangle const& rect) const;
47
bool shaped() const override;
50
std::string const& name() const;
51
geometry::Point position() const;
52
geometry::Size size() const;
53
bool contains(geometry::Point const& point) const;
55
//ms::MutableSurfaceState
56
void move_to(geometry::Point);
57
void resize(geometry::Size const& size);
59
void set_hidden(bool hidden);
60
void apply_alpha(float alpha);
61
void apply_rotation(float degrees, glm::vec3 const&);
62
void set_input_region(std::vector<geometry::Rectangle> const& input_rectangles);
65
std::mutex mutable guard;
66
std::function<void()> notify_change;
67
std::string surface_name;
68
geometry::Rectangle surface_rect;
69
glm::mat4 rotation_matrix;
70
mutable glm::mat4 transformation_matrix;
71
mutable geometry::Size transformation_size;
72
mutable bool transformation_dirty;
74
bool first_frame_posted;
76
const bool nonrectangular;
77
std::vector<geometry::Rectangle> input_rectangles;
82
#endif /* MIR_SCENE_SURFACE_DATA_STORAGE_H_ */