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

Side by Side Diff: views/touchui/touch_factory.h

Issue 6300007: touch: Allow grabbing/ungrabbing touch devices for XInput2. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 11 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
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 VIEWS_TOUCHUI_TOUCH_FACTORY_H_
6 #define VIEWS_TOUCHUI_TOUCH_FACTORY_H_
7 #pragma once
8
9 #include <bitset>
10 #include <vector>
11 #include <X11/Xlib.h>
sky 2011/01/19 19:34:54 Is it possible to forward declare the types you ne
sadrul 2011/01/19 20:10:17 Indeed! I wasn't sure if we wanted to typedef Wind
12
13 #include "base/singleton.h"
14
15 namespace views {
16
17 // Functions related to determining touch devices.
18 class TouchFactory {
19 public:
20 // Returns the TouchFactory singleton.
21 static TouchFactory* GetInstance();
sky 2011/01/19 19:34:54 you've got an extra space here.
sadrul 2011/01/19 20:10:17 Done.
22
23 // Keep a list of touch devices so that it is possible to determine if a
24 // pointer event is a touch-event or a mouse-event.
25 void SetTouchDeviceList(const std::vector<unsigned int>& devices);
26
27 // Is the device a touch-device?
28 bool IsTouchDevice(unsigned int deviceid);
29
30 // Grab the touch devices for the specified window on the specified display.
31 // Returns if grab was successful for all touch devices.
32 bool GrabTouchDevices(Display* display, ::Window window);
33
34 // Ungrab the touch devices. Returns if ungrab was successful for all touch
35 // devices.
36 bool UngrabTouchDevices(Display* display);
37
38 private:
39 TouchFactory();
sky 2011/01/19 19:34:54 I think you forget an implementation of this.
sadrul 2011/01/19 20:10:17 It is there in touch_factory.cc
40
41 // Requirement for Signleton
42 friend struct DefaultSingletonTraits<TouchFactory>;
43
44 // A quick lookup table for determining if a device is a touch device.
45 std::bitset<128> touch_device_lookup_;
sky 2011/01/19 19:34:54 Are you sure you want to use both a bitset and vec
sadrul 2011/01/19 20:10:17 The lookup table is used for each pointer event (i
sky 2011/01/19 23:15:31 Sounds good.
46
47 // The list of touch devices.
48 std::vector<int> touch_device_list_;
49
50 DISALLOW_COPY_AND_ASSIGN(TouchFactory);
51 };
52
53 } // namespace views
54
55 #endif // VIEWS_TOUCHUI_TOUCH_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698