update to (c)imgui 1.49

internals
David Pethes 7 years ago
parent 4f125f7b0e
commit 0a9f9fac76
  1. 64
      src/ImGui.NET/Font.cs
  2. 9
      src/ImGui.NET/ImGui.cs
  3. 45
      src/ImGui.NET/ImGuiNative.cs
  4. 7
      src/ImGui.NET/NativeIO.cs
  5. 4
      src/ImGui.NET/NativeStyle.cs
  6. 9
      src/ImGui.NET/Style.cs
  7. 2
      src/ImGui.NET/TextEditCallbackData.cs

@ -21,8 +21,16 @@ namespace ImGuiNET
[StructLayout(LayoutKind.Sequential)]
public unsafe struct NativeFont
{
// Members: Settings
[StructLayout(LayoutKind.Sequential)]
public struct Glyph
{
public ushort Codepoint;
public float XAdvance;
public float X0, Y0, X1, Y1;
public float U0, V0, U1, V1; // Texture coordinates
};
// Members: Hot ~62/78 bytes
/// <summary>
/// Height of characters, set during loading (don't change after loading).
/// Default value: [user-set]
@ -39,55 +47,49 @@ namespace ImGuiNET
/// </summary>
public Vector2 DisplayOffset;
/// <summary>
/// Replacement glyph if one isn't found. Only set via SetFallbackChar()
/// Default value: '?'
/// ImVector(Glyph)
/// </summary>
public ushort FallbackChar;
public ImVector Glyphs;
/// <summary>
/// ImFontConfig*. Pointer within ImFontAtlas->ConfigData
/// Sparse. Glyphs->XAdvance directly indexable (more cache-friendly that reading from Glyphs,
/// for CalcTextSize functions which are often bottleneck in large UI).
/// </summary>
public IntPtr ConfigData;
public int ConfigDataCount;
// Members: Runtime data
[StructLayout(LayoutKind.Sequential)]
public struct Glyph
{
public ushort Codepoint;
public float XAdvance;
public float X0, Y0, X1, Y1;
public float U0, V0, U1, V1; // Texture coordinates
};
public ImVector IndexXAdvance;
/// <summary>
/// Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
/// Sparse. Index glyphs by Unicode code-point.
/// </summary>
public float Ascent, Descent;
public ImVector IndexLookup;
/// <summary>
/// ImFontAtlas*
/// Equivalent to FindGlyph(FontFallbackChar)
/// </summary>
public IntPtr ContainerAtlas; // What we has been loaded into
public Glyph* FallbackGlyph;
public float FallbackXAdvance;
/// <summary>
/// ImVector(Glyph)
/// Replacement glyph if one isn't found. Only set via SetFallbackChar()
/// Default value: '?'
/// </summary>
public ImVector Glyphs;
public ushort FallbackChar;
// Members: Cold ~18/26 bytes
public int ConfigDataCount;
/// <summary>
/// Equivalent to FindGlyph(FontFallbackChar)
/// ImFontConfig*. Pointer within ImFontAtlas->ConfigData
/// </summary>
public Glyph* FallbackGlyph;
public float FallbackXAdvance;
public IntPtr ConfigData;
/// <summary>
/// Sparse. Glyphs->XAdvance directly indexable (more cache-friendly that reading from Glyphs,
/// for CalcTextSize functions which are often bottleneck in large UI).
/// ImFontAtlas*
/// </summary>
public ImVector IndexXAdvance;
public IntPtr ContainerAtlas; // What we has been loaded into
/// <summary>
/// Sparse. Index glyphs by Unicode code-point.
/// Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
/// </summary>
public ImVector IndexLookup;
public float Ascent, Descent;
};
}

@ -140,9 +140,16 @@ namespace ImGuiNET
return ImGuiNative.igImageButton(userTextureID, size, uv0, uv1, framePadding, backgroundColor, tintColor);
}
//obsolete!
public static bool CollapsingHeader(string label, string id, bool displayFrame, bool defaultOpen)
{
int default_open_flags = 1 << 5;
return ImGuiNative.igCollapsingHeader(label, (defaultOpen ? default_open_flags : 0));
}
public static bool CollapsingHeader(string label, int flags)
{
return ImGuiNative.igCollapsingHeader(label, id, displayFrame, defaultOpen);
return ImGuiNative.igCollapsingHeader(label, flags);
}
public static bool Checkbox(string label, ref bool value)

@ -71,10 +71,6 @@ namespace ImGuiNET
[DllImport(cimguiLib)]
public static extern DrawList* igGetWindowDrawList();
[DllImport(cimguiLib)]
public static extern NativeFont* igGetWindowFont();
[DllImport(cimguiLib)]
public static extern float igGetWindowFontSize();
[DllImport(cimguiLib)]
public static extern void igSetWindowFontScale(float scale);
[DllImport(cimguiLib)]
public static extern void igGetWindowPos(out Vector2 @out);
@ -102,14 +98,14 @@ namespace ImGuiNET
public static extern void igSetNextWindowCollapsed(bool collapsed, SetCondition cond);
[DllImport(cimguiLib)]
public static extern void igSetNextWindowFocus();
[DllImport(cimguiLib)]
public static extern void igSetWindowPos(Vector2 pos, SetCondition cond); //(not recommended)
[DllImport(cimguiLib)]
public static extern void igSetWindowPos(Vector2 pos, SetCondition cond);
[DllImport(cimguiLib)]
public static extern void igSetWindowSize(Vector2 size, SetCondition cond);
public static extern void igSetWindowSize(Vector2 size, SetCondition cond); //(not recommended)
[DllImport(cimguiLib)]
public static extern void igSetWindowCollapsed(bool collapsed, SetCondition cond);
public static extern void igSetWindowCollapsed(bool collapsed, SetCondition cond); //(not recommended)
[DllImport(cimguiLib)]
public static extern void igSetWindowFocus();
public static extern void igSetWindowFocus(); //(not recommended)
[DllImport(cimguiLib)]
public static extern void igSetWindowPosByName(string name, Vector2 pos, SetCondition cond);
[DllImport(cimguiLib)]
@ -160,6 +156,10 @@ namespace ImGuiNET
public static extern void igPushStyleVarVec(StyleVar idx, Vector2 val);
[DllImport(cimguiLib)]
public static extern void igPopStyleVar(int count);
[DllImport(cimguiLib)]
public static extern NativeFont* igGetFont();
[DllImport(cimguiLib)]
public static extern float igGetFontSize();
// Parameters stacks (current window)
[DllImport(cimguiLib)]
@ -298,9 +298,6 @@ namespace ImGuiNET
public static extern bool igImageButton(IntPtr user_texture_id, Vector2 size, Vector2 uv0, Vector2 uv1, int frame_padding, Vector4 bg_col, Vector4 tint_col);
[DllImport(cimguiLib)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool igCollapsingHeader(string label, string str_id, bool display_frame, bool default_open);
[DllImport(cimguiLib)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool igCheckbox(string label, ref bool v);
[DllImport(cimguiLib)]
[return: MarshalAs(UnmanagedType.I1)]
@ -471,6 +468,12 @@ namespace ImGuiNET
public static extern void igTreePop();
[DllImport(cimguiLib)]
public static extern void igSetNextTreeNodeOpened(bool opened, SetCondition cond);
[DllImport(cimguiLib)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool igCollapsingHeader(string label, int flags); //ImGuiTreeNodeFlags
[DllImport(cimguiLib)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool igCollapsingHeader(string label, ref bool p_open, int flags); //ImGuiTreeNodeFlags
// Widgets: Selectable / Lists
[DllImport(cimguiLib)]
@ -645,12 +648,6 @@ namespace ImGuiNET
public static extern float igGetTime();
[DllImport(cimguiLib)]
public static extern int igGetFrameCount();
internal static void igPushFont(object nativeFont)
{
throw new NotImplementedException();
}
[DllImport(cimguiLib)]
public static extern string igGetStyleColName(ColorTarget idx);
[DllImport(cimguiLib)]
@ -738,12 +735,12 @@ namespace ImGuiNET
// public state access - if you want to share ImGui state between modules (e.g. DLL) or allocate it yourself
[DllImport(cimguiLib)]
public static extern string igGetVersion();
[DllImport(cimguiLib)]
public static extern void* igGetpublicState();
[DllImport(cimguiLib)]
public static extern uint igGetpublicStateSize();
[DllImport(cimguiLib)]
public static extern void igSetpublicState(void* state, bool construct);
/*
CIMGUI_API struct ImGuiContext* igCreateContext(void* (*malloc_fn)(size_t), void (*free_fn)(void*));
CIMGUI_API void igDestroyContext(struct ImGuiContext* ctx);
CIMGUI_API struct ImGuiContext* igGetCurrentContext();
CIMGUI_API void igSetCurrentContext(struct ImGuiContext* ctx);
*/
[DllImport(cimguiLib)]

@ -105,6 +105,12 @@ namespace ImGuiNET
/// </summary>
public Vector2 DisplayVisibleMax; // <unset> (0.0f,0.0f) // If the values are the same, we defaults to Min=(0.0f) and Max=DisplaySize
public byte WordMovementUsesAltKey; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl
public byte ShortcutsUseSuperKey; // = defined(__APPLE__) // OS X style: Shortcuts using Cmd/Super instead of Ctrl
public byte DoubleClickSelectsWord; // = defined(__APPLE__) // OS X style: Double click selects by word instead of selecting whole text
public byte MultiSelectUsesSuperKey; // = defined(__APPLE__) // OS X style: Multi-selection in lists uses Cmd/Super instead of Ctrl [unused yet]
//------------------------------------------------------------------
// User Functions
//------------------------------------------------------------------
@ -181,6 +187,7 @@ namespace ImGuiNET
/// Keyboard modifier pressed: Alt
/// </summary>
public byte KeyAlt;
public byte KeySuper;
/// <summary>
/// Keyboard keys that are pressed (in whatever storage order you naturally have access to keyboard data)
/// </summary>

@ -51,10 +51,6 @@ namespace ImGuiNET
/// </summary>
public Vector2 TouchExtraPadding;
/// <summary>
/// Default alpha of window background, if not specified in ImGui::Begin().
/// </summary>
public float WindowFillAlphaDefault;
/// <summary>
/// Horizontal indentation when e.g. entering a tree node
/// </summary>
public float IndentSpacing;

@ -110,15 +110,6 @@ namespace ImGuiNET
set { _stylePtr->TouchExtraPadding = value; }
}
/// <summary>
/// Default alpha of window background, if not specified in ImGui::Begin().
/// </summary>
public float WindowFillAlphaDefault
{
get { return _stylePtr->WindowFillAlphaDefault; }
set { _stylePtr->WindowFillAlphaDefault = value; }
}
/// <summary>
/// Horizontal indentation when e.g. entering a tree node
/// </summary>

@ -39,6 +39,8 @@ namespace ImGuiNET
/// Current text. Read-write (pointed data only). char* in native code.
/// </summary>
public IntPtr Buf;
public int BufTextLen;
/// <summary>
/// Read-only.
/// </summary>

Loading…
Cancel
Save