Skip to content

Commit 2a74281

Browse files
committed
coregraphics: Clean up overlapping parts
1 parent bba7468 commit 2a74281

File tree

5 files changed

+153
-18
lines changed

5 files changed

+153
-18
lines changed

macos/coregraphics/coregraphics_custom.go

Lines changed: 0 additions & 13 deletions
This file was deleted.

macos/coregraphics/coregraphics_structs.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package coregraphics
33
// #import <CoreGraphics/CGGeometry.h>
44
import "C"
55
import (
6-
"unsafe"
7-
86
"github.com/progrium/macdriver/objc"
97
)
108

@@ -14,9 +12,6 @@ import (
1412
type PathElement struct{}
1513
type ScreenUpdateMoveDelta struct{}
1614

17-
type ColorConversionInfoRef unsafe.Pointer
18-
type DisplayStreamUpdateRef unsafe.Pointer
19-
2015
type AffineTransform struct {
2116
A Float
2217
B Float
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// AUTO-GENERATED CODE, DO NOT MODIFY
2+
3+
package coregraphics
4+
5+
// #import <stdlib.h>
6+
// #import <stdint.h>
7+
// #import <stdbool.h>
8+
// #import "CoreGraphics/CoreGraphics.h"
9+
// uint32_t MainDisplayID();
10+
// void * DisplayCreateImage(uint32_t displayID);
11+
import "C"
12+
13+
// Returns the display ID of the main display. [Full Topic]
14+
//
15+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/1455620-cgmaindisplayid?language=objc
16+
func MainDisplayID() DirectDisplayID {
17+
rv := C.MainDisplayID()
18+
return DirectDisplayID(rv)
19+
}
20+
21+
// Returns an image containing the contents of the specified display. [Full Topic]
22+
//
23+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/1455691-cgdisplaycreateimage?language=objc
24+
func DisplayCreateImage(displayID DirectDisplayID) ImageRef {
25+
rv := C.DisplayCreateImage(C.uint32_t(displayID))
26+
return ImageRef(rv)
27+
}

macos/coregraphics/functions.gen.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// AUTO-GENERATED CODE, DO NOT MODIFY
2+
3+
#import "CoreGraphics/CoreGraphics.h"
4+
uint32_t MainDisplayID() {
5+
return CGMainDisplayID();
6+
}
7+
void * DisplayCreateImage(uint32_t displayID) {
8+
return CGDisplayCreateImage(displayID);
9+
}

macos/coregraphics/structs.gen.go

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
// AUTO-GENERATED CODE, DO NOT MODIFY
2+
3+
package coregraphics
4+
5+
import (
6+
"unsafe"
7+
)
8+
9+
// A reference to frame update’s metadata. [Full Topic]
10+
//
11+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgdisplaystreamupdateref?language=objc
12+
type DisplayStreamUpdateRef unsafe.Pointer
13+
14+
// A profile that specifies how to interpret a color value for display. [Full Topic]
15+
//
16+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgcolorspaceref?language=objc
17+
type ColorSpaceRef unsafe.Pointer
18+
19+
// An abstraction for data-reading tasks that eliminates the need to manage a raw memory buffer. [Full Topic]
20+
//
21+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgdataproviderref?language=objc
22+
type DataProviderRef unsafe.Pointer
23+
24+
// An opaque data type used to convert PostScript data to PDF data. [Full Topic]
25+
//
26+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgpsconverterref?language=objc
27+
type PSConverterRef unsafe.Pointer
28+
29+
// A document that contains PDF (Portable Document Format) drawing information. [Full Topic]
30+
//
31+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgpdfdocumentref?language=objc
32+
type PDFDocumentRef unsafe.Pointer
33+
34+
// A general facility for defining and using callback functions. [Full Topic]
35+
//
36+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgfunctionref?language=objc
37+
type FunctionRef unsafe.Pointer
38+
39+
// An object that describes how to convert between color spaces for use by other system services. [Full Topic]
40+
//
41+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgcolorconversioninforef?language=objc
42+
type ColorConversionInfoRef unsafe.Pointer
43+
44+
// A Quartz 2D drawing environment. [Full Topic]
45+
//
46+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgcontextref?language=objc
47+
type ContextRef unsafe.Pointer
48+
49+
// Defines an opaque type that represents a low-level hardware event. [Full Topic]
50+
//
51+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgeventref?language=objc
52+
type EventRef unsafe.Pointer
53+
54+
// A mutable graphics path: a mathematical description of shapes or lines to be drawn in a graphics context. [Full Topic]
55+
//
56+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgmutablepathref?language=objc
57+
type MutablePathRef unsafe.Pointer
58+
59+
// A definition for a smooth transition between colors for drawing radial and axial gradient fills. [Full Topic]
60+
//
61+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cggradientref?language=objc
62+
type GradientRef unsafe.Pointer
63+
64+
// A set of character glyphs and layout information for drawing text. [Full Topic]
65+
//
66+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgfontref?language=objc
67+
type FontRef unsafe.Pointer
68+
69+
// A reference to a display stream object. [Full Topic]
70+
//
71+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgdisplaystreamref?language=objc
72+
type DisplayStreamRef unsafe.Pointer
73+
74+
// A set of components that define a color, with a color space specifying how to interpret them. [Full Topic]
75+
//
76+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgcolorref?language=objc
77+
type ColorRef unsafe.Pointer
78+
79+
// A definition for a smooth transition between colors, controlled by a custom function you provide, for drawing radial and axial gradient fills. [Full Topic]
80+
//
81+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgshadingref?language=objc
82+
type ShadingRef unsafe.Pointer
83+
84+
// A bitmap image or image mask. [Full Topic]
85+
//
86+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgimageref?language=objc
87+
type ImageRef unsafe.Pointer
88+
89+
// An abstraction for data-writing tasks that eliminates the need to manage a raw memory buffer. [Full Topic]
90+
//
91+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgdataconsumerref?language=objc
92+
type DataConsumerRef unsafe.Pointer
93+
94+
// A 2D pattern to be used for drawing graphics paths. [Full Topic]
95+
//
96+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgpatternref?language=objc
97+
type PatternRef unsafe.Pointer
98+
99+
// A reference to a display mode object. [Full Topic]
100+
//
101+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgdisplaymoderef?language=objc
102+
type DisplayModeRef unsafe.Pointer
103+
104+
// A type that represents a page in a PDF document. [Full Topic]
105+
//
106+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgpdfpageref?language=objc
107+
type PDFPageRef unsafe.Pointer
108+
109+
// An offscreen context for reusing content drawn with Core Graphics. [Full Topic]
110+
//
111+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cglayerref?language=objc
112+
type LayerRef unsafe.Pointer
113+
114+
// Defines an opaque type that represents the source of a Quartz event. [Full Topic]
115+
//
116+
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgeventsourceref?language=objc
117+
type EventSourceRef unsafe.Pointer

0 commit comments

Comments
 (0)