~alan-griffiths/miral/debug

« back to all changes in this revision

Viewing changes to miral-qt/tests/framework/mock_display.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 (C) 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 MOCKDISPLAY_H
 
18
#define MOCKDISPLAY_H
 
19
 
 
20
#include <mir/graphics/display.h>
 
21
#include <mir/graphics/gl_context.h>
 
22
#include <mir/version.h>
 
23
 
 
24
#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 20, 0)
 
25
#include <mir/graphics/virtual_output.h>
 
26
#endif
 
27
 
 
28
#include <gmock/gmock.h>
 
29
#include "gmock_fixes.h"
 
30
 
 
31
class MockDisplaySyncGroup : public mir::graphics::DisplaySyncGroup
 
32
{
 
33
public:
 
34
    MockDisplaySyncGroup();
 
35
    virtual ~MockDisplaySyncGroup();
 
36
 
 
37
    MOCK_METHOD1(for_each_display_buffer, void(std::function<void(mir::graphics::DisplayBuffer&)> const& f));
 
38
    MOCK_METHOD0(post, void());
 
39
};
 
40
 
 
41
struct MockDisplay : public mir::graphics::Display
 
42
{
 
43
public:
 
44
    MockDisplay();
 
45
    virtual ~MockDisplay();
 
46
 
 
47
    MOCK_METHOD1(for_each_display_sync_group, void(std::function<void(mir::graphics::DisplaySyncGroup&)> const&));
 
48
    MOCK_CONST_METHOD0(configuration, std::unique_ptr<mir::graphics::DisplayConfiguration>());
 
49
    MOCK_METHOD1(configure, void(mir::graphics::DisplayConfiguration const&));
 
50
    MOCK_METHOD2(register_configuration_change_handler,
 
51
                 void(mir::graphics::EventHandlerRegister&, mir::graphics::DisplayConfigurationChangeHandler const&));
 
52
 
 
53
    MOCK_METHOD3(register_pause_resume_handlers, void(mir::graphics::EventHandlerRegister&,
 
54
                                                      mir::graphics::DisplayPauseHandler const&,
 
55
                                                      mir::graphics::DisplayResumeHandler const&));
 
56
    MOCK_METHOD0(pause, void());
 
57
    MOCK_METHOD0(resume, void());
 
58
    MOCK_METHOD1(create_hardware_cursor, std::shared_ptr<mir::graphics::Cursor>(std::shared_ptr<mir::graphics::CursorImage> const&));
 
59
    MOCK_METHOD0(create_gl_context, std::unique_ptr<mir::graphics::GLContext>());
 
60
 
 
61
#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 20, 0)
 
62
    MOCK_METHOD2(create_virtual_output, std::unique_ptr<mir::graphics::VirtualOutput> (int width, int height));
 
63
#endif
 
64
};
 
65
 
 
66
#endif // MOCKDISPLAY_H