Skip to content

Commit

Permalink
coregraphics: Clean up overlapping parts
Browse files Browse the repository at this point in the history
  • Loading branch information
tmc committed Sep 3, 2023
1 parent bba7468 commit 2a74281
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 18 deletions.
13 changes: 0 additions & 13 deletions macos/coregraphics/coregraphics_custom.go

This file was deleted.

5 changes: 0 additions & 5 deletions macos/coregraphics/coregraphics_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package coregraphics
// #import <CoreGraphics/CGGeometry.h>
import "C"
import (
"unsafe"

"github.com/progrium/macdriver/objc"
)

Expand All @@ -14,9 +12,6 @@ import (
type PathElement struct{}
type ScreenUpdateMoveDelta struct{}

type ColorConversionInfoRef unsafe.Pointer
type DisplayStreamUpdateRef unsafe.Pointer

type AffineTransform struct {
A Float
B Float
Expand Down
27 changes: 27 additions & 0 deletions macos/coregraphics/functions.gen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// AUTO-GENERATED CODE, DO NOT MODIFY

package coregraphics

// #import <stdlib.h>
// #import <stdint.h>
// #import <stdbool.h>
// #import "CoreGraphics/CoreGraphics.h"
// uint32_t MainDisplayID();
// void * DisplayCreateImage(uint32_t displayID);
import "C"

// Returns the display ID of the main display. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/1455620-cgmaindisplayid?language=objc
func MainDisplayID() DirectDisplayID {
rv := C.MainDisplayID()
return DirectDisplayID(rv)
}

// Returns an image containing the contents of the specified display. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/1455691-cgdisplaycreateimage?language=objc
func DisplayCreateImage(displayID DirectDisplayID) ImageRef {
rv := C.DisplayCreateImage(C.uint32_t(displayID))
return ImageRef(rv)
}
9 changes: 9 additions & 0 deletions macos/coregraphics/functions.gen.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// AUTO-GENERATED CODE, DO NOT MODIFY

#import "CoreGraphics/CoreGraphics.h"
uint32_t MainDisplayID() {
return CGMainDisplayID();
}
void * DisplayCreateImage(uint32_t displayID) {
return CGDisplayCreateImage(displayID);
}
117 changes: 117 additions & 0 deletions macos/coregraphics/structs.gen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
// AUTO-GENERATED CODE, DO NOT MODIFY

package coregraphics

import (
"unsafe"
)

// A reference to frame update’s metadata. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgdisplaystreamupdateref?language=objc
type DisplayStreamUpdateRef unsafe.Pointer

// A profile that specifies how to interpret a color value for display. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgcolorspaceref?language=objc
type ColorSpaceRef unsafe.Pointer

// An abstraction for data-reading tasks that eliminates the need to manage a raw memory buffer. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgdataproviderref?language=objc
type DataProviderRef unsafe.Pointer

// An opaque data type used to convert PostScript data to PDF data. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgpsconverterref?language=objc
type PSConverterRef unsafe.Pointer

// A document that contains PDF (Portable Document Format) drawing information. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgpdfdocumentref?language=objc
type PDFDocumentRef unsafe.Pointer

// A general facility for defining and using callback functions. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgfunctionref?language=objc
type FunctionRef unsafe.Pointer

// An object that describes how to convert between color spaces for use by other system services. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgcolorconversioninforef?language=objc
type ColorConversionInfoRef unsafe.Pointer

// A Quartz 2D drawing environment. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgcontextref?language=objc
type ContextRef unsafe.Pointer

// Defines an opaque type that represents a low-level hardware event. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgeventref?language=objc
type EventRef unsafe.Pointer

// A mutable graphics path: a mathematical description of shapes or lines to be drawn in a graphics context. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgmutablepathref?language=objc
type MutablePathRef unsafe.Pointer

// A definition for a smooth transition between colors for drawing radial and axial gradient fills. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cggradientref?language=objc
type GradientRef unsafe.Pointer

// A set of character glyphs and layout information for drawing text. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgfontref?language=objc
type FontRef unsafe.Pointer

// A reference to a display stream object. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgdisplaystreamref?language=objc
type DisplayStreamRef unsafe.Pointer

// A set of components that define a color, with a color space specifying how to interpret them. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgcolorref?language=objc
type ColorRef unsafe.Pointer

// A definition for a smooth transition between colors, controlled by a custom function you provide, for drawing radial and axial gradient fills. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgshadingref?language=objc
type ShadingRef unsafe.Pointer

// A bitmap image or image mask. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgimageref?language=objc
type ImageRef unsafe.Pointer

// An abstraction for data-writing tasks that eliminates the need to manage a raw memory buffer. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgdataconsumerref?language=objc
type DataConsumerRef unsafe.Pointer

// A 2D pattern to be used for drawing graphics paths. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgpatternref?language=objc
type PatternRef unsafe.Pointer

// A reference to a display mode object. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgdisplaymoderef?language=objc
type DisplayModeRef unsafe.Pointer

// A type that represents a page in a PDF document. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgpdfpageref?language=objc
type PDFPageRef unsafe.Pointer

// An offscreen context for reusing content drawn with Core Graphics. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cglayerref?language=objc
type LayerRef unsafe.Pointer

// Defines an opaque type that represents the source of a Quartz event. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/coregraphics/cgeventsourceref?language=objc
type EventSourceRef unsafe.Pointer

0 comments on commit 2a74281

Please sign in to comment.