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 #ifndef INPUT_BINDING_H
17 #define INPUT_BINDING_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 struct CPointerEvent;
24 struct CKeyEvent;
25 struct CAxisEvent;
26 struct CPointerStyle;
27 struct CExtraData;
28 
29 int32_t CGetPointerId(const CPointerEvent* cPointerEvent);
30 int32_t CGetPointerAction(const CPointerEvent* cPointerEvent);
31 int32_t CGetTargetWindowId(const CPointerEvent* cPointerEvent);
32 int32_t CGetSourceType(const CPointerEvent* cPointerEvent);
33 int32_t CGetTargetDisplayId(const CPointerEvent* cPointerEvent);
34 int32_t CGetDisplayX(const CPointerEvent* cPointerEvent);
35 int32_t CGetDisplayY(const CPointerEvent* cPointerEvent);
36 void CPointerEventAddFlag(const CPointerEvent* cPointerEvent);
37 void CKeyEventAddFlag(const CKeyEvent* cKeyEvent);
38 int32_t CGetDeviceId(const CPointerEvent* cPointerEvent);
39 int32_t CGetKeyCode(const CKeyEvent* cKeyEvent);
40 
41 int32_t CAddMonitor(void (*callback)(CPointerEvent *));
42 int32_t CGetWindowPid(const CPointerEvent* cPointerEvent);
43 int32_t CGetPointerStyle(CPointerStyle* cPointerStyle);
44 void CAppendExtraData(CExtraData cExtraData);
45 int32_t CSetPointerVisible(bool visible);
46 int32_t CEnableInputDevice(bool enable);
47 int32_t CRemoveInputEventFilter(int filterId);
48 void CRemoveMonitor(int monitorId);
49 void CRemoveInterceptor(int interceptorId);
50 void CSetPointerLocation(int physicalX, int physicalY);
51 
52 void CDestroyPointerEvent(CPointerEvent* cPointerEvent);
53 
54 #ifdef __cplusplus
55 }
56 #endif /* __cplusplus */
57 
58 #endif // INPUT_BINDING_H