1c29fa5a6Sopenharmony_ci/* 2c29fa5a6Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 3c29fa5a6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License") 4c29fa5a6Sopenharmony_ci{} 5c29fa5a6Sopenharmony_ci * you may not use this file except in compliance with the License. 6c29fa5a6Sopenharmony_ci * You may obtain a copy of the License at 7c29fa5a6Sopenharmony_ci * 8c29fa5a6Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 9c29fa5a6Sopenharmony_ci * 10c29fa5a6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 11c29fa5a6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 12c29fa5a6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13c29fa5a6Sopenharmony_ci * See the License for the specific language governing permissions and 14c29fa5a6Sopenharmony_ci * limitations under the License. 15c29fa5a6Sopenharmony_ci */ 16c29fa5a6Sopenharmony_ci 17c29fa5a6Sopenharmony_ci#include "libinput_interface.h" 18c29fa5a6Sopenharmony_ci 19c29fa5a6Sopenharmony_cinamespace { 20c29fa5a6Sopenharmony_ciOHOS::MMI::LibinputInterface *g_instance = nullptr; 21c29fa5a6Sopenharmony_ci} // namespace 22c29fa5a6Sopenharmony_ci 23c29fa5a6Sopenharmony_cinamespace OHOS { 24c29fa5a6Sopenharmony_cinamespace MMI { 25c29fa5a6Sopenharmony_ci 26c29fa5a6Sopenharmony_ciLibinputInterface::LibinputInterface() 27c29fa5a6Sopenharmony_ci{ 28c29fa5a6Sopenharmony_ci g_instance = this; 29c29fa5a6Sopenharmony_ci} 30c29fa5a6Sopenharmony_ci} // namespace MMI 31c29fa5a6Sopenharmony_ci} // namespace OHOS 32c29fa5a6Sopenharmony_ci 33c29fa5a6Sopenharmony_ciextern "C" { 34c29fa5a6Sopenharmony_cienum libinput_event_type libinput_event_get_type(struct libinput_event *event) 35c29fa5a6Sopenharmony_ci{ 36c29fa5a6Sopenharmony_ci return g_instance->GetEventType(event); 37c29fa5a6Sopenharmony_ci} 38c29fa5a6Sopenharmony_ci 39c29fa5a6Sopenharmony_cienum libinput_tablet_tool_tip_state libinput_event_tablet_tool_get_tip_state(struct libinput_event_tablet_tool *event) 40c29fa5a6Sopenharmony_ci{ 41c29fa5a6Sopenharmony_ci return g_instance->TabletToolGetTipState(event); 42c29fa5a6Sopenharmony_ci} 43c29fa5a6Sopenharmony_ci 44c29fa5a6Sopenharmony_cidouble libinput_event_tablet_tool_get_tilt_x(struct libinput_event_tablet_tool *event) 45c29fa5a6Sopenharmony_ci{ 46c29fa5a6Sopenharmony_ci return g_instance->TabletToolGetTiltX(event); 47c29fa5a6Sopenharmony_ci} 48c29fa5a6Sopenharmony_ci 49c29fa5a6Sopenharmony_cienum libinput_pointer_axis_source libinput_event_pointer_get_axis_source(struct libinput_event_pointer *event) 50c29fa5a6Sopenharmony_ci{ 51c29fa5a6Sopenharmony_ci return g_instance->GetAxisSource(event); 52c29fa5a6Sopenharmony_ci} 53c29fa5a6Sopenharmony_ci 54c29fa5a6Sopenharmony_cidouble libinput_event_tablet_tool_get_tilt_y(struct libinput_event_tablet_tool *event) 55c29fa5a6Sopenharmony_ci{ 56c29fa5a6Sopenharmony_ci return g_instance->TabletToolGetTiltY(event); 57c29fa5a6Sopenharmony_ci} 58c29fa5a6Sopenharmony_ci 59c29fa5a6Sopenharmony_ciuint64_t libinput_event_tablet_tool_get_time_usec(struct libinput_event_tablet_tool *event) 60c29fa5a6Sopenharmony_ci{ 61c29fa5a6Sopenharmony_ci return g_instance->TabletToolGetTimeUsec(event); 62c29fa5a6Sopenharmony_ci} 63c29fa5a6Sopenharmony_ci 64c29fa5a6Sopenharmony_cidouble libinput_event_tablet_tool_get_pressure(struct libinput_event_tablet_tool *event) 65c29fa5a6Sopenharmony_ci{ 66c29fa5a6Sopenharmony_ci return g_instance->TabletToolGetPressure(event); 67c29fa5a6Sopenharmony_ci} 68c29fa5a6Sopenharmony_ci 69c29fa5a6Sopenharmony_ciint32_t libinput_event_tablet_tool_get_tool_type(struct libinput_event_tablet_tool *event) 70c29fa5a6Sopenharmony_ci{ 71c29fa5a6Sopenharmony_ci return g_instance->TabletToolGetToolType(event); 72c29fa5a6Sopenharmony_ci} 73c29fa5a6Sopenharmony_ci 74c29fa5a6Sopenharmony_cienum libinput_tablet_tool_type libinput_tablet_tool_get_type(struct libinput_tablet_tool *tool) 75c29fa5a6Sopenharmony_ci{ 76c29fa5a6Sopenharmony_ci return g_instance->TabletToolGetType(tool); 77c29fa5a6Sopenharmony_ci} 78c29fa5a6Sopenharmony_ci 79c29fa5a6Sopenharmony_cistruct libinput_tablet_tool* libinput_event_tablet_tool_get_tool(struct libinput_event_tablet_tool *event) 80c29fa5a6Sopenharmony_ci{ 81c29fa5a6Sopenharmony_ci return g_instance->TabletToolGetTool(event); 82c29fa5a6Sopenharmony_ci} 83c29fa5a6Sopenharmony_ci 84c29fa5a6Sopenharmony_cistruct libinput_device* libinput_event_get_device(struct libinput_event *event) 85c29fa5a6Sopenharmony_ci{ 86c29fa5a6Sopenharmony_ci return g_instance->GetDevice(event); 87c29fa5a6Sopenharmony_ci} 88c29fa5a6Sopenharmony_ci 89c29fa5a6Sopenharmony_ciuint64_t libinput_event_get_sensortime(struct libinput_event *event) 90c29fa5a6Sopenharmony_ci{ 91c29fa5a6Sopenharmony_ci return g_instance->GetSensorTime(event); 92c29fa5a6Sopenharmony_ci} 93c29fa5a6Sopenharmony_ci 94c29fa5a6Sopenharmony_cistruct libinput_event_keyboard* libinput_event_get_keyboard_event(struct libinput_event *event) 95c29fa5a6Sopenharmony_ci{ 96c29fa5a6Sopenharmony_ci return g_instance->LibinputEventGetKeyboardEvent(event); 97c29fa5a6Sopenharmony_ci} 98c29fa5a6Sopenharmony_ci 99c29fa5a6Sopenharmony_cistruct libinput_event_pointer* libinput_event_get_pointer_event(struct libinput_event *event) 100c29fa5a6Sopenharmony_ci{ 101c29fa5a6Sopenharmony_ci return g_instance->LibinputGetPointerEvent(event); 102c29fa5a6Sopenharmony_ci} 103c29fa5a6Sopenharmony_ci 104c29fa5a6Sopenharmony_cistruct libinput_event_touch* libinput_event_get_touch_event(struct libinput_event *event) 105c29fa5a6Sopenharmony_ci{ 106c29fa5a6Sopenharmony_ci return g_instance->GetTouchEvent(event); 107c29fa5a6Sopenharmony_ci} 108c29fa5a6Sopenharmony_ci 109c29fa5a6Sopenharmony_cistruct libinput_event_touch* libinput_event_get_touchpad_event(struct libinput_event *event) 110c29fa5a6Sopenharmony_ci{ 111c29fa5a6Sopenharmony_ci return g_instance->GetTouchpadEvent(event); 112c29fa5a6Sopenharmony_ci} 113c29fa5a6Sopenharmony_ci 114c29fa5a6Sopenharmony_cistruct libinput_event_gesture* libinput_event_get_gesture_event(struct libinput_event *event) 115c29fa5a6Sopenharmony_ci{ 116c29fa5a6Sopenharmony_ci return g_instance->GetGestureEvent(event); 117c29fa5a6Sopenharmony_ci} 118c29fa5a6Sopenharmony_ci 119c29fa5a6Sopenharmony_cistruct libinput_event_tablet_tool* libinput_event_get_tablet_tool_event(struct libinput_event *event) 120c29fa5a6Sopenharmony_ci{ 121c29fa5a6Sopenharmony_ci return g_instance->GetTabletToolEvent(event); 122c29fa5a6Sopenharmony_ci} 123c29fa5a6Sopenharmony_ci 124c29fa5a6Sopenharmony_ciuint64_t libinput_event_keyboard_get_time_usec(struct libinput_event_keyboard *event) 125c29fa5a6Sopenharmony_ci{ 126c29fa5a6Sopenharmony_ci return (event != nullptr ? event->base.time : 0); 127c29fa5a6Sopenharmony_ci} 128c29fa5a6Sopenharmony_ci 129c29fa5a6Sopenharmony_ciuint32_t libinput_event_keyboard_get_key(struct libinput_event_keyboard *event) 130c29fa5a6Sopenharmony_ci{ 131c29fa5a6Sopenharmony_ci return g_instance->LibinputEventKeyboardGetKey(event); 132c29fa5a6Sopenharmony_ci} 133c29fa5a6Sopenharmony_ci 134c29fa5a6Sopenharmony_ciint libinput_device_keyboard_has_key(struct libinput_device *device, uint32_t code) 135c29fa5a6Sopenharmony_ci{ 136c29fa5a6Sopenharmony_ci return 0; 137c29fa5a6Sopenharmony_ci} 138c29fa5a6Sopenharmony_ci 139c29fa5a6Sopenharmony_cienum libinput_key_state libinput_event_keyboard_get_key_state(struct libinput_event_keyboard *event) 140c29fa5a6Sopenharmony_ci{ 141c29fa5a6Sopenharmony_ci return g_instance->LibinputEventKeyboardGetKeyState(event); 142c29fa5a6Sopenharmony_ci} 143c29fa5a6Sopenharmony_ci 144c29fa5a6Sopenharmony_cienum libinput_button_state libinput_event_pointer_get_button_state(struct libinput_event_pointer *event) 145c29fa5a6Sopenharmony_ci{ 146c29fa5a6Sopenharmony_ci return (event != nullptr ? event->buttonState : LIBINPUT_BUTTON_STATE_RELEASED); 147c29fa5a6Sopenharmony_ci} 148c29fa5a6Sopenharmony_ci 149c29fa5a6Sopenharmony_ciuint64_t libinput_event_touch_get_time_usec(struct libinput_event_touch *event) 150c29fa5a6Sopenharmony_ci{ 151c29fa5a6Sopenharmony_ci return g_instance->TouchEventGetTime(event); 152c29fa5a6Sopenharmony_ci} 153c29fa5a6Sopenharmony_ci 154c29fa5a6Sopenharmony_ciint32_t libinput_event_touch_get_seat_slot(struct libinput_event_touch *event) 155c29fa5a6Sopenharmony_ci{ 156c29fa5a6Sopenharmony_ci return g_instance->TouchEventGetSeatSlot(event); 157c29fa5a6Sopenharmony_ci} 158c29fa5a6Sopenharmony_ci 159c29fa5a6Sopenharmony_cidouble libinput_event_touch_get_pressure(struct libinput_event_touch* event) 160c29fa5a6Sopenharmony_ci{ 161c29fa5a6Sopenharmony_ci return g_instance->TouchEventGetPressure(event); 162c29fa5a6Sopenharmony_ci} 163c29fa5a6Sopenharmony_ci 164c29fa5a6Sopenharmony_ciint32_t libinput_event_touch_get_move_flag(struct libinput_event_touch* event) 165c29fa5a6Sopenharmony_ci{ 166c29fa5a6Sopenharmony_ci return g_instance->TouchEventGetMoveFlag(event); 167c29fa5a6Sopenharmony_ci} 168c29fa5a6Sopenharmony_ci 169c29fa5a6Sopenharmony_ciint32_t libinput_event_get_touch_contact_long_axis(struct libinput_event_touch *event) 170c29fa5a6Sopenharmony_ci{ 171c29fa5a6Sopenharmony_ci return g_instance->TouchEventGetContactLongAxis(event); 172c29fa5a6Sopenharmony_ci} 173c29fa5a6Sopenharmony_ci 174c29fa5a6Sopenharmony_ciint32_t libinput_event_get_touch_contact_short_axis(struct libinput_event_touch *event) 175c29fa5a6Sopenharmony_ci{ 176c29fa5a6Sopenharmony_ci return g_instance->TouchEventGetContactShortAxis(event); 177c29fa5a6Sopenharmony_ci} 178c29fa5a6Sopenharmony_ci 179c29fa5a6Sopenharmony_ciint32_t libinput_event_touch_get_tool_type(struct libinput_event_touch *event) 180c29fa5a6Sopenharmony_ci{ 181c29fa5a6Sopenharmony_ci return g_instance->TouchEventGetToolType(event); 182c29fa5a6Sopenharmony_ci} 183c29fa5a6Sopenharmony_ci 184c29fa5a6Sopenharmony_ciint libinput_device_touch_btn_tool_type_down(struct libinput_device *device, int32_t btnToolType) 185c29fa5a6Sopenharmony_ci{ 186c29fa5a6Sopenharmony_ci return g_instance->TouchEventGetBtnToolTypeDown(device, btnToolType); 187c29fa5a6Sopenharmony_ci} 188c29fa5a6Sopenharmony_ci 189c29fa5a6Sopenharmony_cidouble libinput_event_touch_get_x_transformed(struct libinput_event_touch *event, uint32_t width) 190c29fa5a6Sopenharmony_ci{ 191c29fa5a6Sopenharmony_ci return -1.0; 192c29fa5a6Sopenharmony_ci} 193c29fa5a6Sopenharmony_ci 194c29fa5a6Sopenharmony_cidouble libinput_event_touch_get_y_transformed(struct libinput_event_touch *event, uint32_t height) 195c29fa5a6Sopenharmony_ci{ 196c29fa5a6Sopenharmony_ci return -1.0; 197c29fa5a6Sopenharmony_ci} 198c29fa5a6Sopenharmony_ci 199c29fa5a6Sopenharmony_cidouble libinput_event_touch_get_tool_x_transformed(struct libinput_event_touch *event, uint32_t width) 200c29fa5a6Sopenharmony_ci{ 201c29fa5a6Sopenharmony_ci return -1.0; 202c29fa5a6Sopenharmony_ci} 203c29fa5a6Sopenharmony_ci 204c29fa5a6Sopenharmony_cidouble libinput_event_touch_get_tool_y_transformed(struct libinput_event_touch *event, uint32_t height) 205c29fa5a6Sopenharmony_ci{ 206c29fa5a6Sopenharmony_ci return -1.0; 207c29fa5a6Sopenharmony_ci} 208c29fa5a6Sopenharmony_ci 209c29fa5a6Sopenharmony_cidouble libinput_event_touch_get_tool_width_transformed(struct libinput_event_touch *event, uint32_t width) 210c29fa5a6Sopenharmony_ci{ 211c29fa5a6Sopenharmony_ci return -1.0; 212c29fa5a6Sopenharmony_ci} 213c29fa5a6Sopenharmony_ci 214c29fa5a6Sopenharmony_cidouble libinput_event_touch_get_tool_height_transformed(struct libinput_event_touch *event, uint32_t height) 215c29fa5a6Sopenharmony_ci{ 216c29fa5a6Sopenharmony_ci return -1.0; 217c29fa5a6Sopenharmony_ci} 218c29fa5a6Sopenharmony_ci 219c29fa5a6Sopenharmony_cidouble libinput_event_tablet_tool_get_x_transformed(struct libinput_event_tablet_tool *event, uint32_t width) 220c29fa5a6Sopenharmony_ci{ 221c29fa5a6Sopenharmony_ci return -1.0; 222c29fa5a6Sopenharmony_ci} 223c29fa5a6Sopenharmony_ci 224c29fa5a6Sopenharmony_cidouble libinput_event_tablet_tool_get_y_transformed(struct libinput_event_tablet_tool *event, uint32_t height) 225c29fa5a6Sopenharmony_ci{ 226c29fa5a6Sopenharmony_ci return -1.0; 227c29fa5a6Sopenharmony_ci} 228c29fa5a6Sopenharmony_ci 229c29fa5a6Sopenharmony_ciuint64_t libinput_event_touchpad_get_time_usec(struct libinput_event_touch *event) 230c29fa5a6Sopenharmony_ci{ 231c29fa5a6Sopenharmony_ci return (event != nullptr ? event->base.time : 0); 232c29fa5a6Sopenharmony_ci} 233c29fa5a6Sopenharmony_ci 234c29fa5a6Sopenharmony_ciint32_t libinput_event_touchpad_get_seat_slot(struct libinput_event_touch *event) 235c29fa5a6Sopenharmony_ci{ 236c29fa5a6Sopenharmony_ci return (event != nullptr ? event->seatSlot : 0); 237c29fa5a6Sopenharmony_ci} 238c29fa5a6Sopenharmony_ci 239c29fa5a6Sopenharmony_cidouble libinput_event_touchpad_get_x(struct libinput_event_touch *event) 240c29fa5a6Sopenharmony_ci{ 241c29fa5a6Sopenharmony_ci return (event != nullptr ? event->x : 0.0); 242c29fa5a6Sopenharmony_ci} 243c29fa5a6Sopenharmony_ci 244c29fa5a6Sopenharmony_cidouble libinput_event_touchpad_get_y(struct libinput_event_touch *event) 245c29fa5a6Sopenharmony_ci{ 246c29fa5a6Sopenharmony_ci return (event != nullptr ? event->y : 0.0); 247c29fa5a6Sopenharmony_ci} 248c29fa5a6Sopenharmony_ci 249c29fa5a6Sopenharmony_cidouble libinput_event_touchpad_get_pressure(struct libinput_event_touch *event) 250c29fa5a6Sopenharmony_ci{ 251c29fa5a6Sopenharmony_ci return (event != nullptr ? event->pressure : 0.0); 252c29fa5a6Sopenharmony_ci} 253c29fa5a6Sopenharmony_ci 254c29fa5a6Sopenharmony_ciint32_t libinput_event_touchpad_get_touch_contact_long_axis(struct libinput_event_touch *event) 255c29fa5a6Sopenharmony_ci{ 256c29fa5a6Sopenharmony_ci return (event != nullptr ? event->longAxis : 0); 257c29fa5a6Sopenharmony_ci} 258c29fa5a6Sopenharmony_ci 259c29fa5a6Sopenharmony_ciint32_t libinput_event_touchpad_get_touch_contact_short_axis(struct libinput_event_touch *event) 260c29fa5a6Sopenharmony_ci{ 261c29fa5a6Sopenharmony_ci return (event != nullptr ? event->shortAxis : 0); 262c29fa5a6Sopenharmony_ci} 263c29fa5a6Sopenharmony_ci 264c29fa5a6Sopenharmony_ciint32_t libinput_event_touchpad_get_tool_type(struct libinput_event_touch *event) 265c29fa5a6Sopenharmony_ci{ 266c29fa5a6Sopenharmony_ci return g_instance->TouchpadGetTool(event); 267c29fa5a6Sopenharmony_ci} 268c29fa5a6Sopenharmony_ci 269c29fa5a6Sopenharmony_ciint32_t libinput_device_touchpad_btn_tool_type_down(struct libinput_device *device, int32_t btnToolType) 270c29fa5a6Sopenharmony_ci{ 271c29fa5a6Sopenharmony_ci return -1; 272c29fa5a6Sopenharmony_ci} 273c29fa5a6Sopenharmony_ci 274c29fa5a6Sopenharmony_cidouble libinput_event_touchpad_get_tool_x(struct libinput_event_touch *event) 275c29fa5a6Sopenharmony_ci{ 276c29fa5a6Sopenharmony_ci return (event != nullptr ? event->toolX : 0.0); 277c29fa5a6Sopenharmony_ci} 278c29fa5a6Sopenharmony_ci 279c29fa5a6Sopenharmony_cidouble libinput_event_touchpad_get_tool_y(struct libinput_event_touch *event) 280c29fa5a6Sopenharmony_ci{ 281c29fa5a6Sopenharmony_ci return (event != nullptr ? event->toolY : 0.0); 282c29fa5a6Sopenharmony_ci} 283c29fa5a6Sopenharmony_ci 284c29fa5a6Sopenharmony_cidouble libinput_event_touchpad_get_tool_width(struct libinput_event_touch *event) 285c29fa5a6Sopenharmony_ci{ 286c29fa5a6Sopenharmony_ci return (event != nullptr ? event->toolWidth : 0.0); 287c29fa5a6Sopenharmony_ci} 288c29fa5a6Sopenharmony_ci 289c29fa5a6Sopenharmony_cidouble libinput_event_touchpad_get_tool_height(struct libinput_event_touch *event) 290c29fa5a6Sopenharmony_ci{ 291c29fa5a6Sopenharmony_ci return (event != nullptr ? event->toolWidth : 0.0); 292c29fa5a6Sopenharmony_ci} 293c29fa5a6Sopenharmony_ci 294c29fa5a6Sopenharmony_ciuint32_t libinput_event_gesture_get_time(struct libinput_event_gesture *event) 295c29fa5a6Sopenharmony_ci{ 296c29fa5a6Sopenharmony_ci return g_instance->GestureEventGetTime(event); 297c29fa5a6Sopenharmony_ci} 298c29fa5a6Sopenharmony_ci 299c29fa5a6Sopenharmony_ciint libinput_event_gesture_get_finger_count(struct libinput_event_gesture *event) 300c29fa5a6Sopenharmony_ci{ 301c29fa5a6Sopenharmony_ci return g_instance->GestureEventGetFingerCount(event); 302c29fa5a6Sopenharmony_ci} 303c29fa5a6Sopenharmony_ci 304c29fa5a6Sopenharmony_cidouble libinput_event_gesture_get_scale(struct libinput_event_gesture *event) 305c29fa5a6Sopenharmony_ci{ 306c29fa5a6Sopenharmony_ci return (event != nullptr ? static_cast<double>(event->scale) : 1.0); 307c29fa5a6Sopenharmony_ci} 308c29fa5a6Sopenharmony_ci 309c29fa5a6Sopenharmony_cidouble libinput_event_gesture_get_angle_delta(struct libinput_event_gesture *event) 310c29fa5a6Sopenharmony_ci{ 311c29fa5a6Sopenharmony_ci return (event != nullptr ? static_cast<double>(event->angle) : 0.0); 312c29fa5a6Sopenharmony_ci} 313c29fa5a6Sopenharmony_ci 314c29fa5a6Sopenharmony_ciint libinput_event_gesture_get_device_coords_x(struct libinput_event_gesture *event, uint32_t idx) 315c29fa5a6Sopenharmony_ci{ 316c29fa5a6Sopenharmony_ci return g_instance->GestureEventGetDevCoordsX(event, idx); 317c29fa5a6Sopenharmony_ci} 318c29fa5a6Sopenharmony_ci 319c29fa5a6Sopenharmony_ciint libinput_event_gesture_get_device_coords_y(struct libinput_event_gesture *event, uint32_t idx) 320c29fa5a6Sopenharmony_ci{ 321c29fa5a6Sopenharmony_ci return g_instance->GestureEventGetDevCoordsY(event, idx); 322c29fa5a6Sopenharmony_ci} 323c29fa5a6Sopenharmony_ci 324c29fa5a6Sopenharmony_ciint libinput_has_event_led_type(struct libinput_device *device) 325c29fa5a6Sopenharmony_ci{ 326c29fa5a6Sopenharmony_ci return 0; 327c29fa5a6Sopenharmony_ci} 328c29fa5a6Sopenharmony_ci 329c29fa5a6Sopenharmony_ciconst char* libinput_device_get_name(struct libinput_device *device) 330c29fa5a6Sopenharmony_ci{ 331c29fa5a6Sopenharmony_ci return g_instance->DeviceGetName(device); 332c29fa5a6Sopenharmony_ci} 333c29fa5a6Sopenharmony_ci 334c29fa5a6Sopenharmony_ciunsigned int libinput_device_get_id_bustype(struct libinput_device *device) 335c29fa5a6Sopenharmony_ci{ 336c29fa5a6Sopenharmony_ci return (device != nullptr ? device->busType : 0); 337c29fa5a6Sopenharmony_ci} 338c29fa5a6Sopenharmony_ci 339c29fa5a6Sopenharmony_ciunsigned int libinput_device_get_id_version(struct libinput_device *device) 340c29fa5a6Sopenharmony_ci{ 341c29fa5a6Sopenharmony_ci return (device != nullptr ? device->version : 0); 342c29fa5a6Sopenharmony_ci} 343c29fa5a6Sopenharmony_ci 344c29fa5a6Sopenharmony_ciunsigned int libinput_device_get_id_product(struct libinput_device *device) 345c29fa5a6Sopenharmony_ci{ 346c29fa5a6Sopenharmony_ci return (device != nullptr ? device->product : 0); 347c29fa5a6Sopenharmony_ci} 348c29fa5a6Sopenharmony_ci 349c29fa5a6Sopenharmony_ciunsigned int libinput_device_get_id_vendor(struct libinput_device *device) 350c29fa5a6Sopenharmony_ci{ 351c29fa5a6Sopenharmony_ci return (device != nullptr ? device->vendor : 0); 352c29fa5a6Sopenharmony_ci} 353c29fa5a6Sopenharmony_ci 354c29fa5a6Sopenharmony_ciconst char* libinput_device_get_phys(struct libinput_device* device) 355c29fa5a6Sopenharmony_ci{ 356c29fa5a6Sopenharmony_ci return ""; 357c29fa5a6Sopenharmony_ci} 358c29fa5a6Sopenharmony_ci 359c29fa5a6Sopenharmony_ciconst char* libinput_device_get_uniq(struct libinput_device* device) 360c29fa5a6Sopenharmony_ci{ 361c29fa5a6Sopenharmony_ci return ""; 362c29fa5a6Sopenharmony_ci} 363c29fa5a6Sopenharmony_ci 364c29fa5a6Sopenharmony_ciconst char* libinput_device_get_sysname(struct libinput_device *device) 365c29fa5a6Sopenharmony_ci{ 366c29fa5a6Sopenharmony_ci return nullptr; 367c29fa5a6Sopenharmony_ci} 368c29fa5a6Sopenharmony_ci 369c29fa5a6Sopenharmony_cistruct udev_device* libinput_device_get_udev_device(struct libinput_device *device) 370c29fa5a6Sopenharmony_ci{ 371c29fa5a6Sopenharmony_ci return nullptr; 372c29fa5a6Sopenharmony_ci} 373c29fa5a6Sopenharmony_ci 374c29fa5a6Sopenharmony_cienum evdev_device_udev_tags libinput_device_get_tags(struct libinput_device* device) 375c29fa5a6Sopenharmony_ci{ 376c29fa5a6Sopenharmony_ci return EVDEV_UDEV_TAG_INPUT; 377c29fa5a6Sopenharmony_ci} 378c29fa5a6Sopenharmony_ci 379c29fa5a6Sopenharmony_ciint libinput_device_has_capability(struct libinput_device *device, enum libinput_device_capability capability) 380c29fa5a6Sopenharmony_ci{ 381c29fa5a6Sopenharmony_ci return 0; 382c29fa5a6Sopenharmony_ci} 383c29fa5a6Sopenharmony_ci 384c29fa5a6Sopenharmony_ciint32_t libinput_device_has_key(struct libinput_device* device, int32_t keyCode) 385c29fa5a6Sopenharmony_ci{ 386c29fa5a6Sopenharmony_ci return 0; 387c29fa5a6Sopenharmony_ci} 388c29fa5a6Sopenharmony_ci 389c29fa5a6Sopenharmony_ciint32_t libinput_device_get_axis_min(struct libinput_device* device, int32_t code) 390c29fa5a6Sopenharmony_ci{ 391c29fa5a6Sopenharmony_ci return -1; 392c29fa5a6Sopenharmony_ci} 393c29fa5a6Sopenharmony_ci 394c29fa5a6Sopenharmony_ciint32_t libinput_device_get_axis_max(struct libinput_device* device, int32_t code) 395c29fa5a6Sopenharmony_ci{ 396c29fa5a6Sopenharmony_ci return -1; 397c29fa5a6Sopenharmony_ci} 398c29fa5a6Sopenharmony_ci 399c29fa5a6Sopenharmony_ciint32_t libinput_device_get_axis_fuzz(struct libinput_device* device, int32_t code) 400c29fa5a6Sopenharmony_ci{ 401c29fa5a6Sopenharmony_ci return -1; 402c29fa5a6Sopenharmony_ci} 403c29fa5a6Sopenharmony_ci 404c29fa5a6Sopenharmony_ciint32_t libinput_device_get_axis_flat(struct libinput_device* device, int32_t code) 405c29fa5a6Sopenharmony_ci{ 406c29fa5a6Sopenharmony_ci return -1; 407c29fa5a6Sopenharmony_ci} 408c29fa5a6Sopenharmony_ci 409c29fa5a6Sopenharmony_ciint32_t libinput_device_get_axis_resolution(struct libinput_device* device, int32_t code) 410c29fa5a6Sopenharmony_ci{ 411c29fa5a6Sopenharmony_ci return -1; 412c29fa5a6Sopenharmony_ci} 413c29fa5a6Sopenharmony_ci 414c29fa5a6Sopenharmony_ciint libinput_get_funckey_state(struct libinput_device *device, unsigned int code) 415c29fa5a6Sopenharmony_ci{ 416c29fa5a6Sopenharmony_ci return 0; 417c29fa5a6Sopenharmony_ci} 418c29fa5a6Sopenharmony_ci 419c29fa5a6Sopenharmony_ciuint32_t libinput_event_pointer_get_finger_count(struct libinput_event_pointer *event) 420c29fa5a6Sopenharmony_ci{ 421c29fa5a6Sopenharmony_ci return g_instance->PointerEventGetFingerCount(event); 422c29fa5a6Sopenharmony_ci} 423c29fa5a6Sopenharmony_ci 424c29fa5a6Sopenharmony_cidouble libinput_event_pointer_get_dx_unaccelerated(struct libinput_event_pointer *event) 425c29fa5a6Sopenharmony_ci{ 426c29fa5a6Sopenharmony_ci return g_instance->PointerGetDxUnaccelerated(event); 427c29fa5a6Sopenharmony_ci} 428c29fa5a6Sopenharmony_ci 429c29fa5a6Sopenharmony_cidouble libinput_event_pointer_get_dy_unaccelerated(struct libinput_event_pointer *event) 430c29fa5a6Sopenharmony_ci{ 431c29fa5a6Sopenharmony_ci return g_instance->PointerGetDyUnaccelerated(event); 432c29fa5a6Sopenharmony_ci} 433c29fa5a6Sopenharmony_ci 434c29fa5a6Sopenharmony_ciuint32_t libinput_event_pointer_get_button(struct libinput_event_pointer *event) 435c29fa5a6Sopenharmony_ci{ 436c29fa5a6Sopenharmony_ci return g_instance->PointerGetButton(event); 437c29fa5a6Sopenharmony_ci} 438c29fa5a6Sopenharmony_ci 439c29fa5a6Sopenharmony_ciint libinput_event_pointer_has_axis(struct libinput_event_pointer *event, enum libinput_pointer_axis axis) 440c29fa5a6Sopenharmony_ci{ 441c29fa5a6Sopenharmony_ci return g_instance->PointerHasAxis(event, axis); 442c29fa5a6Sopenharmony_ci} 443c29fa5a6Sopenharmony_ci 444c29fa5a6Sopenharmony_cidouble libinput_event_pointer_get_axis_value(struct libinput_event_pointer *event, enum libinput_pointer_axis axis) 445c29fa5a6Sopenharmony_ci{ 446c29fa5a6Sopenharmony_ci return g_instance->PointerGetAxisValue(event, axis); 447c29fa5a6Sopenharmony_ci} 448c29fa5a6Sopenharmony_ci} // extern "C" 449