From e468a641af06f82910e04dc1a384636eea9b6cfb Mon Sep 17 00:00:00 2001 From: Jeff Lindsay Date: Tue, 14 Nov 2023 14:31:40 -0500 Subject: [PATCH] macos: minor fixes and missing types --- macos/corefoundation/corefoundation_custom.go | 4 ++++ macos/coregraphics/coregraphics_custom.go | 12 ++++++++++++ macos/coremedia/coremedia_custom.go | 8 ++++++++ macos/corevideo/corevideo_custom.go | 4 ++++ macos/fileprovider/fileprovider_structs.go | 8 -------- macos/foundation/foundation_custom.go | 4 ++++ macos/sysconfig/sysconfig_custom.go | 7 ------- 7 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 macos/corefoundation/corefoundation_custom.go create mode 100644 macos/coremedia/coremedia_custom.go create mode 100644 macos/corevideo/corevideo_custom.go diff --git a/macos/corefoundation/corefoundation_custom.go b/macos/corefoundation/corefoundation_custom.go new file mode 100644 index 00000000..7b174f06 --- /dev/null +++ b/macos/corefoundation/corefoundation_custom.go @@ -0,0 +1,4 @@ +package corefoundation + +type NotificationName StringRef +type TypeRef uintptr diff --git a/macos/coregraphics/coregraphics_custom.go b/macos/coregraphics/coregraphics_custom.go index 7d2812de..98ac5c28 100644 --- a/macos/coregraphics/coregraphics_custom.go +++ b/macos/coregraphics/coregraphics_custom.go @@ -1 +1,13 @@ package coregraphics + +// An affine transformation matrix for use in drawing 2D graphics. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corefoundation/cgaffinetransform?language=objc +type AffineTransform struct { + M11 float64 + M12 float64 + M21 float64 + M22 float64 + TX float64 + TY float64 +} diff --git a/macos/coremedia/coremedia_custom.go b/macos/coremedia/coremedia_custom.go new file mode 100644 index 00000000..f9c320ab --- /dev/null +++ b/macos/coremedia/coremedia_custom.go @@ -0,0 +1,8 @@ +package coremedia + +import "github.com/progrium/macdriver/macos/corefoundation" + +type BufferRef corefoundation.TypeRef +type MetadataFormatDescriptionRef FormatDescriptionRef +type VideoFormatDescriptionRef FormatDescriptionRef +type AudioFormatDescriptionRef FormatDescriptionRef diff --git a/macos/corevideo/corevideo_custom.go b/macos/corevideo/corevideo_custom.go new file mode 100644 index 00000000..47abe748 --- /dev/null +++ b/macos/corevideo/corevideo_custom.go @@ -0,0 +1,4 @@ +package corevideo + +type PixelBufferRef ImageBufferRef +type ImageBufferRef BufferRef diff --git a/macos/fileprovider/fileprovider_structs.go b/macos/fileprovider/fileprovider_structs.go index 03642c66..8d712e70 100644 --- a/macos/fileprovider/fileprovider_structs.go +++ b/macos/fileprovider/fileprovider_structs.go @@ -7,11 +7,3 @@ type FileProviderTypeAndCreator struct { Type uint32 Creator uint32 } - -// A structure that contains the file type and file creator codes for an item. [Full Topic] -// -// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertypeandcreator?language=objc -type FileProviderTypeAndCreator struct { - Type uint32 - Creator uint32 -} diff --git a/macos/foundation/foundation_custom.go b/macos/foundation/foundation_custom.go index 3381ad69..f8ed8a4b 100644 --- a/macos/foundation/foundation_custom.go +++ b/macos/foundation/foundation_custom.go @@ -23,6 +23,10 @@ type Point = coregraphics.Point type Size = coregraphics.Size type Rect = coregraphics.Rect +type FastEnumerationState struct { + // TODO +} + func (N *String) String() string { return objc.ToGoString(N.Ptr()) } diff --git a/macos/sysconfig/sysconfig_custom.go b/macos/sysconfig/sysconfig_custom.go index 3688cf2b..5e2998e2 100644 --- a/macos/sysconfig/sysconfig_custom.go +++ b/macos/sysconfig/sysconfig_custom.go @@ -1,8 +1 @@ package sysconfig - -import "unsafe" - -type PreferencesRef unsafe.Pointer -type EtworkConnectionRef unsafe.Pointer -type EtworkReachabilityRef unsafe.Pointer -type DynamicStoreRef unsafe.Pointer