~alan-griffiths/miral/debug

« back to all changes in this revision

Viewing changes to miral-qt/tests/mirserver/WindowManager/stub_surface.h

  • Committer: Gerry Boland
  • Date: 2016-06-01 22:06:51 UTC
  • mto: This revision was merged to the branch mainline in revision 178.
  • Revision ID: gerry.boland@canonical.com-20160601220651-ge508tffql4e7u7c
Import QtMir code into miral-qt subdirectory. Disabled by default, use -DMIRAL_ENABLE_QT=1 to build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2015 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 3,
 
6
 * as 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 QPAMIRSERVER_STUB_SURFACE_H
 
18
#define QPAMIRSERVER_STUB_SURFACE_H
 
19
 
 
20
#include <mir/scene/surface.h>
 
21
 
 
22
// mir::scene::Surface is a horribly wide interface to expose from Mir
 
23
// and there's not even a proper stub in the Mir-0.15 package mirtest-dev
 
24
struct StubSurface : mir::scene::Surface
 
25
{
 
26
    std::string name() const override;
 
27
    void move_to(mir::geometry::Point const& top_left) override;
 
28
    float alpha() const override;
 
29
    mir::geometry::Size size() const override;
 
30
    mir::geometry::Size client_size() const override;
 
31
    std::shared_ptr<mir::frontend::BufferStream> primary_buffer_stream() const override;
 
32
    void set_streams(std::list<mir::scene::StreamInfo> const& streams) override;
 
33
    bool supports_input() const override;
 
34
    int client_input_fd() const override;
 
35
    std::shared_ptr<mir::input::InputChannel> input_channel() const override;
 
36
    mir::input::InputReceptionMode reception_mode() const override;
 
37
    void set_reception_mode(mir::input::InputReceptionMode mode) override;
 
38
    void set_input_region(std::vector<mir::geometry::Rectangle> const& input_rectangles) override;
 
39
    void resize(mir::geometry::Size const& size) override;
 
40
    mir::geometry::Point top_left() const override;
 
41
    mir::geometry::Rectangle input_bounds() const override;
 
42
    bool input_area_contains(mir::geometry::Point const& point) const override;
 
43
    void consume(MirEvent const* event) override;
 
44
    void set_alpha(float alpha) override;
 
45
    void set_orientation(MirOrientation orientation) override;
 
46
    void set_transformation(glm::mat4 const&) override;
 
47
    bool visible() const override;
 
48
    mir::graphics::RenderableList generate_renderables(mir::compositor::CompositorID id) const override;
 
49
    int buffers_ready_for_compositor(void const* compositor_id) const override;
 
50
    MirSurfaceType type() const override;
 
51
    MirSurfaceState state() const override;
 
52
    int configure(MirSurfaceAttrib attrib, int value) override;
 
53
    int query(MirSurfaceAttrib attrib) const override;
 
54
    void hide() override;
 
55
    void show() override;
 
56
    void set_cursor_image(std::shared_ptr<mir::graphics::CursorImage> const& image) override;
 
57
    std::shared_ptr<mir::graphics::CursorImage> cursor_image() const override;
 
58
    void set_cursor_stream(std::shared_ptr<mir::frontend::BufferStream> const& stream, mir::geometry::Displacement const& hotspot) override;
 
59
    void request_client_surface_close() override;
 
60
    std::shared_ptr<Surface> parent() const override;
 
61
    void add_observer(std::shared_ptr<mir::scene::SurfaceObserver> const& observer) override;
 
62
    void remove_observer(std::weak_ptr<mir::scene::SurfaceObserver> const& observer) override;
 
63
    void set_keymap(MirInputDeviceId id, std::string const& model, std::string const& layout,
 
64
                    std::string const& variant, std::string const& options) override;
 
65
    void rename(std::string const& title) override;
 
66
};
 
67
 
 
68
#endif //QPAMIRSERVER_STUB_SURFACE_H