Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mock_surface.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013-2014 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  * Authored by: Robert Carr <robert.carr@canonical.com>
17  */
18 
19 #ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_H_
20 #define MIR_TEST_DOUBLES_MOCK_SURFACE_H_
21 
24 
25 #include <gmock/gmock.h>
26 
27 namespace mir
28 {
29 namespace test
30 {
31 namespace doubles
32 {
33 
35 {
37  scene::BasicSurface(
38  {},
39  {{},{}},
40  true,
41  {},
42  {},
43  {},
45  {
46  }
47 
48  ~MockSurface() noexcept {}
49 
50  MOCK_METHOD0(hide, void());
51  MOCK_METHOD0(show, void());
52  MOCK_METHOD0(visible, bool());
53  MOCK_METHOD1(raise, void(std::shared_ptr<scene::SurfaceRanker> const&));
54 
56  MOCK_METHOD0(advance_client_buffer, std::shared_ptr<graphics::Buffer>());
57 
60 
63 
65  MOCK_METHOD1(take_input_focus, void(std::shared_ptr<shell::InputTargeter> const&));
66  MOCK_METHOD1(add_observer, void(std::shared_ptr<scene::SurfaceObserver> const&));
67 };
68 
69 }
70 }
71 } // namespace mir
72 
73 #endif // MIR_TEST_DOUBLES_MOCK_SURFACE_H_
Definition: size.h:30
std::shared_ptr< scene::SceneReport > null_scene_report()
Definition: null_report_factory.cpp:73
void hide() override
Definition: basic_surface.cpp:436
~MockSurface() noexcept
Definition: mock_surface.h:48
MOCK_METHOD2(configure, int(MirSurfaceAttrib, int))
MirPixelFormat pixel_format() const
Definition: basic_surface.cpp:168
void show() override
Definition: basic_surface.cpp:441
int configure(MirSurfaceAttrib attrib, int value) override
Definition: basic_surface.cpp:394
void take_input_focus(std::shared_ptr< shell::InputTargeter > const &targeter) override
Definition: basic_surface.cpp:389
bool visible() const
TODO: Its a bit questionable that we have this member function, why not just trim the renderable from...
Definition: basic_surface.cpp:311
MockSurface()
Definition: mock_surface.h:36
Definition: mock_surface.h:34
geometry::Size size() const override
Definition: basic_surface.cpp:162
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:34
Definition: basic_surface.h:89
MirPixelFormat
The order of components in a format enum matches the order of the components as they would be written...
Definition: common.h:99
int client_input_fd() const
Definition: basic_surface.cpp:206
MOCK_METHOD1(raise, void(std::shared_ptr< scene::SurfaceRanker > const &))
MOCK_CONST_METHOD0(size, geometry::Size())
BasicSurface(std::string const &name, geometry::Rectangle rect, bool nonrectangular, std::shared_ptr< compositor::BufferStream > const &buffer_stream, std::shared_ptr< input::InputChannel > const &input_channel, std::shared_ptr< SurfaceConfigurator > const &configurator, std::shared_ptr< SceneReport > const &report)
Definition: basic_surface.cpp:92
void force_requests_to_complete()
Definition: basic_surface.cpp:118
bool supports_input() const
Definition: basic_surface.cpp:199
void add_observer(std::shared_ptr< SurfaceObserver > const &observer) override
Definition: basic_surface.cpp:447

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014