~lukas-kde/miral/shellchrome-windowinfo

« back to all changes in this revision

Viewing changes to miral-qt/tests/framework/mock_surface.h

  • Committer: Larry Price
  • Date: 2016-09-13 16:19:29 UTC
  • mto: (330.4.1 miral)
  • mto: This revision was merged to the branch mainline in revision 352.
  • Revision ID: larry.price@canonical.com-20160913161929-vs9ka1capmljq1es
Removing miral-qt from release branch, updating copyright file, and adding GPL3 license to root dir

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2014-2015 Canonical, Ltd.
3
 
 *
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.
7
 
 *
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.
12
 
 *
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/>.
15
 
 */
16
 
 
17
 
#ifndef MOCK_MIR_SCENE_SURFACE_H
18
 
#define MOCK_MIR_SCENE_SURFACE_H
19
 
 
20
 
#include <mir/scene/surface.h>
21
 
#include <mir/version.h>
22
 
#include <gmock/gmock.h>
23
 
 
24
 
#include <string>
25
 
#include "mock_renderable.h"
26
 
 
27
 
namespace mir {
28
 
namespace scene {
29
 
 
30
 
struct MockSurface : public mir::scene::Surface
31
 
{
32
 
    MockSurface();
33
 
    virtual ~MockSurface();
34
 
 
35
 
    MOCK_CONST_METHOD0(name, std::string());
36
 
    MOCK_CONST_METHOD0(client_size, geometry::Size());
37
 
    MOCK_CONST_METHOD0(input_bounds, geometry::Rectangle());
38
 
    MOCK_CONST_METHOD0(top_left, geometry::Point());
39
 
    MOCK_CONST_METHOD0(size, geometry::Size());
40
 
    MOCK_CONST_METHOD1(generate_renderables,graphics::RenderableList(compositor::CompositorID id));
41
 
    MOCK_CONST_METHOD0(parent, std::shared_ptr<Surface>());
42
 
 
43
 
 
44
 
    MOCK_CONST_METHOD0(alpha, float());
45
 
    MOCK_CONST_METHOD0(type, MirSurfaceType());
46
 
    MOCK_CONST_METHOD0(state, MirSurfaceState());
47
 
    MOCK_METHOD0(hide, void());
48
 
    MOCK_METHOD0(show, void());
49
 
    MOCK_CONST_METHOD0(visible, bool());
50
 
    MOCK_METHOD1(move_to, void(geometry::Point const& top_left));
51
 
    MOCK_METHOD1(take_input_focus, void(std::shared_ptr<shell::InputTargeter> const& targeter));
52
 
    MOCK_METHOD1(set_input_region, void(std::vector<geometry::Rectangle> const& region));
53
 
    MOCK_METHOD1(allow_framedropping, void(bool));
54
 
    MOCK_METHOD1(resize, void(geometry::Size const& size));
55
 
    MOCK_METHOD1(set_transformation, void(glm::mat4 const& t));
56
 
    MOCK_METHOD1(set_alpha, void(float alpha));
57
 
    MOCK_METHOD1(set_orientation, void(MirOrientation orientation));
58
 
    MOCK_METHOD0(force_requests_to_complete, void());
59
 
    MOCK_METHOD1(set_cursor_image, void(std::shared_ptr<graphics::CursorImage> const& image));
60
 
    MOCK_CONST_METHOD0(cursor_image, std::shared_ptr<graphics::CursorImage>());
61
 
    MOCK_METHOD1(add_observer, void(std::shared_ptr<SurfaceObserver> const& observer));
62
 
    MOCK_METHOD1(remove_observer, void(std::weak_ptr<SurfaceObserver> const& observer));
63
 
    MOCK_CONST_METHOD0(input_channel, std::shared_ptr<input::InputChannel>());
64
 
    MOCK_METHOD1(set_reception_mode, void(input::InputReceptionMode mode));
65
 
    MOCK_METHOD0(request_client_surface_close, void());
66
 
    MOCK_CONST_METHOD1(buffers_ready_for_compositor, int(void const*));
67
 
    void set_keymap(MirInputDeviceId, std::string const&, std::string const&,
68
 
        std::string const&, std::string const&) override;
69
 
    void rename(std::string const&) override;
70
 
    MOCK_METHOD1(set_streams, void(std::list<StreamInfo> const&));
71
 
 
72
 
    // from mir::input::surface
73
 
    MOCK_CONST_METHOD1(input_area_contains, bool(geometry::Point const& point));
74
 
    MOCK_CONST_METHOD0(reception_mode, input::InputReceptionMode());
75
 
    MOCK_METHOD1(consume, void(MirEvent const* event));
76
 
    //void consume(MirEvent const* event) override;
77
 
 
78
 
    // from mir::frontend::surface
79
 
    MOCK_CONST_METHOD0(pixel_format, MirPixelFormat());
80
 
    MOCK_METHOD2(swap_buffers, void(graphics::Buffer* old_buffer, std::function<void(graphics::Buffer* new_buffer)> complete));
81
 
    MOCK_CONST_METHOD0(supports_input, bool());
82
 
    MOCK_CONST_METHOD0(client_input_fd, int());
83
 
    MOCK_METHOD2(configure, int(MirSurfaceAttrib attrib, int value));
84
 
    MOCK_CONST_METHOD1(query, int(MirSurfaceAttrib attrib));
85
 
    MOCK_CONST_METHOD0(primary_buffer_stream, std::shared_ptr<frontend::BufferStream>());
86
 
 
87
 
    // from mir::scene::SurfaceBufferAccess
88
 
    MOCK_METHOD1(with_most_recent_buffer_do, void(std::function<void(graphics::Buffer&)> const& exec));
89
 
 
90
 
    MOCK_METHOD2(set_cursor_stream, void(std::shared_ptr<frontend::BufferStream> const&, geometry::Displacement const&));
91
 
 
92
 
#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 24, 0)
93
 
    void set_confine_pointer_state(MirPointerConfinementState) {}
94
 
    MirPointerConfinementState confine_pointer_state() const { return {}; }
95
 
#endif
96
 
};
97
 
 
98
 
} // namespace scene
99
 
} // namespace mir
100
 
 
101
 
#endif // MOCK_MIR_SCENE_SURFACE_H