feat(api): extend available API for imgui.internal.ImGui (#294)
Extending available API for imgui.internal.ImGui class. This adds multiple new methods to manipulate windows, fonts etc.
This commit is contained in:
1 parent
80ea84b345
commit
5dab4bce55
4 files changed
+1193
-18
No files matched your search
@@ -1,5 +1,9 @@
|
||||
package imgui.internal;
|
||||
|
||||
import imgui.ImDrawList;
|
||||
import imgui.ImFont;
|
||||
import imgui.ImGuiPlatformMonitor;
|
||||
import imgui.ImGuiViewport;
|
||||
import imgui.ImVec2;
|
||||
import imgui.type.ImFloat;
|
||||
import imgui.type.ImInt;
|
||||
@@ -21,8 +25,800 @@ public final class ImGui extends imgui.ImGui {
|
||||
Jni::InitInternal(env);
|
||||
*/
|
||||
|
||||
// Windows
|
||||
// We should always have a CurrentWindow in the stack (there is an implicit "Debug" window)
|
||||
// If this ever crash because g.CurrentWindow is NULL it means that either
|
||||
// - ImGui::NewFrame() has never been called, which is illegal.
|
||||
// - You are calling ImGui functions after ImGui::EndFrame()/ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal.
|
||||
|
||||
public static ImGuiWindow getCurrentWindowRead() {
|
||||
return new ImGuiWindow(nGetCurrentWindowRead());
|
||||
}
|
||||
|
||||
private static native long nGetCurrentWindowRead(); /*
|
||||
return (uintptr_t)ImGui::GetCurrentWindowRead();
|
||||
*/
|
||||
|
||||
public static ImGuiWindow getCurrentWindow() {
|
||||
return new ImGuiWindow(nGetCurrentWindow());
|
||||
}
|
||||
|
||||
private static native long nGetCurrentWindow(); /*
|
||||
return (uintptr_t)ImGui::GetCurrentWindow();
|
||||
*/
|
||||
|
||||
public static ImGuiWindow findWindowByID(final int id) {
|
||||
return new ImGuiWindow(nFindWindowByID(id));
|
||||
}
|
||||
|
||||
private static native long nFindWindowByID(int id); /*
|
||||
return (uintptr_t)ImGui::FindWindowByID(id);
|
||||
*/
|
||||
|
||||
public static ImGuiWindow findWindowByName(final String name) {
|
||||
return new ImGuiWindow(nFindWindowByName(name));
|
||||
}
|
||||
|
||||
private static native long nFindWindowByName(String obj_name); /*MANUAL
|
||||
auto name = obj_name == NULL ? NULL : (char*)env->GetStringUTFChars(obj_name, JNI_FALSE);
|
||||
auto _result = (uintptr_t)ImGui::FindWindowByName(name);
|
||||
if (name != NULL) env->ReleaseStringUTFChars(obj_name, name);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
public static void updateWindowParentAndRootLinks(final ImGuiWindow window, final int flags, final ImGuiWindow parentWindow) {
|
||||
nUpdateWindowParentAndRootLinks(window.ptr, flags, parentWindow.ptr);
|
||||
}
|
||||
|
||||
private static native void nUpdateWindowParentAndRootLinks(long window, int flags, long parentWindow); /*
|
||||
ImGui::UpdateWindowParentAndRootLinks(reinterpret_cast<ImGuiWindow*>(window), flags, reinterpret_cast<ImGuiWindow*>(parentWindow));
|
||||
*/
|
||||
|
||||
public static ImVec2 calcWindowNextAutoFitSize(final ImGuiWindow window) {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nCalcWindowNextAutoFitSize(dst, window.ptr);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static float calcWindowNextAutoFitSizeX(final ImGuiWindow window) {
|
||||
return nCalcWindowNextAutoFitSizeX(window.ptr);
|
||||
}
|
||||
|
||||
public static float calcWindowNextAutoFitSizeY(final ImGuiWindow window) {
|
||||
return nCalcWindowNextAutoFitSizeY(window.ptr);
|
||||
}
|
||||
|
||||
public static void calcWindowNextAutoFitSize(final ImVec2 dst, final ImGuiWindow window) {
|
||||
nCalcWindowNextAutoFitSize(dst, window.ptr);
|
||||
}
|
||||
|
||||
private static native void nCalcWindowNextAutoFitSize(ImVec2 dst, long window); /*
|
||||
Jni::ImVec2Cpy(env, ImGui::CalcWindowNextAutoFitSize(reinterpret_cast<ImGuiWindow*>(window)), dst);
|
||||
*/
|
||||
|
||||
private static native float nCalcWindowNextAutoFitSizeX(long window); /*
|
||||
return ImGui::CalcWindowNextAutoFitSize(reinterpret_cast<ImGuiWindow*>(window)).x;
|
||||
*/
|
||||
|
||||
private static native float nCalcWindowNextAutoFitSizeY(long window); /*
|
||||
return ImGui::CalcWindowNextAutoFitSize(reinterpret_cast<ImGuiWindow*>(window)).y;
|
||||
*/
|
||||
|
||||
public static boolean isWindowChildOf(final ImGuiWindow window, final ImGuiWindow potentialParent, final boolean popupHierarchy, final boolean dockHierarchy) {
|
||||
return nIsWindowChildOf(window.ptr, potentialParent.ptr, popupHierarchy, dockHierarchy);
|
||||
}
|
||||
|
||||
private static native boolean nIsWindowChildOf(long window, long potentialParent, boolean popupHierarchy, boolean dockHierarchy); /*
|
||||
return ImGui::IsWindowChildOf(reinterpret_cast<ImGuiWindow*>(window), reinterpret_cast<ImGuiWindow*>(potentialParent), popupHierarchy, dockHierarchy);
|
||||
*/
|
||||
|
||||
public static boolean isWindowWithinBeginStackOf(final ImGuiWindow window, final ImGuiWindow potentialParent) {
|
||||
return nIsWindowWithinBeginStackOf(window.ptr, potentialParent.ptr);
|
||||
}
|
||||
|
||||
private static native boolean nIsWindowWithinBeginStackOf(long window, long potentialParent); /*
|
||||
return ImGui::IsWindowWithinBeginStackOf(reinterpret_cast<ImGuiWindow*>(window), reinterpret_cast<ImGuiWindow*>(potentialParent));
|
||||
*/
|
||||
|
||||
public static boolean isWindowAbove(final ImGuiWindow potentialAbove, final ImGuiWindow potentialBelow) {
|
||||
return nIsWindowAbove(potentialAbove.ptr, potentialBelow.ptr);
|
||||
}
|
||||
|
||||
private static native boolean nIsWindowAbove(long potentialAbove, long potentialBelow); /*
|
||||
return ImGui::IsWindowAbove(reinterpret_cast<ImGuiWindow*>(potentialAbove), reinterpret_cast<ImGuiWindow*>(potentialBelow));
|
||||
*/
|
||||
|
||||
public static boolean isWindowNavFocusable(final ImGuiWindow window) {
|
||||
return nIsWindowNavFocusable(window.ptr);
|
||||
}
|
||||
|
||||
private static native boolean nIsWindowNavFocusable(long window); /*
|
||||
return ImGui::IsWindowNavFocusable(reinterpret_cast<ImGuiWindow*>(window));
|
||||
*/
|
||||
|
||||
public static void setWindowPos(final ImGuiWindow window, final ImVec2 pos) {
|
||||
nSetWindowPos(window.ptr, pos.x, pos.y);
|
||||
}
|
||||
|
||||
public static void setWindowPos(final ImGuiWindow window, final float posX, final float posY) {
|
||||
nSetWindowPos(window.ptr, posX, posY);
|
||||
}
|
||||
|
||||
public static void setWindowPos(final ImGuiWindow window, final ImVec2 pos, final int cond) {
|
||||
nSetWindowPos(window.ptr, pos.x, pos.y, cond);
|
||||
}
|
||||
|
||||
public static void setWindowPos(final ImGuiWindow window, final float posX, final float posY, final int cond) {
|
||||
nSetWindowPos(window.ptr, posX, posY, cond);
|
||||
}
|
||||
|
||||
private static native void nSetWindowPos(long window, float posX, float posY); /*MANUAL
|
||||
ImVec2 pos = ImVec2(posX, posY);
|
||||
ImGui::SetWindowPos(reinterpret_cast<ImGuiWindow*>(window), pos);
|
||||
*/
|
||||
|
||||
private static native void nSetWindowPos(long window, float posX, float posY, int cond); /*MANUAL
|
||||
ImVec2 pos = ImVec2(posX, posY);
|
||||
ImGui::SetWindowPos(reinterpret_cast<ImGuiWindow*>(window), pos, cond);
|
||||
*/
|
||||
|
||||
public static void setWindowSize(final ImGuiWindow window, final ImVec2 size) {
|
||||
nSetWindowSize(window.ptr, size.x, size.y);
|
||||
}
|
||||
|
||||
public static void setWindowSize(final ImGuiWindow window, final float sizeX, final float sizeY) {
|
||||
nSetWindowSize(window.ptr, sizeX, sizeY);
|
||||
}
|
||||
|
||||
public static void setWindowSize(final ImGuiWindow window, final ImVec2 size, final int cond) {
|
||||
nSetWindowSize(window.ptr, size.x, size.y, cond);
|
||||
}
|
||||
|
||||
public static void setWindowSize(final ImGuiWindow window, final float sizeX, final float sizeY, final int cond) {
|
||||
nSetWindowSize(window.ptr, sizeX, sizeY, cond);
|
||||
}
|
||||
|
||||
private static native void nSetWindowSize(long window, float sizeX, float sizeY); /*MANUAL
|
||||
ImVec2 size = ImVec2(sizeX, sizeY);
|
||||
ImGui::SetWindowSize(reinterpret_cast<ImGuiWindow*>(window), size);
|
||||
*/
|
||||
|
||||
private static native void nSetWindowSize(long window, float sizeX, float sizeY, int cond); /*MANUAL
|
||||
ImVec2 size = ImVec2(sizeX, sizeY);
|
||||
ImGui::SetWindowSize(reinterpret_cast<ImGuiWindow*>(window), size, cond);
|
||||
*/
|
||||
|
||||
public static void setWindowCollapsed(final ImGuiWindow window, final boolean collapsed) {
|
||||
nSetWindowCollapsed(window.ptr, collapsed);
|
||||
}
|
||||
|
||||
public static void setWindowCollapsed(final ImGuiWindow window, final boolean collapsed, final int cond) {
|
||||
nSetWindowCollapsed(window.ptr, collapsed, cond);
|
||||
}
|
||||
|
||||
private static native void nSetWindowCollapsed(long window, boolean collapsed); /*
|
||||
ImGui::SetWindowCollapsed(reinterpret_cast<ImGuiWindow*>(window), static_cast<bool>(collapsed));
|
||||
*/
|
||||
|
||||
private static native void nSetWindowCollapsed(long window, boolean collapsed, int cond); /*
|
||||
ImGui::SetWindowCollapsed(reinterpret_cast<ImGuiWindow*>(window), static_cast<bool>(collapsed), cond);
|
||||
*/
|
||||
|
||||
public static void setWindowHitTestHole(final ImGuiWindow window, final ImVec2 pos, final ImVec2 size) {
|
||||
nSetWindowHitTestHole(window.ptr, pos.x, pos.y, size.x, size.y);
|
||||
}
|
||||
|
||||
public static void setWindowHitTestHole(final ImGuiWindow window, final float posX, final float posY, final float sizeX, final float sizeY) {
|
||||
nSetWindowHitTestHole(window.ptr, posX, posY, sizeX, sizeY);
|
||||
}
|
||||
|
||||
private static native void nSetWindowHitTestHole(long window, float posX, float posY, float sizeX, float sizeY); /*MANUAL
|
||||
ImVec2 pos = ImVec2(posX, posY);
|
||||
ImVec2 size = ImVec2(sizeX, sizeY);
|
||||
ImGui::SetWindowHitTestHole(reinterpret_cast<ImGuiWindow*>(window), pos, size);
|
||||
*/
|
||||
|
||||
public static ImRect windowRectAbsToRel(final ImGuiWindow window, final ImRect r) {
|
||||
final ImRect dst = new ImRect();
|
||||
nWindowRectAbsToRel(dst, window.ptr, r.min.x, r.min.y, r.max.x, r.max.y);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static ImRect windowRectAbsToRel(final ImGuiWindow window, final float rMinX, final float rMinY, final float rMaxX, final float rMaxY) {
|
||||
final ImRect dst = new ImRect();
|
||||
nWindowRectAbsToRel(dst, window.ptr, rMinX, rMinY, rMaxX, rMaxY);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static void windowRectAbsToRel(final ImRect dst, final ImGuiWindow window, final ImRect r) {
|
||||
nWindowRectAbsToRel(dst, window.ptr, r.min.x, r.min.y, r.max.x, r.max.y);
|
||||
}
|
||||
|
||||
public static void windowRectAbsToRel(final ImRect dst, final ImGuiWindow window, final float rMinX, final float rMinY, final float rMaxX, final float rMaxY) {
|
||||
nWindowRectAbsToRel(dst, window.ptr, rMinX, rMinY, rMaxX, rMaxY);
|
||||
}
|
||||
|
||||
private static native void nWindowRectAbsToRel(ImRect dst, long window, float rMinX, float rMinY, float rMaxX, float rMaxY); /*
|
||||
Jni::ImRectCpy(env, ImGui::WindowRectAbsToRel(reinterpret_cast<ImGuiWindow*>(window), ImRect(rMinX, rMinY, rMaxX, rMaxY)), dst);
|
||||
*/
|
||||
|
||||
public static ImRect windowRectRelToAbs(final ImGuiWindow window, final ImRect r) {
|
||||
final ImRect dst = new ImRect();
|
||||
nWindowRectRelToAbs(dst, window.ptr, r.min.x, r.min.y, r.max.x, r.max.y);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static ImRect windowRectRelToAbs(final ImGuiWindow window, final float rMinX, final float rMinY, final float rMaxX, final float rMaxY) {
|
||||
final ImRect dst = new ImRect();
|
||||
nWindowRectRelToAbs(dst, window.ptr, rMinX, rMinY, rMaxX, rMaxY);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static void windowRectRelToAbs(final ImRect dst, final ImGuiWindow window, final ImRect r) {
|
||||
nWindowRectRelToAbs(dst, window.ptr, r.min.x, r.min.y, r.max.x, r.max.y);
|
||||
}
|
||||
|
||||
public static void windowRectRelToAbs(final ImRect dst, final ImGuiWindow window, final float rMinX, final float rMinY, final float rMaxX, final float rMaxY) {
|
||||
nWindowRectRelToAbs(dst, window.ptr, rMinX, rMinY, rMaxX, rMaxY);
|
||||
}
|
||||
|
||||
private static native void nWindowRectRelToAbs(ImRect dst, long window, float rMinX, float rMinY, float rMaxX, float rMaxY); /*
|
||||
Jni::ImRectCpy(env, ImGui::WindowRectRelToAbs(reinterpret_cast<ImGuiWindow*>(window), ImRect(rMinX, rMinY, rMaxX, rMaxY)), dst);
|
||||
*/
|
||||
|
||||
|
||||
// Windows: Display Order and Focus Order
|
||||
|
||||
public static void focusWindow(final ImGuiWindow window) {
|
||||
nFocusWindow(window.ptr);
|
||||
}
|
||||
|
||||
private static native void nFocusWindow(long window); /*
|
||||
ImGui::FocusWindow(reinterpret_cast<ImGuiWindow*>(window));
|
||||
*/
|
||||
|
||||
public static void focusTopMostWindowUnderOne(final ImGuiWindow underThisWindow, final ImGuiWindow ignoreWindow) {
|
||||
nFocusTopMostWindowUnderOne(underThisWindow.ptr, ignoreWindow.ptr);
|
||||
}
|
||||
|
||||
private static native void nFocusTopMostWindowUnderOne(long underThisWindow, long ignoreWindow); /*
|
||||
ImGui::FocusTopMostWindowUnderOne(reinterpret_cast<ImGuiWindow*>(underThisWindow), reinterpret_cast<ImGuiWindow*>(ignoreWindow));
|
||||
*/
|
||||
|
||||
public static void bringWindowToFocusFront(final ImGuiWindow window) {
|
||||
nBringWindowToFocusFront(window.ptr);
|
||||
}
|
||||
|
||||
private static native void nBringWindowToFocusFront(long window); /*
|
||||
ImGui::BringWindowToFocusFront(reinterpret_cast<ImGuiWindow*>(window));
|
||||
*/
|
||||
|
||||
public static void bringWindowToDisplayFront(final ImGuiWindow window) {
|
||||
nBringWindowToDisplayFront(window.ptr);
|
||||
}
|
||||
|
||||
private static native void nBringWindowToDisplayFront(long window); /*
|
||||
ImGui::BringWindowToDisplayFront(reinterpret_cast<ImGuiWindow*>(window));
|
||||
*/
|
||||
|
||||
public static void bringWindowToDisplayBack(final ImGuiWindow window) {
|
||||
nBringWindowToDisplayBack(window.ptr);
|
||||
}
|
||||
|
||||
private static native void nBringWindowToDisplayBack(long window); /*
|
||||
ImGui::BringWindowToDisplayBack(reinterpret_cast<ImGuiWindow*>(window));
|
||||
*/
|
||||
|
||||
public static void bringWindowToDisplayBehind(final ImGuiWindow window, final ImGuiWindow aboveWindow) {
|
||||
nBringWindowToDisplayBehind(window.ptr, aboveWindow.ptr);
|
||||
}
|
||||
|
||||
private static native void nBringWindowToDisplayBehind(long window, long aboveWindow); /*
|
||||
ImGui::BringWindowToDisplayBehind(reinterpret_cast<ImGuiWindow*>(window), reinterpret_cast<ImGuiWindow*>(aboveWindow));
|
||||
*/
|
||||
|
||||
public static int findWindowDisplayIndex(final ImGuiWindow window) {
|
||||
return nFindWindowDisplayIndex(window.ptr);
|
||||
}
|
||||
|
||||
private static native int nFindWindowDisplayIndex(long window); /*
|
||||
return ImGui::FindWindowDisplayIndex(reinterpret_cast<ImGuiWindow*>(window));
|
||||
*/
|
||||
|
||||
public static ImGuiWindow findBottomMostVisibleWindowWithinBeginStack(final ImGuiWindow window) {
|
||||
return new ImGuiWindow(nFindBottomMostVisibleWindowWithinBeginStack(window.ptr));
|
||||
}
|
||||
|
||||
private static native long nFindBottomMostVisibleWindowWithinBeginStack(long window); /*
|
||||
return (uintptr_t)ImGui::FindBottomMostVisibleWindowWithinBeginStack(reinterpret_cast<ImGuiWindow*>(window));
|
||||
*/
|
||||
|
||||
// Fonts, drawing
|
||||
|
||||
public static void setCurrentFont(final ImFont font) {
|
||||
nSetCurrentFont(font.ptr);
|
||||
}
|
||||
|
||||
private static native void nSetCurrentFont(long font); /*
|
||||
ImGui::SetCurrentFont(reinterpret_cast<ImFont*>(font));
|
||||
*/
|
||||
|
||||
public static ImFont getDefaultFont() {
|
||||
return new ImFont(nGetDefaultFont());
|
||||
}
|
||||
|
||||
private static native long nGetDefaultFont(); /*
|
||||
return (uintptr_t)ImGui::GetDefaultFont();
|
||||
*/
|
||||
|
||||
public static ImDrawList getForegroundDrawList(final ImGuiWindow window) {
|
||||
return new ImDrawList(nGetForegroundDrawList(window.ptr));
|
||||
}
|
||||
|
||||
private static native long nGetForegroundDrawList(long window); /*
|
||||
return (uintptr_t)ImGui::GetForegroundDrawList(reinterpret_cast<ImGuiWindow*>(window));
|
||||
*/
|
||||
|
||||
// Init
|
||||
|
||||
public static void initialize(final ImGuiContext context) {
|
||||
nInitialize(context.ptr);
|
||||
}
|
||||
|
||||
private static native void nInitialize(long context); /*
|
||||
ImGui::Initialize(reinterpret_cast<ImGuiContext*>(context));
|
||||
*/
|
||||
|
||||
public static void shutdown(final ImGuiContext context) {
|
||||
nShutdown(context.ptr);
|
||||
}
|
||||
|
||||
private static native void nShutdown(long context); /*
|
||||
ImGui::Shutdown(reinterpret_cast<ImGuiContext*>(context));
|
||||
*/
|
||||
|
||||
// NewFrame
|
||||
|
||||
public static void updateInputEvents(final boolean trickleFastInputs) {
|
||||
nUpdateInputEvents(trickleFastInputs);
|
||||
}
|
||||
|
||||
private static native void nUpdateInputEvents(boolean trickleFastInputs); /*
|
||||
ImGui::UpdateInputEvents(trickleFastInputs);
|
||||
*/
|
||||
|
||||
public static void updateHoveredWindowAndCaptureFlags() {
|
||||
nUpdateHoveredWindowAndCaptureFlags();
|
||||
}
|
||||
|
||||
private static native void nUpdateHoveredWindowAndCaptureFlags(); /*
|
||||
ImGui::UpdateHoveredWindowAndCaptureFlags();
|
||||
*/
|
||||
|
||||
public static void startMouseMovingWindow(final ImGuiWindow window) {
|
||||
nStartMouseMovingWindow(window.ptr);
|
||||
}
|
||||
|
||||
private static native void nStartMouseMovingWindow(long window); /*
|
||||
ImGui::StartMouseMovingWindow(reinterpret_cast<ImGuiWindow*>(window));
|
||||
*/
|
||||
|
||||
public static void startMouseMovingWindowOrNode(final ImGuiWindow window, final ImGuiDockNode node, final boolean undockFloatingNode) {
|
||||
nStartMouseMovingWindowOrNode(window.ptr, node.ptr, undockFloatingNode);
|
||||
}
|
||||
|
||||
private static native void nStartMouseMovingWindowOrNode(long window, long node, boolean undockFloatingNode); /*
|
||||
ImGui::StartMouseMovingWindowOrNode(reinterpret_cast<ImGuiWindow*>(window), reinterpret_cast<ImGuiDockNode*>(node), undockFloatingNode);
|
||||
*/
|
||||
|
||||
public static void updateMouseMovingWindowNewFrame() {
|
||||
nUpdateMouseMovingWindowNewFrame();
|
||||
}
|
||||
|
||||
private static native void nUpdateMouseMovingWindowNewFrame(); /*
|
||||
ImGui::UpdateMouseMovingWindowNewFrame();
|
||||
*/
|
||||
|
||||
public static void updateMouseMovingWindowEndFrame() {
|
||||
nUpdateMouseMovingWindowEndFrame();
|
||||
}
|
||||
|
||||
private static native void nUpdateMouseMovingWindowEndFrame(); /*
|
||||
ImGui::UpdateMouseMovingWindowEndFrame();
|
||||
*/
|
||||
|
||||
// TODO: Generic context hooks
|
||||
|
||||
// Viewports
|
||||
|
||||
public static ImGuiPlatformMonitor getViewportPlatformMonitor(final ImGuiViewport viewport) {
|
||||
return new ImGuiPlatformMonitor(nGetViewportPlatformMonitor(viewport.ptr));
|
||||
}
|
||||
|
||||
private static native long nGetViewportPlatformMonitor(long viewport); /*
|
||||
return (uintptr_t)ImGui::GetViewportPlatformMonitor(reinterpret_cast<ImGuiViewport*>(viewport));
|
||||
*/
|
||||
|
||||
// TODO: Settings
|
||||
|
||||
// Scrolling
|
||||
|
||||
public static void setNextWindowScroll(final ImVec2 scroll) {
|
||||
nSetNextWindowScroll(scroll.x, scroll.y);
|
||||
}
|
||||
|
||||
public static void setNextWindowScroll(final float scrollX, final float scrollY) {
|
||||
nSetNextWindowScroll(scrollX, scrollY);
|
||||
}
|
||||
|
||||
private static native void nSetNextWindowScroll(float scrollX, float scrollY); /*MANUAL
|
||||
ImVec2 scroll = ImVec2(scrollX, scrollY);
|
||||
ImGui::SetNextWindowScroll(scroll);
|
||||
*/
|
||||
|
||||
public static void setScrollX(final ImGuiWindow window, final float scrollX) {
|
||||
nSetScrollX(window.ptr, scrollX);
|
||||
}
|
||||
|
||||
private static native void nSetScrollX(long window, float scrollX); /*
|
||||
ImGui::SetScrollX(reinterpret_cast<ImGuiWindow*>(window), scrollX);
|
||||
*/
|
||||
|
||||
public static void setScrollY(final ImGuiWindow window, final float scrollY) {
|
||||
nSetScrollY(window.ptr, scrollY);
|
||||
}
|
||||
|
||||
private static native void nSetScrollY(long window, float scrollY); /*
|
||||
ImGui::SetScrollY(reinterpret_cast<ImGuiWindow*>(window), scrollY);
|
||||
*/
|
||||
|
||||
public static void setScrollFromPosX(final ImGuiWindow window, final float localX, final float centerXRatio) {
|
||||
nSetScrollFromPosX(window.ptr, localX, centerXRatio);
|
||||
}
|
||||
|
||||
private static native void nSetScrollFromPosX(long window, float localX, float centerXRatio); /*
|
||||
ImGui::SetScrollFromPosX(reinterpret_cast<ImGuiWindow*>(window), localX, centerXRatio);
|
||||
*/
|
||||
|
||||
public static void setScrollFromPosY(final ImGuiWindow window, final float localY, final float centerYRatio) {
|
||||
nSetScrollFromPosY(window.ptr, localY, centerYRatio);
|
||||
}
|
||||
|
||||
private static native void nSetScrollFromPosY(long window, float localY, float centerYRatio); /*
|
||||
ImGui::SetScrollFromPosY(reinterpret_cast<ImGuiWindow*>(window), localY, centerYRatio);
|
||||
*/
|
||||
|
||||
// Early work-in-progress API (ScrollToItem() will become public)
|
||||
|
||||
public static void scrollToItem() {
|
||||
nScrollToItem();
|
||||
}
|
||||
|
||||
public static void scrollToItem(final int flags) {
|
||||
nScrollToItem(flags);
|
||||
}
|
||||
|
||||
private static native void nScrollToItem(); /*
|
||||
ImGui::ScrollToItem();
|
||||
*/
|
||||
|
||||
private static native void nScrollToItem(int flags); /*
|
||||
ImGui::ScrollToItem(flags);
|
||||
*/
|
||||
|
||||
public static void scrollToRect(final ImGuiWindow window, final ImRect rect) {
|
||||
nScrollToRect(window.ptr, rect.min.x, rect.min.y, rect.max.x, rect.max.y);
|
||||
}
|
||||
|
||||
public static void scrollToRect(final ImGuiWindow window, final float rectMinX, final float rectMinY, final float rectMaxX, final float rectMaxY) {
|
||||
nScrollToRect(window.ptr, rectMinX, rectMinY, rectMaxX, rectMaxY);
|
||||
}
|
||||
|
||||
public static void scrollToRect(final ImGuiWindow window, final ImRect rect, final int flags) {
|
||||
nScrollToRect(window.ptr, rect.min.x, rect.min.y, rect.max.x, rect.max.y, flags);
|
||||
}
|
||||
|
||||
public static void scrollToRect(final ImGuiWindow window, final float rectMinX, final float rectMinY, final float rectMaxX, final float rectMaxY, final int flags) {
|
||||
nScrollToRect(window.ptr, rectMinX, rectMinY, rectMaxX, rectMaxY, flags);
|
||||
}
|
||||
|
||||
private static native void nScrollToRect(long window, float rectMinX, float rectMinY, float rectMaxX, float rectMaxY); /*
|
||||
ImGui::ScrollToRect(reinterpret_cast<ImGuiWindow*>(window), ImRect(rectMinX, rectMinY, rectMaxX, rectMaxY));
|
||||
*/
|
||||
|
||||
private static native void nScrollToRect(long window, float rectMinX, float rectMinY, float rectMaxX, float rectMaxY, int flags); /*
|
||||
ImGui::ScrollToRect(reinterpret_cast<ImGuiWindow*>(window), ImRect(rectMinX, rectMinY, rectMaxX, rectMaxY), flags);
|
||||
*/
|
||||
|
||||
public static ImVec2 scrollToRectEx(final ImGuiWindow window, final ImRect rect) {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nScrollToRectEx(dst, window.ptr, rect.min.x, rect.min.y, rect.max.x, rect.max.y);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static ImVec2 scrollToRectEx(final ImGuiWindow window, final float rectMinX, final float rectMinY, final float rectMaxX, final float rectMaxY) {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nScrollToRectEx(dst, window.ptr, rectMinX, rectMinY, rectMaxX, rectMaxY);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static float scrollToRectExX(final ImGuiWindow window, final ImRect rect) {
|
||||
return nScrollToRectExX(window.ptr, rect.min.x, rect.min.y, rect.max.x, rect.max.y);
|
||||
}
|
||||
|
||||
public static float scrollToRectExY(final ImGuiWindow window, final ImRect rect) {
|
||||
return nScrollToRectExY(window.ptr, rect.min.x, rect.min.y, rect.max.x, rect.max.y);
|
||||
}
|
||||
|
||||
public static void scrollToRectEx(final ImVec2 dst, final ImGuiWindow window, final ImRect rect) {
|
||||
nScrollToRectEx(dst, window.ptr, rect.min.x, rect.min.y, rect.max.x, rect.max.y);
|
||||
}
|
||||
|
||||
public static void scrollToRectEx(final ImVec2 dst, final ImGuiWindow window, final float rectMinX, final float rectMinY, final float rectMaxX, final float rectMaxY) {
|
||||
nScrollToRectEx(dst, window.ptr, rectMinX, rectMinY, rectMaxX, rectMaxY);
|
||||
}
|
||||
|
||||
public static ImVec2 scrollToRectEx(final ImGuiWindow window, final ImRect rect, final int flags) {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nScrollToRectEx(dst, window.ptr, rect.min.x, rect.min.y, rect.max.x, rect.max.y, flags);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static ImVec2 scrollToRectEx(final ImGuiWindow window, final float rectMinX, final float rectMinY, final float rectMaxX, final float rectMaxY, final int flags) {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nScrollToRectEx(dst, window.ptr, rectMinX, rectMinY, rectMaxX, rectMaxY, flags);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static float scrollToRectExX(final ImGuiWindow window, final ImRect rect, final int flags) {
|
||||
return nScrollToRectExX(window.ptr, rect.min.x, rect.min.y, rect.max.x, rect.max.y, flags);
|
||||
}
|
||||
|
||||
public static float scrollToRectExY(final ImGuiWindow window, final ImRect rect, final int flags) {
|
||||
return nScrollToRectExY(window.ptr, rect.min.x, rect.min.y, rect.max.x, rect.max.y, flags);
|
||||
}
|
||||
|
||||
public static void scrollToRectEx(final ImVec2 dst, final ImGuiWindow window, final ImRect rect, final int flags) {
|
||||
nScrollToRectEx(dst, window.ptr, rect.min.x, rect.min.y, rect.max.x, rect.max.y, flags);
|
||||
}
|
||||
|
||||
public static void scrollToRectEx(final ImVec2 dst, final ImGuiWindow window, final float rectMinX, final float rectMinY, final float rectMaxX, final float rectMaxY, final int flags) {
|
||||
nScrollToRectEx(dst, window.ptr, rectMinX, rectMinY, rectMaxX, rectMaxY, flags);
|
||||
}
|
||||
|
||||
private static native void nScrollToRectEx(ImVec2 dst, long window, float rectMinX, float rectMinY, float rectMaxX, float rectMaxY); /*
|
||||
Jni::ImVec2Cpy(env, ImGui::ScrollToRectEx(reinterpret_cast<ImGuiWindow*>(window), ImRect(rectMinX, rectMinY, rectMaxX, rectMaxY)), dst);
|
||||
*/
|
||||
|
||||
private static native float nScrollToRectExX(long window, float rectMinX, float rectMinY, float rectMaxX, float rectMaxY); /*
|
||||
return ImGui::ScrollToRectEx(reinterpret_cast<ImGuiWindow*>(window), ImRect(rectMinX, rectMinY, rectMaxX, rectMaxY)).x;
|
||||
*/
|
||||
|
||||
private static native float nScrollToRectExY(long window, float rectMinX, float rectMinY, float rectMaxX, float rectMaxY); /*
|
||||
return ImGui::ScrollToRectEx(reinterpret_cast<ImGuiWindow*>(window), ImRect(rectMinX, rectMinY, rectMaxX, rectMaxY)).y;
|
||||
*/
|
||||
|
||||
private static native void nScrollToRectEx(ImVec2 dst, long window, float rectMinX, float rectMinY, float rectMaxX, float rectMaxY, int flags); /*
|
||||
Jni::ImVec2Cpy(env, ImGui::ScrollToRectEx(reinterpret_cast<ImGuiWindow*>(window), ImRect(rectMinX, rectMinY, rectMaxX, rectMaxY), flags), dst);
|
||||
*/
|
||||
|
||||
private static native float nScrollToRectExX(long window, float rectMinX, float rectMinY, float rectMaxX, float rectMaxY, int flags); /*
|
||||
return ImGui::ScrollToRectEx(reinterpret_cast<ImGuiWindow*>(window), ImRect(rectMinX, rectMinY, rectMaxX, rectMaxY), flags).x;
|
||||
*/
|
||||
|
||||
private static native float nScrollToRectExY(long window, float rectMinX, float rectMinY, float rectMaxX, float rectMaxY, int flags); /*
|
||||
return ImGui::ScrollToRectEx(reinterpret_cast<ImGuiWindow*>(window), ImRect(rectMinX, rectMinY, rectMaxX, rectMaxY), flags).y;
|
||||
*/
|
||||
|
||||
// Basic Accessors
|
||||
|
||||
public static int getItemID() {
|
||||
return nGetItemID();
|
||||
}
|
||||
|
||||
private static native int nGetItemID(); /*
|
||||
return ImGui::GetItemID();
|
||||
*/
|
||||
|
||||
public static int getItemStatusFlags() {
|
||||
return nGetItemStatusFlags();
|
||||
}
|
||||
|
||||
private static native int nGetItemStatusFlags(); /*
|
||||
return ImGui::GetItemStatusFlags();
|
||||
*/
|
||||
|
||||
public static int getItemFlags() {
|
||||
return nGetItemFlags();
|
||||
}
|
||||
|
||||
private static native int nGetItemFlags(); /*
|
||||
return ImGui::GetItemFlags();
|
||||
*/
|
||||
|
||||
public static int getActiveID() {
|
||||
return nGetActiveID();
|
||||
}
|
||||
|
||||
private static native int nGetActiveID(); /*
|
||||
return ImGui::GetActiveID();
|
||||
*/
|
||||
|
||||
public static int getFocusID() {
|
||||
return nGetFocusID();
|
||||
}
|
||||
|
||||
private static native int nGetFocusID(); /*
|
||||
return ImGui::GetFocusID();
|
||||
*/
|
||||
|
||||
public static void setActiveID(final int id, final ImGuiWindow window) {
|
||||
nSetActiveID(id, window.ptr);
|
||||
}
|
||||
|
||||
private static native void nSetActiveID(int id, long window); /*
|
||||
ImGui::SetActiveID(id, reinterpret_cast<ImGuiWindow*>(window));
|
||||
*/
|
||||
|
||||
public static void setFocusID(final int id, final ImGuiWindow window) {
|
||||
nSetFocusID(id, window.ptr);
|
||||
}
|
||||
|
||||
private static native void nSetFocusID(int id, long window); /*
|
||||
ImGui::SetFocusID(id, reinterpret_cast<ImGuiWindow*>(window));
|
||||
*/
|
||||
|
||||
public static void clearActiveID() {
|
||||
nClearActiveID();
|
||||
}
|
||||
|
||||
private static native void nClearActiveID(); /*
|
||||
ImGui::ClearActiveID();
|
||||
*/
|
||||
|
||||
public static int getHoveredID() {
|
||||
return nGetHoveredID();
|
||||
}
|
||||
|
||||
private static native int nGetHoveredID(); /*
|
||||
return ImGui::GetHoveredID();
|
||||
*/
|
||||
|
||||
public static void setHoveredID(final int id) {
|
||||
nSetHoveredID(id);
|
||||
}
|
||||
|
||||
private static native void nSetHoveredID(int id); /*
|
||||
ImGui::SetHoveredID(id);
|
||||
*/
|
||||
|
||||
public static void keepAliveID(final int id) {
|
||||
nKeepAliveID(id);
|
||||
}
|
||||
|
||||
private static native void nKeepAliveID(int id); /*
|
||||
ImGui::KeepAliveID(id);
|
||||
*/
|
||||
|
||||
public static void markItemEdited(final int id) {
|
||||
nMarkItemEdited(id);
|
||||
}
|
||||
|
||||
private static native void nMarkItemEdited(int id); /*
|
||||
ImGui::MarkItemEdited(id);
|
||||
*/
|
||||
|
||||
public static void pushOverrideID(final int id) {
|
||||
nPushOverrideID(id);
|
||||
}
|
||||
|
||||
private static native void nPushOverrideID(int id); /*
|
||||
ImGui::PushOverrideID(id);
|
||||
*/
|
||||
|
||||
public static int getIDWithSeed(final String strIdBegin, final String strIdEnd, final int seed) {
|
||||
return nGetIDWithSeed(strIdBegin, strIdEnd, seed);
|
||||
}
|
||||
|
||||
private static native int nGetIDWithSeed(String obj_strIdBegin, String obj_strIdEnd, int seed); /*MANUAL
|
||||
auto strIdBegin = obj_strIdBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_strIdBegin, JNI_FALSE);
|
||||
auto strIdEnd = obj_strIdEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_strIdEnd, JNI_FALSE);
|
||||
auto _result = ImGui::GetIDWithSeed(strIdBegin, strIdEnd, seed);
|
||||
if (strIdBegin != NULL) env->ReleaseStringUTFChars(obj_strIdBegin, strIdBegin);
|
||||
if (strIdEnd != NULL) env->ReleaseStringUTFChars(obj_strIdEnd, strIdEnd);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
// Basic Helpers for widget code
|
||||
|
||||
public static void itemSize(final ImVec2 size) {
|
||||
nItemSize(size.x, size.y);
|
||||
}
|
||||
|
||||
public static void itemSize(final float sizeX, final float sizeY) {
|
||||
nItemSize(sizeX, sizeY);
|
||||
}
|
||||
|
||||
public static void itemSize(final ImVec2 size, final float textBaselineY) {
|
||||
nItemSize(size.x, size.y, textBaselineY);
|
||||
}
|
||||
|
||||
public static void itemSize(final float sizeX, final float sizeY, final float textBaselineY) {
|
||||
nItemSize(sizeX, sizeY, textBaselineY);
|
||||
}
|
||||
|
||||
private static native void nItemSize(float sizeX, float sizeY); /*MANUAL
|
||||
ImVec2 size = ImVec2(sizeX, sizeY);
|
||||
ImGui::ItemSize(size);
|
||||
*/
|
||||
|
||||
private static native void nItemSize(float sizeX, float sizeY, float textBaselineY); /*MANUAL
|
||||
ImVec2 size = ImVec2(sizeX, sizeY);
|
||||
ImGui::ItemSize(size, textBaselineY);
|
||||
*/
|
||||
|
||||
public static void itemSize(final ImRect bb) {
|
||||
nItemSize(bb.min.x, bb.min.y, bb.max.x, bb.max.y);
|
||||
}
|
||||
|
||||
public static void itemSize(final float bbMinX, final float bbMinY, final float bbMaxX, final float bbMaxY) {
|
||||
nItemSize(bbMinX, bbMinY, bbMaxX, bbMaxY);
|
||||
}
|
||||
|
||||
public static void itemSize(final ImRect bb, final float textBaselineY) {
|
||||
nItemSize(bb.min.x, bb.min.y, bb.max.x, bb.max.y, textBaselineY);
|
||||
}
|
||||
|
||||
public static void itemSize(final float bbMinX, final float bbMinY, final float bbMaxX, final float bbMaxY, final float textBaselineY) {
|
||||
nItemSize(bbMinX, bbMinY, bbMaxX, bbMaxY, textBaselineY);
|
||||
}
|
||||
|
||||
private static native void nItemSize(float bbMinX, float bbMinY, float bbMaxX, float bbMaxY); /*
|
||||
ImGui::ItemSize(ImRect(bbMinX, bbMinY, bbMaxX, bbMaxY));
|
||||
*/
|
||||
|
||||
private static native void nItemSize(float bbMinX, float bbMinY, float bbMaxX, float bbMaxY, float textBaselineY); /*
|
||||
ImGui::ItemSize(ImRect(bbMinX, bbMinY, bbMaxX, bbMaxY), textBaselineY);
|
||||
*/
|
||||
|
||||
// TODO: ItemAdd
|
||||
|
||||
public static boolean itemHoverable(final ImRect bb, final int id) {
|
||||
return nItemHoverable(bb.min.x, bb.min.y, bb.max.x, bb.max.y, id);
|
||||
}
|
||||
|
||||
public static boolean itemHoverable(final float bbMinX, final float bbMinY, final float bbMaxX, final float bbMaxY, final int id) {
|
||||
return nItemHoverable(bbMinX, bbMinY, bbMaxX, bbMaxY, id);
|
||||
}
|
||||
|
||||
private static native boolean nItemHoverable(float bbMinX, float bbMinY, float bbMaxX, float bbMaxY, int id); /*
|
||||
return ImGui::ItemHoverable(ImRect(bbMinX, bbMinY, bbMaxX, bbMaxY), id);
|
||||
*/
|
||||
|
||||
public static boolean isClippedEx(final ImRect bb, final int id) {
|
||||
return nIsClippedEx(bb.min.x, bb.min.y, bb.max.x, bb.max.y, id);
|
||||
}
|
||||
|
||||
public static boolean isClippedEx(final float bbMinX, final float bbMinY, final float bbMaxX, final float bbMaxY, final int id) {
|
||||
return nIsClippedEx(bbMinX, bbMinY, bbMaxX, bbMaxY, id);
|
||||
}
|
||||
|
||||
private static native boolean nIsClippedEx(float bbMinX, float bbMinY, float bbMaxX, float bbMaxY, int id); /*
|
||||
return ImGui::IsClippedEx(ImRect(bbMinX, bbMinY, bbMaxX, bbMaxY), id);
|
||||
*/
|
||||
|
||||
public static void setLastItemData(final int itemId, final int inFlags, final int statusFlags, final ImRect itemRect) {
|
||||
nSetLastItemData(itemId, inFlags, statusFlags, itemRect.min.x, itemRect.min.y, itemRect.max.x, itemRect.max.y);
|
||||
}
|
||||
|
||||
public static void setLastItemData(final int itemId, final int inFlags, final int statusFlags, final float itemRectMinX, final float itemRectMinY, final float itemRectMaxX, final float itemRectMaxY) {
|
||||
nSetLastItemData(itemId, inFlags, statusFlags, itemRectMinX, itemRectMinY, itemRectMaxX, itemRectMaxY);
|
||||
}
|
||||
|
||||
private static native void nSetLastItemData(int itemId, int inFlags, int statusFlags, float itemRectMinX, float itemRectMinY, float itemRectMaxX, float itemRectMaxY); /*
|
||||
ImGui::SetLastItemData(itemId, inFlags, statusFlags, ImRect(itemRectMinX, itemRectMinY, itemRectMaxX, itemRectMaxY));
|
||||
*/
|
||||
|
||||
public static ImVec2 calcItemSize(final ImVec2 size, final float defaultW, final float defaultH) {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nCalcItemSize(dst, size.x, size.y, defaultW, defaultH);
|
||||
@@ -68,12 +864,76 @@ public final class ImGui extends imgui.ImGui {
|
||||
return _result;
|
||||
*/
|
||||
|
||||
public static void pushItemFlag(final int imGuiItemFlags, final boolean enabled) {
|
||||
nPushItemFlag(imGuiItemFlags, enabled);
|
||||
public static float calcWrapWidthForPos(final ImVec2 pos, final float wrapPosX) {
|
||||
return nCalcWrapWidthForPos(pos.x, pos.y, wrapPosX);
|
||||
}
|
||||
|
||||
private static native void nPushItemFlag(int imGuiItemFlags, boolean enabled); /*
|
||||
ImGui::PushItemFlag(imGuiItemFlags, enabled);
|
||||
public static float calcWrapWidthForPos(final float posX, final float posY, final float wrapPosX) {
|
||||
return nCalcWrapWidthForPos(posX, posY, wrapPosX);
|
||||
}
|
||||
|
||||
private static native float nCalcWrapWidthForPos(float posX, float posY, float wrapPosX); /*MANUAL
|
||||
ImVec2 pos = ImVec2(posX, posY);
|
||||
auto _result = ImGui::CalcWrapWidthForPos(pos, wrapPosX);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
public static void pushMultiItemsWidths(final int components, final float widthFull) {
|
||||
nPushMultiItemsWidths(components, widthFull);
|
||||
}
|
||||
|
||||
private static native void nPushMultiItemsWidths(int components, float widthFull); /*
|
||||
ImGui::PushMultiItemsWidths(components, widthFull);
|
||||
*/
|
||||
|
||||
public static boolean isItemToggledSelection() {
|
||||
return nIsItemToggledSelection();
|
||||
}
|
||||
|
||||
private static native boolean nIsItemToggledSelection(); /*
|
||||
return ImGui::IsItemToggledSelection();
|
||||
*/
|
||||
|
||||
public static ImVec2 getContentRegionMaxAbs() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetContentRegionMaxAbs(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static float getContentRegionMaxAbsX() {
|
||||
return nGetContentRegionMaxAbsX();
|
||||
}
|
||||
|
||||
public static float getContentRegionMaxAbsY() {
|
||||
return nGetContentRegionMaxAbsY();
|
||||
}
|
||||
|
||||
public static void getContentRegionMaxAbs(final ImVec2 dst) {
|
||||
nGetContentRegionMaxAbs(dst);
|
||||
}
|
||||
|
||||
private static native void nGetContentRegionMaxAbs(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, ImGui::GetContentRegionMaxAbs(), dst);
|
||||
*/
|
||||
|
||||
private static native float nGetContentRegionMaxAbsX(); /*
|
||||
return ImGui::GetContentRegionMaxAbs().x;
|
||||
*/
|
||||
|
||||
private static native float nGetContentRegionMaxAbsY(); /*
|
||||
return ImGui::GetContentRegionMaxAbs().y;
|
||||
*/
|
||||
|
||||
// TODO: ShrinkWidths
|
||||
|
||||
// Parameter stacks
|
||||
|
||||
public static void pushItemFlag(final int option, final boolean enabled) {
|
||||
nPushItemFlag(option, enabled);
|
||||
}
|
||||
|
||||
private static native void nPushItemFlag(int option, boolean enabled); /*
|
||||
ImGui::PushItemFlag(option, enabled);
|
||||
*/
|
||||
|
||||
public static void popItemFlag() {
|
||||
@@ -316,14 +1176,6 @@ public final class ImGui extends imgui.ImGui {
|
||||
return _result;
|
||||
*/
|
||||
|
||||
public static ImGuiWindow getCurrentWindow() {
|
||||
return new ImGuiWindow(nGetCurrentWindow());
|
||||
}
|
||||
|
||||
private static native long nGetCurrentWindow(); /*
|
||||
return (uintptr_t)ImGui::GetCurrentWindow();
|
||||
*/
|
||||
|
||||
public static ImRect getWindowScrollbarRect(final ImGuiWindow imGuiWindow, final int axis) {
|
||||
final ImRect dst = new ImRect();
|
||||
nGetWindowScrollbarRect(dst, imGuiWindow.ptr, axis);
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package imgui.internal.flag;
|
||||
|
||||
|
||||
public class ImGuiItemStatusFlags {
|
||||
private ImGuiItemStatusFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* Mouse position is within item rectangle (does NOT mean that the window is in correct z-order and can be hovered!, this is only one part of the most-common IsItemHovered test)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int HoveredRect = 1;
|
||||
|
||||
/**
|
||||
* g.LastItemData.DisplayRect is valid
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int HasDisplayRect = 2;
|
||||
|
||||
/**
|
||||
* Value exposed by item was edited in the current frame (should match the bool return value of most widgets)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int Edited = 4;
|
||||
|
||||
/**
|
||||
* Set when Selectable(), TreeNode() reports toggling a selection. We can't report "Selected", only state changes, in order to easily handle clipping with less issues.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int ToggledSelection = 8;
|
||||
|
||||
/**
|
||||
* Set when TreeNode() reports toggling their open state.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 4}
|
||||
*/
|
||||
public static final int ToggledOpen = 16;
|
||||
|
||||
/**
|
||||
* Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 5}
|
||||
*/
|
||||
public static final int HasDeactivated = 32;
|
||||
|
||||
/**
|
||||
* Only valid if ImGuiItemStatusFlags_HasDeactivated is set.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 6}
|
||||
*/
|
||||
public static final int Deactivated = 64;
|
||||
|
||||
/**
|
||||
* Override the HoveredWindow test to allow cross-window hover testing.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 7}
|
||||
*/
|
||||
public static final int HoveredWindow = 128;
|
||||
|
||||
/**
|
||||
* Set when the Focusable item just got focused by Tabbing (FIXME: to be removed soon)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 8}
|
||||
*/
|
||||
public static final int FocusedByTabbing = 256;
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
package imgui.internal;
|
||||
|
||||
import imgui.ImDrawList;
|
||||
import imgui.ImFont;
|
||||
import imgui.ImGuiPlatformMonitor;
|
||||
import imgui.ImGuiViewport;
|
||||
import imgui.ImVec2;
|
||||
import imgui.binding.annotation.ArgValue;
|
||||
import imgui.binding.annotation.BindingMethod;
|
||||
@@ -26,13 +30,247 @@ public final class ImGui extends imgui.ImGui {
|
||||
Jni::InitInternal(env);
|
||||
*/
|
||||
|
||||
// Windows
|
||||
// We should always have a CurrentWindow in the stack (there is an implicit "Debug" window)
|
||||
// If this ever crash because g.CurrentWindow is NULL it means that either
|
||||
// - ImGui::NewFrame() has never been called, which is illegal.
|
||||
// - You are calling ImGui functions after ImGui::EndFrame()/ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal.
|
||||
|
||||
@BindingMethod
|
||||
public static native ImGuiWindow GetCurrentWindowRead();
|
||||
|
||||
@BindingMethod
|
||||
public static native ImGuiWindow GetCurrentWindow();
|
||||
|
||||
@BindingMethod
|
||||
public static native ImGuiWindow FindWindowByID(int id);
|
||||
|
||||
@BindingMethod
|
||||
public static native ImGuiWindow FindWindowByName(String name);
|
||||
|
||||
@BindingMethod
|
||||
public static native void UpdateWindowParentAndRootLinks(ImGuiWindow window, int flags, ImGuiWindow parentWindow);
|
||||
|
||||
@BindingMethod
|
||||
public static native ImVec2 CalcWindowNextAutoFitSize(ImGuiWindow window);
|
||||
|
||||
@BindingMethod
|
||||
public static native boolean IsWindowChildOf(ImGuiWindow window, ImGuiWindow potentialParent, boolean popupHierarchy, boolean dockHierarchy);
|
||||
|
||||
@BindingMethod
|
||||
public static native boolean IsWindowWithinBeginStackOf(ImGuiWindow window, ImGuiWindow potentialParent);
|
||||
|
||||
@BindingMethod
|
||||
public static native boolean IsWindowAbove(ImGuiWindow potentialAbove, ImGuiWindow potentialBelow);
|
||||
|
||||
@BindingMethod
|
||||
public static native boolean IsWindowNavFocusable(ImGuiWindow window);
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetWindowPos(ImGuiWindow window, ImVec2 pos, @OptArg int cond);
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetWindowSize(ImGuiWindow window, ImVec2 size, @OptArg int cond);
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetWindowCollapsed(ImGuiWindow window, @ArgValue(staticCast = "bool") boolean collapsed, @OptArg int cond);
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetWindowHitTestHole(ImGuiWindow window, ImVec2 pos, ImVec2 size);
|
||||
|
||||
@BindingMethod
|
||||
public static native ImRect WindowRectAbsToRel(ImGuiWindow window, ImRect r);
|
||||
|
||||
@BindingMethod
|
||||
public static native ImRect WindowRectRelToAbs(ImGuiWindow window, ImRect r);
|
||||
|
||||
|
||||
// Windows: Display Order and Focus Order
|
||||
|
||||
@BindingMethod
|
||||
public static native void FocusWindow(ImGuiWindow window);
|
||||
|
||||
@BindingMethod
|
||||
public static native void FocusTopMostWindowUnderOne(ImGuiWindow underThisWindow, ImGuiWindow ignoreWindow);
|
||||
|
||||
@BindingMethod
|
||||
public static native void BringWindowToFocusFront(ImGuiWindow window);
|
||||
|
||||
@BindingMethod
|
||||
public static native void BringWindowToDisplayFront(ImGuiWindow window);
|
||||
|
||||
@BindingMethod
|
||||
public static native void BringWindowToDisplayBack(ImGuiWindow window);
|
||||
|
||||
@BindingMethod
|
||||
public static native void BringWindowToDisplayBehind(ImGuiWindow window, ImGuiWindow aboveWindow);
|
||||
|
||||
@BindingMethod
|
||||
public static native int FindWindowDisplayIndex(ImGuiWindow window);
|
||||
|
||||
@BindingMethod
|
||||
public static native ImGuiWindow FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow window);
|
||||
|
||||
// Fonts, drawing
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetCurrentFont(ImFont font);
|
||||
|
||||
@BindingMethod
|
||||
public static native ImFont GetDefaultFont();
|
||||
|
||||
@BindingMethod
|
||||
public static native ImDrawList GetForegroundDrawList(ImGuiWindow window);
|
||||
|
||||
// Init
|
||||
|
||||
@BindingMethod
|
||||
public static native void Initialize(ImGuiContext context);
|
||||
|
||||
@BindingMethod
|
||||
public static native void Shutdown(ImGuiContext context);
|
||||
|
||||
// NewFrame
|
||||
|
||||
@BindingMethod
|
||||
public static native void UpdateInputEvents(boolean trickleFastInputs);
|
||||
|
||||
@BindingMethod
|
||||
public static native void UpdateHoveredWindowAndCaptureFlags();
|
||||
|
||||
@BindingMethod
|
||||
public static native void StartMouseMovingWindow(ImGuiWindow window);
|
||||
|
||||
@BindingMethod
|
||||
public static native void StartMouseMovingWindowOrNode(ImGuiWindow window, ImGuiDockNode node, boolean undockFloatingNode);
|
||||
|
||||
@BindingMethod
|
||||
public static native void UpdateMouseMovingWindowNewFrame();
|
||||
|
||||
@BindingMethod
|
||||
public static native void UpdateMouseMovingWindowEndFrame();
|
||||
|
||||
// TODO: Generic context hooks
|
||||
|
||||
// Viewports
|
||||
|
||||
@BindingMethod
|
||||
public static native ImGuiPlatformMonitor GetViewportPlatformMonitor(ImGuiViewport viewport);
|
||||
|
||||
// TODO: Settings
|
||||
|
||||
// Scrolling
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetNextWindowScroll(ImVec2 scroll);
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetScrollX(ImGuiWindow window, float scrollX);
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetScrollY(ImGuiWindow window, float scrollY);
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetScrollFromPosX(ImGuiWindow window, float localX, float centerXRatio);
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetScrollFromPosY(ImGuiWindow window, float localY, float centerYRatio);
|
||||
|
||||
// Early work-in-progress API (ScrollToItem() will become public)
|
||||
|
||||
@BindingMethod
|
||||
public static native void ScrollToItem(@OptArg int flags);
|
||||
|
||||
@BindingMethod
|
||||
public static native void ScrollToRect(ImGuiWindow window, ImRect rect, @OptArg int flags);
|
||||
|
||||
@BindingMethod
|
||||
public static native ImVec2 ScrollToRectEx(ImGuiWindow window, ImRect rect, @OptArg int flags);
|
||||
|
||||
// Basic Accessors
|
||||
|
||||
@BindingMethod
|
||||
public static native int GetItemID();
|
||||
|
||||
@BindingMethod
|
||||
public static native int GetItemStatusFlags();
|
||||
|
||||
@BindingMethod
|
||||
public static native int GetItemFlags();
|
||||
|
||||
@BindingMethod
|
||||
public static native int GetActiveID();
|
||||
|
||||
@BindingMethod
|
||||
public static native int GetFocusID();
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetActiveID(int id, ImGuiWindow window);
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetFocusID(int id, ImGuiWindow window);
|
||||
|
||||
@BindingMethod
|
||||
public static native void ClearActiveID();
|
||||
|
||||
@BindingMethod
|
||||
public static native int GetHoveredID();
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetHoveredID(int id);
|
||||
|
||||
@BindingMethod
|
||||
public static native void KeepAliveID(int id);
|
||||
|
||||
@BindingMethod
|
||||
public static native void MarkItemEdited(int id);
|
||||
|
||||
@BindingMethod
|
||||
public static native void PushOverrideID(int id);
|
||||
|
||||
@BindingMethod
|
||||
public static native int GetIDWithSeed(String strIdBegin, String strIdEnd, int seed);
|
||||
|
||||
// Basic Helpers for widget code
|
||||
|
||||
@BindingMethod
|
||||
public static native void ItemSize(ImVec2 size, @OptArg float textBaselineY);
|
||||
|
||||
@BindingMethod
|
||||
public static native void ItemSize(ImRect bb, @OptArg float textBaselineY);
|
||||
|
||||
// TODO: ItemAdd
|
||||
|
||||
@BindingMethod
|
||||
public static native boolean ItemHoverable(ImRect bb, int id);
|
||||
|
||||
@BindingMethod
|
||||
public static native boolean IsClippedEx(ImRect bb, int id);
|
||||
|
||||
@BindingMethod
|
||||
public static native void SetLastItemData(int itemId, int inFlags, int statusFlags, ImRect itemRect);
|
||||
|
||||
@BindingMethod
|
||||
public static native ImVec2 CalcItemSize(ImVec2 size, float defaultW, float defaultH);
|
||||
|
||||
@BindingMethod
|
||||
public static native void PushItemFlag(int imGuiItemFlags, boolean enabled);
|
||||
public static native float CalcWrapWidthForPos(ImVec2 pos, float wrapPosX);
|
||||
|
||||
@BindingMethod
|
||||
public static native void PushMultiItemsWidths(int components, float widthFull);
|
||||
|
||||
@BindingMethod
|
||||
public static native boolean IsItemToggledSelection();
|
||||
|
||||
@BindingMethod
|
||||
public static native ImVec2 GetContentRegionMaxAbs();
|
||||
|
||||
// TODO: ShrinkWidths
|
||||
|
||||
// Parameter stacks
|
||||
|
||||
@BindingMethod
|
||||
public static native void PushItemFlag(int option, boolean enabled);
|
||||
|
||||
@BindingMethod
|
||||
public static native void PopItemFlag();
|
||||
@@ -51,10 +289,10 @@ public final class ImGui extends imgui.ImGui {
|
||||
public static native void DockBuilderDockWindow(String windowName, int nodeId);
|
||||
|
||||
@BindingMethod
|
||||
public static native ImGuiDockNode DockBuilderGetNode(final int nodeId);
|
||||
public static native ImGuiDockNode DockBuilderGetNode(int nodeId);
|
||||
|
||||
@BindingMethod
|
||||
public static native ImGuiDockNode DockBuilderGetCentralNode(final int nodeId);
|
||||
public static native ImGuiDockNode DockBuilderGetCentralNode(int nodeId);
|
||||
|
||||
@BindingMethod
|
||||
public static native int DockBuilderAddNode(@OptArg int nodeId, @OptArg int flags);
|
||||
@@ -99,9 +337,6 @@ public final class ImGui extends imgui.ImGui {
|
||||
@BindingMethod
|
||||
public static native boolean SplitterBehavior(ImRect bb, int id, @ArgValue(staticCast = "ImGuiAxis") int axis, ImFloat size1, ImFloat size2, float minSize1, float minSize2, @OptArg float hoverExtend, @OptArg float hoverVisibilityDelay, @OptArg int bgCol);
|
||||
|
||||
@BindingMethod
|
||||
public static native ImGuiWindow GetCurrentWindow();
|
||||
|
||||
@BindingMethod
|
||||
public static native ImRect GetWindowScrollbarRect(ImGuiWindow imGuiWindow, @ArgValue(staticCast = "ImGuiAxis") int axis);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package imgui.internal.flag;
|
||||
|
||||
import imgui.binding.annotation.BindingAstEnum;
|
||||
import imgui.binding.annotation.BindingSource;
|
||||
|
||||
@BindingSource
|
||||
public class ImGuiItemStatusFlags {
|
||||
private ImGuiItemStatusFlags() {
|
||||
}
|
||||
|
||||
@BindingAstEnum(file = "ast-imgui_internal.json", qualType = "ImGuiItemStatusFlags_")
|
||||
public Void __;
|
||||
}
|
||||
Reference in new issue
Block a user