1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16export const Action = { 17 CANCEL: 0, 18 DOWN: 1, 19 MOVE: 2, 20 UP: 3, 21} 22 23export const ToolType = { 24 FINGER: 0, 25 PEN: 1, 26 RUBBER: 2, 27 BRUSH: 3, 28 PENCIL: 4, 29 AIRBRUSH: 5, 30 MOUSE: 6, 31 LENS: 7, 32} 33 34export const SourceType = { 35 TOUCH_SCREEN: 0, 36 PEN: 1, 37 TOUCH_PAD: 2, 38 } 39 40export function mockTouchEvent() { 41 const Touch = { 42 id: '[PC preview] unknow id', 43 pressedTime: '[PC preview] unknow pressedTime', 44 screenX: '[PC preview] unknow screenX', 45 screenY: '[PC preview] unknow screenY', 46 windowX: '[PC preview] unknow windowX', 47 windowY: '[PC preview] unknow windowY', 48 pressure: '[PC preview] unknow pressure', 49 width: '[PC preview] unknow width', 50 height: '[PC preview] unknow height', 51 tiltX: '[PC preview] unknow tiltX', 52 tiltY: '[PC preview] unknow tiltY', 53 toolX: '[PC preview] unknow toolX', 54 toolY: '[PC preview] unknow toolY', 55 toolWidth: '[PC preview] unknow toolWidth', 56 toolHeight: '[PC preview] unknow toolHeight', 57 rawX: '[PC preview] unknow rawX', 58 rawY: '[PC preview] unknow rawY', 59 toolType: '[PC preview] unknow toolType', 60 } 61 const TouchEvent = { 62 action: '[PC preview] unknow action', 63 touch: '[PC preview] unknow Touch', 64 touches: ['[PC preview] unknow Touch'], 65 sourceType: '[PC preview] unknow SourceType', 66 } 67 const touchEvent = { 68 Action, 69 ToolType, 70 SourceType, 71 } 72 return touchEvent; 73}