Mir
wrap_shell_to_track_latest_surface.h
Go to the documentation of this file.
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 2 or 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: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIR_TEST_WRAP_SHELL_TO_TRACK_LATEST_SURFACE_H
20 #define MIR_TEST_WRAP_SHELL_TO_TRACK_LATEST_SURFACE_H
21 
22 #include "mir/shell/shell_wrapper.h"
23 #include "mir/scene/session.h"
24 
25 namespace mir
26 {
27 namespace test
28 {
29 namespace doubles
30 {
31 struct WrapShellToTrackLatestSurface : mir::shell::ShellWrapper
32 {
33  using mir::shell::ShellWrapper::ShellWrapper;
34 
36  std::shared_ptr <mir::scene::Session> const& session,
37  mir::scene::SurfaceCreationParameters const& params,
38  std::shared_ptr<mir::frontend::EventSink> const& sink) override
39  {
40  auto const surface = mir::shell::ShellWrapper::create_surface(session, params, sink);
41  latest_surface = session->surface(surface);
42  return surface;
43  }
44 
45  std::weak_ptr <mir::scene::Surface> latest_surface;
46 };
47 }
48 }
49 }
50 
51 #endif //MIR_TEST_WRAP_SHELL_TO_TRACK_LATEST_SURFACE_H
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: blob.h:26
Definition: wrap_shell_to_track_latest_surface.h:31
mir::frontend::SurfaceId create_surface(std::shared_ptr< mir::scene::Session > const &session, mir::scene::SurfaceCreationParameters const &params, std::shared_ptr< mir::frontend::EventSink > const &sink) override
Definition: wrap_shell_to_track_latest_surface.h:35
std::weak_ptr< mir::scene::Surface > latest_surface
Definition: wrap_shell_to_track_latest_surface.h:45
Definition: int_wrapper.h:27

Copyright © 2012-2018 Canonical Ltd.
Generated on Thu Apr 5 15:26:05 UTC 2018