Merge pull request #6 from dpethes/update_imgui_149

Update to imgui 1.49
internals
Eric Mellino 8 years ago committed by GitHub
commit 24ed1a6478
  1. BIN
      deps/cimgui/win7-x64/cimgui.dll
  2. 64
      src/ImGui.NET/Font.cs
  3. 1
      src/ImGui.NET/ImGui.NET.Net46.csproj
  4. 1
      src/ImGui.NET/ImGui.NET.csproj
  5. 9
      src/ImGui.NET/ImGui.cs
  6. 84
      src/ImGui.NET/ImGuiNative.cs
  7. 7
      src/ImGui.NET/NativeIO.cs
  8. 4
      src/ImGui.NET/NativeStyle.cs
  9. 9
      src/ImGui.NET/Style.cs
  10. 2
      src/ImGui.NET/TextEditCallbackData.cs
  11. 51
      src/ImGui.NET/TreeNodeFlags.cs

Binary file not shown.

@ -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;
};
}

@ -15,6 +15,7 @@
<ItemGroup>
<Compile Include="Align.cs" />
<Compile Include="ColorTarget.cs" />
<Compile Include="TreeNodeFlags.cs" />
<Compile Include="IntStructs.cs" />
<Compile Include="MouseCursorKind.cs" />
<Compile Include="NativeIO.cs" />

@ -13,6 +13,7 @@
<ItemGroup>
<Compile Include="Align.cs" />
<Compile Include="ColorTarget.cs" />
<Compile Include="TreeNodeFlags.cs" />
<Compile Include="IntStructs.cs" />
<Compile Include="MouseCursorKind.cs" />
<Compile Include="NativeIO.cs" />

@ -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)
{
return ImGuiNative.igCollapsingHeader(label, id, displayFrame, defaultOpen);
TreeNodeFlags default_open_flags = TreeNodeFlags.DefaultOpen;
return ImGuiNative.igCollapsingHeader(label, (defaultOpen ? default_open_flags : 0));
}
public static bool CollapsingHeader(string label, TreeNodeFlags flags)
{
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);
public static extern void igSetWindowSize(Vector2 size, SetCondition cond); //(not recommended)
[DllImport(cimguiLib)]
public static extern void igSetWindowSize(Vector2 size, SetCondition cond);
public static extern void igSetWindowCollapsed(bool collapsed, SetCondition cond); //(not recommended)
[DllImport(cimguiLib)]
public static extern void igSetWindowCollapsed(bool collapsed, SetCondition cond);
[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)]
@ -183,10 +183,6 @@ namespace ImGuiNET
// Layout
[DllImport(cimguiLib)]
public static extern void igBeginGroup();
[DllImport(cimguiLib)]
public static extern void igEndGroup();
[DllImport(cimguiLib)]
public static extern void igSeparator();
[DllImport(cimguiLib)]
public static extern void igSameLine(float local_pos_x, float spacing_w);
@ -195,23 +191,13 @@ namespace ImGuiNET
[DllImport(cimguiLib)]
public static extern void igDummy(Vector2* size);
[DllImport(cimguiLib)]
public static extern void igIndent();
public static extern void igIndent(float indent_w = 0.0f);
[DllImport(cimguiLib)]
public static extern void igUnindent();
[DllImport(cimguiLib)]
public static extern void igColumns(int count, string id, bool border);
public static extern void igUnindent(float indent_w = 0.0f);
[DllImport(cimguiLib)]
public static extern void igNextColumn();
[DllImport(cimguiLib)]
public static extern int igGetColumnIndex();
[DllImport(cimguiLib)]
public static extern float igGetColumnOffset(int column_index);
[DllImport(cimguiLib)]
public static extern void igSetColumnOffset(int column_index, float offset_x);
[DllImport(cimguiLib)]
public static extern float igGetColumnWidth(int column_index);
public static extern void igBeginGroup();
[DllImport(cimguiLib)]
public static extern int igGetColumnsCount();
public static extern void igEndGroup();
[DllImport(cimguiLib)]
public static extern void igGetCursorPos(Vector2* pOut);
[DllImport(cimguiLib)]
@ -239,6 +225,23 @@ namespace ImGuiNET
[DllImport(cimguiLib)]
public static extern float igGetItemsLineHeightWithSpacing();
// Columns
[DllImport(cimguiLib)]
public static extern void igColumns(int count, string id, bool border);
[DllImport(cimguiLib)]
public static extern void igNextColumn();
[DllImport(cimguiLib)]
public static extern int igGetColumnIndex();
[DllImport(cimguiLib)]
public static extern float igGetColumnOffset(int column_index);
[DllImport(cimguiLib)]
public static extern void igSetColumnOffset(int column_index, float offset_x);
[DllImport(cimguiLib)]
public static extern float igGetColumnWidth(int column_index);
[DllImport(cimguiLib)]
public static extern int igGetColumnsCount();
// ID scopes
// If you are creating widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them
// You can also use "##extra" within your widget name to distinguish them from each others (see 'Programmer Guide')
@ -298,9 +301,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 +471,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, TreeNodeFlags flags = 0);
[DllImport(cimguiLib)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool igCollapsingHeader(string label, ref bool p_open, TreeNodeFlags flags = 0);
// Widgets: Selectable / Lists
[DllImport(cimguiLib)]
@ -645,12 +651,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 +738,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>

@ -0,0 +1,51 @@
using System;
namespace ImGuiNET
{
[Flags]
public enum TreeNodeFlags : int
{
/// <summary>
/// Draw as selected
/// </summary>
Selected = 1 << 0,
/// <summary>
/// Full colored frame (e.g. for CollapsingHeader)
/// </summary>
Framed = 1 << 1,
/// <summary>
/// Hit testing to allow subsequent widgets to overlap this one
/// </summary>
AllowOverlapMode = 1 << 2,
/// <summary>
/// Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
/// </summary>
NoTreePushOnOpen = 1 << 3,
/// <summary>
/// Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
/// </summary>
NoAutoOpenOnLog = 1 << 4,
/// <summary>
/// Default node to be open
/// </summary>
DefaultOpen = 1 << 5,
/// <summary>
/// Need double-click to open node
/// </summary>
OpenOnDoubleClick = 1 << 6,
/// <summary>
/// Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open.
/// </summary>
OpenOnArrow = 1 << 7,
/// <summary>
/// No collapsing, no arrow (use as a convenience for leaf nodes).
/// </summary>
Leaf = 1 << 8,
/// <summary>
/// Display a bullet instead of arrow
/// </summary>
Bullet = 1 << 9,
CollapsingHeader = Framed | NoAutoOpenOnLog
};
}
Loading…
Cancel
Save