OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/wayland/server.h" | 5 #include "components/exo/wayland/server.h" |
6 | 6 |
7 #include <grp.h> | 7 #include <grp.h> |
8 #include <linux/input.h> | 8 #include <linux/input.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 2945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2956 } | 2956 } |
2957 ~WaylandPointerStylusDelegate() override { | 2957 ~WaylandPointerStylusDelegate() override { |
2958 if (pointer_ != nullptr) | 2958 if (pointer_ != nullptr) |
2959 pointer_->SetStylusDelegate(nullptr); | 2959 pointer_->SetStylusDelegate(nullptr); |
2960 } | 2960 } |
2961 void OnPointerDestroying(Pointer* pointer) override { pointer_ = nullptr; } | 2961 void OnPointerDestroying(Pointer* pointer) override { pointer_ = nullptr; } |
2962 void OnPointerToolChange(ui::EventPointerType type) override { | 2962 void OnPointerToolChange(ui::EventPointerType type) override { |
2963 uint wayland_type = ZWP_POINTER_STYLUS_V1_TOOL_TYPE_MOUSE; | 2963 uint wayland_type = ZWP_POINTER_STYLUS_V1_TOOL_TYPE_MOUSE; |
2964 if (type == ui::EventPointerType::POINTER_TYPE_PEN) | 2964 if (type == ui::EventPointerType::POINTER_TYPE_PEN) |
2965 wayland_type = ZWP_POINTER_STYLUS_V1_TOOL_TYPE_PEN; | 2965 wayland_type = ZWP_POINTER_STYLUS_V1_TOOL_TYPE_PEN; |
| 2966 else if (type == ui::EventPointerType::POINTER_TYPE_ERASER) |
| 2967 wayland_type = ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ERASER; |
2966 zwp_pointer_stylus_v1_send_tool_change(resource_, wayland_type); | 2968 zwp_pointer_stylus_v1_send_tool_change(resource_, wayland_type); |
2967 } | 2969 } |
2968 void OnPointerForce(base::TimeTicks time_stamp, float force) override { | 2970 void OnPointerForce(base::TimeTicks time_stamp, float force) override { |
2969 zwp_pointer_stylus_v1_send_force(resource_, | 2971 zwp_pointer_stylus_v1_send_force(resource_, |
2970 TimeTicksToMilliseconds(time_stamp), | 2972 TimeTicksToMilliseconds(time_stamp), |
2971 wl_fixed_from_double(force)); | 2973 wl_fixed_from_double(force)); |
2972 } | 2974 } |
2973 void OnPointerTilt(base::TimeTicks time_stamp, gfx::Vector2dF tilt) override { | 2975 void OnPointerTilt(base::TimeTicks time_stamp, gfx::Vector2dF tilt) override { |
2974 zwp_pointer_stylus_v1_send_tilt( | 2976 zwp_pointer_stylus_v1_send_tilt( |
2975 resource_, TimeTicksToMilliseconds(time_stamp), | 2977 resource_, TimeTicksToMilliseconds(time_stamp), |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3126 DCHECK(event_loop); | 3128 DCHECK(event_loop); |
3127 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); | 3129 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); |
3128 } | 3130 } |
3129 | 3131 |
3130 void Server::Flush() { | 3132 void Server::Flush() { |
3131 wl_display_flush_clients(wl_display_.get()); | 3133 wl_display_flush_clients(wl_display_.get()); |
3132 } | 3134 } |
3133 | 3135 |
3134 } // namespace wayland | 3136 } // namespace wayland |
3135 } // namespace exo | 3137 } // namespace exo |
OLD | NEW |