OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_DISPLAY_H_ | 5 #ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_DISPLAY_H_ |
6 #define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_DISPLAY_H_ | 6 #define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_DISPLAY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/message_loop/message_pump_libevent.h" | 10 #include "base/message_loop/message_pump_libevent.h" |
11 #include "ui/events/platform/platform_event_source.h" | 11 #include "ui/events/platform/platform_event_source.h" |
12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
| 13 #include "ui/ozone/ozone_export.h" |
13 #include "ui/ozone/platform/wayland/wayland_object.h" | 14 #include "ui/ozone/platform/wayland/wayland_object.h" |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 | 17 |
17 class WaylandWindow; | 18 class WaylandWindow; |
18 | 19 |
19 class WaylandDisplay : public PlatformEventSource, | 20 class OZONE_EXPORT WaylandDisplay : public PlatformEventSource, |
20 public base::MessagePumpLibevent::Watcher { | 21 public base::MessagePumpLibevent::Watcher { |
21 public: | 22 public: |
22 WaylandDisplay(); | 23 WaylandDisplay(); |
23 ~WaylandDisplay() override; | 24 ~WaylandDisplay() override; |
24 | 25 |
25 bool Initialize(); | 26 bool Initialize(); |
26 | 27 |
27 // Flushes the Wayland connection. | 28 // Flushes the Wayland connection. |
28 void Flush(); | 29 void Flush(); |
29 | 30 |
| 31 wl_display* display() { return display_.get(); } |
30 wl_compositor* compositor() { return compositor_.get(); } | 32 wl_compositor* compositor() { return compositor_.get(); } |
31 wl_shm* shm() { return shm_.get(); } | 33 wl_shm* shm() { return shm_.get(); } |
32 xdg_shell* shell() { return shell_.get(); } | 34 xdg_shell* shell() { return shell_.get(); } |
33 | 35 |
34 WaylandWindow* GetWindow(gfx::AcceleratedWidget widget); | 36 WaylandWindow* GetWindow(gfx::AcceleratedWidget widget); |
35 void AddWindow(WaylandWindow* window); | 37 void AddWindow(WaylandWindow* window); |
36 void RemoveWindow(WaylandWindow* window); | 38 void RemoveWindow(WaylandWindow* window); |
37 | 39 |
38 private: | 40 private: |
39 // PlatformEventSource | 41 // PlatformEventSource |
(...skipping 24 matching lines...) Expand all Loading... |
64 | 66 |
65 bool watching_ = false; | 67 bool watching_ = false; |
66 base::MessagePumpLibevent::FileDescriptorWatcher controller_; | 68 base::MessagePumpLibevent::FileDescriptorWatcher controller_; |
67 | 69 |
68 DISALLOW_COPY_AND_ASSIGN(WaylandDisplay); | 70 DISALLOW_COPY_AND_ASSIGN(WaylandDisplay); |
69 }; | 71 }; |
70 | 72 |
71 } // namespace ui | 73 } // namespace ui |
72 | 74 |
73 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_DISPLAY_H_ | 75 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_DISPLAY_H_ |
OLD | NEW |