diff --git a/imgui-binding/src/main/java/imgui/ImDrawData.java b/imgui-binding/src/main/java/imgui/ImDrawData.java index ce18272..d6c8a49 100644 --- a/imgui-binding/src/main/java/imgui/ImDrawData.java +++ b/imgui-binding/src/main/java/imgui/ImDrawData.java @@ -53,6 +53,15 @@ public final class ImDrawData extends ImGuiStruct { return IM_DRAW_DATA->CmdLists[cmdListIdx]->CmdBuffer[cmdBufferIdx].ElemCount; */ + /** + * Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData.DisplayPos to get clipping rectangle in "viewport" coordinates + */ + public ImVec4 getCmdListCmdBufferClipRect(final int cmdListIdx, final int cmdBufferIdx) { + final ImVec4 value = new ImVec4(); + getCmdListCmdBufferClipRect(cmdListIdx, cmdBufferIdx, value); + return value; + } + /** * Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData.DisplayPos to get clipping rectangle in "viewport" coordinates */ @@ -165,6 +174,15 @@ public final class ImDrawData extends ImGuiStruct { return IM_DRAW_DATA->TotalVtxCount; */ + /** + * Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use) + */ + public ImVec2 getDisplayPos() { + final ImVec2 value = new ImVec2(); + getDisplayPos(value); + return value; + } + /** * Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use) */ @@ -186,6 +204,16 @@ public final class ImDrawData extends ImGuiStruct { return IM_DRAW_DATA->DisplayPos.y; */ + /** + * Size of the viewport to render (== io.DisplaySize for the main viewport) + * (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use) + */ + public ImVec2 getDisplaySize() { + final ImVec2 value = new ImVec2(); + getDisplaySize(value); + return value; + } + /** * Size of the viewport to render (== io.DisplaySize for the main viewport) * (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use) @@ -210,6 +238,15 @@ public final class ImDrawData extends ImGuiStruct { return IM_DRAW_DATA->DisplaySize.y; */ + /** + * Amount of pixels for each unit of DisplaySize. Based on io.DisplayFramebufferScale. Generally (1,1) on normal display, (2,2) on OSX with Retina display. + */ + public ImVec2 getFramebufferScale() { + final ImVec2 value = new ImVec2(); + getFramebufferScale(value); + return value; + } + /** * Amount of pixels for each unit of DisplaySize. Based on io.DisplayFramebufferScale. Generally (1,1) on normal display, (2,2) on OSX with Retina display. */ diff --git a/imgui-binding/src/main/java/imgui/ImDrawList.java b/imgui-binding/src/main/java/imgui/ImDrawList.java index a4fd4d4..a2d47c5 100644 --- a/imgui-binding/src/main/java/imgui/ImDrawList.java +++ b/imgui-binding/src/main/java/imgui/ImDrawList.java @@ -96,6 +96,12 @@ public final class ImDrawList extends ImGuiStruct { IM_DRAW_LIST->PopTextureID(); */ + public ImVec2 getClipRectMin() { + final ImVec2 value = new ImVec2(); + getClipRectMin(value); + return value; + } + public native void getClipRectMin(ImVec2 dstImVec2); /* Jni::ImVec2Cpy(env, IM_DRAW_LIST->GetClipRectMin(), dstImVec2); */ @@ -108,6 +114,12 @@ public final class ImDrawList extends ImGuiStruct { return IM_DRAW_LIST->GetClipRectMin().y; */ + public ImVec2 getClipRectMax() { + final ImVec2 value = new ImVec2(); + getClipRectMax(value); + return value; + } + public native void getClipRectMax(ImVec2 dstImVec2); /* Jni::ImVec2Cpy(env, IM_DRAW_LIST->GetClipRectMax(), dstImVec2); */ diff --git a/imgui-binding/src/main/java/imgui/ImFont.java b/imgui-binding/src/main/java/imgui/ImFont.java index 15bec71..6c0d3fa 100644 --- a/imgui-binding/src/main/java/imgui/ImFont.java +++ b/imgui-binding/src/main/java/imgui/ImFont.java @@ -199,6 +199,12 @@ public final class ImFont extends ImGuiStructDestroyable { return env->NewStringUTF(IM_FONT->GetDebugName()); */ + public ImVec2 calcTextSizeA(final float size, final float maxWidth, final float wrapWidth, final String text) { + final ImVec2 value = new ImVec2(); + calcTextSizeA(value, size, maxWidth, wrapWidth, text); + return value; + } + /** * 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable. * 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable. diff --git a/imgui-binding/src/main/java/imgui/ImFontConfig.java b/imgui-binding/src/main/java/imgui/ImFontConfig.java index bede956..d68cf41 100644 --- a/imgui-binding/src/main/java/imgui/ImFontConfig.java +++ b/imgui-binding/src/main/java/imgui/ImFontConfig.java @@ -164,6 +164,15 @@ public final class ImFontConfig extends ImGuiStructDestroyable { IM_FONT_CONFIG->PixelSnapH = isPixelSnapH; */ + /** + * Extra spacing (in pixels) between glyphs. Only X axis is supported for now. + */ + public ImVec2 getGlyphExtraSpacing() { + final ImVec2 value = new ImVec2(); + getGlyphExtraSpacing(value); + return value; + } + /** * Extra spacing (in pixels) between glyphs. Only X axis is supported for now. */ @@ -193,6 +202,15 @@ public final class ImFontConfig extends ImGuiStructDestroyable { IM_FONT_CONFIG->GlyphExtraSpacing.y = y; */ + /** + * Offset all glyphs from this font input. + */ + public ImVec2 getGlyphOffset() { + final ImVec2 value = new ImVec2(); + getGlyphOffset(value); + return value; + } + /** * Offset all glyphs from this font input. */ diff --git a/imgui-binding/src/main/java/imgui/ImGui.java b/imgui-binding/src/main/java/imgui/ImGui.java index 7cdfca9..76ee63a 100644 --- a/imgui-binding/src/main/java/imgui/ImGui.java +++ b/imgui-binding/src/main/java/imgui/ImGui.java @@ -503,6 +503,15 @@ public class ImGui { return ImGui::GetWindowDpiScale(); */ + /** + * Get current window position in screen space (useful if you want to do your own drawing via the DrawList API) + */ + public static ImVec2 getWindowPos() { + final ImVec2 value = new ImVec2(); + getWindowPos(value); + return value; + } + /** * Get current window position in screen space (useful if you want to do your own drawing via the DrawList API) */ @@ -524,6 +533,15 @@ public class ImGui { return ImGui::GetWindowPos().y; */ + /** + * Get current window size + */ + public static ImVec2 getWindowSize() { + final ImVec2 value = new ImVec2(); + getWindowSize(value); + return value; + } + /** * Get current window size */ @@ -779,6 +797,15 @@ public class ImGui { // - Retrieve available space from a given point. GetContentRegionAvail() is frequently useful. // - Those functions are bound to be redesigned (they are confusing, incomplete and the Min/Max return values are in local window coordinates which increases confusion) + /** + * == GetContentRegionMax() - GetCursorPos() + */ + public static ImVec2 getContentRegionAvail() { + final ImVec2 value = new ImVec2(); + getContentRegionAvail(value); + return value; + } + /** * == GetContentRegionMax() - GetCursorPos() */ @@ -800,6 +827,15 @@ public class ImGui { return ImGui::GetContentRegionAvail().y; */ + /** + * Current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates + */ + public static ImVec2 getContentRegionMax() { + final ImVec2 value = new ImVec2(); + getContentRegionMax(value); + return value; + } + /** * Current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates */ @@ -821,6 +857,15 @@ public class ImGui { return ImGui::GetContentRegionMax().y; */ + /** + * Content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates + */ + public static ImVec2 getWindowContentRegionMin() { + final ImVec2 value = new ImVec2(); + getWindowContentRegionMin(value); + return value; + } + /** * Content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates */ @@ -842,6 +887,12 @@ public class ImGui { return ImGui::GetWindowContentRegionMin().y; */ + public final ImVec2 getWindowContentRegionMax() { + final ImVec2 value = new ImVec2(); + getWindowContentRegionMax(value); + return value; + } + public static native void getWindowContentRegionMax(ImVec2 dstImVec2); /* Jni::ImVec2Cpy(env, ImGui::GetWindowContentRegionMax(), dstImVec2); */ @@ -1116,6 +1167,15 @@ public class ImGui { return ImGui::GetFontSize(); */ + /** + * Get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API + */ + public static ImVec2 getFontTexUvWhitePixel() { + final ImVec2 value = new ImVec2(); + getFontTexUvWhitePixel(value); + return value; + } + /** * Get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API */ @@ -1167,6 +1227,16 @@ public class ImGui { return ImGui::GetColorU32((ImU32)col); */ + /** + * Retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), + * otherwise use GetColorU32() to get style color with style alpha baked in. + */ + public ImVec4 getStyleColorVec4(final int imGuiStyleVar) { + final ImVec4 value = new ImVec4(); + getStyleColorVec4(imGuiStyleVar, value); + return value; + } + /** * Retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), * otherwise use GetColorU32() to get style color with style alpha baked in. @@ -1279,6 +1349,15 @@ public class ImGui { // are using the main, absolute coordinate system. // GetWindowPos() + GetCursorPos() == GetCursorScreenPos() etc.) + /** + * Cursor position in window coordinates (relative to window position) + */ + public static ImVec2 getCursorPos() { + final ImVec2 value = new ImVec2(); + getCursorPos(value); + return value; + } + /** * Cursor position in window coordinates (relative to window position) */ @@ -1321,6 +1400,15 @@ public class ImGui { ImGui::SetCursorPosY(y); */ + /** + * Initial cursor position in window coordinates + */ + public static ImVec2 getCursorStartPos() { + final ImVec2 value = new ImVec2(); + getCursorStartPos(value); + return value; + } + /** * Initial cursor position in window coordinates */ @@ -1342,6 +1430,17 @@ public class ImGui { return ImGui::GetCursorStartPos().y; */ + /** + * Cursor position in absolute coordinates (useful to work with ImDrawList API). + * Generally top-left == GetMainViewport().Pos == (0,0) in single viewport mode, + * and bottom-right == GetMainViewport().Pos+Size == io.DisplaySize in single-viewport mode. + */ + public static ImVec2 getCursorScreenPos() { + final ImVec2 value = new ImVec2(); + getCursorScreenPos(value); + return value; + } + /** * Cursor position in absolute coordinates (useful to work with ImDrawList API). * Generally top-left == GetMainViewport().Pos == (0,0) in single viewport mode, @@ -5047,6 +5146,15 @@ public class ImGui { return ImGui::IsAnyItemFocused(); */ + /** + * Get upper-left bounding rectangle of the last item (screen space) + */ + public static ImVec2 getItemRectMin() { + final ImVec2 value = new ImVec2(); + getItemRectMin(value); + return value; + } + /** * Get upper-left bounding rectangle of the last item (screen space) */ @@ -5068,6 +5176,15 @@ public class ImGui { return ImGui::GetItemRectMin().y; */ + /** + * Get lower-right bounding rectangle of the last item (screen space) + */ + public static ImVec2 getItemRectMax() { + final ImVec2 value = new ImVec2(); + getItemRectMax(value); + return value; + } + /** * Get lower-right bounding rectangle of the last item (screen space) */ @@ -5089,6 +5206,15 @@ public class ImGui { return ImGui::GetItemRectMax().y; */ + /** + * Get size of last item + */ + public static ImVec2 getItemRectSize() { + final ImVec2 value = new ImVec2(); + getItemRectSize(value); + return value; + } + /** * Get size of last item */ @@ -5275,6 +5401,24 @@ public class ImGui { // Text Utilities + public final ImVec2 calcTextSize(final String text) { + final ImVec2 value = new ImVec2(); + calcTextSize(value, text); + return value; + } + + public final ImVec2 calcTextSize(final String text, final boolean hideTextAfterDoubleHash) { + final ImVec2 value = new ImVec2(); + calcTextSize(value, text, hideTextAfterDoubleHash); + return value; + } + + public final ImVec2 calcTextSize(final String text, final boolean hideTextAfterDoubleHash, final float wrapWidth) { + final ImVec2 value = new ImVec2(); + calcTextSize(value, text, hideTextAfterDoubleHash, wrapWidth); + return value; + } + public static native void calcTextSize(ImVec2 dstImVec2, String text); /* ImVec2 src = ImGui::CalcTextSize(text); Jni::ImVec2Cpy(env, src, dstImVec2); @@ -5297,6 +5441,12 @@ public class ImGui { // Color Utilities + public final ImVec4 colorConvertU32ToFloat4(final int in) { + final ImVec4 value = new ImVec4(); + colorConvertU32ToFloat4(in, value); + return value; + } + public static native void colorConvertU32ToFloat4(int in, ImVec4 dstImVec4); /* Jni::ImVec4Cpy(env, ImGui::ColorConvertU32ToFloat4(in), dstImVec4); */ @@ -5465,6 +5615,15 @@ public class ImGui { return ImGui::IsMousePosValid(&pos); */ + /** + * Shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls + */ + public static ImVec2 getMousePos() { + final ImVec2 value = new ImVec2(); + getMousePos(value); + return value; + } + /** * Shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls */ @@ -5486,6 +5645,15 @@ public class ImGui { return ImGui::GetMousePos().y; */ + /** + * Retrieve backup of mouse position at the time of opening popup we have BeginPopup() into + */ + public static ImVec2 getMousePosOnOpeningCurrentPopup() { + final ImVec2 value = new ImVec2(); + getMousePosOnOpeningCurrentPopup(value); + return value; + } + /** * Retrieve backup of mouse position at the time of opening popup we have BeginPopup() into */ @@ -5507,6 +5675,16 @@ public class ImGui { return ImGui::GetMousePosOnOpeningCurrentPopup().y; */ + /** + * Return the delta from the initial clicking position while the mouse button is pressed or was just released. + * This is locked and return 0.0f until the mouse moves past a distance threshold at least once. If lockThreshold {@code < -1.0f} uses io.MouseDraggingThreshold. + */ + public static ImVec2 getMouseDragDelta() { + final ImVec2 value = new ImVec2(); + getMouseDragDelta(value); + return value; + } + /** * Return the delta from the initial clicking position while the mouse button is pressed or was just released. * This is locked and return 0.0f until the mouse moves past a distance threshold at least once. If lockThreshold {@code < -1.0f} uses io.MouseDraggingThreshold. @@ -5531,6 +5709,16 @@ public class ImGui { return ImGui::GetMouseDragDelta().y; */ + /** + * Return the delta from the initial clicking position while the mouse button is pressed or was just released. + * This is locked and return 0.0f until the mouse moves past a distance threshold at least once. If lockThreshold {@code < -1.0f} uses io.MouseDraggingThreshold. + */ + public static ImVec2 getMouseDragDelta(final int button) { + final ImVec2 value = new ImVec2(); + getMouseDragDelta(value, button); + return value; + } + /** * Return the delta from the initial clicking position while the mouse button is pressed or was just released. * This is locked and return 0.0f until the mouse moves past a distance threshold at least once. If lockThreshold {@code < -1.0f} uses io.MouseDraggingThreshold. @@ -5555,6 +5743,16 @@ public class ImGui { return ImGui::GetMouseDragDelta(button).y; */ + /** + * Return the delta from the initial clicking position while the mouse button is pressed or was just released. + * This is locked and return 0.0f until the mouse moves past a distance threshold at least once. If lockThreshold {@code < -1.0f} uses io.MouseDraggingThreshold. + */ + public static ImVec2 getMouseDragDelta(final int button, final float lockThreshold) { + final ImVec2 value = new ImVec2(); + getMouseDragDelta(value, button, lockThreshold); + return value; + } + /** * Return the delta from the initial clicking position while the mouse button is pressed or was just released. * This is locked and return 0.0f until the mouse moves past a distance threshold at least once. If lockThreshold {@code < -1.0f} uses io.MouseDraggingThreshold. diff --git a/imgui-binding/src/main/java/imgui/ImGuiIO.java b/imgui-binding/src/main/java/imgui/ImGuiIO.java index ac66fa0..723c166 100644 --- a/imgui-binding/src/main/java/imgui/ImGuiIO.java +++ b/imgui-binding/src/main/java/imgui/ImGuiIO.java @@ -484,6 +484,17 @@ public final class ImGuiIO extends ImGuiStruct { // Input - Fill before calling NewFrame() //------------------------------------------------------------------ + /** + * Main display size, in pixels. + *
+ * BINDING NOTICE: This should be a "Config" part, but since those values may be different for every frame I don't see how it is possible to set them only once. + */ + public ImVec2 getDisplaySize() { + final ImVec2 value = new ImVec2(); + getDisplaySize(value); + return value; + } + /** * Main display size, in pixels. *
@@ -521,6 +532,17 @@ public final class ImGuiIO extends ImGuiStruct { IO->DisplaySize.y = y; */ + /** + * For retina display or other situations where window coordinates are different from framebuffer coordinates. This generally ends up in ImDrawData::FramebufferScale. + *
+ * BINDING NOTICE: This should be a "Config" part, but since those values may be different for every frame I don't see how it is possible to set them only once. + */ + public ImVec2 getDisplayFramebufferScale() { + final ImVec2 value = new ImVec2(); + getDisplayFramebufferScale(value); + return value; + } + /** * For retina display or other situations where window coordinates are different from framebuffer coordinates. This generally ends up in ImDrawData::FramebufferScale. *
@@ -707,6 +729,15 @@ public final class ImGuiIO extends ImGuiStruct { IO->DeltaTime = deltaTime; */ + /** + * Mouse position, in pixels. Set to ImVec2(-FLT_MAX, -FLT_MAX) if mouse is unavailable (on another screen, etc.) + */ + public ImVec2 getMousePos() { + final ImVec2 value = new ImVec2(); + getMousePos(value); + return value; + } + /** * Mouse position, in pixels. Set to ImVec2(-FLT_MAX, -FLT_MAX) if mouse is unavailable (on another screen, etc.) */ @@ -1136,6 +1167,15 @@ public final class ImGuiIO extends ImGuiStruct { IO->MetricsActiveAllocations = metricsActiveAllocations; */ + /** + * Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta. + */ + public ImVec2 getMouseDelta() { + final ImVec2 value = new ImVec2(); + getMouseDelta(value); + return value; + } + /** * Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta. */ diff --git a/imgui-binding/src/main/java/imgui/ImGuiStyle.java b/imgui-binding/src/main/java/imgui/ImGuiStyle.java index 3b5170e..1b20b4e 100644 --- a/imgui-binding/src/main/java/imgui/ImGuiStyle.java +++ b/imgui-binding/src/main/java/imgui/ImGuiStyle.java @@ -47,6 +47,15 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { IMGUI_STYLE->Alpha = alpha; */ + /** + * Padding within a window. + */ + public ImVec2 getWindowPadding() { + final ImVec2 value = new ImVec2(); + getWindowPadding(value); + return value; + } + /** * Padding within a window. */ @@ -106,6 +115,15 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { IMGUI_STYLE->WindowBorderSize = windowBorderSize; */ + /** + * Minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints(). + */ + public ImVec2 getWindowMinSize() { + final ImVec2 value = new ImVec2(); + getWindowMinSize(value); + return value; + } + /** * Minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints(). */ @@ -135,6 +153,15 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { IMGUI_STYLE->WindowMinSize.y = y; */ + /** + * Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered. + */ + public ImVec2 getWindowTitleAlign() { + final ImVec2 value = new ImVec2(); + getWindowTitleAlign(value); + return value; + } + /** * Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered. */ @@ -234,6 +261,15 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { IMGUI_STYLE->PopupBorderSize = popupBorderSize; */ + /** + * Padding within a framed rectangle (used by most widgets). + */ + public ImVec2 getFramePadding() { + final ImVec2 value = new ImVec2(); + getFramePadding(value); + return value; + } + /** * Padding within a framed rectangle (used by most widgets). */ @@ -291,6 +327,15 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { IMGUI_STYLE->FrameBorderSize = frameBorderSize; */ + /** + * Horizontal and vertical spacing between widgets/lines. + */ + public ImVec2 getItemSpacing() { + final ImVec2 value = new ImVec2(); + getItemSpacing(value); + return value; + } + /** * Horizontal and vertical spacing between widgets/lines. */ @@ -320,6 +365,15 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { IMGUI_STYLE->ItemSpacing.y = y; */ + /** + * Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label). + */ + public ImVec2 getItemInnerSpacing() { + final ImVec2 value = new ImVec2(); + getItemInnerSpacing(value); + return value; + } + /** * Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label). */ @@ -349,6 +403,15 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { IMGUI_STYLE->ItemInnerSpacing.y = y; */ + /** + * Padding within a table cell. + */ + public ImVec2 getCellPadding() { + final ImVec2 value = new ImVec2(); + getCellPadding(value); + return value; + } + /** * Padding within a table cell. */ @@ -378,6 +441,16 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { IMGUI_STYLE->CellPadding.y = y; */ + /** + * Expand reactive bounding box for touch-based system where touch position is not accurate enough. + * Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much! + */ + public ImVec2 getTouchExtraPadding() { + final ImVec2 value = new ImVec2(); + getTouchExtraPadding(value); + return value; + } + /** * Expand reactive bounding box for touch-based system where touch position is not accurate enough. * Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much! @@ -567,6 +640,15 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { IMGUI_STYLE->ColorButtonPosition = colorButtonPosition; */ + /** + * Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered). + */ + public ImVec2 getButtonTextAlign() { + final ImVec2 value = new ImVec2(); + getButtonTextAlign(value); + return value; + } + /** * Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered). */ @@ -596,6 +678,16 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { IMGUI_STYLE->ButtonTextAlign.y = y; */ + /** + * Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). + * It's generally important to keep this left-aligned if you want to lay multiple items on a same line. + */ + public ImVec2 getSelectableTextAlign() { + final ImVec2 value = new ImVec2(); + getSelectableTextAlign(value); + return value; + } + /** * Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). * It's generally important to keep this left-aligned if you want to lay multiple items on a same line. @@ -629,6 +721,15 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { IMGUI_STYLE->SelectableTextAlign.y = y; */ + /** + * Window position are clamped to be visible within the display area by at least this amount. Only applies to regular windows. + */ + public ImVec2 getDisplayWindowPadding() { + final ImVec2 value = new ImVec2(); + getDisplayWindowPadding(value); + return value; + } + /** * Window position are clamped to be visible within the display area by at least this amount. Only applies to regular windows. */ @@ -658,6 +759,16 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { IMGUI_STYLE->DisplayWindowPadding.y = y; */ + /** + * If you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. + * Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly! + */ + public ImVec2 getDisplaySafeAreaPadding() { + final ImVec2 value = new ImVec2(); + getDisplaySafeAreaPadding(value); + return value; + } + /** * If you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. * Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly! @@ -821,6 +932,12 @@ public final class ImGuiStyle extends ImGuiStructDestroyable { } */ + public ImVec4 getColor(final int imGuiCol) { + final ImVec4 value = new ImVec4(); + getColor(imGuiCol, value); + return value; + } + public native void getColor(int imGuiCol, ImVec4 dstImVec4); /* Jni::ImVec4Cpy(env, IMGUI_STYLE->Colors[imGuiCol], dstImVec4); */ diff --git a/imgui-binding/src/main/java/imgui/ImGuiViewport.java b/imgui-binding/src/main/java/imgui/ImGuiViewport.java index 4f5cbf8..1cf4df2 100644 --- a/imgui-binding/src/main/java/imgui/ImGuiViewport.java +++ b/imgui-binding/src/main/java/imgui/ImGuiViewport.java @@ -72,6 +72,15 @@ public final class ImGuiViewport extends ImGuiStruct { return (getFlags() & flags) != 0; } + /** + * Main Area: Position of the viewport (the imgui coordinates are the same as OS desktop/native coordinates). + */ + public ImVec2 getPos() { + final ImVec2 value = new ImVec2(); + getPos(value); + return value; + } + /** * Main Area: Position of the viewport (the imgui coordinates are the same as OS desktop/native coordinates). */ @@ -100,6 +109,15 @@ public final class ImGuiViewport extends ImGuiStruct { IMGUI_VIEWPORT->Pos = ImVec2(x, y); */ + /** + * Main Area: Size of the viewport. + */ + public ImVec2 getSize() { + final ImVec2 value = new ImVec2(); + getSize(value); + return value; + } + /** * Main Area: Size of the viewport. */ @@ -128,6 +146,15 @@ public final class ImGuiViewport extends ImGuiStruct { IMGUI_VIEWPORT->Size = ImVec2(x, y); */ + /** + * Work Area: Position of the viewport minus task bars, menus bars, status bars. + */ + public ImVec2 getWorkPos() { + final ImVec2 value = new ImVec2(); + getWorkPos(value); + return value; + } + /** * Work Area: Position of the viewport minus task bars, menus bars, status bars. */ @@ -156,6 +183,15 @@ public final class ImGuiViewport extends ImGuiStruct { IMGUI_VIEWPORT->WorkPos = ImVec2(x, y); */ + /** + * Work Area: Size of the viewport minus task bars, menu bars, status bars. + */ + public ImVec2 getWorkSize() { + final ImVec2 value = new ImVec2(); + getWorkSize(value); + return value; + } + /** * Work Area: Size of the viewport minus task bars, menu bars, status bars. */ @@ -335,6 +371,12 @@ public final class ImGuiViewport extends ImGuiStruct { // Helpers + public ImVec2 getCenter() { + final ImVec2 value = new ImVec2(); + getCenter(value); + return value; + } + public native void getCenter(ImVec2 dstImVec2); /* Jni::ImVec2Cpy(env, IMGUI_VIEWPORT->GetCenter(), dstImVec2); */ @@ -347,6 +389,12 @@ public final class ImGuiViewport extends ImGuiStruct { return IMGUI_VIEWPORT->GetCenter().y; */ + public ImVec2 getWorkCenter() { + final ImVec2 value = new ImVec2(); + getWorkCenter(value); + return value; + } + public native void getWorkCenter(ImVec2 dstImVec2); /* Jni::ImVec2Cpy(env, IMGUI_VIEWPORT->GetWorkCenter(), dstImVec2); */ diff --git a/imgui-binding/src/main/java/imgui/extension/nodeditor/NodeEditorStyle.java b/imgui-binding/src/main/java/imgui/extension/nodeditor/NodeEditorStyle.java index 344afd8..267b12a 100644 --- a/imgui-binding/src/main/java/imgui/extension/nodeditor/NodeEditorStyle.java +++ b/imgui-binding/src/main/java/imgui/extension/nodeditor/NodeEditorStyle.java @@ -22,6 +22,13 @@ public final class NodeEditorStyle extends ImGuiStruct { #define IM_NODE_EDITOR_STYLE ((ed::Style*)STRUCT_PTR) */ + public ImVec4 getNodePadding() { + final ImVec4 value = new ImVec4(); + getNodePadding(value); + return value; + } + + public native void getNodePadding(ImVec4 dstImVec4); /* Jni::ImVec4Cpy(env, IM_NODE_EDITOR_STYLE->NodePadding, dstImVec4); */ @@ -89,6 +96,12 @@ public final class NodeEditorStyle extends ImGuiStruct { IM_NODE_EDITOR_STYLE->LinkStrength = linkStrength; */ + public ImVec2 getSourceDirection() { + final ImVec2 value = new ImVec2(); + getSourceDirection(value); + return value; + } + public native void getSourceDirection(ImVec2 dstImVec2); /* Jni::ImVec2Cpy(env, &IM_NODE_EDITOR_STYLE->SourceDirection, dstImVec2); */ @@ -106,6 +119,12 @@ public final class NodeEditorStyle extends ImGuiStruct { IM_NODE_EDITOR_STYLE->SourceDirection.y = y; */ + public ImVec2 getTargetDirection() { + final ImVec2 value = new ImVec2(); + getTargetDirection(value); + return value; + } + public native void getTargetDirection(ImVec2 dstImVec2); /* Jni::ImVec2Cpy(env, &IM_NODE_EDITOR_STYLE->TargetDirection, dstImVec2); */ @@ -156,6 +175,12 @@ public final class NodeEditorStyle extends ImGuiStruct { IM_NODE_EDITOR_STYLE->FlowDuration = flowDuration; */ + public ImVec2 getPivotAlignment() { + final ImVec2 value = new ImVec2(); + getPivotAlignment(value); + return value; + } + public native void getPivotAlignment(ImVec2 dstImVec2); /* Jni::ImVec2Cpy(env, &IM_NODE_EDITOR_STYLE->PivotAlignment, dstImVec2); */ @@ -173,6 +198,12 @@ public final class NodeEditorStyle extends ImGuiStruct { IM_NODE_EDITOR_STYLE->PivotAlignment.y = y; */ + public ImVec2 getPivotSize() { + final ImVec2 value = new ImVec2(); + getPivotSize(value); + return value; + } + public native void getPivotSize(ImVec2 dstImVec2); /* Jni::ImVec2Cpy(env, &IM_NODE_EDITOR_STYLE->PivotSize, dstImVec2); */ @@ -190,6 +221,12 @@ public final class NodeEditorStyle extends ImGuiStruct { IM_NODE_EDITOR_STYLE->PivotSize.y = y; */ + public ImVec2 getPivotScale() { + final ImVec2 value = new ImVec2(); + getPivotScale(value); + return value; + } + public native void getPivotScale(ImVec2 dstImVec2); /* Jni::ImVec2Cpy(env, &IM_NODE_EDITOR_STYLE->PivotScale, dstImVec2); */ @@ -273,6 +310,12 @@ public final class NodeEditorStyle extends ImGuiStruct { } */ + public ImVec4 getColor(final int styleColor) { + final ImVec4 value = new ImVec4(); + getColor(styleColor, value); + return value; + } + public native void getColor(int styleColor, ImVec4 dstImVec4); /* Jni::ImVec4Cpy(env, IM_NODE_EDITOR_STYLE->Colors[styleColor], dstImVec4); */ diff --git a/imgui-binding/src/main/java/imgui/internal/ImGui.java b/imgui-binding/src/main/java/imgui/internal/ImGui.java index 0e62340..f90461f 100644 --- a/imgui-binding/src/main/java/imgui/internal/ImGui.java +++ b/imgui-binding/src/main/java/imgui/internal/ImGui.java @@ -16,6 +16,12 @@ public final class ImGui extends imgui.ImGui { // Basic Helpers for widget code + public static ImVec2 calcItemSize(float sizeX, float sizeY, float defaultW, float defaultH) { + final ImVec2 value = new ImVec2(); + calcItemSize(sizeX, sizeY, defaultW, defaultH, value); + return value; + } + public static native void calcItemSize(float sizeX, float sizeY, float defaultW, float defaultH, ImVec2 dstImVec2); /* Jni::ImVec2Cpy(env, ImGui::CalcItemSize(ImVec2(sizeX, sizeY), defaultW, defaultH), dstImVec2); */ diff --git a/imgui-binding/src/main/java/imgui/internal/ImGuiDockNode.java b/imgui-binding/src/main/java/imgui/internal/ImGuiDockNode.java index aae7678..31895e1 100644 --- a/imgui-binding/src/main/java/imgui/internal/ImGuiDockNode.java +++ b/imgui-binding/src/main/java/imgui/internal/ImGuiDockNode.java @@ -186,6 +186,15 @@ public final class ImGuiDockNode extends ImGuiStruct { IMGUI_DOCK_NODE->WindowClass = *((ImGuiWindowClass*)imGuiWindowClassPtr); */ + /** + * Current position + */ + public ImVec2 getPos() { + final ImVec2 value = new ImVec2(); + getPos(value); + return value; + } + /** * Current position */ @@ -215,6 +224,15 @@ public final class ImGuiDockNode extends ImGuiStruct { IMGUI_DOCK_NODE->Pos.y = y; */ + /** + * Current size + */ + public ImVec2 getSize() { + final ImVec2 value = new ImVec2(); + getSize(value); + return value; + } + /** * Current size */ @@ -244,6 +262,15 @@ public final class ImGuiDockNode extends ImGuiStruct { IMGUI_DOCK_NODE->Size.y = y; */ + /** + * [Split node only] Last explicitly written-to size (overridden when using a splitter affecting the node), used to calculate Size. + */ + public ImVec2 getSizeRef() { + final ImVec2 value = new ImVec2(); + getSizeRef(value); + return value; + } + /** * [Split node only] Last explicitly written-to size (overridden when using a splitter affecting the node), used to calculate Size. */ diff --git a/imgui-binding/src/main/java/imgui/internal/ImRect.java b/imgui-binding/src/main/java/imgui/internal/ImRect.java index 902c72d..05a2ef9 100644 --- a/imgui-binding/src/main/java/imgui/internal/ImRect.java +++ b/imgui-binding/src/main/java/imgui/internal/ImRect.java @@ -45,7 +45,7 @@ public final class ImRect implements Cloneable { max.x = value.max.x; max.y = value.max.y; } - + @Override public String toString() { return "ImRect{"