1 /*
2 * Copyright (c) 2023 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
16 #include "MouseInput.h"
17
MouseInput()18 MouseInput::MouseInput() : touchAction(0), mouseXPosition(0), mouseYPosition(0),
19 pointButton(0), pointAction(0), sourceType(0), sourceTool(0) {}
20
SetMouseStatus(int status)21 void MouseInput::SetMouseStatus(int status)
22 {
23 touchAction = status;
24 }
25
SetMousePosition(double xPosition,double yPosition)26 void MouseInput::SetMousePosition(double xPosition, double yPosition)
27 {
28 mouseXPosition = xPosition;
29 mouseYPosition = yPosition;
30 }
31
GetMouseXPosition() const32 double MouseInput::GetMouseXPosition() const
33 {
34 return mouseXPosition;
35 }
36
GetMouseYPosition() const37 double MouseInput::GetMouseYPosition() const
38 {
39 return mouseYPosition;
40 }
41
SetMouseButton(int buttonVal)42 void MouseInput::SetMouseButton(int buttonVal)
43 {
44 pointButton = buttonVal;
45 }
46
SetMouseAction(int actionVal)47 void MouseInput::SetMouseAction(int actionVal)
48 {
49 pointAction = actionVal;
50 }
51
SetSourceType(int sourceTypeVal)52 void MouseInput::SetSourceType(int sourceTypeVal)
53 {
54 sourceType = sourceTypeVal;
55 }
56
SetSourceTool(int sourceToolVal)57 void MouseInput::SetSourceTool(int sourceToolVal)
58 {
59 sourceTool = sourceToolVal;
60 }
61
SetPressedBtns(std::set<int> & pressedBtns)62 void MouseInput::SetPressedBtns(std::set<int>& pressedBtns)
63 {
64 pressedBtnsVec = pressedBtns;
65 }
66
SetAxisValues(std::vector<double> & axisValues)67 void MouseInput::SetAxisValues(std::vector<double>& axisValues) // 13 is array size
68 {
69 axisValuesArr = axisValues;
70 }
71