OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/event_constants.h" | 5 #include "ui/events/event_constants.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <X11/extensions/XInput.h> | 8 #include <X11/extensions/XInput.h> |
9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
10 #include <X11/XKBlib.h> | 10 #include <X11/XKBlib.h> |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 return NULL; | 732 return NULL; |
733 XEvent* copy = new XEvent; | 733 XEvent* copy = new XEvent; |
734 *copy = *event; | 734 *copy = *event; |
735 return copy; | 735 return copy; |
736 } | 736 } |
737 | 737 |
738 void ReleaseCopiedNativeEvent(const base::NativeEvent& event) { | 738 void ReleaseCopiedNativeEvent(const base::NativeEvent& event) { |
739 delete event; | 739 delete event; |
740 } | 740 } |
741 | 741 |
| 742 void IncrementTouchIdRefCount(const base::NativeEvent& xev) { |
| 743 ui::DeviceDataManagerX11* manager = ui::DeviceDataManagerX11::GetInstance(); |
| 744 double tracking_id; |
| 745 if (!manager->GetEventData( |
| 746 *xev, ui::DeviceDataManagerX11::DT_TOUCH_TRACKING_ID, &tracking_id)) { |
| 747 return; |
| 748 } |
| 749 |
| 750 ui::TouchFactory* factory = ui::TouchFactory::GetInstance(); |
| 751 factory->AcquireSlotForTrackingID(tracking_id); |
| 752 } |
| 753 |
742 void ClearTouchIdIfReleased(const base::NativeEvent& xev) { | 754 void ClearTouchIdIfReleased(const base::NativeEvent& xev) { |
743 ui::EventType type = ui::EventTypeFromNative(xev); | 755 ui::EventType type = ui::EventTypeFromNative(xev); |
744 if (type == ui::ET_TOUCH_CANCELLED || | 756 if (type == ui::ET_TOUCH_CANCELLED || |
745 type == ui::ET_TOUCH_RELEASED) { | 757 type == ui::ET_TOUCH_RELEASED) { |
746 ui::TouchFactory* factory = ui::TouchFactory::GetInstance(); | 758 ui::TouchFactory* factory = ui::TouchFactory::GetInstance(); |
747 ui::DeviceDataManagerX11* manager = ui::DeviceDataManagerX11::GetInstance(); | 759 ui::DeviceDataManagerX11* manager = ui::DeviceDataManagerX11::GetInstance(); |
748 double tracking_id; | 760 double tracking_id; |
749 if (manager->GetEventData( | 761 if (manager->GetEventData( |
750 *xev, ui::DeviceDataManagerX11::DT_TOUCH_TRACKING_ID, &tracking_id)) { | 762 *xev, ui::DeviceDataManagerX11::DT_TOUCH_TRACKING_ID, &tracking_id)) { |
751 factory->ReleaseSlotForTrackingID(tracking_id); | 763 factory->ReleaseSlotForTrackingID(tracking_id); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 xievent->detail = | 914 xievent->detail = |
903 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); | 915 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); |
904 break; | 916 break; |
905 } | 917 } |
906 default: | 918 default: |
907 break; | 919 break; |
908 } | 920 } |
909 } | 921 } |
910 | 922 |
911 } // namespace ui | 923 } // namespace ui |
OLD | NEW |