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