Debian Codegraph @

bind/testdata/objcw.go.golden

raw
1 // Code generated by gobind. DO NOT EDIT.
2
3 package ObjC
4
5 // Used to silence this package not used errors
6 const Dummy = 0
7
8 type Foundation_NSDate interface {
9 Hash() uint
10 Description() string
11 }
12
13 type Foundation_NSObjectC interface {
14 Hash() uint
15 Description() string
16 }
17
18 type Foundation_NSObjectP interface {
19 Hash() uint
20 Description() string
21 }
22
23 type Foundation_NSSet interface {
24 Hash() uint
25 Description() string
26 }
27
28 type Foundation_NSMutableString interface {
29 Hash() uint
30 Description() string
31 DataUsingEncoding(encoding uint) []byte
32 }
33
34 type UIKit_UIResponder interface {
35 Hash() uint
36 Description() string
37 }
38
39 type UIKit_UIPressesEvent interface {
40 Hash() uint
41 Description() string
42 }
43
44 type NetworkExtension_NEPacket interface {
45 Hash() uint
46 Description() string
47 }
48
49 type Objc_GoNSDate interface {
50 Hash() uint
51 Description() string
52 Super() Objc_GoNSDate
53 }
54
55 type Objc_GoNSObject interface {
56 Hash() uint
57 Description() string
58 Super() Objc_GoNSObject
59 }
60
61 type Objc_GoUIResponder interface {
62 Hash() uint
63 Description() string
64 Super() Objc_GoUIResponder
65 }
66 // Code generated by gobind. DO NOT EDIT.
67
68 package main
69
70 // #include "interfaces.h"
71 import "C"
72
73 import "ObjC"
74 import _seq "golang.org/x/mobile/bind/seq"
75 import "ObjC/Foundation/NSMutableString"
76 import "ObjC/NetworkExtension/NEPacket"
77
78 type proxy interface{ Bind_proxy_refnum__() int32 }
79
80 // Suppress unused package error
81
82 var _ = _seq.FromRefNum
83
84 const _ = ObjC.Dummy
85
86 func init() {
87 }
88
89 type proxy_class_NSDate _seq.Ref
90
91 func (p *proxy_class_NSDate) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
92
93 func (p *proxy_class_NSDate) Hash() uint {
94 res := C.cproxy_NSDate_Hash(C.int(p.Bind_proxy_refnum__()))
95 _res := uint(res)
96 return _res
97 }
98
99 func (p *proxy_class_NSDate) Description() string {
100 res := C.cproxy_NSDate_Description(C.int(p.Bind_proxy_refnum__()))
101 _res := decodeString(res)
102 return _res
103 }
104
105 func init() {
106 }
107
108 type proxy_class_NSObjectC _seq.Ref
109
110 func (p *proxy_class_NSObjectC) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
111
112 func (p *proxy_class_NSObjectC) Hash() uint {
113 res := C.cproxy_NSObjectC_Hash(C.int(p.Bind_proxy_refnum__()))
114 _res := uint(res)
115 return _res
116 }
117
118 func (p *proxy_class_NSObjectC) Description() string {
119 res := C.cproxy_NSObjectC_Description(C.int(p.Bind_proxy_refnum__()))
120 _res := decodeString(res)
121 return _res
122 }
123
124 func init() {
125 }
126
127 type proxy_class_NSObjectP _seq.Ref
128
129 func (p *proxy_class_NSObjectP) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
130
131 func (p *proxy_class_NSObjectP) Hash() uint {
132 res := C.cproxy_NSObjectP_Hash(C.int(p.Bind_proxy_refnum__()))
133 _res := uint(res)
134 return _res
135 }
136
137 func (p *proxy_class_NSObjectP) Description() string {
138 res := C.cproxy_NSObjectP_Description(C.int(p.Bind_proxy_refnum__()))
139 _res := decodeString(res)
140 return _res
141 }
142
143 func init() {
144 }
145
146 type proxy_class_NSSet _seq.Ref
147
148 func (p *proxy_class_NSSet) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
149
150 func (p *proxy_class_NSSet) Hash() uint {
151 res := C.cproxy_NSSet_Hash(C.int(p.Bind_proxy_refnum__()))
152 _res := uint(res)
153 return _res
154 }
155
156 func (p *proxy_class_NSSet) Description() string {
157 res := C.cproxy_NSSet_Description(C.int(p.Bind_proxy_refnum__()))
158 _res := decodeString(res)
159 return _res
160 }
161
162 func init() {
163 NSMutableString.NewWithData = func(data []byte, encoding uint) ObjC.Foundation_NSMutableString {
164 _data := fromSlice(data, false)
165 _encoding := C.ulong(encoding)
166 res := C.cproxy_s_NSMutableString_NewWithData(_data, _encoding)
167 var _res ObjC.Foundation_NSMutableString
168 _res_ref := _seq.FromRefNum(int32(res))
169 if _res_ref != nil {
170 if res < 0 { // go object
171 _res = _res_ref.Get().(ObjC.Foundation_NSMutableString)
172 } else { // foreign object
173 _res = (*proxy_class_NSMutableString)(_res_ref)
174 }
175 }
176 return _res
177 }
178
179 }
180
181 type proxy_class_NSMutableString _seq.Ref
182
183 func (p *proxy_class_NSMutableString) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
184
185 func (p *proxy_class_NSMutableString) Hash() uint {
186 res := C.cproxy_NSMutableString_Hash(C.int(p.Bind_proxy_refnum__()))
187 _res := uint(res)
188 return _res
189 }
190
191 func (p *proxy_class_NSMutableString) Description() string {
192 res := C.cproxy_NSMutableString_Description(C.int(p.Bind_proxy_refnum__()))
193 _res := decodeString(res)
194 return _res
195 }
196
197 func (p *proxy_class_NSMutableString) DataUsingEncoding(encoding uint) []byte {
198 _encoding := C.ulong(encoding)
199 res := C.cproxy_NSMutableString_DataUsingEncoding(C.int(p.Bind_proxy_refnum__()), _encoding)
200 _res := toSlice(res, true)
201 return _res
202 }
203
204 func init() {
205 }
206
207 type proxy_class_UIResponder _seq.Ref
208
209 func (p *proxy_class_UIResponder) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
210
211 func (p *proxy_class_UIResponder) Hash() uint {
212 res := C.cproxy_UIResponder_Hash(C.int(p.Bind_proxy_refnum__()))
213 _res := uint(res)
214 return _res
215 }
216
217 func (p *proxy_class_UIResponder) Description() string {
218 res := C.cproxy_UIResponder_Description(C.int(p.Bind_proxy_refnum__()))
219 _res := decodeString(res)
220 return _res
221 }
222
223 func init() {
224 }
225
226 type proxy_class_UIPressesEvent _seq.Ref
227
228 func (p *proxy_class_UIPressesEvent) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
229
230 func (p *proxy_class_UIPressesEvent) Hash() uint {
231 res := C.cproxy_UIPressesEvent_Hash(C.int(p.Bind_proxy_refnum__()))
232 _res := uint(res)
233 return _res
234 }
235
236 func (p *proxy_class_UIPressesEvent) Description() string {
237 res := C.cproxy_UIPressesEvent_Description(C.int(p.Bind_proxy_refnum__()))
238 _res := decodeString(res)
239 return _res
240 }
241
242 func init() {
243 NEPacket.NewWithData = func(data []byte, protocolFamily uint8) ObjC.NetworkExtension_NEPacket {
244 _data := fromSlice(data, false)
245 _protocolFamily := C.uchar(protocolFamily)
246 res := C.cproxy_s_NEPacket_NewWithData(_data, _protocolFamily)
247 var _res ObjC.NetworkExtension_NEPacket
248 _res_ref := _seq.FromRefNum(int32(res))
249 if _res_ref != nil {
250 if res < 0 { // go object
251 _res = _res_ref.Get().(ObjC.NetworkExtension_NEPacket)
252 } else { // foreign object
253 _res = (*proxy_class_NEPacket)(_res_ref)
254 }
255 }
256 return _res
257 }
258
259 }
260
261 type proxy_class_NEPacket _seq.Ref
262
263 func (p *proxy_class_NEPacket) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
264
265 func (p *proxy_class_NEPacket) Hash() uint {
266 res := C.cproxy_NEPacket_Hash(C.int(p.Bind_proxy_refnum__()))
267 _res := uint(res)
268 return _res
269 }
270
271 func (p *proxy_class_NEPacket) Description() string {
272 res := C.cproxy_NEPacket_Description(C.int(p.Bind_proxy_refnum__()))
273 _res := decodeString(res)
274 return _res
275 }
276
277 func init() {
278 }
279
280 type proxy_class_GoNSDate _seq.Ref
281
282 func (p *proxy_class_GoNSDate) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
283
284 func (p *proxy_class_GoNSDate) Hash() uint {
285 res := C.cproxy_GoNSDate_Hash(C.int(p.Bind_proxy_refnum__()))
286 _res := uint(res)
287 return _res
288 }
289
290 func (p *proxy_class_GoNSDate) Description() string {
291 res := C.cproxy_GoNSDate_Description(C.int(p.Bind_proxy_refnum__()))
292 _res := decodeString(res)
293 return _res
294 }
295
296 func (p *proxy_class_GoNSDate) Super() ObjC.Objc_GoNSDate {
297 return &super_GoNSDate{p}
298 }
299
300 type super_GoNSDate struct{ *proxy_class_GoNSDate }
301
302 func (p *super_GoNSDate) Hash() uint {
303 res := C.csuper_GoNSDate_Hash(C.int(p.Bind_proxy_refnum__()))
304 _res := uint(res)
305 return _res
306 }
307
308 func (p *super_GoNSDate) Description() string {
309 res := C.csuper_GoNSDate_Description(C.int(p.Bind_proxy_refnum__()))
310 _res := decodeString(res)
311 return _res
312 }
313
314 func init() {
315 }
316
317 type proxy_class_GoNSObject _seq.Ref
318
319 func (p *proxy_class_GoNSObject) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
320
321 func (p *proxy_class_GoNSObject) Hash() uint {
322 res := C.cproxy_GoNSObject_Hash(C.int(p.Bind_proxy_refnum__()))
323 _res := uint(res)
324 return _res
325 }
326
327 func (p *proxy_class_GoNSObject) Description() string {
328 res := C.cproxy_GoNSObject_Description(C.int(p.Bind_proxy_refnum__()))
329 _res := decodeString(res)
330 return _res
331 }
332
333 func (p *proxy_class_GoNSObject) Super() ObjC.Objc_GoNSObject {
334 return &super_GoNSObject{p}
335 }
336
337 type super_GoNSObject struct{ *proxy_class_GoNSObject }
338
339 func (p *super_GoNSObject) Hash() uint {
340 res := C.csuper_GoNSObject_Hash(C.int(p.Bind_proxy_refnum__()))
341 _res := uint(res)
342 return _res
343 }
344
345 func (p *super_GoNSObject) Description() string {
346 res := C.csuper_GoNSObject_Description(C.int(p.Bind_proxy_refnum__()))
347 _res := decodeString(res)
348 return _res
349 }
350
351 func init() {
352 }
353
354 type proxy_class_GoUIResponder _seq.Ref
355
356 func (p *proxy_class_GoUIResponder) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
357
358 func (p *proxy_class_GoUIResponder) Hash() uint {
359 res := C.cproxy_GoUIResponder_Hash(C.int(p.Bind_proxy_refnum__()))
360 _res := uint(res)
361 return _res
362 }
363
364 func (p *proxy_class_GoUIResponder) Description() string {
365 res := C.cproxy_GoUIResponder_Description(C.int(p.Bind_proxy_refnum__()))
366 _res := decodeString(res)
367 return _res
368 }
369
370 func (p *proxy_class_GoUIResponder) Super() ObjC.Objc_GoUIResponder {
371 return &super_GoUIResponder{p}
372 }
373
374 type super_GoUIResponder struct{ *proxy_class_GoUIResponder }
375
376 func (p *super_GoUIResponder) Hash() uint {
377 res := C.csuper_GoUIResponder_Hash(C.int(p.Bind_proxy_refnum__()))
378 _res := uint(res)
379 return _res
380 }
381
382 func (p *super_GoUIResponder) Description() string {
383 res := C.csuper_GoUIResponder_Description(C.int(p.Bind_proxy_refnum__()))
384 _res := decodeString(res)
385 return _res
386 }
387 // Code generated by gobind. DO NOT EDIT.
388
389 // Package main is an autogenerated binder stub for package objc.
390 //
391 // autogenerated by gobind -lang=go objcw
392 package main
393
394 /*
395 #include <stdlib.h>
396 #include <stdint.h>
397 #include "seq.h"
398 #include "objc.h"
399
400 */
401 import "C"
402
403 import (
404 "ObjC/Foundation"
405 "ObjC/UIKit"
406 _seq "golang.org/x/mobile/bind/seq"
407 "objcw"
408 )
409
410 // suppress the error if seq ends up unused
411 var _ = _seq.FromRefNum
412
413 //export proxyobjc_GoNSDate_NSDate_Set
414 func proxyobjc_GoNSDate_NSDate_Set(refnum C.int32_t, v C.int32_t) {
415 ref := _seq.FromRefNum(int32(refnum))
416 var _v Foundation.NSDate
417 _v_ref := _seq.FromRefNum(int32(v))
418 if _v_ref != nil {
419 if v < 0 { // go object
420 _v = _v_ref.Get().(Foundation.NSDate)
421 } else { // foreign object
422 _v = (*proxy_class_NSDate)(_v_ref)
423 }
424 }
425 ref.Get().(*objc.GoNSDate).NSDate = _v
426 }
427
428 //export proxyobjc_GoNSDate_NSDate_Get
429 func proxyobjc_GoNSDate_NSDate_Get(refnum C.int32_t) C.int32_t {
430 ref := _seq.FromRefNum(int32(refnum))
431 v := ref.Get().(*objc.GoNSDate).NSDate
432 var _v C.int32_t = _seq.NullRefNum
433 if v != nil {
434 _v = C.int32_t(_seq.ToRefNum(v))
435 }
436 return _v
437 }
438
439 //export proxyobjc_GoNSDate_Hash
440 func proxyobjc_GoNSDate_Hash(refnum C.int32_t, param_this C.int32_t) C.nint {
441 ref := _seq.FromRefNum(int32(refnum))
442 v := ref.Get().(*objc.GoNSDate)
443 var _param_this Foundation.NSDate
444 _param_this_ref := _seq.FromRefNum(int32(param_this))
445 if _param_this_ref != nil {
446 if param_this < 0 { // go object
447 _param_this = _param_this_ref.Get().(Foundation.NSDate)
448 } else { // foreign object
449 _param_this = (*proxy_class_NSDate)(_param_this_ref)
450 }
451 }
452 res_0 := v.Hash(_param_this)
453 _res_0 := C.nint(res_0)
454 return _res_0
455 }
456
457 //export new_objc_GoNSDate
458 func new_objc_GoNSDate() C.int32_t {
459 return C.int32_t(_seq.ToRefNum(new(objc.GoNSDate)))
460 }
461
462 //export proxyobjc_GoNSObject_C_Set
463 func proxyobjc_GoNSObject_C_Set(refnum C.int32_t, v C.int32_t) {
464 ref := _seq.FromRefNum(int32(refnum))
465 var _v Foundation.NSObjectC
466 _v_ref := _seq.FromRefNum(int32(v))
467 if _v_ref != nil {
468 if v < 0 { // go object
469 _v = _v_ref.Get().(Foundation.NSObjectC)
470 } else { // foreign object
471 _v = (*proxy_class_NSObjectC)(_v_ref)
472 }
473 }
474 ref.Get().(*objc.GoNSObject).C = _v
475 }
476
477 //export proxyobjc_GoNSObject_C_Get
478 func proxyobjc_GoNSObject_C_Get(refnum C.int32_t) C.int32_t {
479 ref := _seq.FromRefNum(int32(refnum))
480 v := ref.Get().(*objc.GoNSObject).C
481 var _v C.int32_t = _seq.NullRefNum
482 if v != nil {
483 _v = C.int32_t(_seq.ToRefNum(v))
484 }
485 return _v
486 }
487
488 //export proxyobjc_GoNSObject_P_Set
489 func proxyobjc_GoNSObject_P_Set(refnum C.int32_t, v C.int32_t) {
490 ref := _seq.FromRefNum(int32(refnum))
491 var _v Foundation.NSObjectP
492 _v_ref := _seq.FromRefNum(int32(v))
493 if _v_ref != nil {
494 if v < 0 { // go object
495 _v = _v_ref.Get().(Foundation.NSObjectP)
496 } else { // foreign object
497 _v = (*proxy_class_NSObjectP)(_v_ref)
498 }
499 }
500 ref.Get().(*objc.GoNSObject).P = _v
501 }
502
503 //export proxyobjc_GoNSObject_P_Get
504 func proxyobjc_GoNSObject_P_Get(refnum C.int32_t) C.int32_t {
505 ref := _seq.FromRefNum(int32(refnum))
506 v := ref.Get().(*objc.GoNSObject).P
507 var _v C.int32_t = _seq.NullRefNum
508 if v != nil {
509 _v = C.int32_t(_seq.ToRefNum(v))
510 }
511 return _v
512 }
513
514 //export proxyobjc_GoNSObject_Description
515 func proxyobjc_GoNSObject_Description(refnum C.int32_t, param_this C.int32_t) C.nstring {
516 ref := _seq.FromRefNum(int32(refnum))
517 v := ref.Get().(*objc.GoNSObject)
518 var _param_this Foundation.NSObjectC
519 _param_this_ref := _seq.FromRefNum(int32(param_this))
520 if _param_this_ref != nil {
521 if param_this < 0 { // go object
522 _param_this = _param_this_ref.Get().(Foundation.NSObjectC)
523 } else { // foreign object
524 _param_this = (*proxy_class_NSObjectC)(_param_this_ref)
525 }
526 }
527 res_0 := v.Description(_param_this)
528 _res_0 := encodeString(res_0)
529 return _res_0
530 }
531
532 //export new_objc_GoNSObject
533 func new_objc_GoNSObject() C.int32_t {
534 return C.int32_t(_seq.ToRefNum(new(objc.GoNSObject)))
535 }
536
537 //export proxyobjc_GoUIResponder_UIResponder_Set
538 func proxyobjc_GoUIResponder_UIResponder_Set(refnum C.int32_t, v C.int32_t) {
539 ref := _seq.FromRefNum(int32(refnum))
540 var _v UIKit.UIResponder
541 _v_ref := _seq.FromRefNum(int32(v))
542 if _v_ref != nil {
543 if v < 0 { // go object
544 _v = _v_ref.Get().(UIKit.UIResponder)
545 } else { // foreign object
546 _v = (*proxy_class_UIResponder)(_v_ref)
547 }
548 }
549 ref.Get().(*objc.GoUIResponder).UIResponder = _v
550 }
551
552 //export proxyobjc_GoUIResponder_UIResponder_Get
553 func proxyobjc_GoUIResponder_UIResponder_Get(refnum C.int32_t) C.int32_t {
554 ref := _seq.FromRefNum(int32(refnum))
555 v := ref.Get().(*objc.GoUIResponder).UIResponder
556 var _v C.int32_t = _seq.NullRefNum
557 if v != nil {
558 _v = C.int32_t(_seq.ToRefNum(v))
559 }
560 return _v
561 }
562
563 //export proxyobjc_GoUIResponder_PressesBegan
564 func proxyobjc_GoUIResponder_PressesBegan(refnum C.int32_t, param_p0 C.int32_t, param_p1 C.int32_t) {
565 ref := _seq.FromRefNum(int32(refnum))
566 v := ref.Get().(*objc.GoUIResponder)
567 var _param_p0 Foundation.NSSet
568 _param_p0_ref := _seq.FromRefNum(int32(param_p0))
569 if _param_p0_ref != nil {
570 if param_p0 < 0 { // go object
571 _param_p0 = _param_p0_ref.Get().(Foundation.NSSet)
572 } else { // foreign object
573 _param_p0 = (*proxy_class_NSSet)(_param_p0_ref)
574 }
575 }
576 var _param_p1 UIKit.UIPressesEvent
577 _param_p1_ref := _seq.FromRefNum(int32(param_p1))
578 if _param_p1_ref != nil {
579 if param_p1 < 0 { // go object
580 _param_p1 = _param_p1_ref.Get().(UIKit.UIPressesEvent)
581 } else { // foreign object
582 _param_p1 = (*proxy_class_UIPressesEvent)(_param_p1_ref)
583 }
584 }
585 v.PressesBegan(_param_p0, _param_p1)
586 }
587
588 //export new_objc_GoUIResponder
589 func new_objc_GoUIResponder() C.int32_t {
590 return C.int32_t(_seq.ToRefNum(new(objc.GoUIResponder)))
591 }
592
593 //export proxyobjc__CallUcharFunction
594 func proxyobjc__CallUcharFunction() {
595 objc.CallUcharFunction()
596 }
597
598 //export proxyobjc__CreateReadNSMutableString
599 func proxyobjc__CreateReadNSMutableString() {
600 objc.CreateReadNSMutableString()
601 }
602
603 //export proxyobjc__DupNSDate
604 func proxyobjc__DupNSDate(param_date C.int32_t) C.int32_t {
605 var _param_date Foundation.NSDate
606 _param_date_ref := _seq.FromRefNum(int32(param_date))
607 if _param_date_ref != nil {
608 if param_date < 0 { // go object
609 _param_date = _param_date_ref.Get().(Foundation.NSDate)
610 } else { // foreign object
611 _param_date = (*proxy_class_NSDate)(_param_date_ref)
612 }
613 }
614 res_0 := objc.DupNSDate(_param_date)
615 var _res_0 C.int32_t = _seq.NullRefNum
616 if res_0 != nil {
617 _res_0 = C.int32_t(_seq.ToRefNum(res_0))
618 }
619 return _res_0
620 }