/ CoreGraphics / include / CoreGraphics / CGEventSource.h
CGEventSource.h
 1  /*
 2   This file is part of Darling.
 3  
 4   Copyright (C) 2020 Lubos Dolezel
 5  
 6   Darling is free software: you can redistribute it and/or modify
 7   it under the terms of the GNU General Public License as published by
 8   the Free Software Foundation, either version 3 of the License, or
 9   (at your option) any later version.
10  
11   Darling is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15  
16   You should have received a copy of the GNU General Public License
17   along with Darling.  If not, see <http://www.gnu.org/licenses/>.
18  */
19  #ifndef CGEVENTSOURCE_H
20  #define CGEVENTSOURCE_H
21  #include <CoreFoundation/CFBase.h>
22  #include <CoreGraphics/CGEventTypes.h>
23  #include <stdint.h>
24  
25  __BEGIN_DECLS
26  
27  extern CFTypeID CGEventSourceGetTypeID(void);
28  
29  extern CGEventSourceRef _Nullable CGEventSourceCreate(
30      CGEventSourceStateID stateID);
31  
32  extern CGEventSourceKeyboardType CGEventSourceGetKeyboardType(
33      CGEventSourceRef _Nullable source);
34  
35  extern void CGEventSourceSetKeyboardType(CGEventSourceRef _Nullable source,
36      CGEventSourceKeyboardType keyboardType);
37  extern double CGEventSourceGetPixelsPerLine(
38      CGEventSourceRef _Nullable source);
39  extern void CGEventSourceSetPixelsPerLine(CGEventSourceRef _Nullable source,
40      double pixelsPerLine);
41  extern CGEventSourceStateID CGEventSourceGetSourceStateID(
42      CGEventSourceRef _Nullable source);
43  
44  extern bool CGEventSourceButtonState(CGEventSourceStateID stateID,
45      CGMouseButton button);
46  
47  extern bool CGEventSourceKeyState(CGEventSourceStateID stateID,
48      CGKeyCode key);
49  
50  extern CGEventFlags CGEventSourceFlagsState(CGEventSourceStateID stateID);
51  
52  extern CFTimeInterval CGEventSourceSecondsSinceLastEventType(
53      CGEventSourceStateID stateID, CGEventType eventType);
54  extern uint32_t CGEventSourceCounterForEventType(CGEventSourceStateID
55                                                       stateID,
56      CGEventType eventType);
57  extern void CGEventSourceSetUserData(CGEventSourceRef _Nullable source,
58      int64_t userData);
59  extern int64_t CGEventSourceGetUserData(CGEventSourceRef _Nullable source);
60  extern void CGEventSourceSetLocalEventsFilterDuringSuppressionState(
61      CGEventSourceRef _Nullable source, CGEventFilterMask filter,
62      CGEventSuppressionState state);
63  extern CGEventFilterMask
64  CGEventSourceGetLocalEventsFilterDuringSuppressionState(
65      CGEventSourceRef _Nullable source, CGEventSuppressionState state);
66  extern void CGEventSourceSetLocalEventsSuppressionInterval(
67      CGEventSourceRef _Nullable source, CFTimeInterval seconds);
68  
69  extern CFTimeInterval CGEventSourceGetLocalEventsSuppressionInterval(
70      CGEventSourceRef _Nullable source);
71  
72  __END_DECLS
73  
74  #endif