-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimplot_funcs.tcl
More file actions
265 lines (224 loc) · 8.27 KB
/
implot_funcs.tcl
File metadata and controls
265 lines (224 loc) · 8.27 KB
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
# Copyright (c) 2022 Nicolas ROBERT.
# Distributed under MIT license. Please see LICENSE for details.
namespace eval ::implot {
variable cbplot
variable implot_funcs
}
proc ::implot::initprocFunc {} {
variable implot_funcs
foreach {name func} $implot_funcs {
# remove cimgui header name declaration
regsub {(^ImPlot_)} $name {} procname
proc $procname args "CIMGUI function $name [list {*}$func]; tailcall $name {*}\$args"
}
}
proc ::implot::init {} {
variable cbplot
variable implot_funcs
cffi::prototype function ImPlotPoint_getter void {
data {pointer unsafe}
idx int
point {pointer.ImPlotPoint unsafe}
}
set implot_funcs {
ImPlot_CreateContext {pointer.ImPlotContext {}}
ImPlot_GetCurrentContext {pointer.ImPlotContext {}}
ImPlot_SetCurrentContext {void {ctx pointer.ImPlotContext}}
ImPlot_SetImGuiContext {void {ctx pointer.::imgui::ImGuiContext}}
ImPlot_EndPlot {void {}}
ImPlot_EndSubplots {void {}}
ImPlot_EndDragDropSource {void {}}
ImPlot_BeginDragDropTargetPlot {CIMGUI_BOOL {}}
ImPlot_EndDragDropTarget {void {}}
ImPlot_BeginPlot {CIMGUI_BOOL {
title_id string
size {struct.::imgui::ImVec2 {default {x -1 y -1}}}
flags {ImPlotFlags bitmask {default 0}}
}
}
ImPlot_SetNextMarkerStyle {void {
marker {ImPlotMarker {default -1}}
size {float {default -1}}
fill {struct.::imgui::ImVec4 {default {x 0 y 0 z 0 w -1}}}
weight {float {default -1}}
outline {struct.::imgui::ImVec4 {default {x 0 y 0 z 0 w -1}}}
}
}
ImPlot_ShowDemoWindow {void {
p_open {pointer.bool nullok {default NULL}}
}
}
ImPlot_PlotLineG {void {
label_id string
getter pointer.ImPlotPoint_getter
data {pointer nullok}
count int
flags {ImPlotLineFlags {default 0}}
}
}
ImPlot_PlotLine_doublePtrdoublePtr {void {
label_id string
xs pointer.double
ys pointer.double
count int
flags {ImPlotLineFlags {default 0}}
offset {int {default 0}}
stride {int {default 8}}
}
}
ImPlot_SetupAxesLimits {void {
x_min double
x_max double
y_min double
y_max double
cond {ImPlotCond {default 2}}
}
}
ImPlot_GetPlotLimits {struct.ImPlotRect {
x_axis {ImAxis {default -1}}
y_axis {ImAxis {default -1}}
}
}
ImPlot_SetNextLineStyle {void {
col struct.::imgui::ImVec4
weight {float {default -1}}
}
}
ImPlot_GetPlotSize {void {
pOut {struct.::imgui::ImVec2 out}
}
}
ImPlot_GetPlotPos {void {
pOut {struct.::imgui::ImVec2 out}
}
}
ImPlot_PushStyleColor_Vec4 {void {
idx ImPlotCol
col struct.::imgui::ImVec4
}
}
ImPlot_PopStyleColor {void {
count {int {default 1}}
}
}
ImPlot_SetupAxes {void {
x_label {string nullifempty}
y_label {string nullifempty}
x_flags {ImPlotAxisFlags {default 0}}
y_flags {ImPlotAxisFlags {default 0}}
}
}
ImPlot_PushStyleVar_Float {void {
idx ImPlotStyleVar
val float
}
}
ImPlot_PushStyleVar_Vec2 {void {
idx ImPlotStyleVar
val struct.::imgui::ImVec2
}
}
ImPlot_PlotShaded_doublePtrdoublePtrInt {void {
label_id string
xs pointer.double
ys pointer.double
count int
yref {double {default 0}}
flags {ImPlotShadedFlags {default 0}}
offset {int {default 0}}
stride {int {default 8}}
}
}
ImPlot_PlotShaded_doublePtrdoublePtrdoublePtr {void {
label_id string
xs pointer.double
ys1 pointer.double
ys2 pointer.double
count int
flags {ImPlotShadedFlags {default 0}}
offset {int {default 0}}
stride {int {default 8}}
}
}
ImPlot_PlotShaded_doublePtrdoublePtrInt {void {
label_id string
xs pointer.double
ys pointer.double
count int
yref double
flags {ImPlotShadedFlags {default 0}}
offset {int {default 0}}
stride {int {default 8}}
}
}
ImPlot_PopStyleVar {void {
count {int {default 1}}
}
}
ImPlot_BeginSubplots {CIMGUI_BOOL {
title_id string
rows int
cols int
size struct.::imgui::ImVec2
flags ImPlotSubplotFlags
row_ratios {pointer nullok {default NULL}}
col_ratios {pointer nullok {default NULL}}
}
}
ImPlot_SampleColormap {void {
pOut {struct.::imgui::ImVec4 out}
t float
cmap {ImPlotColormap {default -1}}
}
}
ImPlot_BeginDragDropSourceItem {CIMGUI_BOOL {
label_id string
flags {imgui::ImGuiDragDropFlags {default 0}}
}
}
ImPlot_ItemIcon_Vec4 {void {
col struct.::imgui::ImVec4
}
}
ImPlot_GetLastItemColor {void {
pOut {struct.::imgui::ImVec4 out}
}
}
ImPlot_PushColormap_PlotColormap {void {
cmap ImPlotColormap
}
}
ImPlot_PopColormap {void {
count {int {default 1}}
}
}
ImPlot_GetColormapColor {void {
pOut {struct.::imgui::ImVec4 out}
idx int
cmap {ImPlotColormap {default -1}}
}
}
ImPlot_PlotStems_doublePtrdoublePtr {void {
label_id string
xs pointer.double
ys pointer.double
count int
ref {double {default 0}}
flags {ImPlotStemsFlags {default 0}}
offset {int {default 0}}
stride {int {default 8}}
}
}
ImPlot_DragRect {CIMGUI_BOOL {
id int
x_min {double inout}
y_min {double inout}
x_max {double inout}
y_max {double inout}
col struct.::imgui::ImVec4
flags {ImPlotDragToolFlags {default 0}}
}
}
}
set cbplot [cffi::callback new ImPlotPoint_getter implottk::cbFuncPlot struct.ImPlotPoint]
}