|
|
@ -4,177 +4,177 @@ using System.Runtime.InteropServices; |
|
|
|
using System.Text; |
|
|
|
using System.Text; |
|
|
|
using ImGuiNET; |
|
|
|
using ImGuiNET; |
|
|
|
|
|
|
|
|
|
|
|
namespace ImNodesNET |
|
|
|
namespace imnodesNET |
|
|
|
{ |
|
|
|
{ |
|
|
|
public static unsafe partial class ImNodes |
|
|
|
public static unsafe partial class imnodes |
|
|
|
{ |
|
|
|
{ |
|
|
|
public static void BeginInputAttribute(int id) |
|
|
|
public static void BeginInputAttribute(int id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
PinShape shape = PinShape._CircleFilled; |
|
|
|
PinShape shape = PinShape._CircleFilled; |
|
|
|
ImNodesNative.imnodes_BeginInputAttribute(id, shape); |
|
|
|
imnodesNative.imnodes_BeginInputAttribute(id, shape); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void BeginInputAttribute(int id, PinShape shape) |
|
|
|
public static void BeginInputAttribute(int id, PinShape shape) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_BeginInputAttribute(id, shape); |
|
|
|
imnodesNative.imnodes_BeginInputAttribute(id, shape); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void BeginNode(int id) |
|
|
|
public static void BeginNode(int id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_BeginNode(id); |
|
|
|
imnodesNative.imnodes_BeginNode(id); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void BeginNodeEditor() |
|
|
|
public static void BeginNodeEditor() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_BeginNodeEditor(); |
|
|
|
imnodesNative.imnodes_BeginNodeEditor(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void BeginNodeTitleBar() |
|
|
|
public static void BeginNodeTitleBar() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_BeginNodeTitleBar(); |
|
|
|
imnodesNative.imnodes_BeginNodeTitleBar(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void BeginOutputAttribute(int id) |
|
|
|
public static void BeginOutputAttribute(int id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
PinShape shape = PinShape._CircleFilled; |
|
|
|
PinShape shape = PinShape._CircleFilled; |
|
|
|
ImNodesNative.imnodes_BeginOutputAttribute(id, shape); |
|
|
|
imnodesNative.imnodes_BeginOutputAttribute(id, shape); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void BeginOutputAttribute(int id, PinShape shape) |
|
|
|
public static void BeginOutputAttribute(int id, PinShape shape) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_BeginOutputAttribute(id, shape); |
|
|
|
imnodesNative.imnodes_BeginOutputAttribute(id, shape); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void BeginStaticAttribute(int id) |
|
|
|
public static void BeginStaticAttribute(int id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_BeginStaticAttribute(id); |
|
|
|
imnodesNative.imnodes_BeginStaticAttribute(id); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void ClearLinkSelection() |
|
|
|
public static void ClearLinkSelection() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_ClearLinkSelection(); |
|
|
|
imnodesNative.imnodes_ClearLinkSelection(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void ClearNodeSelection() |
|
|
|
public static void ClearNodeSelection() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_ClearNodeSelection(); |
|
|
|
imnodesNative.imnodes_ClearNodeSelection(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static IntPtr EditorContextCreate() |
|
|
|
public static IntPtr EditorContextCreate() |
|
|
|
{ |
|
|
|
{ |
|
|
|
IntPtr ret = ImNodesNative.imnodes_EditorContextCreate(); |
|
|
|
IntPtr ret = imnodesNative.imnodes_EditorContextCreate(); |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
public static void EditorContextFree(IntPtr noname1) |
|
|
|
public static void EditorContextFree(IntPtr noname1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_EditorContextFree(noname1); |
|
|
|
imnodesNative.imnodes_EditorContextFree(noname1); |
|
|
|
} |
|
|
|
} |
|
|
|
public static Vector2 EditorContextGetPanning() |
|
|
|
public static Vector2 EditorContextGetPanning() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Vector2 __retval; |
|
|
|
Vector2 __retval; |
|
|
|
ImNodesNative.imnodes_EditorContextGetPanning(&__retval); |
|
|
|
imnodesNative.imnodes_EditorContextGetPanning(&__retval); |
|
|
|
return __retval; |
|
|
|
return __retval; |
|
|
|
} |
|
|
|
} |
|
|
|
public static void EditorContextMoveToNode(int node_id) |
|
|
|
public static void EditorContextMoveToNode(int node_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_EditorContextMoveToNode(node_id); |
|
|
|
imnodesNative.imnodes_EditorContextMoveToNode(node_id); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void EditorContextResetPanning(Vector2 pos) |
|
|
|
public static void EditorContextResetPanning(Vector2 pos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_EditorContextResetPanning(pos); |
|
|
|
imnodesNative.imnodes_EditorContextResetPanning(pos); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void EditorContextSet(IntPtr noname1) |
|
|
|
public static void EditorContextSet(IntPtr noname1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_EditorContextSet(noname1); |
|
|
|
imnodesNative.imnodes_EditorContextSet(noname1); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void EndInputAttribute() |
|
|
|
public static void EndInputAttribute() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_EndInputAttribute(); |
|
|
|
imnodesNative.imnodes_EndInputAttribute(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void EndNode() |
|
|
|
public static void EndNode() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_EndNode(); |
|
|
|
imnodesNative.imnodes_EndNode(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void EndNodeEditor() |
|
|
|
public static void EndNodeEditor() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_EndNodeEditor(); |
|
|
|
imnodesNative.imnodes_EndNodeEditor(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void EndNodeTitleBar() |
|
|
|
public static void EndNodeTitleBar() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_EndNodeTitleBar(); |
|
|
|
imnodesNative.imnodes_EndNodeTitleBar(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void EndOutputAttribute() |
|
|
|
public static void EndOutputAttribute() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_EndOutputAttribute(); |
|
|
|
imnodesNative.imnodes_EndOutputAttribute(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void EndStaticAttribute() |
|
|
|
public static void EndStaticAttribute() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_EndStaticAttribute(); |
|
|
|
imnodesNative.imnodes_EndStaticAttribute(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static IO* GetIO() |
|
|
|
public static IO* GetIO() |
|
|
|
{ |
|
|
|
{ |
|
|
|
IO* ret = ImNodesNative.imnodes_GetIO(); |
|
|
|
IO* ret = imnodesNative.imnodes_GetIO(); |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
public static Vector2 GetNodeDimensions(int id) |
|
|
|
public static Vector2 GetNodeDimensions(int id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Vector2 __retval; |
|
|
|
Vector2 __retval; |
|
|
|
ImNodesNative.imnodes_GetNodeDimensions(&__retval, id); |
|
|
|
imnodesNative.imnodes_GetNodeDimensions(&__retval, id); |
|
|
|
return __retval; |
|
|
|
return __retval; |
|
|
|
} |
|
|
|
} |
|
|
|
public static Vector2 GetNodeEditorSpacePos(int node_id) |
|
|
|
public static Vector2 GetNodeEditorSpacePos(int node_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Vector2 __retval; |
|
|
|
Vector2 __retval; |
|
|
|
ImNodesNative.imnodes_GetNodeEditorSpacePos(&__retval, node_id); |
|
|
|
imnodesNative.imnodes_GetNodeEditorSpacePos(&__retval, node_id); |
|
|
|
return __retval; |
|
|
|
return __retval; |
|
|
|
} |
|
|
|
} |
|
|
|
public static Vector2 GetNodeGridSpacePos(int node_id) |
|
|
|
public static Vector2 GetNodeGridSpacePos(int node_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Vector2 __retval; |
|
|
|
Vector2 __retval; |
|
|
|
ImNodesNative.imnodes_GetNodeGridSpacePos(&__retval, node_id); |
|
|
|
imnodesNative.imnodes_GetNodeGridSpacePos(&__retval, node_id); |
|
|
|
return __retval; |
|
|
|
return __retval; |
|
|
|
} |
|
|
|
} |
|
|
|
public static Vector2 GetNodeScreenSpacePos(int node_id) |
|
|
|
public static Vector2 GetNodeScreenSpacePos(int node_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Vector2 __retval; |
|
|
|
Vector2 __retval; |
|
|
|
ImNodesNative.imnodes_GetNodeScreenSpacePos(&__retval, node_id); |
|
|
|
imnodesNative.imnodes_GetNodeScreenSpacePos(&__retval, node_id); |
|
|
|
return __retval; |
|
|
|
return __retval; |
|
|
|
} |
|
|
|
} |
|
|
|
public static void GetSelectedLinks(ref int link_ids) |
|
|
|
public static void GetSelectedLinks(ref int link_ids) |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (int* native_link_ids = &link_ids) |
|
|
|
fixed (int* native_link_ids = &link_ids) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_GetSelectedLinks(native_link_ids); |
|
|
|
imnodesNative.imnodes_GetSelectedLinks(native_link_ids); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public static void GetSelectedNodes(ref int node_ids) |
|
|
|
public static void GetSelectedNodes(ref int node_ids) |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (int* native_node_ids = &node_ids) |
|
|
|
fixed (int* native_node_ids = &node_ids) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_GetSelectedNodes(native_node_ids); |
|
|
|
imnodesNative.imnodes_GetSelectedNodes(native_node_ids); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public static Style* GetStyle() |
|
|
|
public static Style* GetStyle() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Style* ret = ImNodesNative.imnodes_GetStyle(); |
|
|
|
Style* ret = imnodesNative.imnodes_GetStyle(); |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
public static void Initialize() |
|
|
|
public static void Initialize() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_Initialize(); |
|
|
|
imnodesNative.imnodes_Initialize(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static bool IsAnyAttributeActive() |
|
|
|
public static bool IsAnyAttributeActive() |
|
|
|
{ |
|
|
|
{ |
|
|
|
int* attribute_id = null; |
|
|
|
int* attribute_id = null; |
|
|
|
byte ret = ImNodesNative.imnodes_IsAnyAttributeActive(attribute_id); |
|
|
|
byte ret = imnodesNative.imnodes_IsAnyAttributeActive(attribute_id); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
public static bool IsAnyAttributeActive(ref int attribute_id) |
|
|
|
public static bool IsAnyAttributeActive(ref int attribute_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (int* native_attribute_id = &attribute_id) |
|
|
|
fixed (int* native_attribute_id = &attribute_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsAnyAttributeActive(native_attribute_id); |
|
|
|
byte ret = imnodesNative.imnodes_IsAnyAttributeActive(native_attribute_id); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public static bool IsAttributeActive() |
|
|
|
public static bool IsAttributeActive() |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsAttributeActive(); |
|
|
|
byte ret = imnodesNative.imnodes_IsAttributeActive(); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
public static bool IsEditorHovered() |
|
|
|
public static bool IsEditorHovered() |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsEditorHovered(); |
|
|
|
byte ret = imnodesNative.imnodes_IsEditorHovered(); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
public static bool IsLinkCreated(ref int started_at_attribute_id, ref int ended_at_attribute_id) |
|
|
|
public static bool IsLinkCreated(ref int started_at_attribute_id, ref int ended_at_attribute_id) |
|
|
@ -184,7 +184,7 @@ namespace ImNodesNET |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (int* native_ended_at_attribute_id = &ended_at_attribute_id) |
|
|
|
fixed (int* native_ended_at_attribute_id = &ended_at_attribute_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsLinkCreatedBoolPtr(native_started_at_attribute_id, native_ended_at_attribute_id, created_from_snap); |
|
|
|
byte ret = imnodesNative.imnodes_IsLinkCreatedBoolPtr(native_started_at_attribute_id, native_ended_at_attribute_id, created_from_snap); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -197,7 +197,7 @@ namespace ImNodesNET |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (int* native_ended_at_attribute_id = &ended_at_attribute_id) |
|
|
|
fixed (int* native_ended_at_attribute_id = &ended_at_attribute_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsLinkCreatedBoolPtr(native_started_at_attribute_id, native_ended_at_attribute_id, native_created_from_snap); |
|
|
|
byte ret = imnodesNative.imnodes_IsLinkCreatedBoolPtr(native_started_at_attribute_id, native_ended_at_attribute_id, native_created_from_snap); |
|
|
|
created_from_snap = native_created_from_snap_val != 0; |
|
|
|
created_from_snap = native_created_from_snap_val != 0; |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
@ -214,7 +214,7 @@ namespace ImNodesNET |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (int* native_ended_at_attribute_id = &ended_at_attribute_id) |
|
|
|
fixed (int* native_ended_at_attribute_id = &ended_at_attribute_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsLinkCreatedIntPtr(native_started_at_node_id, native_started_at_attribute_id, native_ended_at_node_id, native_ended_at_attribute_id, created_from_snap); |
|
|
|
byte ret = imnodesNative.imnodes_IsLinkCreatedIntPtr(native_started_at_node_id, native_started_at_attribute_id, native_ended_at_node_id, native_ended_at_attribute_id, created_from_snap); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -233,7 +233,7 @@ namespace ImNodesNET |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (int* native_ended_at_attribute_id = &ended_at_attribute_id) |
|
|
|
fixed (int* native_ended_at_attribute_id = &ended_at_attribute_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsLinkCreatedIntPtr(native_started_at_node_id, native_started_at_attribute_id, native_ended_at_node_id, native_ended_at_attribute_id, native_created_from_snap); |
|
|
|
byte ret = imnodesNative.imnodes_IsLinkCreatedIntPtr(native_started_at_node_id, native_started_at_attribute_id, native_ended_at_node_id, native_ended_at_attribute_id, native_created_from_snap); |
|
|
|
created_from_snap = native_created_from_snap_val != 0; |
|
|
|
created_from_snap = native_created_from_snap_val != 0; |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
@ -245,7 +245,7 @@ namespace ImNodesNET |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (int* native_link_id = &link_id) |
|
|
|
fixed (int* native_link_id = &link_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsLinkDestroyed(native_link_id); |
|
|
|
byte ret = imnodesNative.imnodes_IsLinkDestroyed(native_link_id); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -253,7 +253,7 @@ namespace ImNodesNET |
|
|
|
{ |
|
|
|
{ |
|
|
|
int* started_at_attribute_id = null; |
|
|
|
int* started_at_attribute_id = null; |
|
|
|
byte including_detached_links = 1; |
|
|
|
byte including_detached_links = 1; |
|
|
|
byte ret = ImNodesNative.imnodes_IsLinkDropped(started_at_attribute_id, including_detached_links); |
|
|
|
byte ret = imnodesNative.imnodes_IsLinkDropped(started_at_attribute_id, including_detached_links); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
public static bool IsLinkDropped(ref int started_at_attribute_id) |
|
|
|
public static bool IsLinkDropped(ref int started_at_attribute_id) |
|
|
@ -261,7 +261,7 @@ namespace ImNodesNET |
|
|
|
byte including_detached_links = 1; |
|
|
|
byte including_detached_links = 1; |
|
|
|
fixed (int* native_started_at_attribute_id = &started_at_attribute_id) |
|
|
|
fixed (int* native_started_at_attribute_id = &started_at_attribute_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsLinkDropped(native_started_at_attribute_id, including_detached_links); |
|
|
|
byte ret = imnodesNative.imnodes_IsLinkDropped(native_started_at_attribute_id, including_detached_links); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -270,7 +270,7 @@ namespace ImNodesNET |
|
|
|
byte native_including_detached_links = including_detached_links ? (byte)1 : (byte)0; |
|
|
|
byte native_including_detached_links = including_detached_links ? (byte)1 : (byte)0; |
|
|
|
fixed (int* native_started_at_attribute_id = &started_at_attribute_id) |
|
|
|
fixed (int* native_started_at_attribute_id = &started_at_attribute_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsLinkDropped(native_started_at_attribute_id, native_including_detached_links); |
|
|
|
byte ret = imnodesNative.imnodes_IsLinkDropped(native_started_at_attribute_id, native_including_detached_links); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -278,7 +278,7 @@ namespace ImNodesNET |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (int* native_link_id = &link_id) |
|
|
|
fixed (int* native_link_id = &link_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsLinkHovered(native_link_id); |
|
|
|
byte ret = imnodesNative.imnodes_IsLinkHovered(native_link_id); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -286,7 +286,7 @@ namespace ImNodesNET |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (int* native_started_at_attribute_id = &started_at_attribute_id) |
|
|
|
fixed (int* native_started_at_attribute_id = &started_at_attribute_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsLinkStarted(native_started_at_attribute_id); |
|
|
|
byte ret = imnodesNative.imnodes_IsLinkStarted(native_started_at_attribute_id); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -294,7 +294,7 @@ namespace ImNodesNET |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (int* native_node_id = &node_id) |
|
|
|
fixed (int* native_node_id = &node_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsNodeHovered(native_node_id); |
|
|
|
byte ret = imnodesNative.imnodes_IsNodeHovered(native_node_id); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -302,13 +302,13 @@ namespace ImNodesNET |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (int* native_attribute_id = &attribute_id) |
|
|
|
fixed (int* native_attribute_id = &attribute_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte ret = ImNodesNative.imnodes_IsPinHovered(native_attribute_id); |
|
|
|
byte ret = imnodesNative.imnodes_IsPinHovered(native_attribute_id); |
|
|
|
return ret != 0; |
|
|
|
return ret != 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public static void Link(int id, int start_attribute_id, int end_attribute_id) |
|
|
|
public static void Link(int id, int start_attribute_id, int end_attribute_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_Link(id, start_attribute_id, end_attribute_id); |
|
|
|
imnodesNative.imnodes_Link(id, start_attribute_id, end_attribute_id); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void LoadCurrentEditorStateFromIniFile(string file_name) |
|
|
|
public static void LoadCurrentEditorStateFromIniFile(string file_name) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -330,7 +330,7 @@ namespace ImNodesNET |
|
|
|
native_file_name[native_file_name_offset] = 0; |
|
|
|
native_file_name[native_file_name_offset] = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
else { native_file_name = null; } |
|
|
|
else { native_file_name = null; } |
|
|
|
ImNodesNative.imnodes_LoadCurrentEditorStateFromIniFile(native_file_name); |
|
|
|
imnodesNative.imnodes_LoadCurrentEditorStateFromIniFile(native_file_name); |
|
|
|
if (file_name_byteCount > Util.StackAllocationSizeLimit) |
|
|
|
if (file_name_byteCount > Util.StackAllocationSizeLimit) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Util.Free(native_file_name); |
|
|
|
Util.Free(native_file_name); |
|
|
@ -356,7 +356,7 @@ namespace ImNodesNET |
|
|
|
native_data[native_data_offset] = 0; |
|
|
|
native_data[native_data_offset] = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
else { native_data = null; } |
|
|
|
else { native_data = null; } |
|
|
|
ImNodesNative.imnodes_LoadCurrentEditorStateFromIniString(native_data, data_size); |
|
|
|
imnodesNative.imnodes_LoadCurrentEditorStateFromIniString(native_data, data_size); |
|
|
|
if (data_byteCount > Util.StackAllocationSizeLimit) |
|
|
|
if (data_byteCount > Util.StackAllocationSizeLimit) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Util.Free(native_data); |
|
|
|
Util.Free(native_data); |
|
|
@ -382,7 +382,7 @@ namespace ImNodesNET |
|
|
|
native_file_name[native_file_name_offset] = 0; |
|
|
|
native_file_name[native_file_name_offset] = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
else { native_file_name = null; } |
|
|
|
else { native_file_name = null; } |
|
|
|
ImNodesNative.imnodes_LoadEditorStateFromIniFile(editor, native_file_name); |
|
|
|
imnodesNative.imnodes_LoadEditorStateFromIniFile(editor, native_file_name); |
|
|
|
if (file_name_byteCount > Util.StackAllocationSizeLimit) |
|
|
|
if (file_name_byteCount > Util.StackAllocationSizeLimit) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Util.Free(native_file_name); |
|
|
|
Util.Free(native_file_name); |
|
|
@ -408,7 +408,7 @@ namespace ImNodesNET |
|
|
|
native_data[native_data_offset] = 0; |
|
|
|
native_data[native_data_offset] = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
else { native_data = null; } |
|
|
|
else { native_data = null; } |
|
|
|
ImNodesNative.imnodes_LoadEditorStateFromIniString(editor, native_data, data_size); |
|
|
|
imnodesNative.imnodes_LoadEditorStateFromIniString(editor, native_data, data_size); |
|
|
|
if (data_byteCount > Util.StackAllocationSizeLimit) |
|
|
|
if (data_byteCount > Util.StackAllocationSizeLimit) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Util.Free(native_data); |
|
|
|
Util.Free(native_data); |
|
|
@ -416,37 +416,37 @@ namespace ImNodesNET |
|
|
|
} |
|
|
|
} |
|
|
|
public static int NumSelectedLinks() |
|
|
|
public static int NumSelectedLinks() |
|
|
|
{ |
|
|
|
{ |
|
|
|
int ret = ImNodesNative.imnodes_NumSelectedLinks(); |
|
|
|
int ret = imnodesNative.imnodes_NumSelectedLinks(); |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
public static int NumSelectedNodes() |
|
|
|
public static int NumSelectedNodes() |
|
|
|
{ |
|
|
|
{ |
|
|
|
int ret = ImNodesNative.imnodes_NumSelectedNodes(); |
|
|
|
int ret = imnodesNative.imnodes_NumSelectedNodes(); |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
public static void PopAttributeFlag() |
|
|
|
public static void PopAttributeFlag() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_PopAttributeFlag(); |
|
|
|
imnodesNative.imnodes_PopAttributeFlag(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void PopColorStyle() |
|
|
|
public static void PopColorStyle() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_PopColorStyle(); |
|
|
|
imnodesNative.imnodes_PopColorStyle(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void PopStyleVar() |
|
|
|
public static void PopStyleVar() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_PopStyleVar(); |
|
|
|
imnodesNative.imnodes_PopStyleVar(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void PushAttributeFlag(AttributeFlags flag) |
|
|
|
public static void PushAttributeFlag(AttributeFlags flag) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_PushAttributeFlag(flag); |
|
|
|
imnodesNative.imnodes_PushAttributeFlag(flag); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void PushColorStyle(ColorStyle item, uint color) |
|
|
|
public static void PushColorStyle(ColorStyle item, uint color) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_PushColorStyle(item, color); |
|
|
|
imnodesNative.imnodes_PushColorStyle(item, color); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void PushStyleVar(StyleVar style_item, float value) |
|
|
|
public static void PushStyleVar(StyleVar style_item, float value) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_PushStyleVar(style_item, value); |
|
|
|
imnodesNative.imnodes_PushStyleVar(style_item, value); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void SaveCurrentEditorStateToIniFile(string file_name) |
|
|
|
public static void SaveCurrentEditorStateToIniFile(string file_name) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -468,7 +468,7 @@ namespace ImNodesNET |
|
|
|
native_file_name[native_file_name_offset] = 0; |
|
|
|
native_file_name[native_file_name_offset] = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
else { native_file_name = null; } |
|
|
|
else { native_file_name = null; } |
|
|
|
ImNodesNative.imnodes_SaveCurrentEditorStateToIniFile(native_file_name); |
|
|
|
imnodesNative.imnodes_SaveCurrentEditorStateToIniFile(native_file_name); |
|
|
|
if (file_name_byteCount > Util.StackAllocationSizeLimit) |
|
|
|
if (file_name_byteCount > Util.StackAllocationSizeLimit) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Util.Free(native_file_name); |
|
|
|
Util.Free(native_file_name); |
|
|
@ -477,14 +477,14 @@ namespace ImNodesNET |
|
|
|
public static string SaveCurrentEditorStateToIniString() |
|
|
|
public static string SaveCurrentEditorStateToIniString() |
|
|
|
{ |
|
|
|
{ |
|
|
|
uint* data_size = null; |
|
|
|
uint* data_size = null; |
|
|
|
byte* ret = ImNodesNative.imnodes_SaveCurrentEditorStateToIniString(data_size); |
|
|
|
byte* ret = imnodesNative.imnodes_SaveCurrentEditorStateToIniString(data_size); |
|
|
|
return Util.StringFromPtr(ret); |
|
|
|
return Util.StringFromPtr(ret); |
|
|
|
} |
|
|
|
} |
|
|
|
public static string SaveCurrentEditorStateToIniString(ref uint data_size) |
|
|
|
public static string SaveCurrentEditorStateToIniString(ref uint data_size) |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (uint* native_data_size = &data_size) |
|
|
|
fixed (uint* native_data_size = &data_size) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte* ret = ImNodesNative.imnodes_SaveCurrentEditorStateToIniString(native_data_size); |
|
|
|
byte* ret = imnodesNative.imnodes_SaveCurrentEditorStateToIniString(native_data_size); |
|
|
|
return Util.StringFromPtr(ret); |
|
|
|
return Util.StringFromPtr(ret); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -508,7 +508,7 @@ namespace ImNodesNET |
|
|
|
native_file_name[native_file_name_offset] = 0; |
|
|
|
native_file_name[native_file_name_offset] = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
else { native_file_name = null; } |
|
|
|
else { native_file_name = null; } |
|
|
|
ImNodesNative.imnodes_SaveEditorStateToIniFile(editor, native_file_name); |
|
|
|
imnodesNative.imnodes_SaveEditorStateToIniFile(editor, native_file_name); |
|
|
|
if (file_name_byteCount > Util.StackAllocationSizeLimit) |
|
|
|
if (file_name_byteCount > Util.StackAllocationSizeLimit) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Util.Free(native_file_name); |
|
|
|
Util.Free(native_file_name); |
|
|
@ -517,53 +517,53 @@ namespace ImNodesNET |
|
|
|
public static string SaveEditorStateToIniString(IntPtr editor) |
|
|
|
public static string SaveEditorStateToIniString(IntPtr editor) |
|
|
|
{ |
|
|
|
{ |
|
|
|
uint* data_size = null; |
|
|
|
uint* data_size = null; |
|
|
|
byte* ret = ImNodesNative.imnodes_SaveEditorStateToIniString(editor, data_size); |
|
|
|
byte* ret = imnodesNative.imnodes_SaveEditorStateToIniString(editor, data_size); |
|
|
|
return Util.StringFromPtr(ret); |
|
|
|
return Util.StringFromPtr(ret); |
|
|
|
} |
|
|
|
} |
|
|
|
public static string SaveEditorStateToIniString(IntPtr editor, ref uint data_size) |
|
|
|
public static string SaveEditorStateToIniString(IntPtr editor, ref uint data_size) |
|
|
|
{ |
|
|
|
{ |
|
|
|
fixed (uint* native_data_size = &data_size) |
|
|
|
fixed (uint* native_data_size = &data_size) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte* ret = ImNodesNative.imnodes_SaveEditorStateToIniString(editor, native_data_size); |
|
|
|
byte* ret = imnodesNative.imnodes_SaveEditorStateToIniString(editor, native_data_size); |
|
|
|
return Util.StringFromPtr(ret); |
|
|
|
return Util.StringFromPtr(ret); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public static void SetImGuiContext(IntPtr ctx) |
|
|
|
public static void SetImGuiContext(IntPtr ctx) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_SetImGuiContext(ctx); |
|
|
|
imnodesNative.imnodes_SetImGuiContext(ctx); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void SetNodeDraggable(int node_id, bool draggable) |
|
|
|
public static void SetNodeDraggable(int node_id, bool draggable) |
|
|
|
{ |
|
|
|
{ |
|
|
|
byte native_draggable = draggable ? (byte)1 : (byte)0; |
|
|
|
byte native_draggable = draggable ? (byte)1 : (byte)0; |
|
|
|
ImNodesNative.imnodes_SetNodeDraggable(node_id, native_draggable); |
|
|
|
imnodesNative.imnodes_SetNodeDraggable(node_id, native_draggable); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void SetNodeEditorSpacePos(int node_id, Vector2 editor_space_pos) |
|
|
|
public static void SetNodeEditorSpacePos(int node_id, Vector2 editor_space_pos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_SetNodeEditorSpacePos(node_id, editor_space_pos); |
|
|
|
imnodesNative.imnodes_SetNodeEditorSpacePos(node_id, editor_space_pos); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void SetNodeGridSpacePos(int node_id, Vector2 grid_pos) |
|
|
|
public static void SetNodeGridSpacePos(int node_id, Vector2 grid_pos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_SetNodeGridSpacePos(node_id, grid_pos); |
|
|
|
imnodesNative.imnodes_SetNodeGridSpacePos(node_id, grid_pos); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void SetNodeScreenSpacePos(int node_id, Vector2 screen_space_pos) |
|
|
|
public static void SetNodeScreenSpacePos(int node_id, Vector2 screen_space_pos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_SetNodeScreenSpacePos(node_id, screen_space_pos); |
|
|
|
imnodesNative.imnodes_SetNodeScreenSpacePos(node_id, screen_space_pos); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void Shutdown() |
|
|
|
public static void Shutdown() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_Shutdown(); |
|
|
|
imnodesNative.imnodes_Shutdown(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void StyleColorsClassic() |
|
|
|
public static void StyleColorsClassic() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_StyleColorsClassic(); |
|
|
|
imnodesNative.imnodes_StyleColorsClassic(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void StyleColorsDark() |
|
|
|
public static void StyleColorsDark() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_StyleColorsDark(); |
|
|
|
imnodesNative.imnodes_StyleColorsDark(); |
|
|
|
} |
|
|
|
} |
|
|
|
public static void StyleColorsLight() |
|
|
|
public static void StyleColorsLight() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImNodesNative.imnodes_StyleColorsLight(); |
|
|
|
imnodesNative.imnodes_StyleColorsLight(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|