forked from progrium/darwinkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequest.gen.go
174 lines (147 loc) · 5.93 KB
/
request.gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// Code generated by DarwinKit. DO NOT EDIT.
package vision
import (
"unsafe"
"github.com/progrium/macdriver/macos/foundation"
"github.com/progrium/macdriver/objc"
)
// The class instance for the [Request] class.
var RequestClass = _RequestClass{objc.GetClass("VNRequest")}
type _RequestClass struct {
objc.Class
}
// An interface definition for the [Request] class.
type IRequest interface {
objc.IObject
Cancel()
Results() []Observation
PreferBackgroundProcessing() bool
SetPreferBackgroundProcessing(value bool)
CompletionHandler() RequestCompletionHandler
Revision() uint
SetRevision(value uint)
}
// The abstract superclass for analysis requests. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest?language=objc
type Request struct {
objc.Object
}
func RequestFrom(ptr unsafe.Pointer) Request {
return Request{
Object: objc.ObjectFrom(ptr),
}
}
func (r_ Request) InitWithCompletionHandler(completionHandler RequestCompletionHandler) Request {
rv := objc.Call[Request](r_, objc.Sel("initWithCompletionHandler:"), completionHandler)
return rv
}
// Creates a new Vision request with an optional completion handler. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc
func NewRequestWithCompletionHandler(completionHandler RequestCompletionHandler) Request {
instance := RequestClass.Alloc().InitWithCompletionHandler(completionHandler)
instance.Autorelease()
return instance
}
func (r_ Request) Init() Request {
rv := objc.Call[Request](r_, objc.Sel("init"))
return rv
}
func (rc _RequestClass) Alloc() Request {
rv := objc.Call[Request](rc, objc.Sel("alloc"))
return rv
}
func (rc _RequestClass) New() Request {
rv := objc.Call[Request](rc, objc.Sel("new"))
rv.Autorelease()
return rv
}
func NewRequest() Request {
return RequestClass.New()
}
// Cancels the request before it can finish executing. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2867234-cancel?language=objc
func (r_ Request) Cancel() {
objc.Call[objc.Void](r_, objc.Sel("cancel"))
}
// The collection of VNObservation results generated by request processing. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2867238-results?language=objc
func (r_ Request) Results() []Observation {
rv := objc.Call[[]Observation](r_, objc.Sel("results"))
return rv
}
// A hint to minimize the resource burden of the request. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875404-preferbackgroundprocessing?language=objc
func (r_ Request) PreferBackgroundProcessing() bool {
rv := objc.Call[bool](r_, objc.Sel("preferBackgroundProcessing"))
return rv
}
// A hint to minimize the resource burden of the request. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875404-preferbackgroundprocessing?language=objc
func (r_ Request) SetPreferBackgroundProcessing(value bool) {
objc.Call[objc.Void](r_, objc.Sel("setPreferBackgroundProcessing:"), value)
}
// The current revison supported by the request. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967108-currentrevision?language=objc
func (rc _RequestClass) CurrentRevision() uint {
rv := objc.Call[uint](rc, objc.Sel("currentRevision"))
return rv
}
// The current revison supported by the request. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967108-currentrevision?language=objc
func Request_CurrentRevision() uint {
return RequestClass.CurrentRevision()
}
// The completion handler the system invokes after the request finishes processing. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2867266-completionhandler?language=objc
func (r_ Request) CompletionHandler() RequestCompletionHandler {
rv := objc.Call[RequestCompletionHandler](r_, objc.Sel("completionHandler"))
return rv
}
// The collection of currently-supported algorithm versions for the class of request. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967111-supportedrevisions?language=objc
func (rc _RequestClass) SupportedRevisions() foundation.IndexSet {
rv := objc.Call[foundation.IndexSet](rc, objc.Sel("supportedRevisions"))
return rv
}
// The collection of currently-supported algorithm versions for the class of request. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967111-supportedrevisions?language=objc
func Request_SupportedRevisions() foundation.IndexSet {
return RequestClass.SupportedRevisions()
}
// The revision of the latest request for the particular SDK linked with the client application. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967109-defaultrevision?language=objc
func (rc _RequestClass) DefaultRevision() uint {
rv := objc.Call[uint](rc, objc.Sel("defaultRevision"))
return rv
}
// The revision of the latest request for the particular SDK linked with the client application. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967109-defaultrevision?language=objc
func Request_DefaultRevision() uint {
return RequestClass.DefaultRevision()
}
// The specific algorithm or implementation revision that’s used to perform the request. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967110-revision?language=objc
func (r_ Request) Revision() uint {
rv := objc.Call[uint](r_, objc.Sel("revision"))
return rv
}
// The specific algorithm or implementation revision that’s used to perform the request. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967110-revision?language=objc
func (r_ Request) SetRevision(value uint) {
objc.Call[objc.Void](r_, objc.Sel("setRevision:"), value)
}