Mir
visible_surface.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016 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: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_TEST_FRAMEWORK_VISIBLE_SURFACE_H_
20 #define MIR_TEST_FRAMEWORK_VISIBLE_SURFACE_H_
21 
23 #include <mutex>
24 #include <condition_variable>
25 #include <ostream>
26 
27 namespace mir_test_framework
28 {
30 {
31 public:
32  explicit VisibleSurface(MirWindowSpec* spec);
35  VisibleSurface(VisibleSurface const&) = delete;
36  VisibleSurface& operator=(VisibleSurface const&) = delete;
37 
39  static void event_callback(MirWindow* surf, MirEvent const* ev, void* context);
40  void set_visibility(MirWindow* surf, bool vis);
41  operator MirWindow*() const;
42 private:
43  std::mutex mutex;
44  std::condition_variable cv;
45 
46  MirWindow* window;
47  bool visible;
48 };
49 
50 std::ostream& operator<<(std::ostream& os, VisibleSurface const& s);
51 }
52 
53 #endif /* MIR_TEST_FRAMEWORK_VISIBLE_SURFACE_H_ */
struct MirSurface MirWindow
Definition: client_types.h:43
std::ostream & operator<<(std::ostream &out, const Result &result)
static void event_callback(MirWindow *surf, MirEvent const *ev, void *context)
VisibleSurface & operator=(VisibleSurface &&)
struct MirEvent MirEvent
Definition: event.h:84
Definition: visible_surface.h:29
struct MirSurfaceSpec MirWindowSpec
Definition: client_types.h:45
Definition: any_surface.h:25
VisibleSurface(MirWindowSpec *spec)
void set_visibility(MirWindow *surf, bool vis)

Copyright © 2012-2018 Canonical Ltd.
Generated on Thu Mar 15 13:06:27 UTC 2018