/ CoreGraphics / src / stubs.c
stubs.c
 1  /*
 2   This file is part of Darling.
 3  
 4   Copyright (C) 2019 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  
20  #include <CoreFoundation/CoreFoundation.h>
21  #include <CoreGraphics/CGDirectDisplay.h>
22  #include <CoreGraphics/CGGeometry.h>
23  #include <stdio.h>
24  
25  typedef float CGGammaValue;
26  typedef int32_t CGWindowLevel;
27  
28  static int verbose = 0;
29  
30  __attribute__((constructor)) static void initme(void) {
31      verbose = getenv("STUB_VERBOSE") != NULL;
32  }
33  
34  boolean_t CGCursorIsVisible(void) {
35      if(verbose)
36          puts("STUB: CGCursorIsVisible called");
37      return false;
38  }
39  
40  CGOpenGLDisplayMask CGDisplayIDToOpenGLDisplayMask(CGDirectDisplayID a) {
41      if(verbose)
42          puts("STUB: CGDisplayIDToOpenGLDisplayMask called");
43      return 0;
44  }
45  
46  CGError CGDisplayMoveCursorToPoint(CGDirectDisplayID a, CGPoint b) {
47      if(verbose)
48          puts("STUB: CGDisplayMoveCursorToPoint called");
49      return (CGError)0;
50  }
51  
52  void CGDisplayRestoreColorSyncSettings(void) {
53      if(verbose)
54          puts("STUB: CGDisplayRestoreColorSyncSettings called");
55  }
56  
57  CGError CGGetDisplayTransferByFormula(CGDirectDisplayID a, CGGammaValue *b, CGGammaValue *c, CGGammaValue *d, CGGammaValue *e, CGGammaValue *f, CGGammaValue *g, CGGammaValue *h, CGGammaValue *i, CGGammaValue *j) {
58      if(verbose)
59          puts("STUB: CGGetDisplayTransferByFormula called");
60      return (CGError)0;
61  }
62  
63  CGError CGGetDisplayTransferByTable(CGDirectDisplayID a, uint32_t b, CGGammaValue *c, CGGammaValue *d, CGGammaValue *e, uint32_t *f) {
64      if(verbose)
65          puts("STUB: CGGetDisplayTransferByTable called");
66      return (CGError)0;
67  }
68  
69  void CGGetLastMouseDelta(int32_t *a, int32_t *b) {
70      if(verbose)
71          puts("STUB: CGGetLastMouseDelta called");
72  }
73  
74  CGError CGSetDisplayTransferByFormula(CGDirectDisplayID a, CGGammaValue b, CGGammaValue c, CGGammaValue d, CGGammaValue e, CGGammaValue f, CGGammaValue g, CGGammaValue h, CGGammaValue i, CGGammaValue j) {
75      if(verbose)
76          puts("STUB: CGSetDisplayTransferByFormula called");
77      return (CGError)0;
78  }
79  
80  CGError CGSetDisplayTransferByTable(CGDirectDisplayID a, uint32_t b, const CGGammaValue *c, const CGGammaValue *d, const CGGammaValue *e) {
81      if(verbose)
82          puts("STUB: CGSetDisplayTransferByTable called");
83      return (CGError)0;
84  }
85  
86  CGError CGSetLocalEventsSuppressionInterval(CFTimeInterval a) {
87      if(verbose)
88          puts("STUB: CGSetLocalEventsSuppressionInterval called");
89      return (CGError)0;
90  }
91  
92  CGWindowLevel CGShieldingWindowLevel(void) {
93      if(verbose)
94          puts("STUB: CGShieldingWindowLevel called");
95      return 0;
96  }