feat(api): bump Dear ImGui from 1.87 to 1.88 (#309)

This commit is contained in:
SpaiR authored and GitHub committed 2024-12-27 18:02:10 +02:00
1 parent 72a62131e8
commit 666d1112ab
29 files changed
+3247 -2482

No files matched your search

@@ -62,7 +62,8 @@ public final class ImDrawList extends ImGuiStruct {
public native ImVec2 GetClipRectMax();
// Primitives
// - For rectangular primitives, "pMin" and "pMax" represent the upper-left and lower-right corners.
// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
// In future versions we will use textures to provide cheaper and higher-quality circles.
@@ -113,9 +114,6 @@ public final class ImDrawList extends ImGuiStruct {
@BindingMethod
public native void AddPolyline(ImVec2[] points, int numPoint, int col, int imDrawFlags, float thickness);
/**
* Note: Anti-aliased filling requires points to be in clockwise order.
*/
@BindingMethod
public native void AddConvexPolyFilled(ImVec2[] points, int numPoints, int col);
@@ -146,6 +144,7 @@ public final class ImDrawList extends ImGuiStruct {
public native void AddImageRounded(@ArgValue(callPrefix = "(ImTextureID)(uintptr_t)") long textureID, ImVec2 pMin, ImVec2 pMax, ImVec2 uvMin, ImVec2 uvMax, int col, float rounding, @OptArg int imDrawFlags);
// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
@BindingMethod
public native void PathClear();
+45 -30
View File
@@ -238,6 +238,12 @@ public class ImGui {
@BindingMethod
public static native void ShowMetricsWindow(@OptArg ImBoolean pOpen);
/**
* Create Debug Log window. display a simplified log of important dear imgui events.
*/
@BindingMethod
public static native void ShowDebugLogWindow(@OptArg ImBoolean pOpen);
/**
* Create Stack Tool window. hover items with mouse to query information about the source of their unique ID.
*/
@@ -1895,13 +1901,11 @@ public class ImGui {
public static native boolean IsPopupOpen(String strId, @OptArg int imGuiPopupFlags);
// Tables
// [BETA API] API may evolve slightly! If you use this, please update to the next version when it comes out!
// - Full-featured replacement for old Columns API.
// - See Demo->Tables for demo code.
// - See top of imgui_tables.cpp for general commentary.
// - See Demo->Tables for demo code. See top of imgui_tables.cpp for general commentary.
// - See ImGuiTableFlags_ and ImGuiTableColumnFlags_ enums for a description of available flags.
// The typical call flow is:
// - 1. Call BeginTable().
// - 1. Call BeginTable(), early out if returning false.
// - 2. Optionally call TableSetupColumn() to submit column name/flags/defaults.
// - 3. Optionally call TableSetupScrollFreeze() to request scroll freezing of columns/rows.
// - 4. Optionally call TableHeadersRow() to submit a header row. Names are pulled from TableSetupColumn() data.
@@ -1977,13 +1981,17 @@ public class ImGui {
@BindingMethod
public static native void TableHeader(String label);
// Tables: Sorting
// - Call TableGetSortSpecs() to retrieve latest sort specs for the table. NULL when not sorting.
// - When 'SpecsDirty == true' you should sort your data. It will be true when sorting specs have changed
// since last call, or the first time. Make sure to set 'SpecsDirty = false' after sorting, else you may
// wastefully sort your data every frame!
// - Lifetime: don't hold on this pointer over multiple frames or past any subsequent call to BeginTable().
// Tables: Sorting & Miscellaneous functions
// - Sorting: call TableGetSortSpecs() to retrieve latest sort specs for the table. NULL when not sorting.
// When 'sort_specs->SpecsDirty == true' you should sort your data. It will be true when sorting specs have
// changed since last call, or the first time. Make sure to set 'SpecsDirty = false' after sorting,
// else you may wastefully sort your data every frame!
// - Functions args 'int column_n' treat the default value of -1 as the same as passing the current column index.
/**
* Get latest sort specs for the table (NULL if not sorting).
* Lifetime: don't hold on this pointer over multiple frames or past any subsequent call to BeginTable().
*/
@BindingMethod
public static native ImGuiTableSortSpecs TableGetSortSpecs();
@@ -2523,6 +2531,22 @@ public class ImGui {
@ReturnValue(isStatic = true)
public static native ImGuiViewport GetMainViewport();
// Background/Foreground Draw Lists
/**
* Get background draw list for the viewport associated to the current window.
* This draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.
*/
@BindingMethod
public static native ImDrawList GetBackgroundDrawList(@OptArg ImGuiViewport viewport);
/**
* Get foreground draw list for the viewport associated to the current window.
* This draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents.
*/
@BindingMethod
public static native ImDrawList GetForegroundDrawList(@OptArg ImGuiViewport viewport);
// Miscellaneous Utilities
/**
@@ -2549,19 +2573,7 @@ public class ImGui {
@BindingMethod
public static native int GetFrameCount();
/**
* Get background draw list for the viewport associated to the current window.
* This draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.
*/
@BindingMethod
public static native ImDrawList GetBackgroundDrawList(@OptArg ImGuiViewport viewport);
/**
* Get foreground draw list for the viewport associated to the current window.
* This draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.
*/
@BindingMethod
public static native ImDrawList GetForegroundDrawList(@OptArg ImGuiViewport viewport);
// TODO GetDrawListSharedData
@@ -2667,12 +2679,12 @@ public class ImGui {
public static native String GetKeyName(@ArgValue(staticCast = "ImGuiKey") int key);
/**
* Attention: misleading name! manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle).
* e.g. force capture keyboard when your widget is being hovered.
* This is equivalent to setting "io.WantCaptureKeyboard = wantCaptureKeyboardValue"; after the next NewFrame() call.
* Override io.WantCaptureKeyboard flag next frame (said flag is left for your application to handle,
* typically when true it instructs your app to ignore inputs). e.g. force capture keyboard when your widget is being hovered.
* This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard"; after the next NewFrame() call.
*/
@BindingMethod
public static native void CaptureKeyboardFromApp(@OptArg boolean wantCaptureKeyboardValue);
public static native void SetNextFrameWantCaptureKeyboard(boolean wantCaptureKeyboard);
// Inputs Utilities: Mouse
// - To refer to a mouse button, you may use named enums in your code e.g. ImGuiMouseButton_Left, ImGuiMouseButton_Right.
@@ -2769,11 +2781,12 @@ public class ImGui {
public static native void SetMouseCursor(int type);
/**
* Attention: misleading name! manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle).
* This is equivalent to setting "io.WantCaptureMouse = wantCaptureMouseValue;" after the next NewFrame() call.
* Override io.WantCaptureMouse flag next frame (said flag is left for your application to handle,
* typical when true it instucts your app to ignore inputs).
* This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse;" after the next NewFrame() call.
*/
@BindingMethod
public static native void CaptureMouseFromApp(@OptArg boolean wantCaptureMouseValue);
public static native void SetNextFrameWantCaptureMouse(boolean wantCaptureMouse);
// Clipboard Utilities
// - Also see the LogToClipboard() function to capture GUI into clipboard, or easily output text data to the clipboard.
@@ -2814,7 +2827,9 @@ public class ImGui {
public static native String SaveIniSettingsToMemory(@OptArg @ArgValue(callPrefix = "(size_t*)&") long outIniSize);
// Debug Utilities
// - This is used by the IMGUI_CHECKVERSION() macro.
@BindingMethod
public static native void DebugTextEncoding(String text);
@BindingMethod
public static native boolean DebugCheckVersionAndDataLayout(String versionStr, int szIo, int szStyle, int szVec2, int szVec4, int szDrawVert, int szDrawIdx);
+26 -16
View File
@@ -43,13 +43,13 @@ public final class ImGuiIO extends ImGuiStruct {
public int BackendFlags;
/**
* Main display size, in pixels (generally == {@code GetMainViewport()->Size})
* Main display size, in pixels (generally == {@code GetMainViewport()->Size}). May change every frame.
*/
@BindingField
public ImVec2 DisplaySize;
/**
* Time elapsed since last frame, in seconds.
* Time elapsed since last frame, in seconds. May change every frame.
*/
@BindingField
public float DeltaTime;
@@ -350,6 +350,18 @@ public final class ImGuiIO extends ImGuiStruct {
@BindingMethod
public native void AddInputCharactersUTF8(String str);
/**
* [Optional] Specify index for legacy {@code <1.87} IsKeyXXX() functions with native indices + specify native keycode, scancode.
*/
@BindingMethod
public native void SetKeyEventNativeData(@ArgValue(staticCast = "ImGuiKey") int key, int nativeKeycode, int nativeScancode, @OptArg int nativeLegacyIndex);
/**
* Set master flag for accepting key/mouse/text events (default to true). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen.
*/
@BindingMethod
public native void SetAppAcceptingEvents(boolean acceptingEvents);
/**
* [Internal] Clear the text input buffer manually
*/
@@ -362,12 +374,6 @@ public final class ImGuiIO extends ImGuiStruct {
@BindingMethod
public native void ClearInputKeys();
/**
* [Optional] Specify index for legacy before 1.87 IsKeyXXX() functions with native indices + specify native keycode, scancode.
*/
@BindingMethod
public native void SetKeyEventNativeData(@ArgValue(staticCast = "ImGuiKey") int key, int nativeKeycode, int nativeScancode, @OptArg int nativeLegacyIndex);
//------------------------------------------------------------------
// Output - Updated by NewFrame() or EndFrame()/Render()
// (when reading from the io.WantCaptureMouse, io.WantCaptureKeyboard flags to dispatch your inputs, it is
@@ -476,9 +482,10 @@ public final class ImGuiIO extends ImGuiStruct {
/**
* Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys).
* This used to be [512] sized. It is now ImGuiKey_COUNT to allow legacy io.KeysDown[GetKeyIndex(...)] to work without an overflow.
*/
@BindingField
@TypeArray(type = "boolean", size = "512")
@TypeArray(type = "boolean", size = "ImGuiKey_COUNT")
@Deprecated
public boolean[] KeysDown;
@@ -559,12 +566,6 @@ public final class ImGuiIO extends ImGuiStruct {
@BindingField
public int KeyMods;
/**
* Key mods flags (from previous frame)
*/
@BindingField
public int KeyModsPrev;
/**
* Key state for all known keys. Use IsKeyXXX() functions to access this.
*/
@@ -689,9 +690,18 @@ public final class ImGuiIO extends ImGuiStruct {
@BindingField
public float PenPressure;
@BindingField
/**
* Only modify via AddFocusEvent().
*/
@BindingField(accessors = BindingField.Accessor.GETTER)
public boolean AppFocusLost;
/**
* Only modify via SetAppAcceptingEvents().
*/
@BindingField(accessors = BindingField.Accessor.GETTER)
public boolean AppAcceptingEvents;
/**
* -1: unknown, 0: using AddKeyEvent(), 1: using legacy io.KeysDown[]
*/
@@ -258,7 +258,7 @@ public final class ImGuiStyle extends ImGuiStructDestroyable {
/**
* Enable anti-aliased lines/borders using textures where possible.
* Require backend to render with bilinear filtering.
* Require backend to render with bilinear filtering (NOT point/nearest filtering).
* Latched at the beginning of the frame (copied to ImDrawList).
*/
@BindingField
@@ -7,10 +7,10 @@ import imgui.binding.annotation.BindingSource;
* To test io.KeyMods (which is a combination of individual fields io.KeyCtrl, io.KeyShift, io.KeyAlt set by user/backend)
*/
@BindingSource
public final class ImGuiKeyModFlags {
private ImGuiKeyModFlags() {
public final class ImGuiModFlags {
private ImGuiModFlags() {
}
@BindingAstEnum(file = "ast-imgui.json", qualType = "ImGuiKeyModFlags_")
@BindingAstEnum(file = "ast-imgui.json", qualType = "ImGuiModFlags_")
public Void __;
}
@@ -5,6 +5,7 @@ import imgui.binding.annotation.BindingSource;
/**
* Gamepad/Keyboard directional navigation
* Since {@code >=1.87} backends you generally don't need to care about this enum since io.NavInputs[] is setup automatically. This might become private/internal some day.
* Keyboard: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable.
* NewFrame() will automatically fill io.NavInputs[] based on your io.KeysDown[] + io.KeyMap[] arrays.
* Gamepad: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable.
@@ -127,10 +127,10 @@ public final class ImGui extends imgui.ImGui {
// Init
@BindingMethod
public static native void Initialize(ImGuiContext context);
public static native void Initialize();
@BindingMethod
public static native void Shutdown(ImGuiContext context);
public static native void Shutdown();
// NewFrame