Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: ui/ozone/platform/wayland/wayland_display.h

Issue 1610683003: Add initial SHM-only Wayland Ozone implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/ozone/platform/wayland/wayland.gypi ('k') | ui/ozone/platform/wayland/wayland_display.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_DISPLAY_H_
6 #define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_DISPLAY_H_
7
8 #include <map>
9
10 #include "base/message_loop/message_pump_libevent.h"
11 #include "ui/events/platform/platform_event_source.h"
12 #include "ui/gfx/native_widget_types.h"
13 #include "ui/ozone/platform/wayland/wayland_object.h"
14
15 namespace ui {
16
17 class WaylandWindow;
18
19 class WaylandDisplay : public PlatformEventSource,
20 public base::MessagePumpLibevent::Watcher {
21 public:
22 WaylandDisplay();
23 ~WaylandDisplay() override;
24
25 bool Initialize();
26
27 // Flushes the Wayland connection.
28 void Flush();
29
30 wl_compositor* compositor() { return compositor_.get(); }
31 wl_shm* shm() { return shm_.get(); }
32 xdg_shell* shell() { return shell_.get(); }
33
34 WaylandWindow* GetWindow(gfx::AcceleratedWidget widget);
35 void AddWindow(WaylandWindow* window);
36 void RemoveWindow(WaylandWindow* window);
37
38 private:
39 // PlatformEventSource
40 void OnDispatcherListChanged() override;
41
42 // base::MessagePumpLibevent::Watcher
43 void OnFileCanReadWithoutBlocking(int fd) override;
44 void OnFileCanWriteWithoutBlocking(int fd) override;
45
46 // wl_registry_listener
47 static void Global(void* data,
48 wl_registry* registry,
49 uint32_t name,
50 const char* interface,
51 uint32_t version);
52 static void GlobalRemove(void* data, wl_registry* registry, uint32_t name);
53
54 // xdg_shell_listener
55 static void Ping(void* data, xdg_shell* shell, uint32_t serial);
56
57 std::map<gfx::AcceleratedWidget, WaylandWindow*> window_map_;
58
59 wl::Object<wl_display> display_;
60 wl::Object<wl_registry> registry_;
61 wl::Object<wl_compositor> compositor_;
62 wl::Object<wl_shm> shm_;
63 wl::Object<xdg_shell> shell_;
64
65 bool watching_ = false;
66 base::MessagePumpLibevent::FileDescriptorWatcher controller_;
67
68 DISALLOW_COPY_AND_ASSIGN(WaylandDisplay);
69 };
70
71 } // namespace ui
72
73 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_DISPLAY_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/wayland/wayland.gypi ('k') | ui/ozone/platform/wayland/wayland_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698