Skip to content

Commit 93bf217

Browse files
committed
modules: add screencapturekit
1 parent 5cbb735 commit 93bf217

File tree

6 files changed

+45
-2
lines changed

6 files changed

+45
-2
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
SCFrameStatusBlank 2
2+
SCFrameStatusComplete 0
3+
SCFrameStatusIdle 1
4+
SCFrameStatusStarted 4
5+
SCFrameStatusStopped 5
6+
SCFrameStatusSuspended 3
7+
SCStreamErrorAttemptToConfigState -3810
8+
SCStreamErrorAttemptToStartStreamState -3807
9+
SCStreamErrorAttemptToStopStreamState -3808
10+
SCStreamErrorAttemptToUpdateFilterState -3809
11+
SCStreamErrorFailedApplicationConnectionInterrupted -3805
12+
SCStreamErrorFailedApplicationConnectionInvalid -3804
13+
SCStreamErrorFailedNoMatchingApplicationContext -3806
14+
SCStreamErrorFailedToStart -3802
15+
SCStreamErrorInternalError -3811
16+
SCStreamErrorInvalidParameter -3812
17+
SCStreamErrorMissingEntitlements -3803
18+
SCStreamErrorNoCaptureSource -3815
19+
SCStreamErrorNoDisplayList -3814
20+
SCStreamErrorNoWindowList -3813
21+
SCStreamErrorRemovingStream -3816
22+
SCStreamErrorUserDeclined -3801
23+
SCStreamOutputTypeScreen 0
24+
SCStreamErrorDomain com.apple.ScreenCaptureKit.SCStreamErrorDomain
25+
SCStreamFrameInfoContentRect SCStreamUpdateFrameContentRect
26+
SCStreamFrameInfoContentScale SCStreamUpdateFrameContentScale
27+
SCStreamFrameInfoDirtyRects SCStreamUpdateFrameDirtyRect
28+
SCStreamFrameInfoDisplayTime SCStreamUpdateFrameDisplayTime
29+
SCStreamFrameInfoScaleFactor SCStreamUpdateFrameDisplayResolution
30+
SCStreamFrameInfoStatus SCStreamUpdateFrameStatus

generate/modules/modules.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,5 +157,6 @@ var All = []Module{
157157
{"MetalPerformanceShadersGraph", "Metal Performance Shaders Graph", "mpsgraph", "MetalPerformanceShadersGraph/MetalPerformanceShadersGraph.h", []string{"MPSGraph"}},
158158
{"MetalPerformanceShaders", "Metal Performance Shaders", "mps", "MetalPerformanceShaders/MetalPerformanceShaders.h", []string{"MPS"}},
159159
{"SystemConfiguration", "System Configuration", "sysconfig", "SystemConfiguration/SystemConfiguration.h", []string{"SC", "kSC"}},
160+
{"ScreenCaptureKit", "Screen Capture", "screencapturekit", "ScreenCaptureKit/ScreenCaptureKit.h", []string{"SC"}},
160161
{"MediaPlayer", "Media Player", "mediaplayer", "MediaPlayer/MediaPlayer.h", []string{"MP"}},
161162
}

generate/tools/enumexport.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func exportConstants(db *generate.SymbolCache, framework *modules.Module, platfo
155155
continue
156156
}
157157
if s.Kind == "Constant" && s.Type == "Global Variable" {
158-
stmt, err := s.Parse()
158+
stmt, err := s.Parse(TargetPlatform)
159159
if err != nil {
160160
log.Fatalf("%s: %s in '%s'", s.Name, err, s.Declaration)
161161
}
@@ -177,7 +177,7 @@ func exportConstants(db *generate.SymbolCache, framework *modules.Module, platfo
177177
if typ.Declaration == "" {
178178
return nil, false
179179
}
180-
typdef, err := typ.Parse()
180+
typdef, err := typ.Parse(TargetPlatform)
181181
if err != nil {
182182
log.Fatalf("%s: %s in '%s'", typ.Name, err, typ.Declaration)
183183
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//go:generate go run ../../generate/tools/genmod.go
2+
package screencapturekit
3+
4+
// #cgo CFLAGS: -x objective-c
5+
// #cgo LDFLAGS: -framework ScreenCaptureKit
6+
import "C"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package screencapturekit
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package screencapturekit
2+
3+
import "testing"
4+
5+
func TestScreenCaptureKitValid(t *testing.T) {}

0 commit comments

Comments
 (0)