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

Side by Side Diff: ui/events/platform/x11/x11_event_source_libevent.cc

Issue 1723303002: Implement GLX for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to use #define Created 4 years, 3 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/events/platform/x11/x11_event_source_libevent.h ('k') | ui/gl/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "ui/events/platform/x11/x11_event_source_libevent.h" 5 #include "ui/events/platform/x11/x11_event_source_libevent.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 9
10 #include <memory>
11
10 #include "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
11 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
12 #include "ui/events/event.h" 14 #include "ui/events/event.h"
13 #include "ui/events/event_utils.h" 15 #include "ui/events/event_utils.h"
14 #include "ui/events/keycodes/keyboard_code_conversion_x.h" 16 #include "ui/events/keycodes/keyboard_code_conversion_x.h"
15 #include "ui/events/platform/platform_event_dispatcher.h" 17 #include "ui/events/platform/platform_event_dispatcher.h"
16 #include "ui/events/x/events_x_utils.h" 18 #include "ui/events/x/events_x_utils.h"
17 19
18 namespace ui { 20 namespace ui {
19 21
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 132
131 } // namespace 133 } // namespace
132 134
133 X11EventSourceLibevent::X11EventSourceLibevent(XDisplay* display) 135 X11EventSourceLibevent::X11EventSourceLibevent(XDisplay* display)
134 : event_source_(this, display) { 136 : event_source_(this, display) {
135 AddEventWatcher(); 137 AddEventWatcher();
136 } 138 }
137 139
138 X11EventSourceLibevent::~X11EventSourceLibevent() {} 140 X11EventSourceLibevent::~X11EventSourceLibevent() {}
139 141
142 // static
143 X11EventSourceLibevent* X11EventSourceLibevent::GetInstance() {
144 return static_cast<X11EventSourceLibevent*>(
145 PlatformEventSource::GetInstance());
146 }
147
140 void X11EventSourceLibevent::AddXEventDispatcher(XEventDispatcher* dispatcher) { 148 void X11EventSourceLibevent::AddXEventDispatcher(XEventDispatcher* dispatcher) {
141 dispatchers_xevent_.AddObserver(dispatcher); 149 dispatchers_xevent_.AddObserver(dispatcher);
142 } 150 }
143 151
144 void X11EventSourceLibevent::RemoveXEventDispatcher( 152 void X11EventSourceLibevent::RemoveXEventDispatcher(
145 XEventDispatcher* dispatcher) { 153 XEventDispatcher* dispatcher) {
146 dispatchers_xevent_.RemoveObserver(dispatcher); 154 dispatchers_xevent_.RemoveObserver(dispatcher);
147 } 155 }
148 156
149 void X11EventSourceLibevent::ProcessXEvent(XEvent* xevent) { 157 void X11EventSourceLibevent::ProcessXEvent(XEvent* xevent) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 199
192 void X11EventSourceLibevent::OnFileCanReadWithoutBlocking(int fd) { 200 void X11EventSourceLibevent::OnFileCanReadWithoutBlocking(int fd) {
193 event_source_.DispatchXEvents(); 201 event_source_.DispatchXEvents();
194 } 202 }
195 203
196 void X11EventSourceLibevent::OnFileCanWriteWithoutBlocking(int fd) { 204 void X11EventSourceLibevent::OnFileCanWriteWithoutBlocking(int fd) {
197 NOTREACHED(); 205 NOTREACHED();
198 } 206 }
199 207
200 } // namespace ui 208 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/platform/x11/x11_event_source_libevent.h ('k') | ui/gl/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698