2
* Copyright (C) 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/>.
20
#include <mir/graphics/display.h>
21
#include <mir/graphics/gl_context.h>
22
#include <mir/version.h>
24
#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 20, 0)
25
#include <mir/graphics/virtual_output.h>
28
#include <gmock/gmock.h>
29
#include "gmock_fixes.h"
31
class MockDisplaySyncGroup : public mir::graphics::DisplaySyncGroup
34
MockDisplaySyncGroup();
35
virtual ~MockDisplaySyncGroup();
37
MOCK_METHOD1(for_each_display_buffer, void(std::function<void(mir::graphics::DisplayBuffer&)> const& f));
38
MOCK_METHOD0(post, void());
41
struct MockDisplay : public mir::graphics::Display
45
virtual ~MockDisplay();
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&));
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>());
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));
66
#endif // MOCKDISPLAY_H