2
* Copyright (C) 2014-2015 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License version 3, as published by
6
* the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
* SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#ifndef MIR_TEST_DOUBLES_STUB_SCENE_SURFACE_H_
18
#define MIR_TEST_DOUBLES_STUB_SCENE_SURFACE_H_
20
#include "mir/scene/surface.h"
21
#include "stub_input_channel.h"
24
#include <gmock/gmock.h>
33
class StubSceneSurface :
34
public mir::scene::Surface
37
std::shared_ptr<StubInputChannel> channel;
39
mir::input::InputReceptionMode input_mode{mir::input::InputReceptionMode::normal};
41
StubSceneSurface(int fd);
42
virtual ~StubSceneSurface();
44
std::shared_ptr<mir::input::InputChannel> input_channel() const override;
46
mir::input::InputReceptionMode reception_mode() const override;
48
std::string name() const override;
49
geometry::Point top_left() const override;
50
geometry::Size client_size() const override;
51
geometry::Size size() const override;
52
geometry::Rectangle input_bounds() const override;
53
bool input_area_contains(mir::geometry::Point const&) const override;
55
graphics::RenderableList generate_renderables(compositor::CompositorID) const override;
56
float alpha() const override;
57
MirSurfaceType type() const override;
58
MirSurfaceState state() const override;
62
void move_to(geometry::Point const&) override;
63
void set_input_region(std::vector<geometry::Rectangle> const&) override;
64
void resize(geometry::Size const&) override;
65
void set_transformation(glm::mat4 const&) override;
66
void set_alpha(float) override;
67
void set_orientation(MirOrientation) override;
69
void add_observer(std::shared_ptr<scene::SurfaceObserver> const&) override;
70
void remove_observer(std::weak_ptr<scene::SurfaceObserver> const&) override;
72
void set_reception_mode(input::InputReceptionMode mode) override;
73
void consume(MirEvent const*) override;
75
void set_cursor_image(std::shared_ptr<graphics::CursorImage> const& /* image */) override;
76
std::shared_ptr<graphics::CursorImage> cursor_image() const override;
78
bool supports_input() const override;
79
int client_input_fd() const override;
80
int configure(MirSurfaceAttrib, int) override;
81
int query(MirSurfaceAttrib) const override;