-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcimnodes_editor.h
More file actions
320 lines (300 loc) · 13.2 KB
/
Copy pathcimnodes_editor.h
File metadata and controls
320 lines (300 loc) · 13.2 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
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
//This file is automatically generated by generator.lua from https://github.com/cimgui/imnodes
//based on imnodes.h file version XXX from https://github.com/Nelarius/imnodes
#ifndef CIMMODES_EDITOR_INCLUDED
#define CIMMODES_EDITOR_INCLUDED
#include "cimgui.h"
#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
typedef struct NodeId NodeId;
typedef struct LinkId LinkId;
typedef struct PinId PinId;
typedef struct EditorContext EditorContext;
struct NodeId;
struct LinkId;
struct PinId;
typedef enum {
Input,
Output
}PinKind;
typedef enum {
Forward,
Backward
}FlowDirection;
typedef enum {
FitVerticalView,
FitHorizontalView,
CenterOnly,
}CanvasSizeMode;
typedef enum {
None=0x00000000,
Navigation=0x00000001,
Position=0x00000002,
Size=0x00000004,
Selection=0x00000008,
AddNode=0x00000010,
RemoveNode=0x00000020,
User=0x00000040,
}SaveReasonFlags;
typedef bool (*ConfigSaveSettings)(const char* data, size_t size, SaveReasonFlags reason, void* userPointer);
typedef size_t (*ConfigLoadSettings)(char* data, void* userPointer);
typedef bool (*ConfigSaveNodeSettings)(NodeId nodeId, const char* data, size_t size, SaveReasonFlags reason, void* userPointer);
typedef size_t (*ConfigLoadNodeSettings)(NodeId nodeId, char* data, void* userPointer);
typedef void (*ConfigSession)(void* userPointer);
typedef struct Config Config;
typedef CanvasSizeMode CanvasSizeModeAlias;
struct Config
{
const char* SettingsFile;
ConfigSession BeginSaveSession;
ConfigSession EndSaveSession;
ConfigSaveSettings SaveSettings;
ConfigLoadSettings LoadSettings;
ConfigSaveNodeSettings SaveNodeSettings;
ConfigLoadNodeSettings LoadNodeSettings;
void* UserPointer;
ImVector_float CustomZoomLevels;
CanvasSizeModeAlias CanvasSizeMode;
int DragButtonIndex;
int SelectButtonIndex;
int NavigateButtonIndex;
int ContextMenuButtonIndex;
bool EnableSmoothZoom;
float SmoothZoomPower;
};
typedef enum {
StyleColor_Bg,
StyleColor_Grid,
StyleColor_NodeBg,
StyleColor_NodeBorder,
StyleColor_HovNodeBorder,
StyleColor_SelNodeBorder,
StyleColor_NodeSelRect,
StyleColor_NodeSelRectBorder,
StyleColor_HovLinkBorder,
StyleColor_SelLinkBorder,
StyleColor_HighlightLinkBorder,
StyleColor_LinkSelRect,
StyleColor_LinkSelRectBorder,
StyleColor_PinRect,
StyleColor_PinRectBorder,
StyleColor_Flow,
StyleColor_FlowMarker,
StyleColor_GroupBg,
StyleColor_GroupBorder,
StyleColor_Count
}StyleColor;
typedef enum {
StyleVar_NodePadding,
StyleVar_NodeRounding,
StyleVar_NodeBorderWidth,
StyleVar_HoveredNodeBorderWidth,
StyleVar_SelectedNodeBorderWidth,
StyleVar_PinRounding,
StyleVar_PinBorderWidth,
StyleVar_LinkStrength,
StyleVar_SourceDirection,
StyleVar_TargetDirection,
StyleVar_ScrollDuration,
StyleVar_FlowMarkerDistance,
StyleVar_FlowSpeed,
StyleVar_FlowDuration,
StyleVar_PivotAlignment,
StyleVar_PivotSize,
StyleVar_PivotScale,
StyleVar_PinCorners,
StyleVar_PinRadius,
StyleVar_PinArrowSize,
StyleVar_PinArrowWidth,
StyleVar_GroupRounding,
StyleVar_GroupBorderWidth,
StyleVar_HighlightConnectedLinks,
StyleVar_SnapLinkToPinDir,
StyleVar_HoveredNodeBorderOffset,
StyleVar_SelectedNodeBorderOffset,
StyleVar_Count
}StyleVar;
typedef struct cimnodes_editor_Style cimnodes_editor_Style;
struct cimnodes_editor_Style
{
ImVec4_c NodePadding;
float NodeRounding;
float NodeBorderWidth;
float HoveredNodeBorderWidth;
float HoverNodeBorderOffset;
float SelectedNodeBorderWidth;
float SelectedNodeBorderOffset;
float PinRounding;
float PinBorderWidth;
float LinkStrength;
ImVec2_c SourceDirection;
ImVec2_c TargetDirection;
float ScrollDuration;
float FlowMarkerDistance;
float FlowSpeed;
float FlowDuration;
ImVec2_c PivotAlignment;
ImVec2_c PivotSize;
ImVec2_c PivotScale;
float PinCorners;
float PinRadius;
float PinArrowSize;
float PinArrowWidth;
float GroupRounding;
float GroupBorderWidth;
float HighlightConnectedLinks;
float SnapLinkToPinDir;
ImVec4_c Colors[StyleColor_Count];
};
struct EditorContext;
typedef struct SafeType SafeType;
typedef struct SafePointerType SafePointerType;
typedef struct NodeId NodeId;
typedef struct LinkId LinkId;
typedef struct PinId PinId;
#else
#endif // CIMGUI_DEFINE_ENUMS_AND_STRUCTS
#ifndef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
typedef ax::NodeEditor::Config Config;
typedef ax::NodeEditor::EditorContext EditorContext;
typedef ax::NodeEditor::LinkId LinkId;
typedef ax::NodeEditor::NodeId NodeId;
typedef ax::NodeEditor::PinId PinId;
typedef ax::NodeEditor::Style cimnodes_editor_Style;
typedef ax::NodeEditor::CanvasSizeMode CanvasSizeMode;
typedef ax::NodeEditor::FlowDirection FlowDirection;
typedef ax::NodeEditor::PinKind PinKind;
typedef ax::NodeEditor::SaveReasonFlags SaveReasonFlags;
typedef ax::NodeEditor::StyleColor StyleColor;
typedef ax::NodeEditor::StyleVar StyleVar;
typedef ImVector<float> ImVector_float;
typedef ax::NodeEditor::LinkId LinkId;
typedef ax::NodeEditor::NodeId NodeId;
typedef ax::NodeEditor::PinId PinId;
#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS
CIMGUI_API Config* ax_NodeEditor_Config_Config_Config(void);
CIMGUI_API void Config_destroy(Config* self);
CIMGUI_API void ax_NodeEditor_SetCurrentEditor(EditorContext* ctx);
CIMGUI_API EditorContext* ax_NodeEditor_GetCurrentEditor(void);
CIMGUI_API EditorContext* ax_NodeEditor_CreateEditor(const Config* config);
CIMGUI_API void ax_NodeEditor_DestroyEditor(EditorContext* ctx);
CIMGUI_API const Config* ax_NodeEditor_GetConfig(EditorContext* ctx);
CIMGUI_API cimnodes_editor_Style* ax_NodeEditor_GetStyle(void);
CIMGUI_API const char* ax_NodeEditor_GetStyleColorName(StyleColor colorIndex);
CIMGUI_API void ax_NodeEditor_PushStyleColor(StyleColor colorIndex,const ImVec4_c color);
CIMGUI_API void ax_NodeEditor_PopStyleColor(int count);
CIMGUI_API void ax_NodeEditor_PushStyleVar_Float(StyleVar varIndex,float value);
CIMGUI_API void ax_NodeEditor_PushStyleVar_Vec2(StyleVar varIndex,const ImVec2_c value);
CIMGUI_API void ax_NodeEditor_PushStyleVar_Vec4(StyleVar varIndex,const ImVec4_c value);
CIMGUI_API void ax_NodeEditor_PopStyleVar(int count);
CIMGUI_API void ax_NodeEditor_Begin(const char* id,const ImVec2_c size);
CIMGUI_API void ax_NodeEditor_End(void);
CIMGUI_API void ax_NodeEditor_BeginNode(NodeId* id);
CIMGUI_API void ax_NodeEditor_BeginPin(PinId* id,PinKind kind);
CIMGUI_API void ax_NodeEditor_PinRect(const ImVec2_c a,const ImVec2_c b);
CIMGUI_API void ax_NodeEditor_PinPivotRect(const ImVec2_c a,const ImVec2_c b);
CIMGUI_API void ax_NodeEditor_PinPivotSize(const ImVec2_c size);
CIMGUI_API void ax_NodeEditor_PinPivotScale(const ImVec2_c scale);
CIMGUI_API void ax_NodeEditor_PinPivotAlignment(const ImVec2_c alignment);
CIMGUI_API void ax_NodeEditor_EndPin(void);
CIMGUI_API void ax_NodeEditor_Group(const ImVec2_c size);
CIMGUI_API void ax_NodeEditor_EndNode(void);
CIMGUI_API bool ax_NodeEditor_BeginGroupHint(NodeId* nodeId);
CIMGUI_API ImVec2_c ax_NodeEditor_GetGroupMin(void);
CIMGUI_API ImVec2_c ax_NodeEditor_GetGroupMax(void);
CIMGUI_API ImDrawList* ax_NodeEditor_GetHintForegroundDrawList(void);
CIMGUI_API ImDrawList* ax_NodeEditor_GetHintBackgroundDrawList(void);
CIMGUI_API void ax_NodeEditor_EndGroupHint(void);
CIMGUI_API ImDrawList* ax_NodeEditor_GetNodeBackgroundDrawList(NodeId* nodeId);
CIMGUI_API bool ax_NodeEditor_Link(LinkId* id,PinId* startPinId,PinId* endPinId,const ImVec4_c color,float thickness);
CIMGUI_API void ax_NodeEditor_Flow(LinkId* linkId,FlowDirection direction);
CIMGUI_API bool ax_NodeEditor_BeginCreate(const ImVec4_c color,float thickness);
CIMGUI_API bool ax_NodeEditor_QueryNewLink_Nil(PinId* startId,PinId* endId);
CIMGUI_API bool ax_NodeEditor_QueryNewLink_Vec4(PinId* startId,PinId* endId,const ImVec4_c color,float thickness);
CIMGUI_API bool ax_NodeEditor_QueryNewNode_Nil(PinId* pinId);
CIMGUI_API bool ax_NodeEditor_QueryNewNode_Vec4(PinId* pinId,const ImVec4_c color,float thickness);
CIMGUI_API bool ax_NodeEditor_AcceptNewItem_Nil(void);
CIMGUI_API bool ax_NodeEditor_AcceptNewItem_Vec4(const ImVec4_c color,float thickness);
CIMGUI_API void ax_NodeEditor_RejectNewItem_Nil(void);
CIMGUI_API void ax_NodeEditor_RejectNewItem_Vec4(const ImVec4_c color,float thickness);
CIMGUI_API void ax_NodeEditor_EndCreate(void);
CIMGUI_API bool ax_NodeEditor_BeginDelete(void);
CIMGUI_API bool ax_NodeEditor_QueryDeletedLink(LinkId* linkId,PinId* startId,PinId* endId);
CIMGUI_API bool ax_NodeEditor_QueryDeletedNode(NodeId* nodeId);
CIMGUI_API bool ax_NodeEditor_AcceptDeletedItem(bool deleteDependencies);
CIMGUI_API void ax_NodeEditor_RejectDeletedItem(void);
CIMGUI_API void ax_NodeEditor_EndDelete(void);
CIMGUI_API void ax_NodeEditor_SetNodePosition(NodeId* nodeId,const ImVec2_c editorPosition);
CIMGUI_API void ax_NodeEditor_SetGroupSize(NodeId* nodeId,const ImVec2_c size);
CIMGUI_API ImVec2_c ax_NodeEditor_GetNodePosition(NodeId* nodeId);
CIMGUI_API ImVec2_c ax_NodeEditor_GetNodeSize(NodeId* nodeId);
CIMGUI_API void ax_NodeEditor_CenterNodeOnScreen(NodeId* nodeId);
CIMGUI_API void ax_NodeEditor_SetNodeZPosition(NodeId* nodeId,float z);
CIMGUI_API float ax_NodeEditor_GetNodeZPosition(NodeId* nodeId);
CIMGUI_API void ax_NodeEditor_RestoreNodeState(NodeId* nodeId);
CIMGUI_API void ax_NodeEditor_Suspend(void);
CIMGUI_API void ax_NodeEditor_Resume(void);
CIMGUI_API bool ax_NodeEditor_IsSuspended(void);
CIMGUI_API bool ax_NodeEditor_IsActive(void);
CIMGUI_API bool ax_NodeEditor_HasSelectionChanged(void);
CIMGUI_API int ax_NodeEditor_GetSelectedObjectCount(void);
CIMGUI_API int ax_NodeEditor_GetSelectedNodes(NodeId* nodes,int size);
CIMGUI_API int ax_NodeEditor_GetSelectedLinks(LinkId* links,int size);
CIMGUI_API bool ax_NodeEditor_IsNodeSelected(NodeId* nodeId);
CIMGUI_API bool ax_NodeEditor_IsLinkSelected(LinkId* linkId);
CIMGUI_API void ax_NodeEditor_ClearSelection(void);
CIMGUI_API void ax_NodeEditor_SelectNode(NodeId* nodeId,bool append);
CIMGUI_API void ax_NodeEditor_SelectLink(LinkId* linkId,bool append);
CIMGUI_API void ax_NodeEditor_DeselectNode(NodeId* nodeId);
CIMGUI_API void ax_NodeEditor_DeselectLink(LinkId* linkId);
CIMGUI_API bool ax_NodeEditor_DeleteNode(NodeId* nodeId);
CIMGUI_API bool ax_NodeEditor_DeleteLink(LinkId* linkId);
CIMGUI_API bool ax_NodeEditor_HasAnyLinks_NodeId(NodeId* nodeId);
CIMGUI_API bool ax_NodeEditor_HasAnyLinks_PinId(PinId* pinId);
CIMGUI_API int ax_NodeEditor_BreakLinks_NodeId(NodeId* nodeId);
CIMGUI_API int ax_NodeEditor_BreakLinks_PinId(PinId* pinId);
CIMGUI_API void ax_NodeEditor_NavigateToContent(float duration);
CIMGUI_API void ax_NodeEditor_NavigateToSelection(bool zoomIn,float duration);
CIMGUI_API bool ax_NodeEditor_ShowNodeContextMenu(NodeId* nodeId);
CIMGUI_API bool ax_NodeEditor_ShowPinContextMenu(PinId* pinId);
CIMGUI_API bool ax_NodeEditor_ShowLinkContextMenu(LinkId* linkId);
CIMGUI_API bool ax_NodeEditor_ShowBackgroundContextMenu(void);
CIMGUI_API void ax_NodeEditor_EnableShortcuts(bool enable);
CIMGUI_API bool ax_NodeEditor_AreShortcutsEnabled(void);
CIMGUI_API bool ax_NodeEditor_BeginShortcut(void);
CIMGUI_API bool ax_NodeEditor_AcceptCut(void);
CIMGUI_API bool ax_NodeEditor_AcceptCopy(void);
CIMGUI_API bool ax_NodeEditor_AcceptPaste(void);
CIMGUI_API bool ax_NodeEditor_AcceptDuplicate(void);
CIMGUI_API bool ax_NodeEditor_AcceptCreateNode(void);
CIMGUI_API int ax_NodeEditor_GetActionContextSize(void);
CIMGUI_API int ax_NodeEditor_GetActionContextNodes(NodeId* nodes,int size);
CIMGUI_API int ax_NodeEditor_GetActionContextLinks(LinkId* links,int size);
CIMGUI_API void ax_NodeEditor_EndShortcut(void);
CIMGUI_API float ax_NodeEditor_GetCurrentZoom(void);
CIMGUI_API NodeId* ax_NodeEditor_GetHoveredNode(void);
CIMGUI_API PinId* ax_NodeEditor_GetHoveredPin(void);
CIMGUI_API LinkId* ax_NodeEditor_GetHoveredLink(void);
CIMGUI_API NodeId* ax_NodeEditor_GetDoubleClickedNode(void);
CIMGUI_API PinId* ax_NodeEditor_GetDoubleClickedPin(void);
CIMGUI_API LinkId* ax_NodeEditor_GetDoubleClickedLink(void);
CIMGUI_API bool ax_NodeEditor_IsBackgroundClicked(void);
CIMGUI_API bool ax_NodeEditor_IsBackgroundDoubleClicked(void);
CIMGUI_API ImGuiMouseButton ax_NodeEditor_GetBackgroundClickButtonIndex(void);
CIMGUI_API ImGuiMouseButton ax_NodeEditor_GetBackgroundDoubleClickButtonIndex(void);
CIMGUI_API bool ax_NodeEditor_GetLinkPins(LinkId* linkId,PinId* startPinId,PinId* endPinId);
CIMGUI_API bool ax_NodeEditor_PinHadAnyLinks(PinId* pinId);
CIMGUI_API ImVec2_c ax_NodeEditor_GetScreenSize(void);
CIMGUI_API ImVec2_c ax_NodeEditor_ScreenToCanvas(const ImVec2_c pos);
CIMGUI_API ImVec2_c ax_NodeEditor_CanvasToScreen(const ImVec2_c pos);
CIMGUI_API int ax_NodeEditor_GetNodeCount(void);
CIMGUI_API int ax_NodeEditor_GetOrderedNodeIds(NodeId* nodes,int size);
///manuals
CIMGUI_API NodeId* ax_NodeEditor_NodeId(uintptr_t val);
CIMGUI_API void ax_NodeEditor_NodeId_destroy(NodeId* self);
CIMGUI_API PinId* ax_NodeEditor_PinId(uintptr_t val);
CIMGUI_API void ax_NodeEditor_PinId_destroy(PinId* self);
CIMGUI_API LinkId* ax_NodeEditor_LinkId(uintptr_t val);
CIMGUI_API void ax_NodeEditor_LinkId_destroy(LinkId* self);
CIMGUI_API uintptr_t ax_NodeEditor_NodeId_value(NodeId* self);
CIMGUI_API uintptr_t ax_NodeEditor_PinId_value(PinId* self);
CIMGUI_API uintptr_t ax_NodeEditor_LinkId_value(LinkId* self);
#endif //CIMMODES_EDITOR_INCLUDED