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

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

Issue 289283015: Extract touchscreen device management into a generic manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/events/platform/x11/BUILD.gn ('k') | ui/events/platform/x11/x11_events_platform.gyp » ('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.h" 5 #include "ui/events/platform/x11/x11_event_source.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 #include <X11/X.h> 8 #include <X11/X.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #include <X11/XKBlib.h> 10 #include <X11/XKBlib.h>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "ui/events/event_utils.h" 13 #include "ui/events/event_utils.h"
14 #include "ui/events/platform/platform_event_dispatcher.h" 14 #include "ui/events/platform/platform_event_dispatcher.h"
15 #include "ui/events/x/device_data_manager_x11.h"
15 #include "ui/gfx/x/x11_types.h" 16 #include "ui/gfx/x/x11_types.h"
16 17
17 namespace ui { 18 namespace ui {
18 19
19 namespace { 20 namespace {
20 21
21 int g_xinput_opcode = -1; 22 int g_xinput_opcode = -1;
22 23
23 bool InitializeXInput2(XDisplay* display) { 24 bool InitializeXInput2(XDisplay* display) {
24 if (!display) 25 if (!display)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 77
77 return true; 78 return true;
78 } 79 }
79 80
80 } // namespace 81 } // namespace
81 82
82 X11EventSource::X11EventSource(XDisplay* display) 83 X11EventSource::X11EventSource(XDisplay* display)
83 : display_(display), 84 : display_(display),
84 continue_stream_(true) { 85 continue_stream_(true) {
85 CHECK(display_); 86 CHECK(display_);
87 DeviceDataManagerX11::CreateInstance();
86 InitializeXInput2(display_); 88 InitializeXInput2(display_);
87 InitializeXkb(display_); 89 InitializeXkb(display_);
88 } 90 }
89 91
90 X11EventSource::~X11EventSource() { 92 X11EventSource::~X11EventSource() {
91 } 93 }
92 94
93 // static 95 // static
94 X11EventSource* X11EventSource::GetInstance() { 96 X11EventSource* X11EventSource::GetInstance() {
95 return static_cast<X11EventSource*>(PlatformEventSource::GetInstance()); 97 return static_cast<X11EventSource*>(PlatformEventSource::GetInstance());
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 if (have_cookie) 142 if (have_cookie)
141 XFreeEventData(xevent->xgeneric.display, &xevent->xcookie); 143 XFreeEventData(xevent->xgeneric.display, &xevent->xcookie);
142 return action; 144 return action;
143 } 145 }
144 146
145 void X11EventSource::StopCurrentEventStream() { 147 void X11EventSource::StopCurrentEventStream() {
146 continue_stream_ = false; 148 continue_stream_ = false;
147 } 149 }
148 150
149 } // namespace ui 151 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/platform/x11/BUILD.gn ('k') | ui/events/platform/x11/x11_events_platform.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698