forked from AllenDang/cimgui-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cimplot_structs.go
939 lines (763 loc) · 25.9 KB
/
cimplot_structs.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
// Code generated by cmd/codegen from https://github.com/AllenDang/cimgui-go.
// DO NOT EDIT.
package imgui
// #include <stdlib.h>
// #include <memory.h>
// #include "extra_types.h"
// #include "cimplot_wrapper.h"
import "C"
import "unsafe"
type FormatterTimeData struct {
// TODO: contains unsupported fields
data unsafe.Pointer
}
func (self FormatterTimeData) handle() (result *C.Formatter_Time_Data, releaseFn func()) {
result = (*C.Formatter_Time_Data)(self.data)
return result, func() {}
}
func (self FormatterTimeData) c() (result C.Formatter_Time_Data, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newFormatterTimeDataFromC(cvalue *C.Formatter_Time_Data) *FormatterTimeData {
result := new(FormatterTimeData)
result.data = unsafe.Pointer(cvalue)
return result
}
type PlotAlignmentData struct {
FieldVertical bool
FieldPadA float32
FieldPadB float32
FieldPadAMax float32
FieldPadBMax float32
}
func (self PlotAlignmentData) handle() (result *C.ImPlotAlignmentData, releaseFn func()) {
result = new(C.ImPlotAlignmentData)
FieldVertical := self.FieldVertical
result.Vertical = C.bool(FieldVertical)
FieldPadA := self.FieldPadA
result.PadA = C.float(FieldPadA)
FieldPadB := self.FieldPadB
result.PadB = C.float(FieldPadB)
FieldPadAMax := self.FieldPadAMax
result.PadAMax = C.float(FieldPadAMax)
FieldPadBMax := self.FieldPadBMax
result.PadBMax = C.float(FieldPadBMax)
releaseFn = func() {
}
return result, releaseFn
}
func (self PlotAlignmentData) c() (result C.ImPlotAlignmentData, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotAlignmentDataFromC(cvalue *C.ImPlotAlignmentData) *PlotAlignmentData {
result := new(PlotAlignmentData)
result.FieldVertical = cvalue.Vertical == C.bool(true)
result.FieldPadA = float32(cvalue.PadA)
result.FieldPadB = float32(cvalue.PadB)
result.FieldPadAMax = float32(cvalue.PadAMax)
result.FieldPadBMax = float32(cvalue.PadBMax)
return result
}
type PlotAnnotation struct {
FieldPos Vec2
FieldOffset Vec2
FieldColorBg uint32
FieldColorFg uint32
FieldTextOffset int32
FieldClamp bool
}
func (self PlotAnnotation) handle() (result *C.ImPlotAnnotation, releaseFn func()) {
result = new(C.ImPlotAnnotation)
FieldPos := self.FieldPos
result.Pos = FieldPos.toC()
FieldOffset := self.FieldOffset
result.Offset = FieldOffset.toC()
FieldColorBg := self.FieldColorBg
result.ColorBg = C.ImU32(FieldColorBg)
FieldColorFg := self.FieldColorFg
result.ColorFg = C.ImU32(FieldColorFg)
FieldTextOffset := self.FieldTextOffset
result.TextOffset = C.int(FieldTextOffset)
FieldClamp := self.FieldClamp
result.Clamp = C.bool(FieldClamp)
releaseFn = func() {
}
return result, releaseFn
}
func (self PlotAnnotation) c() (result C.ImPlotAnnotation, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotAnnotationFromC(cvalue *C.ImPlotAnnotation) *PlotAnnotation {
result := new(PlotAnnotation)
result.FieldPos = *(&Vec2{}).fromC(cvalue.Pos)
result.FieldOffset = *(&Vec2{}).fromC(cvalue.Offset)
result.FieldColorBg = uint32(cvalue.ColorBg)
result.FieldColorFg = uint32(cvalue.ColorFg)
result.FieldTextOffset = int32(cvalue.TextOffset)
result.FieldClamp = cvalue.Clamp == C.bool(true)
return result
}
type PlotAnnotationCollection struct {
FieldAnnotations Vector[*PlotAnnotation]
FieldTextBuffer TextBuffer
FieldSize int32
}
func (self PlotAnnotationCollection) handle() (result *C.ImPlotAnnotationCollection, releaseFn func()) {
result = new(C.ImPlotAnnotationCollection)
FieldAnnotations := self.FieldAnnotations
FieldAnnotationsData := FieldAnnotations.Data
FieldAnnotationsDataArg, FieldAnnotationsDataFin := FieldAnnotationsData.handle()
FieldAnnotationsVecArg := new(C.ImVector_ImPlotAnnotation)
FieldAnnotationsVecArg.Size = C.int(FieldAnnotations.Size)
FieldAnnotationsVecArg.Capacity = C.int(FieldAnnotations.Capacity)
FieldAnnotationsVecArg.Data = FieldAnnotationsDataArg
FieldAnnotations.pinner.Pin(FieldAnnotationsVecArg.Data)
result.Annotations = *FieldAnnotationsVecArg
FieldTextBuffer := self.FieldTextBuffer
FieldTextBufferArg, FieldTextBufferFin := FieldTextBuffer.c()
result.TextBuffer = FieldTextBufferArg
FieldSize := self.FieldSize
result.Size = C.int(FieldSize)
releaseFn = func() {
FieldAnnotationsDataFin()
FieldAnnotations.pinner.Unpin()
FieldTextBufferFin()
}
return result, releaseFn
}
func (self PlotAnnotationCollection) c() (result C.ImPlotAnnotationCollection, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotAnnotationCollectionFromC(cvalue *C.ImPlotAnnotationCollection) *PlotAnnotationCollection {
result := new(PlotAnnotationCollection)
result.FieldAnnotations = newVectorFromC(cvalue.Annotations.Size, cvalue.Annotations.Capacity, newPlotAnnotationFromC(cvalue.Annotations.Data))
result.FieldTextBuffer = *newTextBufferFromC(func() *C.ImGuiTextBuffer { result := cvalue.TextBuffer; return &result }())
result.FieldSize = int32(cvalue.Size)
return result
}
type PlotAxis struct {
// TODO: contains unsupported fields
data unsafe.Pointer
}
func (self PlotAxis) handle() (result *C.ImPlotAxis, releaseFn func()) {
result = (*C.ImPlotAxis)(self.data)
return result, func() {}
}
func (self PlotAxis) c() (result C.ImPlotAxis, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotAxisFromC(cvalue *C.ImPlotAxis) *PlotAxis {
result := new(PlotAxis)
result.data = unsafe.Pointer(cvalue)
return result
}
type PlotColormapData struct {
// TODO: contains unsupported fields
data unsafe.Pointer
}
func (self PlotColormapData) handle() (result *C.ImPlotColormapData, releaseFn func()) {
result = (*C.ImPlotColormapData)(self.data)
return result, func() {}
}
func (self PlotColormapData) c() (result C.ImPlotColormapData, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotColormapDataFromC(cvalue *C.ImPlotColormapData) *PlotColormapData {
result := new(PlotColormapData)
result.data = unsafe.Pointer(cvalue)
return result
}
type PlotContext struct {
// TODO: contains unsupported fields
data unsafe.Pointer
}
func (self PlotContext) handle() (result *C.ImPlotContext, releaseFn func()) {
result = (*C.ImPlotContext)(self.data)
return result, func() {}
}
func (self PlotContext) c() (result C.ImPlotContext, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotContextFromC(cvalue *C.ImPlotContext) *PlotContext {
result := new(PlotContext)
result.data = unsafe.Pointer(cvalue)
return result
}
type PlotDateTimeSpec struct {
FieldDate PlotDateFmt
FieldTime PlotTimeFmt
FieldUseISO8601 bool
FieldUse24HourClock bool
}
func (self PlotDateTimeSpec) handle() (result *C.ImPlotDateTimeSpec, releaseFn func()) {
result = new(C.ImPlotDateTimeSpec)
FieldDate := self.FieldDate
result.Date = C.ImPlotDateFmt(FieldDate)
FieldTime := self.FieldTime
result.Time = C.ImPlotTimeFmt(FieldTime)
FieldUseISO8601 := self.FieldUseISO8601
result.UseISO8601 = C.bool(FieldUseISO8601)
FieldUse24HourClock := self.FieldUse24HourClock
result.Use24HourClock = C.bool(FieldUse24HourClock)
releaseFn = func() {
}
return result, releaseFn
}
func (self PlotDateTimeSpec) c() (result C.ImPlotDateTimeSpec, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotDateTimeSpecFromC(cvalue *C.ImPlotDateTimeSpec) *PlotDateTimeSpec {
result := new(PlotDateTimeSpec)
result.FieldDate = PlotDateFmt(cvalue.Date)
result.FieldTime = PlotTimeFmt(cvalue.Time)
result.FieldUseISO8601 = cvalue.UseISO8601 == C.bool(true)
result.FieldUse24HourClock = cvalue.Use24HourClock == C.bool(true)
return result
}
type PlotInputMap struct {
FieldPan MouseButton
FieldPanMod int32
FieldFit MouseButton
FieldSelect MouseButton
FieldSelectCancel MouseButton
FieldSelectMod int32
FieldSelectHorzMod int32
FieldSelectVertMod int32
FieldMenu MouseButton
FieldOverrideMod int32
FieldZoomMod int32
FieldZoomRate float32
}
func (self PlotInputMap) handle() (result *C.ImPlotInputMap, releaseFn func()) {
result = new(C.ImPlotInputMap)
FieldPan := self.FieldPan
result.Pan = C.ImGuiMouseButton(FieldPan)
FieldPanMod := self.FieldPanMod
result.PanMod = C.int(FieldPanMod)
FieldFit := self.FieldFit
result.Fit = C.ImGuiMouseButton(FieldFit)
FieldSelect := self.FieldSelect
result.Select = C.ImGuiMouseButton(FieldSelect)
FieldSelectCancel := self.FieldSelectCancel
result.SelectCancel = C.ImGuiMouseButton(FieldSelectCancel)
FieldSelectMod := self.FieldSelectMod
result.SelectMod = C.int(FieldSelectMod)
FieldSelectHorzMod := self.FieldSelectHorzMod
result.SelectHorzMod = C.int(FieldSelectHorzMod)
FieldSelectVertMod := self.FieldSelectVertMod
result.SelectVertMod = C.int(FieldSelectVertMod)
FieldMenu := self.FieldMenu
result.Menu = C.ImGuiMouseButton(FieldMenu)
FieldOverrideMod := self.FieldOverrideMod
result.OverrideMod = C.int(FieldOverrideMod)
FieldZoomMod := self.FieldZoomMod
result.ZoomMod = C.int(FieldZoomMod)
FieldZoomRate := self.FieldZoomRate
result.ZoomRate = C.float(FieldZoomRate)
releaseFn = func() {
}
return result, releaseFn
}
func (self PlotInputMap) c() (result C.ImPlotInputMap, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotInputMapFromC(cvalue *C.ImPlotInputMap) *PlotInputMap {
result := new(PlotInputMap)
result.FieldPan = MouseButton(cvalue.Pan)
result.FieldPanMod = int32(cvalue.PanMod)
result.FieldFit = MouseButton(cvalue.Fit)
result.FieldSelect = MouseButton(cvalue.Select)
result.FieldSelectCancel = MouseButton(cvalue.SelectCancel)
result.FieldSelectMod = int32(cvalue.SelectMod)
result.FieldSelectHorzMod = int32(cvalue.SelectHorzMod)
result.FieldSelectVertMod = int32(cvalue.SelectVertMod)
result.FieldMenu = MouseButton(cvalue.Menu)
result.FieldOverrideMod = int32(cvalue.OverrideMod)
result.FieldZoomMod = int32(cvalue.ZoomMod)
result.FieldZoomRate = float32(cvalue.ZoomRate)
return result
}
type PlotItem struct {
FieldID ID
FieldColor uint32
FieldLegendHoverRect Rect
FieldNameOffset int32
FieldShow bool
FieldLegendHovered bool
FieldSeenThisFrame bool
}
func (self PlotItem) handle() (result *C.ImPlotItem, releaseFn func()) {
result = new(C.ImPlotItem)
FieldID := self.FieldID
result.ID = C.ImGuiID(FieldID)
FieldColor := self.FieldColor
result.Color = C.ImU32(FieldColor)
FieldLegendHoverRect := self.FieldLegendHoverRect
result.LegendHoverRect = FieldLegendHoverRect.toC()
FieldNameOffset := self.FieldNameOffset
result.NameOffset = C.int(FieldNameOffset)
FieldShow := self.FieldShow
result.Show = C.bool(FieldShow)
FieldLegendHovered := self.FieldLegendHovered
result.LegendHovered = C.bool(FieldLegendHovered)
FieldSeenThisFrame := self.FieldSeenThisFrame
result.SeenThisFrame = C.bool(FieldSeenThisFrame)
releaseFn = func() {
}
return result, releaseFn
}
func (self PlotItem) c() (result C.ImPlotItem, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotItemFromC(cvalue *C.ImPlotItem) *PlotItem {
result := new(PlotItem)
result.FieldID = ID(cvalue.ID)
result.FieldColor = uint32(cvalue.Color)
result.FieldLegendHoverRect = *(&Rect{}).fromC(cvalue.LegendHoverRect)
result.FieldNameOffset = int32(cvalue.NameOffset)
result.FieldShow = cvalue.Show == C.bool(true)
result.FieldLegendHovered = cvalue.LegendHovered == C.bool(true)
result.FieldSeenThisFrame = cvalue.SeenThisFrame == C.bool(true)
return result
}
type PlotItemGroup struct {
// TODO: contains unsupported fields
data unsafe.Pointer
}
func (self PlotItemGroup) handle() (result *C.ImPlotItemGroup, releaseFn func()) {
result = (*C.ImPlotItemGroup)(self.data)
return result, func() {}
}
func (self PlotItemGroup) c() (result C.ImPlotItemGroup, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotItemGroupFromC(cvalue *C.ImPlotItemGroup) *PlotItemGroup {
result := new(PlotItemGroup)
result.data = unsafe.Pointer(cvalue)
return result
}
type PlotLegend struct {
FieldFlags PlotLegendFlags
FieldPreviousFlags PlotLegendFlags
FieldLocation PlotLocation
FieldPreviousLocation PlotLocation
FieldScroll Vec2
FieldIndices Vector[*int32]
FieldLabels TextBuffer
FieldRect Rect
FieldRectClamped Rect
FieldHovered bool
FieldHeld bool
FieldCanGoInside bool
}
func (self PlotLegend) handle() (result *C.ImPlotLegend, releaseFn func()) {
result = new(C.ImPlotLegend)
FieldFlags := self.FieldFlags
result.Flags = C.ImPlotLegendFlags(FieldFlags)
FieldPreviousFlags := self.FieldPreviousFlags
result.PreviousFlags = C.ImPlotLegendFlags(FieldPreviousFlags)
FieldLocation := self.FieldLocation
result.Location = C.ImPlotLocation(FieldLocation)
FieldPreviousLocation := self.FieldPreviousLocation
result.PreviousLocation = C.ImPlotLocation(FieldPreviousLocation)
FieldScroll := self.FieldScroll
result.Scroll = FieldScroll.toC()
FieldIndices := self.FieldIndices
FieldIndicesData := FieldIndices.Data
FieldIndicesDataArg, FieldIndicesDataFin := WrapNumberPtr[C.int, int32](FieldIndicesData)
FieldIndicesVecArg := new(C.ImVector_int)
FieldIndicesVecArg.Size = C.int(FieldIndices.Size)
FieldIndicesVecArg.Capacity = C.int(FieldIndices.Capacity)
FieldIndicesVecArg.Data = FieldIndicesDataArg
FieldIndices.pinner.Pin(FieldIndicesVecArg.Data)
result.Indices = *FieldIndicesVecArg
FieldLabels := self.FieldLabels
FieldLabelsArg, FieldLabelsFin := FieldLabels.c()
result.Labels = FieldLabelsArg
FieldRect := self.FieldRect
result.Rect = FieldRect.toC()
FieldRectClamped := self.FieldRectClamped
result.RectClamped = FieldRectClamped.toC()
FieldHovered := self.FieldHovered
result.Hovered = C.bool(FieldHovered)
FieldHeld := self.FieldHeld
result.Held = C.bool(FieldHeld)
FieldCanGoInside := self.FieldCanGoInside
result.CanGoInside = C.bool(FieldCanGoInside)
releaseFn = func() {
FieldIndicesDataFin()
FieldIndices.pinner.Unpin()
FieldLabelsFin()
}
return result, releaseFn
}
func (self PlotLegend) c() (result C.ImPlotLegend, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotLegendFromC(cvalue *C.ImPlotLegend) *PlotLegend {
result := new(PlotLegend)
result.FieldFlags = PlotLegendFlags(cvalue.Flags)
result.FieldPreviousFlags = PlotLegendFlags(cvalue.PreviousFlags)
result.FieldLocation = PlotLocation(cvalue.Location)
result.FieldPreviousLocation = PlotLocation(cvalue.PreviousLocation)
result.FieldScroll = *(&Vec2{}).fromC(cvalue.Scroll)
result.FieldIndices = newVectorFromC(cvalue.Indices.Size, cvalue.Indices.Capacity, (*int32)(cvalue.Indices.Data))
result.FieldLabels = *newTextBufferFromC(func() *C.ImGuiTextBuffer { result := cvalue.Labels; return &result }())
result.FieldRect = *(&Rect{}).fromC(cvalue.Rect)
result.FieldRectClamped = *(&Rect{}).fromC(cvalue.RectClamped)
result.FieldHovered = cvalue.Hovered == C.bool(true)
result.FieldHeld = cvalue.Held == C.bool(true)
result.FieldCanGoInside = cvalue.CanGoInside == C.bool(true)
return result
}
type PlotNextItemData struct {
// TODO: contains unsupported fields
data unsafe.Pointer
}
func (self PlotNextItemData) handle() (result *C.ImPlotNextItemData, releaseFn func()) {
result = (*C.ImPlotNextItemData)(self.data)
return result, func() {}
}
func (self PlotNextItemData) c() (result C.ImPlotNextItemData, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotNextItemDataFromC(cvalue *C.ImPlotNextItemData) *PlotNextItemData {
result := new(PlotNextItemData)
result.data = unsafe.Pointer(cvalue)
return result
}
type PlotNextPlotData struct {
// TODO: contains unsupported fields
data unsafe.Pointer
}
func (self PlotNextPlotData) handle() (result *C.ImPlotNextPlotData, releaseFn func()) {
result = (*C.ImPlotNextPlotData)(self.data)
return result, func() {}
}
func (self PlotNextPlotData) c() (result C.ImPlotNextPlotData, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotNextPlotDataFromC(cvalue *C.ImPlotNextPlotData) *PlotNextPlotData {
result := new(PlotNextPlotData)
result.data = unsafe.Pointer(cvalue)
return result
}
type PlotPlot struct {
// TODO: contains unsupported fields
data unsafe.Pointer
}
func (self PlotPlot) handle() (result *C.ImPlotPlot, releaseFn func()) {
result = (*C.ImPlotPlot)(self.data)
return result, func() {}
}
func (self PlotPlot) c() (result C.ImPlotPlot, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotPlotFromC(cvalue *C.ImPlotPlot) *PlotPlot {
result := new(PlotPlot)
result.data = unsafe.Pointer(cvalue)
return result
}
type PlotPointError struct {
FieldX float64
FieldY float64
FieldNeg float64
FieldPos float64
}
func (self PlotPointError) handle() (result *C.ImPlotPointError, releaseFn func()) {
result = new(C.ImPlotPointError)
FieldX := self.FieldX
result.X = C.double(FieldX)
FieldY := self.FieldY
result.Y = C.double(FieldY)
FieldNeg := self.FieldNeg
result.Neg = C.double(FieldNeg)
FieldPos := self.FieldPos
result.Pos = C.double(FieldPos)
releaseFn = func() {
}
return result, releaseFn
}
func (self PlotPointError) c() (result C.ImPlotPointError, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotPointErrorFromC(cvalue *C.ImPlotPointError) *PlotPointError {
result := new(PlotPointError)
result.FieldX = float64(cvalue.X)
result.FieldY = float64(cvalue.Y)
result.FieldNeg = float64(cvalue.Neg)
result.FieldPos = float64(cvalue.Pos)
return result
}
type PlotRange struct {
FieldMin float64
FieldMax float64
}
func (self PlotRange) handle() (result *C.ImPlotRange, releaseFn func()) {
result = new(C.ImPlotRange)
FieldMin := self.FieldMin
result.Min = C.double(FieldMin)
FieldMax := self.FieldMax
result.Max = C.double(FieldMax)
releaseFn = func() {
}
return result, releaseFn
}
func (self PlotRange) c() (result C.ImPlotRange, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotRangeFromC(cvalue *C.ImPlotRange) *PlotRange {
result := new(PlotRange)
result.FieldMin = float64(cvalue.Min)
result.FieldMax = float64(cvalue.Max)
return result
}
type PlotRect struct {
FieldX PlotRange
FieldY PlotRange
}
func (self PlotRect) handle() (result *C.ImPlotRect, releaseFn func()) {
result = new(C.ImPlotRect)
FieldX := self.FieldX
FieldXArg, FieldXFin := FieldX.c()
result.X = FieldXArg
FieldY := self.FieldY
FieldYArg, FieldYFin := FieldY.c()
result.Y = FieldYArg
releaseFn = func() {
FieldXFin()
FieldYFin()
}
return result, releaseFn
}
func (self PlotRect) c() (result C.ImPlotRect, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotRectFromC(cvalue *C.ImPlotRect) *PlotRect {
result := new(PlotRect)
result.FieldX = *newPlotRangeFromC(func() *C.ImPlotRange { result := cvalue.X; return &result }())
result.FieldY = *newPlotRangeFromC(func() *C.ImPlotRange { result := cvalue.Y; return &result }())
return result
}
type PlotStyle struct {
// TODO: contains unsupported fields
data unsafe.Pointer
}
func (self PlotStyle) handle() (result *C.ImPlotStyle, releaseFn func()) {
result = (*C.ImPlotStyle)(self.data)
return result, func() {}
}
func (self PlotStyle) c() (result C.ImPlotStyle, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotStyleFromC(cvalue *C.ImPlotStyle) *PlotStyle {
result := new(PlotStyle)
result.data = unsafe.Pointer(cvalue)
return result
}
type PlotSubplot struct {
// TODO: contains unsupported fields
data unsafe.Pointer
}
func (self PlotSubplot) handle() (result *C.ImPlotSubplot, releaseFn func()) {
result = (*C.ImPlotSubplot)(self.data)
return result, func() {}
}
func (self PlotSubplot) c() (result C.ImPlotSubplot, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotSubplotFromC(cvalue *C.ImPlotSubplot) *PlotSubplot {
result := new(PlotSubplot)
result.data = unsafe.Pointer(cvalue)
return result
}
type PlotTag struct {
FieldAxis PlotAxisEnum
FieldValue float64
FieldColorBg uint32
FieldColorFg uint32
FieldTextOffset int32
}
func (self PlotTag) handle() (result *C.ImPlotTag, releaseFn func()) {
result = new(C.ImPlotTag)
FieldAxis := self.FieldAxis
result.Axis = C.ImAxis(FieldAxis)
FieldValue := self.FieldValue
result.Value = C.double(FieldValue)
FieldColorBg := self.FieldColorBg
result.ColorBg = C.ImU32(FieldColorBg)
FieldColorFg := self.FieldColorFg
result.ColorFg = C.ImU32(FieldColorFg)
FieldTextOffset := self.FieldTextOffset
result.TextOffset = C.int(FieldTextOffset)
releaseFn = func() {
}
return result, releaseFn
}
func (self PlotTag) c() (result C.ImPlotTag, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotTagFromC(cvalue *C.ImPlotTag) *PlotTag {
result := new(PlotTag)
result.FieldAxis = PlotAxisEnum(cvalue.Axis)
result.FieldValue = float64(cvalue.Value)
result.FieldColorBg = uint32(cvalue.ColorBg)
result.FieldColorFg = uint32(cvalue.ColorFg)
result.FieldTextOffset = int32(cvalue.TextOffset)
return result
}
type PlotTagCollection struct {
FieldTags Vector[*PlotTag]
FieldTextBuffer TextBuffer
FieldSize int32
}
func (self PlotTagCollection) handle() (result *C.ImPlotTagCollection, releaseFn func()) {
result = new(C.ImPlotTagCollection)
FieldTags := self.FieldTags
FieldTagsData := FieldTags.Data
FieldTagsDataArg, FieldTagsDataFin := FieldTagsData.handle()
FieldTagsVecArg := new(C.ImVector_ImPlotTag)
FieldTagsVecArg.Size = C.int(FieldTags.Size)
FieldTagsVecArg.Capacity = C.int(FieldTags.Capacity)
FieldTagsVecArg.Data = FieldTagsDataArg
FieldTags.pinner.Pin(FieldTagsVecArg.Data)
result.Tags = *FieldTagsVecArg
FieldTextBuffer := self.FieldTextBuffer
FieldTextBufferArg, FieldTextBufferFin := FieldTextBuffer.c()
result.TextBuffer = FieldTextBufferArg
FieldSize := self.FieldSize
result.Size = C.int(FieldSize)
releaseFn = func() {
FieldTagsDataFin()
FieldTags.pinner.Unpin()
FieldTextBufferFin()
}
return result, releaseFn
}
func (self PlotTagCollection) c() (result C.ImPlotTagCollection, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotTagCollectionFromC(cvalue *C.ImPlotTagCollection) *PlotTagCollection {
result := new(PlotTagCollection)
result.FieldTags = newVectorFromC(cvalue.Tags.Size, cvalue.Tags.Capacity, newPlotTagFromC(cvalue.Tags.Data))
result.FieldTextBuffer = *newTextBufferFromC(func() *C.ImGuiTextBuffer { result := cvalue.TextBuffer; return &result }())
result.FieldSize = int32(cvalue.Size)
return result
}
type PlotTick struct {
FieldPlotPos float64
FieldPixelPos float32
FieldLabelSize Vec2
FieldTextOffset int32
FieldMajor bool
FieldShowLabel bool
FieldLevel int32
FieldIdx int32
}
func (self PlotTick) handle() (result *C.ImPlotTick, releaseFn func()) {
result = new(C.ImPlotTick)
FieldPlotPos := self.FieldPlotPos
result.PlotPos = C.double(FieldPlotPos)
FieldPixelPos := self.FieldPixelPos
result.PixelPos = C.float(FieldPixelPos)
FieldLabelSize := self.FieldLabelSize
result.LabelSize = FieldLabelSize.toC()
FieldTextOffset := self.FieldTextOffset
result.TextOffset = C.int(FieldTextOffset)
FieldMajor := self.FieldMajor
result.Major = C.bool(FieldMajor)
FieldShowLabel := self.FieldShowLabel
result.ShowLabel = C.bool(FieldShowLabel)
FieldLevel := self.FieldLevel
result.Level = C.int(FieldLevel)
FieldIdx := self.FieldIdx
result.Idx = C.int(FieldIdx)
releaseFn = func() {
}
return result, releaseFn
}
func (self PlotTick) c() (result C.ImPlotTick, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotTickFromC(cvalue *C.ImPlotTick) *PlotTick {
result := new(PlotTick)
result.FieldPlotPos = float64(cvalue.PlotPos)
result.FieldPixelPos = float32(cvalue.PixelPos)
result.FieldLabelSize = *(&Vec2{}).fromC(cvalue.LabelSize)
result.FieldTextOffset = int32(cvalue.TextOffset)
result.FieldMajor = cvalue.Major == C.bool(true)
result.FieldShowLabel = cvalue.ShowLabel == C.bool(true)
result.FieldLevel = int32(cvalue.Level)
result.FieldIdx = int32(cvalue.Idx)
return result
}
type PlotTicker struct {
FieldTicks Vector[*PlotTick]
FieldTextBuffer TextBuffer
FieldMaxSize Vec2
FieldLateSize Vec2
FieldLevels int32
}
func (self PlotTicker) handle() (result *C.ImPlotTicker, releaseFn func()) {
result = new(C.ImPlotTicker)
FieldTicks := self.FieldTicks
FieldTicksData := FieldTicks.Data
FieldTicksDataArg, FieldTicksDataFin := FieldTicksData.handle()
FieldTicksVecArg := new(C.ImVector_ImPlotTick)
FieldTicksVecArg.Size = C.int(FieldTicks.Size)
FieldTicksVecArg.Capacity = C.int(FieldTicks.Capacity)
FieldTicksVecArg.Data = FieldTicksDataArg
FieldTicks.pinner.Pin(FieldTicksVecArg.Data)
result.Ticks = *FieldTicksVecArg
FieldTextBuffer := self.FieldTextBuffer
FieldTextBufferArg, FieldTextBufferFin := FieldTextBuffer.c()
result.TextBuffer = FieldTextBufferArg
FieldMaxSize := self.FieldMaxSize
result.MaxSize = FieldMaxSize.toC()
FieldLateSize := self.FieldLateSize
result.LateSize = FieldLateSize.toC()
FieldLevels := self.FieldLevels
result.Levels = C.int(FieldLevels)
releaseFn = func() {
FieldTicksDataFin()
FieldTicks.pinner.Unpin()
FieldTextBufferFin()
}
return result, releaseFn
}
func (self PlotTicker) c() (result C.ImPlotTicker, fin func()) {
resultPtr, finFn := self.handle()
return *resultPtr, finFn
}
func newPlotTickerFromC(cvalue *C.ImPlotTicker) *PlotTicker {
result := new(PlotTicker)
result.FieldTicks = newVectorFromC(cvalue.Ticks.Size, cvalue.Ticks.Capacity, newPlotTickFromC(cvalue.Ticks.Data))
result.FieldTextBuffer = *newTextBufferFromC(func() *C.ImGuiTextBuffer { result := cvalue.TextBuffer; return &result }())
result.FieldMaxSize = *(&Vec2{}).fromC(cvalue.MaxSize)
result.FieldLateSize = *(&Vec2{}).fromC(cvalue.LateSize)
result.FieldLevels = int32(cvalue.Levels)
return result
}