feat: introduce binding generator
A squash of hundreds of commits with a binding API generator. The API generator works with a hybrid model: 1. We define methods and fields in the code. 2. Mark them with API annotations. 3. For specific use cases, we use the old approach with JNI generation comments. There is also an API to generate an AST tree, which is saved to JSON. This JSON can be used for full API generation by declaring only field/method names. Currently, it is used to generate constants. By eyeballing, 95% of the API has been converted to the new approach. This is sufficient for the current moment. Only edge cases with specific API calls are left. fix: ambiguous call for ImGui::GetColorU32 build: disable checkstyle for imgui-binding module Since the module is heavily generated, checkstyle for it doesn't make sense. build: make buildSrc to use JDK 11 build: make generateApi optional when compiling project Initially generated module was not included to the project VCS. Since it's now in the separate src folder, we don't need to call generator every time. Only when a new generation result is required.
This commit is contained in:
1 parent
e64df5a433
commit
8a8cd22ed6
323 files changed
+113518
-15318
No files matched your search
@@ -0,0 +1,209 @@
|
||||
package imgui;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
/**
|
||||
* Helper class to get ABGR packed color used by Dear ImGui.
|
||||
*/
|
||||
public final class ImColor {
|
||||
private ImColor() {
|
||||
}
|
||||
|
||||
public static int rgba(final int r, final int g, final int b, final int a) {
|
||||
return intToColor(r, g, b, a);
|
||||
}
|
||||
|
||||
public static int rgb(final int r, final int g, final int b) {
|
||||
return intToColor(r, g, b);
|
||||
}
|
||||
|
||||
public static int rgba(final float r, final float g, final float b, final float a) {
|
||||
return floatToColor(r, g, b, a);
|
||||
}
|
||||
|
||||
public static int rgb(final float r, final float g, final float b) {
|
||||
return floatToColor(r, g, b);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param hex e.g. "#FFFFFFFF"
|
||||
*/
|
||||
public static int rgba(final String hex) {
|
||||
return rgbaToColor(hex);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param hex e.g. "#FFFFFF"
|
||||
*/
|
||||
public static int rgb(final String hex) {
|
||||
return rgbToColor(hex);
|
||||
}
|
||||
|
||||
public static int rgba(final ImVec4 color) {
|
||||
return rgba(color.x, color.y, color.z, color.w);
|
||||
}
|
||||
|
||||
public static int rgb(final ImVec4 color) {
|
||||
return rgb(color.x, color.y, color.z);
|
||||
}
|
||||
|
||||
public static int rgba(final Color color) {
|
||||
return rgba(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha());
|
||||
}
|
||||
|
||||
public static int rgb(final Color color) {
|
||||
return rgb(color.getRed(), color.getGreen(), color.getBlue());
|
||||
}
|
||||
|
||||
public static int hsla(final float h, final float s, final float l, final float a) {
|
||||
return hslToColor(h, s, l, a);
|
||||
}
|
||||
|
||||
public static int hsl(final float h, final float s, final float l) {
|
||||
return hslToColor(h, s, l);
|
||||
}
|
||||
|
||||
public static int hsla(final int h, final int s, final int l, final int a) {
|
||||
return hslToColor(h, s, l, a);
|
||||
}
|
||||
|
||||
public static int hsl(final int h, final int s, final int l) {
|
||||
return hslToColor(h, s, l);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #rgb(int, int, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int intToColor(final int r, final int g, final int b, final int a) {
|
||||
return a << 24 | b << 16 | g << 8 | r;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #rgba(int, int, int, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int intToColor(final int r, final int g, final int b) {
|
||||
return intToColor(r, g, b, 255);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #rgb(float, float, float)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int floatToColor(final float r, final float g, final float b, final float a) {
|
||||
return intToColor((int) (r * 255), (int) (g * 255), (int) (b * 255), (int) (a * 255));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #rgba(float, float, float, float)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int floatToColor(final float r, final float g, final float b) {
|
||||
return floatToColor(r, g, b, 1f);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param hex e.g. "#FFFFFF"
|
||||
* @deprecated use {@link #rgb(String)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int rgbToColor(final String hex) {
|
||||
return intToColor(
|
||||
Integer.parseInt(hex.substring(1, 3), 16),
|
||||
Integer.parseInt(hex.substring(3, 5), 16),
|
||||
Integer.parseInt(hex.substring(5, 7), 16)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param hex e.g. "#FFFFFFFF"
|
||||
* @deprecated use {@link #rgba(String)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int rgbaToColor(final String hex) {
|
||||
return intToColor(
|
||||
Integer.parseInt(hex.substring(1, 3), 16),
|
||||
Integer.parseInt(hex.substring(3, 5), 16),
|
||||
Integer.parseInt(hex.substring(5, 7), 16),
|
||||
Integer.parseInt(hex.substring(7, 9), 16)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #hsl(int, int, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int hslToColor(final int h, final int s, final int l) {
|
||||
return hslToColor(h, s, l, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #hsla(int, int, int, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int hslToColor(final int h, final int s, final int l, final float a) {
|
||||
return hslToColor(h / 360f, s / 100f, l / 100f, a);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #hsl(float, float, float)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int hslToColor(final float h, final float s, final float l) {
|
||||
return hslToColor(h, s, l, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #hsla(float, float, float, float)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int hslToColor(final float h, final float s, final float l, final float a) {
|
||||
final float q;
|
||||
final float p;
|
||||
final float r;
|
||||
final float g;
|
||||
final float b;
|
||||
|
||||
// Achromatic
|
||||
if (s == 0) {
|
||||
r = l;
|
||||
g = l;
|
||||
b = l;
|
||||
} else {
|
||||
q = l < 0.5 ? (l * (1 + s)) : (l + s - l * s);
|
||||
p = 2 * l - q;
|
||||
r = hue2rgb(p, q, h + 1.0f / 3);
|
||||
g = hue2rgb(p, q, h);
|
||||
b = hue2rgb(p, q, h - 1.0f / 3);
|
||||
}
|
||||
|
||||
return floatToColor(r, g, b, a);
|
||||
}
|
||||
|
||||
private static float hue2rgb(final float p, final float q, final float hue) {
|
||||
float h = hue;
|
||||
|
||||
if (h < 0) {
|
||||
h += 1;
|
||||
}
|
||||
|
||||
if (h > 1) {
|
||||
h -= 1;
|
||||
}
|
||||
|
||||
if (6 * h < 1) {
|
||||
return p + ((q - p) * 6 * h);
|
||||
}
|
||||
|
||||
if (2 * h < 1) {
|
||||
return q;
|
||||
}
|
||||
|
||||
if (3 * h < 2) {
|
||||
return p + ((q - p) * 6 * ((2.0f / 3.0f) - h));
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,370 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.binding.ImGuiStruct;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
/**
|
||||
* All draw data to render Dear ImGui frame
|
||||
* (NB: the style and the naming convention here is a little inconsistent, we currently preserve them for backward compatibility purpose,
|
||||
* as this is one of the oldest structure exposed by the library! Basically, ImDrawList == CmdList)
|
||||
* <p>
|
||||
* BINDING NOTICE: Since it's impossible to do a 1:1 mapping with JNI, current class provides "getCmdList*()" methods.
|
||||
* Those are used to get the data needed to do a rendering.
|
||||
*/
|
||||
public final class ImDrawData extends ImGuiStruct {
|
||||
private static final int RESIZE_FACTOR = 5_000;
|
||||
private static ByteBuffer dataBuffer = ByteBuffer.allocateDirect(25_000).order(ByteOrder.nativeOrder());
|
||||
|
||||
public ImDrawData(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
#define THIS ((ImDrawData*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
///////// Start of Render Methods | Binding
|
||||
|
||||
/**
|
||||
* Draw commands. Typically 1 command = 1 GPU draw call, unless the command is a callback.
|
||||
*/
|
||||
public native int getCmdListCmdBufferSize(int cmdListIdx); /*
|
||||
return THIS->CmdLists[cmdListIdx]->CmdBuffer.Size;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Number of indices (multiple of 3) to be rendered as triangles.
|
||||
* Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[].
|
||||
*/
|
||||
public native int getCmdListCmdBufferElemCount(int cmdListIdx, int cmdBufferIdx); /*
|
||||
return THIS->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 dst = new ImVec4();
|
||||
getCmdListCmdBufferClipRect(dst, cmdListIdx, cmdBufferIdx);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData.DisplayPos to get clipping rectangle in "viewport" coordinates
|
||||
*/
|
||||
public native void getCmdListCmdBufferClipRect(ImVec4 dst, int cmdListIdx, int cmdBufferIdx); /*
|
||||
Jni::ImVec4Cpy(env, &THIS->CmdLists[cmdListIdx]->CmdBuffer[cmdBufferIdx].ClipRect, dst);
|
||||
*/
|
||||
|
||||
/**
|
||||
* User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions.
|
||||
* Ignore if never using images or multiple fonts atlas.
|
||||
*/
|
||||
public native int getCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx); /*
|
||||
return (intptr_t)THIS->CmdLists[cmdListIdx]->CmdBuffer[cmdBufferIdx].GetTexID();
|
||||
*/
|
||||
|
||||
/**
|
||||
* Start offset in vertex buffer. Pre-1.71 or without ImGuiBackendFlags_RendererHasVtxOffset: always 0.
|
||||
* With ImGuiBackendFlags_RendererHasVtxOffset: may be {@code >}0 to support meshes larger than 64K vertices with 16-bit indices.
|
||||
*/
|
||||
public native int getCmdListCmdBufferVtxOffset(int cmdListIdx, int cmdBufferIdx); /*
|
||||
return THIS->CmdLists[cmdListIdx]->CmdBuffer[cmdBufferIdx].VtxOffset;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Start offset in index buffer. Always equal to sum of ElemCount drawn so far.
|
||||
*/
|
||||
public native int getCmdListCmdBufferIdxOffset(int cmdListIdx, int cmdBufferIdx); /*
|
||||
return THIS->CmdLists[cmdListIdx]->CmdBuffer[cmdBufferIdx].IdxOffset;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Index buffer. Each command consume ImDrawCmd::ElemCount of those
|
||||
*/
|
||||
public native int getCmdListIdxBufferSize(int cmdListIdx); /*
|
||||
return THIS->CmdLists[cmdListIdx]->IdxBuffer.Size;
|
||||
*/
|
||||
|
||||
public ByteBuffer getCmdListIdxBufferData(final int cmdListIdx) {
|
||||
final int idxBufferCapacity = getCmdListIdxBufferSize(cmdListIdx) * sizeOfImDrawIdx();
|
||||
if (dataBuffer.capacity() < idxBufferCapacity) {
|
||||
dataBuffer.clear();
|
||||
dataBuffer = ByteBuffer.allocateDirect(idxBufferCapacity + RESIZE_FACTOR).order(ByteOrder.nativeOrder());
|
||||
}
|
||||
|
||||
nGetCmdListIdxBufferData(cmdListIdx, dataBuffer, idxBufferCapacity);
|
||||
|
||||
dataBuffer.position(0);
|
||||
dataBuffer.limit(idxBufferCapacity);
|
||||
|
||||
return dataBuffer;
|
||||
}
|
||||
|
||||
private native void nGetCmdListIdxBufferData(int cmdListIdx, ByteBuffer idxBuffer, int idxBufferCapacity); /*
|
||||
memcpy(idxBuffer, THIS->CmdLists[cmdListIdx]->IdxBuffer.Data, idxBufferCapacity);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Vertex buffer.
|
||||
*/
|
||||
public native int getCmdListVtxBufferSize(int cmdListIdx); /*
|
||||
return THIS->CmdLists[cmdListIdx]->VtxBuffer.Size;
|
||||
*/
|
||||
|
||||
public ByteBuffer getCmdListVtxBufferData(final int cmdListIdx) {
|
||||
final int vtxBufferCapacity = getCmdListVtxBufferSize(cmdListIdx) * sizeOfImDrawVert();
|
||||
if (dataBuffer.capacity() < vtxBufferCapacity) {
|
||||
dataBuffer.clear();
|
||||
dataBuffer = ByteBuffer.allocateDirect(vtxBufferCapacity + RESIZE_FACTOR).order(ByteOrder.nativeOrder());
|
||||
}
|
||||
|
||||
nGetCmdListVtxBufferData(cmdListIdx, dataBuffer, vtxBufferCapacity);
|
||||
|
||||
dataBuffer.position(0);
|
||||
dataBuffer.limit(vtxBufferCapacity);
|
||||
|
||||
return dataBuffer;
|
||||
}
|
||||
|
||||
private native void nGetCmdListVtxBufferData(int cmdListIdx, ByteBuffer vtxBuffer, int vtxBufferCapacity); /*
|
||||
memcpy(vtxBuffer, THIS->CmdLists[cmdListIdx]->VtxBuffer.Data, vtxBufferCapacity);
|
||||
*/
|
||||
|
||||
public static native int sizeOfImDrawVert(); /*
|
||||
return (int)sizeof(ImDrawVert);
|
||||
*/
|
||||
|
||||
public static native int sizeOfImDrawIdx(); /*
|
||||
return (int)sizeof(ImDrawIdx);
|
||||
*/
|
||||
|
||||
///////// End of Render Methods
|
||||
|
||||
/**
|
||||
* Only valid after Render() is called and before the next NewFrame() is called.
|
||||
*/
|
||||
public boolean getValid() {
|
||||
return nGetValid();
|
||||
}
|
||||
|
||||
private native boolean nGetValid(); /*
|
||||
return THIS->Valid;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Number of ImDrawList* to render
|
||||
*/
|
||||
public int getCmdListsCount() {
|
||||
return nGetCmdListsCount();
|
||||
}
|
||||
|
||||
private native int nGetCmdListsCount(); /*
|
||||
return THIS->CmdListsCount;
|
||||
*/
|
||||
|
||||
/**
|
||||
* For convenience, sum of all ImDrawList's IdxBuffer.Size
|
||||
*/
|
||||
public int getTotalIdxCount() {
|
||||
return nGetTotalIdxCount();
|
||||
}
|
||||
|
||||
private native int nGetTotalIdxCount(); /*
|
||||
return THIS->TotalIdxCount;
|
||||
*/
|
||||
|
||||
/**
|
||||
* For convenience, sum of all ImDrawList's VtxBuffer.Size
|
||||
*/
|
||||
public int getTotalVtxCount() {
|
||||
return nGetTotalVtxCount();
|
||||
}
|
||||
|
||||
private native int nGetTotalVtxCount(); /*
|
||||
return THIS->TotalVtxCount;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use)
|
||||
*/
|
||||
public ImVec2 getDisplayPos() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetDisplayPos(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use)
|
||||
*/
|
||||
public float getDisplayPosX() {
|
||||
return nGetDisplayPosX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use)
|
||||
*/
|
||||
public float getDisplayPosY() {
|
||||
return nGetDisplayPosY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use)
|
||||
*/
|
||||
public void getDisplayPos(final ImVec2 dst) {
|
||||
nGetDisplayPos(dst);
|
||||
}
|
||||
|
||||
private native void nGetDisplayPos(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->DisplayPos, dst);
|
||||
*/
|
||||
|
||||
private native float nGetDisplayPosX(); /*
|
||||
return THIS->DisplayPos.x;
|
||||
*/
|
||||
|
||||
private native float nGetDisplayPosY(); /*
|
||||
return THIS->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 dst = new ImVec2();
|
||||
nGetDisplaySize(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Size of the viewport to render (== io.DisplaySize for the main viewport)
|
||||
* (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use)
|
||||
*/
|
||||
public float getDisplaySizeX() {
|
||||
return nGetDisplaySizeX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Size of the viewport to render (== io.DisplaySize for the main viewport)
|
||||
* (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use)
|
||||
*/
|
||||
public float getDisplaySizeY() {
|
||||
return nGetDisplaySizeY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Size of the viewport to render (== io.DisplaySize for the main viewport)
|
||||
* (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use)
|
||||
*/
|
||||
public void getDisplaySize(final ImVec2 dst) {
|
||||
nGetDisplaySize(dst);
|
||||
}
|
||||
|
||||
private native void nGetDisplaySize(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->DisplaySize, dst);
|
||||
*/
|
||||
|
||||
private native float nGetDisplaySizeX(); /*
|
||||
return THIS->DisplaySize.x;
|
||||
*/
|
||||
|
||||
private native float nGetDisplaySizeY(); /*
|
||||
return THIS->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 dst = new ImVec2();
|
||||
nGetFramebufferScale(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 float getFramebufferScaleX() {
|
||||
return nGetFramebufferScaleX();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 float getFramebufferScaleY() {
|
||||
return nGetFramebufferScaleY();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 void getFramebufferScale(final ImVec2 dst) {
|
||||
nGetFramebufferScale(dst);
|
||||
}
|
||||
|
||||
private native void nGetFramebufferScale(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->FramebufferScale, dst);
|
||||
*/
|
||||
|
||||
private native float nGetFramebufferScaleX(); /*
|
||||
return THIS->FramebufferScale.x;
|
||||
*/
|
||||
|
||||
private native float nGetFramebufferScaleY(); /*
|
||||
return THIS->FramebufferScale.y;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Viewport carrying the ImDrawData instance, might be of use to the renderer (generally not).
|
||||
*/
|
||||
public ImGuiViewport getOwnerViewport() {
|
||||
return new ImGuiViewport(nGetOwnerViewport());
|
||||
}
|
||||
|
||||
private native long nGetOwnerViewport(); /*
|
||||
return (intptr_t)THIS->OwnerViewport;
|
||||
*/
|
||||
|
||||
// Functions
|
||||
|
||||
/**
|
||||
* Helper to convert all buffers from indexed to non-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources.
|
||||
* Always prefer indexed rendering!
|
||||
*/
|
||||
public void deIndexAllBuffers() {
|
||||
nDeIndexAllBuffers();
|
||||
}
|
||||
|
||||
private native void nDeIndexAllBuffers(); /*
|
||||
THIS->DeIndexAllBuffers();
|
||||
*/
|
||||
|
||||
/**
|
||||
* Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than Dear ImGui expects,
|
||||
* or if there is a difference between your window resolution and framebuffer resolution.
|
||||
*/
|
||||
public void scaleClipRects(final ImVec2 fbScale) {
|
||||
nScaleClipRects(fbScale.x, fbScale.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than Dear ImGui expects,
|
||||
* or if there is a difference between your window resolution and framebuffer resolution.
|
||||
*/
|
||||
public void scaleClipRects(final float fbScaleX, final float fbScaleY) {
|
||||
nScaleClipRects(fbScaleX, fbScaleY);
|
||||
}
|
||||
|
||||
private native void nScaleClipRects(float fbScaleX, float fbScaleY); /*MANUAL
|
||||
ImVec2 fbScale = ImVec2(fbScaleX, fbScaleY);
|
||||
THIS->ScaleClipRects(fbScale);
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,529 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
|
||||
/**
|
||||
* Font runtime data and rendering
|
||||
* ImFontAtlas automatically loads a default embedded font for you when you call GetTexDataAsAlpha8() or GetTexDataAsRGBA32().
|
||||
*/
|
||||
public final class ImFont extends ImGuiStructDestroyable {
|
||||
public ImFont() {
|
||||
}
|
||||
|
||||
public ImFont(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate();
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
#define THIS ((ImFont*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
private native long nCreate(); /*
|
||||
return (intptr_t)(new ImFont());
|
||||
*/
|
||||
|
||||
// TODO IndexAdvanceX
|
||||
|
||||
/**
|
||||
* = FallbackGlyph.AdvanceX
|
||||
*/
|
||||
public float getFallbackAdvanceX() {
|
||||
return nGetFallbackAdvanceX();
|
||||
}
|
||||
|
||||
/**
|
||||
* = FallbackGlyph.AdvanceX
|
||||
*/
|
||||
public void setFallbackAdvanceX(final float value) {
|
||||
nSetFallbackAdvanceX(value);
|
||||
}
|
||||
|
||||
private native float nGetFallbackAdvanceX(); /*
|
||||
return THIS->FallbackAdvanceX;
|
||||
*/
|
||||
|
||||
private native void nSetFallbackAdvanceX(float value); /*
|
||||
THIS->FallbackAdvanceX = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Height of characters/line, set during loading (don't change after loading)
|
||||
*/
|
||||
public float getFontSize() {
|
||||
return nGetFontSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Height of characters/line, set during loading (don't change after loading)
|
||||
*/
|
||||
public void setFontSize(final float value) {
|
||||
nSetFontSize(value);
|
||||
}
|
||||
|
||||
private native float nGetFontSize(); /*
|
||||
return THIS->FontSize;
|
||||
*/
|
||||
|
||||
private native void nSetFontSize(float value); /*
|
||||
THIS->FontSize = value;
|
||||
*/
|
||||
|
||||
// TODO IndexLookup, Glyphs
|
||||
|
||||
private static final ImFontGlyph _GETFALLBACKGLYPH_1 = new ImFontGlyph(0);
|
||||
|
||||
/**
|
||||
* = FindGlyph(FontFallbackChar)
|
||||
*/
|
||||
public ImFontGlyph getFallbackGlyph() {
|
||||
_GETFALLBACKGLYPH_1.ptr = nGetFallbackGlyph();
|
||||
return _GETFALLBACKGLYPH_1;
|
||||
}
|
||||
|
||||
/**
|
||||
* = FindGlyph(FontFallbackChar)
|
||||
*/
|
||||
public void setFallbackGlyph(final ImFontGlyph value) {
|
||||
nSetFallbackGlyph(value.ptr);
|
||||
}
|
||||
|
||||
private native long nGetFallbackGlyph(); /*
|
||||
return (intptr_t)THIS->FallbackGlyph;
|
||||
*/
|
||||
|
||||
private native void nSetFallbackGlyph(long value); /*
|
||||
THIS->FallbackGlyph = reinterpret_cast<ImFontGlyph*>(value);
|
||||
*/
|
||||
|
||||
// TODO ContainerAtlas, ConfigData
|
||||
|
||||
/**
|
||||
* Number of ImFontConfig involved in creating this font.
|
||||
* Bigger than 1 when merging multiple font sources into one ImFont.
|
||||
*/
|
||||
public short getConfigDataCount() {
|
||||
return nGetConfigDataCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of ImFontConfig involved in creating this font.
|
||||
* Bigger than 1 when merging multiple font sources into one ImFont.
|
||||
*/
|
||||
public void setConfigDataCount(final short value) {
|
||||
nSetConfigDataCount(value);
|
||||
}
|
||||
|
||||
private native short nGetConfigDataCount(); /*
|
||||
return THIS->ConfigDataCount;
|
||||
*/
|
||||
|
||||
private native void nSetConfigDataCount(short value); /*
|
||||
THIS->ConfigDataCount = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Character used for ellipsis rendering.
|
||||
*/
|
||||
public short getEllipsisChar() {
|
||||
return nGetEllipsisChar();
|
||||
}
|
||||
|
||||
/**
|
||||
* Character used for ellipsis rendering.
|
||||
*/
|
||||
public void setEllipsisChar(final short value) {
|
||||
nSetEllipsisChar(value);
|
||||
}
|
||||
|
||||
private native short nGetEllipsisChar(); /*
|
||||
return THIS->EllipsisChar;
|
||||
*/
|
||||
|
||||
private native void nSetEllipsisChar(short value); /*
|
||||
THIS->EllipsisChar = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Character used for ellipsis rendering (if a single '...' character isn't found)
|
||||
*/
|
||||
public short getDotChar() {
|
||||
return nGetDotChar();
|
||||
}
|
||||
|
||||
/**
|
||||
* Character used for ellipsis rendering (if a single '...' character isn't found)
|
||||
*/
|
||||
public void setDotChar(final short value) {
|
||||
nSetDotChar(value);
|
||||
}
|
||||
|
||||
private native short nGetDotChar(); /*
|
||||
return THIS->DotChar;
|
||||
*/
|
||||
|
||||
private native void nSetDotChar(short value); /*
|
||||
THIS->DotChar = value;
|
||||
*/
|
||||
|
||||
public boolean getDirtyLookupTables() {
|
||||
return nGetDirtyLookupTables();
|
||||
}
|
||||
|
||||
public void setDirtyLookupTables(final boolean value) {
|
||||
nSetDirtyLookupTables(value);
|
||||
}
|
||||
|
||||
private native boolean nGetDirtyLookupTables(); /*
|
||||
return THIS->DirtyLookupTables;
|
||||
*/
|
||||
|
||||
private native void nSetDirtyLookupTables(boolean value); /*
|
||||
THIS->DirtyLookupTables = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
|
||||
*/
|
||||
public float getScale() {
|
||||
return nGetScale();
|
||||
}
|
||||
|
||||
/**
|
||||
* Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
|
||||
*/
|
||||
public void setScale(final float value) {
|
||||
nSetScale(value);
|
||||
}
|
||||
|
||||
private native float nGetScale(); /*
|
||||
return THIS->Scale;
|
||||
*/
|
||||
|
||||
private native void nSetScale(float value); /*
|
||||
THIS->Scale = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
|
||||
*/
|
||||
public float getAscent() {
|
||||
return nGetAscent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
|
||||
*/
|
||||
public void setAscent(final float value) {
|
||||
nSetAscent(value);
|
||||
}
|
||||
|
||||
private native float nGetAscent(); /*
|
||||
return THIS->Ascent;
|
||||
*/
|
||||
|
||||
private native void nSetAscent(float value); /*
|
||||
THIS->Ascent = value;
|
||||
*/
|
||||
|
||||
public float getDescent() {
|
||||
return nGetDescent();
|
||||
}
|
||||
|
||||
public void setDescent(final float value) {
|
||||
nSetDescent(value);
|
||||
}
|
||||
|
||||
private native float nGetDescent(); /*
|
||||
return THIS->Descent;
|
||||
*/
|
||||
|
||||
private native void nSetDescent(float value); /*
|
||||
THIS->Descent = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
|
||||
*/
|
||||
public int getMetricsTotalSurface() {
|
||||
return nGetMetricsTotalSurface();
|
||||
}
|
||||
|
||||
/**
|
||||
* Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
|
||||
*/
|
||||
public void setMetricsTotalSurface(final int value) {
|
||||
nSetMetricsTotalSurface(value);
|
||||
}
|
||||
|
||||
private native int nGetMetricsTotalSurface(); /*
|
||||
return THIS->MetricsTotalSurface;
|
||||
*/
|
||||
|
||||
private native void nSetMetricsTotalSurface(int value); /*
|
||||
THIS->MetricsTotalSurface = value;
|
||||
*/
|
||||
|
||||
// Methods
|
||||
|
||||
public ImFontGlyph findGlyph(final int c) {
|
||||
return new ImFontGlyph(nFindGlyph(c));
|
||||
}
|
||||
|
||||
private native long nFindGlyph(int c); /*
|
||||
return (intptr_t)THIS->FindGlyph((ImWchar)c);
|
||||
*/
|
||||
|
||||
public ImFontGlyph findGlyphNoFallback(final int c) {
|
||||
return new ImFontGlyph(nFindGlyphNoFallback(c));
|
||||
}
|
||||
|
||||
private native long nFindGlyphNoFallback(int c); /*
|
||||
return (intptr_t)THIS->FindGlyphNoFallback((ImWchar)c);
|
||||
*/
|
||||
|
||||
public float getCharAdvance(final int c) {
|
||||
return nGetCharAdvance(c);
|
||||
}
|
||||
|
||||
private native float nGetCharAdvance(int c); /*
|
||||
return THIS->GetCharAdvance((ImWchar)c);
|
||||
*/
|
||||
|
||||
public boolean isLoaded() {
|
||||
return nIsLoaded();
|
||||
}
|
||||
|
||||
private native boolean nIsLoaded(); /*
|
||||
return THIS->IsLoaded();
|
||||
*/
|
||||
|
||||
public String getDebugName() {
|
||||
return nGetDebugName();
|
||||
}
|
||||
|
||||
private native String nGetDebugName(); /*
|
||||
return env->NewStringUTF(THIS->GetDebugName());
|
||||
*/
|
||||
|
||||
/**
|
||||
* '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.
|
||||
*/
|
||||
public ImVec2 calcTextSizeA(final float size, final float maxWidth, final float wrapWidth, final String textBegin) {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nCalcTextSizeA(dst, size, maxWidth, wrapWidth, textBegin);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* '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.
|
||||
*/
|
||||
public float calcTextSizeAX(final float size, final float maxWidth, final float wrapWidth, final String textBegin) {
|
||||
return nCalcTextSizeAX(size, maxWidth, wrapWidth, textBegin);
|
||||
}
|
||||
|
||||
/**
|
||||
* '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.
|
||||
*/
|
||||
public float calcTextSizeAY(final float size, final float maxWidth, final float wrapWidth, final String textBegin) {
|
||||
return nCalcTextSizeAY(size, maxWidth, wrapWidth, textBegin);
|
||||
}
|
||||
|
||||
/**
|
||||
* '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.
|
||||
*/
|
||||
public void calcTextSizeA(final ImVec2 dst, final float size, final float maxWidth, final float wrapWidth, final String textBegin) {
|
||||
nCalcTextSizeA(dst, size, maxWidth, wrapWidth, textBegin);
|
||||
}
|
||||
|
||||
/**
|
||||
* '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.
|
||||
*/
|
||||
public ImVec2 calcTextSizeA(final float size, final float maxWidth, final float wrapWidth, final String textBegin, final String textEnd) {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nCalcTextSizeA(dst, size, maxWidth, wrapWidth, textBegin, textEnd);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* '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.
|
||||
*/
|
||||
public float calcTextSizeAX(final float size, final float maxWidth, final float wrapWidth, final String textBegin, final String textEnd) {
|
||||
return nCalcTextSizeAX(size, maxWidth, wrapWidth, textBegin, textEnd);
|
||||
}
|
||||
|
||||
/**
|
||||
* '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.
|
||||
*/
|
||||
public float calcTextSizeAY(final float size, final float maxWidth, final float wrapWidth, final String textBegin, final String textEnd) {
|
||||
return nCalcTextSizeAY(size, maxWidth, wrapWidth, textBegin, textEnd);
|
||||
}
|
||||
|
||||
/**
|
||||
* '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.
|
||||
*/
|
||||
public void calcTextSizeA(final ImVec2 dst, final float size, final float maxWidth, final float wrapWidth, final String textBegin, final String textEnd) {
|
||||
nCalcTextSizeA(dst, size, maxWidth, wrapWidth, textBegin, textEnd);
|
||||
}
|
||||
|
||||
private native void nCalcTextSizeA(ImVec2 dst, float size, float maxWidth, float wrapWidth, String textBegin); /*MANUAL
|
||||
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
|
||||
Jni::ImVec2Cpy(env, THIS->CalcTextSizeA(size, maxWidth, wrapWidth, textBegin), dst);
|
||||
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
|
||||
*/
|
||||
|
||||
private native float nCalcTextSizeAX(float size, float maxWidth, float wrapWidth, String obj_textBegin); /*MANUAL
|
||||
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
|
||||
auto _result = THIS->CalcTextSizeA(size, maxWidth, wrapWidth, textBegin).x;
|
||||
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native float nCalcTextSizeAY(float size, float maxWidth, float wrapWidth, String obj_textBegin); /*MANUAL
|
||||
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
|
||||
auto _result = THIS->CalcTextSizeA(size, maxWidth, wrapWidth, textBegin).y;
|
||||
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native void nCalcTextSizeA(ImVec2 dst, float size, float maxWidth, float wrapWidth, String textBegin, String textEnd); /*MANUAL
|
||||
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
|
||||
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
|
||||
Jni::ImVec2Cpy(env, THIS->CalcTextSizeA(size, maxWidth, wrapWidth, textBegin, textEnd), dst);
|
||||
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
|
||||
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
|
||||
*/
|
||||
|
||||
private native float nCalcTextSizeAX(float size, float maxWidth, float wrapWidth, String obj_textBegin, String obj_textEnd); /*MANUAL
|
||||
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
|
||||
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
|
||||
auto _result = THIS->CalcTextSizeA(size, maxWidth, wrapWidth, textBegin, textEnd).x;
|
||||
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
|
||||
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native float nCalcTextSizeAY(float size, float maxWidth, float wrapWidth, String obj_textBegin, String obj_textEnd); /*MANUAL
|
||||
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
|
||||
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
|
||||
auto _result = THIS->CalcTextSizeA(size, maxWidth, wrapWidth, textBegin, textEnd).y;
|
||||
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
|
||||
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
public String calcWordWrapPositionA(final float scale, final String text, final String textEnd, final float wrapWidth) {
|
||||
return nCalcWordWrapPositionA(scale, text, textEnd, wrapWidth);
|
||||
}
|
||||
|
||||
private native String nCalcWordWrapPositionA(float scale, String obj_text, String obj_textEnd, float wrapWidth); /*MANUAL
|
||||
auto text = obj_text == NULL ? NULL : (char*)env->GetStringUTFChars(obj_text, JNI_FALSE);
|
||||
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
|
||||
auto _result = env->NewStringUTF(THIS->CalcWordWrapPositionA(scale, text, textEnd, wrapWidth));
|
||||
if (text != NULL) env->ReleaseStringUTFChars(obj_text, text);
|
||||
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
public void renderChar(final ImDrawList drawList, final float size, final ImVec2 pos, final int col, final int c) {
|
||||
nRenderChar(drawList.ptr, size, pos.x, pos.y, col, c);
|
||||
}
|
||||
|
||||
public void renderChar(final ImDrawList drawList, final float size, final float posX, final float posY, final int col, final int c) {
|
||||
nRenderChar(drawList.ptr, size, posX, posY, col, c);
|
||||
}
|
||||
|
||||
private native void nRenderChar(long drawList, float size, float posX, float posY, int col, int c); /*MANUAL
|
||||
ImVec2 pos = ImVec2(posX, posY);
|
||||
THIS->RenderChar(reinterpret_cast<ImDrawList*>(drawList), size, pos, col, (ImWchar)c);
|
||||
*/
|
||||
|
||||
public void renderText(final ImDrawList drawList, final float size, final ImVec2 pos, final int col, final ImVec4 clipRect, final String textBegin, final String textEnd) {
|
||||
nRenderText(drawList.ptr, size, pos.x, pos.y, col, clipRect.x, clipRect.y, clipRect.z, clipRect.w, textBegin, textEnd);
|
||||
}
|
||||
|
||||
public void renderText(final ImDrawList drawList, final float size, final float posX, final float posY, final int col, final float clipRectX, final float clipRectY, final float clipRectZ, final float clipRectW, final String textBegin, final String textEnd) {
|
||||
nRenderText(drawList.ptr, size, posX, posY, col, clipRectX, clipRectY, clipRectZ, clipRectW, textBegin, textEnd);
|
||||
}
|
||||
|
||||
public void renderText(final ImDrawList drawList, final float size, final ImVec2 pos, final int col, final ImVec4 clipRect, final String textBegin, final String textEnd, final float wrapWidth) {
|
||||
nRenderText(drawList.ptr, size, pos.x, pos.y, col, clipRect.x, clipRect.y, clipRect.z, clipRect.w, textBegin, textEnd, wrapWidth);
|
||||
}
|
||||
|
||||
public void renderText(final ImDrawList drawList, final float size, final float posX, final float posY, final int col, final float clipRectX, final float clipRectY, final float clipRectZ, final float clipRectW, final String textBegin, final String textEnd, final float wrapWidth) {
|
||||
nRenderText(drawList.ptr, size, posX, posY, col, clipRectX, clipRectY, clipRectZ, clipRectW, textBegin, textEnd, wrapWidth);
|
||||
}
|
||||
|
||||
public void renderText(final ImDrawList drawList, final float size, final ImVec2 pos, final int col, final ImVec4 clipRect, final String textBegin, final String textEnd, final float wrapWidth, final boolean cpuFineClip) {
|
||||
nRenderText(drawList.ptr, size, pos.x, pos.y, col, clipRect.x, clipRect.y, clipRect.z, clipRect.w, textBegin, textEnd, wrapWidth, cpuFineClip);
|
||||
}
|
||||
|
||||
public void renderText(final ImDrawList drawList, final float size, final float posX, final float posY, final int col, final float clipRectX, final float clipRectY, final float clipRectZ, final float clipRectW, final String textBegin, final String textEnd, final float wrapWidth, final boolean cpuFineClip) {
|
||||
nRenderText(drawList.ptr, size, posX, posY, col, clipRectX, clipRectY, clipRectZ, clipRectW, textBegin, textEnd, wrapWidth, cpuFineClip);
|
||||
}
|
||||
|
||||
public void renderText(final ImDrawList drawList, final float size, final ImVec2 pos, final int col, final ImVec4 clipRect, final String textBegin, final String textEnd, final boolean cpuFineClip) {
|
||||
nRenderText(drawList.ptr, size, pos.x, pos.y, col, clipRect.x, clipRect.y, clipRect.z, clipRect.w, textBegin, textEnd, cpuFineClip);
|
||||
}
|
||||
|
||||
public void renderText(final ImDrawList drawList, final float size, final float posX, final float posY, final int col, final float clipRectX, final float clipRectY, final float clipRectZ, final float clipRectW, final String textBegin, final String textEnd, final boolean cpuFineClip) {
|
||||
nRenderText(drawList.ptr, size, posX, posY, col, clipRectX, clipRectY, clipRectZ, clipRectW, textBegin, textEnd, cpuFineClip);
|
||||
}
|
||||
|
||||
private native void nRenderText(long drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd); /*MANUAL
|
||||
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
|
||||
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
|
||||
ImVec2 pos = ImVec2(posX, posY);
|
||||
ImVec4 clipRect = ImVec4(clipRectX, clipRectY, clipRectZ, clipRectW);
|
||||
THIS->RenderText(reinterpret_cast<ImDrawList*>(drawList), size, pos, col, clipRect, textBegin, textEnd);
|
||||
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
|
||||
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
|
||||
*/
|
||||
|
||||
private native void nRenderText(long drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd, float wrapWidth); /*MANUAL
|
||||
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
|
||||
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
|
||||
ImVec2 pos = ImVec2(posX, posY);
|
||||
ImVec4 clipRect = ImVec4(clipRectX, clipRectY, clipRectZ, clipRectW);
|
||||
THIS->RenderText(reinterpret_cast<ImDrawList*>(drawList), size, pos, col, clipRect, textBegin, textEnd, wrapWidth);
|
||||
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
|
||||
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
|
||||
*/
|
||||
|
||||
private native void nRenderText(long drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd, float wrapWidth, boolean cpuFineClip); /*MANUAL
|
||||
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
|
||||
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
|
||||
ImVec2 pos = ImVec2(posX, posY);
|
||||
ImVec4 clipRect = ImVec4(clipRectX, clipRectY, clipRectZ, clipRectW);
|
||||
THIS->RenderText(reinterpret_cast<ImDrawList*>(drawList), size, pos, col, clipRect, textBegin, textEnd, wrapWidth, cpuFineClip);
|
||||
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
|
||||
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
|
||||
*/
|
||||
|
||||
private native void nRenderText(long drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd, boolean cpuFineClip); /*MANUAL
|
||||
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
|
||||
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
|
||||
ImVec2 pos = ImVec2(posX, posY);
|
||||
ImVec4 clipRect = ImVec4(clipRectX, clipRectY, clipRectZ, clipRectW);
|
||||
THIS->RenderText(reinterpret_cast<ImDrawList*>(drawList), size, pos, col, clipRect, textBegin, textEnd, 0.0f, cpuFineClip);
|
||||
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
|
||||
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,812 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
import imgui.type.ImInt;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
/**
|
||||
* Load and rasterize multiple TTF/OTF fonts into a same texture. The font atlas will build a single texture holding:
|
||||
* - One or more fonts.
|
||||
* - Custom graphics data needed to render the shapes needed by Dear ImGui.
|
||||
* - Mouse cursor shapes for software cursor rendering (unless setting 'Flags |= ImFontAtlasFlags_NoMouseCursors' in the font atlas).
|
||||
* It is the user-code responsibility to setup/build the atlas, then upload the pixel data into a texture accessible by your graphics api.
|
||||
* - Optionally, call any of the AddFont*** functions. If you don't call any, the default font embedded in the code will be loaded for you.
|
||||
* - Call GetTexDataAsAlpha8() or GetTexDataAsRGBA32() to build and retrieve pixels data.
|
||||
* - Upload the pixels data into a texture within your graphics system (see imgui_impl_xxxx.cpp examples)
|
||||
* - Call SetTexID(my_tex_id); and pass the pointer/identifier to your texture in a format natural to your graphics API.
|
||||
* This value will be passed back to you during rendering to identify the texture. Read FAQ entry about ImTextureID for more details.
|
||||
* Common pitfalls:
|
||||
* - If you pass a 'glyph_ranges' array to AddFont*** functions, you need to make sure that your array persist up until the
|
||||
* atlas is build (when calling GetTexData*** or Build()). We only copy the pointer, not the data.
|
||||
* - Important: By default, AddFontFromMemoryTTF() takes ownership of the data. Even though we are not writing to it, we will free the pointer on destruction.
|
||||
* You can set font_cfg.FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed,
|
||||
* - Even though many functions are suffixed with "TTF", OTF data is supported just as well.
|
||||
* - This is an old API and it is currently awkward for those and and various other reasons! We will address them in the future!
|
||||
*/
|
||||
public final class ImFontAtlas extends ImGuiStructDestroyable {
|
||||
private ByteBuffer alpha8pixels = null;
|
||||
private ByteBuffer rgba32pixels = null;
|
||||
|
||||
public ImFontAtlas() {
|
||||
}
|
||||
|
||||
public ImFontAtlas(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate();
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
#define THIS ((ImFontAtlas*)STRUCT_PTR)
|
||||
|
||||
jmethodID jImFontAtlasCreateAlpha8PixelsMID;
|
||||
jmethodID jImFontAtlasCreateRgba32PixelsMID;
|
||||
*/
|
||||
|
||||
static native void nInit(); /*
|
||||
jclass jImFontAtlasClass = env->FindClass("imgui/ImFontAtlas");
|
||||
jImFontAtlasCreateAlpha8PixelsMID = env->GetMethodID(jImFontAtlasClass, "createAlpha8Pixels", "(I)Ljava/nio/ByteBuffer;");
|
||||
jImFontAtlasCreateRgba32PixelsMID = env->GetMethodID(jImFontAtlasClass, "createRgba32Pixels", "(I)Ljava/nio/ByteBuffer;");
|
||||
*/
|
||||
|
||||
private native long nCreate(); /*
|
||||
return (intptr_t)(new ImFontConfig());
|
||||
*/
|
||||
|
||||
public ImFont addFont(final ImFontConfig imFontConfig) {
|
||||
return new ImFont(nAddFont(imFontConfig.ptr));
|
||||
}
|
||||
|
||||
private native long nAddFont(long imFontConfig); /*
|
||||
return (intptr_t)THIS->AddFont(reinterpret_cast<ImFontConfig*>(imFontConfig));
|
||||
*/
|
||||
|
||||
public ImFont addFontDefault() {
|
||||
return new ImFont(nAddFontDefault());
|
||||
}
|
||||
|
||||
public ImFont addFontDefault(final ImFontConfig imFontConfig) {
|
||||
return new ImFont(nAddFontDefault(imFontConfig.ptr));
|
||||
}
|
||||
|
||||
private native long nAddFontDefault(); /*
|
||||
return (intptr_t)THIS->AddFontDefault();
|
||||
*/
|
||||
|
||||
private native long nAddFontDefault(long imFontConfig); /*
|
||||
return (intptr_t)THIS->AddFontDefault(reinterpret_cast<ImFontConfig*>(imFontConfig));
|
||||
*/
|
||||
|
||||
public ImFont addFontFromFileTTF(final String filename, final float sizePixels) {
|
||||
return new ImFont(nAddFontFromFileTTF(filename, sizePixels));
|
||||
}
|
||||
|
||||
public ImFont addFontFromFileTTF(final String filename, final float sizePixels, final ImFontConfig fontConfig) {
|
||||
return new ImFont(nAddFontFromFileTTF(filename, sizePixels, fontConfig.ptr));
|
||||
}
|
||||
|
||||
public ImFont addFontFromFileTTF(final String filename, final float sizePixels, final ImFontConfig fontConfig, final short[] glyphRanges) {
|
||||
return new ImFont(nAddFontFromFileTTF(filename, sizePixels, fontConfig.ptr, glyphRanges));
|
||||
}
|
||||
|
||||
public ImFont addFontFromFileTTF(final String filename, final float sizePixels, final short[] glyphRanges) {
|
||||
return new ImFont(nAddFontFromFileTTF(filename, sizePixels, glyphRanges));
|
||||
}
|
||||
|
||||
private native long nAddFontFromFileTTF(String obj_filename, float sizePixels); /*MANUAL
|
||||
auto filename = obj_filename == NULL ? NULL : (char*)env->GetStringUTFChars(obj_filename, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromFileTTF(filename, sizePixels);
|
||||
if (filename != NULL) env->ReleaseStringUTFChars(obj_filename, filename);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromFileTTF(String obj_filename, float sizePixels, long fontConfig); /*MANUAL
|
||||
auto filename = obj_filename == NULL ? NULL : (char*)env->GetStringUTFChars(obj_filename, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromFileTTF(filename, sizePixels, reinterpret_cast<ImFontConfig*>(fontConfig));
|
||||
if (filename != NULL) env->ReleaseStringUTFChars(obj_filename, filename);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromFileTTF(String obj_filename, float sizePixels, long fontConfig, short[] obj_glyphRanges); /*MANUAL
|
||||
auto filename = obj_filename == NULL ? NULL : (char*)env->GetStringUTFChars(obj_filename, JNI_FALSE);
|
||||
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromFileTTF(filename, sizePixels, reinterpret_cast<ImFontConfig*>(fontConfig), (ImWchar*)&glyphRanges[0]);
|
||||
if (filename != NULL) env->ReleaseStringUTFChars(obj_filename, filename);
|
||||
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromFileTTF(String obj_filename, float sizePixels, short[] obj_glyphRanges); /*MANUAL
|
||||
auto filename = obj_filename == NULL ? NULL : (char*)env->GetStringUTFChars(obj_filename, JNI_FALSE);
|
||||
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromFileTTF(filename, sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
|
||||
if (filename != NULL) env->ReleaseStringUTFChars(obj_filename, filename);
|
||||
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
||||
* Set font_cfg.FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed.
|
||||
*/
|
||||
public ImFont addFontFromMemoryTTF(final byte[] fontData, final float sizePixels) {
|
||||
return new ImFont(nAddFontFromMemoryTTF(fontData, sizePixels));
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
||||
* Set font_cfg.FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed.
|
||||
*/
|
||||
public ImFont addFontFromMemoryTTF(final byte[] fontData, final float sizePixels, final ImFontConfig fontConfig) {
|
||||
return new ImFont(nAddFontFromMemoryTTF(fontData, sizePixels, fontConfig.ptr));
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
||||
* Set font_cfg.FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed.
|
||||
*/
|
||||
public ImFont addFontFromMemoryTTF(final byte[] fontData, final float sizePixels, final ImFontConfig fontConfig, final short[] glyphRanges) {
|
||||
return new ImFont(nAddFontFromMemoryTTF(fontData, sizePixels, fontConfig.ptr, glyphRanges));
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
||||
* Set font_cfg.FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed.
|
||||
*/
|
||||
public ImFont addFontFromMemoryTTF(final byte[] fontData, final float sizePixels, final short[] glyphRanges) {
|
||||
return new ImFont(nAddFontFromMemoryTTF(fontData, sizePixels, glyphRanges));
|
||||
}
|
||||
|
||||
private native long nAddFontFromMemoryTTF(byte[] obj_fontData, float sizePixels); /*MANUAL
|
||||
auto fontData = obj_fontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_fontData, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryTTF(&fontData[0], (int)env->GetArrayLength(obj_fontData), sizePixels);
|
||||
if (fontData != NULL) env->ReleasePrimitiveArrayCritical(obj_fontData, fontData, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryTTF(byte[] obj_fontData, float sizePixels, long fontConfig); /*MANUAL
|
||||
auto fontData = obj_fontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_fontData, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryTTF(&fontData[0], (int)env->GetArrayLength(obj_fontData), sizePixels, reinterpret_cast<ImFontConfig*>(fontConfig));
|
||||
if (fontData != NULL) env->ReleasePrimitiveArrayCritical(obj_fontData, fontData, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryTTF(byte[] obj_fontData, float sizePixels, long fontConfig, short[] obj_glyphRanges); /*MANUAL
|
||||
auto fontData = obj_fontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_fontData, JNI_FALSE);
|
||||
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryTTF(&fontData[0], (int)env->GetArrayLength(obj_fontData), sizePixels, reinterpret_cast<ImFontConfig*>(fontConfig), (ImWchar*)&glyphRanges[0]);
|
||||
if (fontData != NULL) env->ReleasePrimitiveArrayCritical(obj_fontData, fontData, JNI_FALSE);
|
||||
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryTTF(byte[] obj_fontData, float sizePixels, short[] obj_glyphRanges); /*MANUAL
|
||||
auto fontData = obj_fontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_fontData, JNI_FALSE);
|
||||
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryTTF(&fontData[0], (int)env->GetArrayLength(obj_fontData), sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
|
||||
if (fontData != NULL) env->ReleasePrimitiveArrayCritical(obj_fontData, fontData, JNI_FALSE);
|
||||
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
||||
* Set font_cfg.FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed.
|
||||
*/
|
||||
public ImFont addFontFromMemoryTTF(final byte[] fontData, final int fontSize, final float sizePixels) {
|
||||
return new ImFont(nAddFontFromMemoryTTF(fontData, fontSize, sizePixels));
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
||||
* Set font_cfg.FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed.
|
||||
*/
|
||||
public ImFont addFontFromMemoryTTF(final byte[] fontData, final int fontSize, final float sizePixels, final ImFontConfig fontConfig) {
|
||||
return new ImFont(nAddFontFromMemoryTTF(fontData, fontSize, sizePixels, fontConfig.ptr));
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
||||
* Set font_cfg.FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed.
|
||||
*/
|
||||
public ImFont addFontFromMemoryTTF(final byte[] fontData, final int fontSize, final float sizePixels, final ImFontConfig fontConfig, final short[] glyphRanges) {
|
||||
return new ImFont(nAddFontFromMemoryTTF(fontData, fontSize, sizePixels, fontConfig.ptr, glyphRanges));
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
||||
* Set font_cfg.FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed.
|
||||
*/
|
||||
public ImFont addFontFromMemoryTTF(final byte[] fontData, final int fontSize, final float sizePixels, final short[] glyphRanges) {
|
||||
return new ImFont(nAddFontFromMemoryTTF(fontData, fontSize, sizePixels, glyphRanges));
|
||||
}
|
||||
|
||||
private native long nAddFontFromMemoryTTF(byte[] obj_fontData, int fontSize, float sizePixels); /*MANUAL
|
||||
auto fontData = obj_fontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_fontData, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels);
|
||||
if (fontData != NULL) env->ReleasePrimitiveArrayCritical(obj_fontData, fontData, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryTTF(byte[] obj_fontData, int fontSize, float sizePixels, long fontConfig); /*MANUAL
|
||||
auto fontData = obj_fontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_fontData, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, reinterpret_cast<ImFontConfig*>(fontConfig));
|
||||
if (fontData != NULL) env->ReleasePrimitiveArrayCritical(obj_fontData, fontData, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryTTF(byte[] obj_fontData, int fontSize, float sizePixels, long fontConfig, short[] obj_glyphRanges); /*MANUAL
|
||||
auto fontData = obj_fontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_fontData, JNI_FALSE);
|
||||
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, reinterpret_cast<ImFontConfig*>(fontConfig), (ImWchar*)&glyphRanges[0]);
|
||||
if (fontData != NULL) env->ReleasePrimitiveArrayCritical(obj_fontData, fontData, JNI_FALSE);
|
||||
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryTTF(byte[] obj_fontData, int fontSize, float sizePixels, short[] obj_glyphRanges); /*MANUAL
|
||||
auto fontData = obj_fontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_fontData, JNI_FALSE);
|
||||
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
|
||||
if (fontData != NULL) env->ReleasePrimitiveArrayCritical(obj_fontData, fontData, JNI_FALSE);
|
||||
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
/**
|
||||
* 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
|
||||
*/
|
||||
public ImFont addFontFromMemoryCompressedTTF(final byte[] compressedFontData, final float sizePixels) {
|
||||
return new ImFont(nAddFontFromMemoryCompressedTTF(compressedFontData, sizePixels));
|
||||
}
|
||||
|
||||
/**
|
||||
* 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
|
||||
*/
|
||||
public ImFont addFontFromMemoryCompressedTTF(final byte[] compressedFontData, final float sizePixels, final ImFontConfig imFontConfig) {
|
||||
return new ImFont(nAddFontFromMemoryCompressedTTF(compressedFontData, sizePixels, imFontConfig.ptr));
|
||||
}
|
||||
|
||||
/**
|
||||
* 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
|
||||
*/
|
||||
public ImFont addFontFromMemoryCompressedTTF(final byte[] compressedFontData, final float sizePixels, final ImFontConfig imFontConfig, final short[] glyphRanges) {
|
||||
return new ImFont(nAddFontFromMemoryCompressedTTF(compressedFontData, sizePixels, imFontConfig.ptr, glyphRanges));
|
||||
}
|
||||
|
||||
/**
|
||||
* 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
|
||||
*/
|
||||
public ImFont addFontFromMemoryCompressedTTF(final byte[] compressedFontData, final float sizePixels, final short[] glyphRanges) {
|
||||
return new ImFont(nAddFontFromMemoryCompressedTTF(compressedFontData, sizePixels, glyphRanges));
|
||||
}
|
||||
|
||||
private native long nAddFontFromMemoryCompressedTTF(byte[] obj_compressedFontData, float sizePixels); /*MANUAL
|
||||
auto compressedFontData = obj_compressedFontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_compressedFontData, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], (int)env->GetArrayLength(obj_compressedFontData), sizePixels);
|
||||
if (compressedFontData != NULL) env->ReleasePrimitiveArrayCritical(obj_compressedFontData, compressedFontData, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryCompressedTTF(byte[] obj_compressedFontData, float sizePixels, long imFontConfig); /*MANUAL
|
||||
auto compressedFontData = obj_compressedFontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_compressedFontData, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], (int)env->GetArrayLength(obj_compressedFontData), sizePixels, reinterpret_cast<ImFontConfig*>(imFontConfig));
|
||||
if (compressedFontData != NULL) env->ReleasePrimitiveArrayCritical(obj_compressedFontData, compressedFontData, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryCompressedTTF(byte[] obj_compressedFontData, float sizePixels, long imFontConfig, short[] obj_glyphRanges); /*MANUAL
|
||||
auto compressedFontData = obj_compressedFontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_compressedFontData, JNI_FALSE);
|
||||
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], (int)env->GetArrayLength(obj_compressedFontData), sizePixels, reinterpret_cast<ImFontConfig*>(imFontConfig), (ImWchar*)&glyphRanges[0]);
|
||||
if (compressedFontData != NULL) env->ReleasePrimitiveArrayCritical(obj_compressedFontData, compressedFontData, JNI_FALSE);
|
||||
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryCompressedTTF(byte[] obj_compressedFontData, float sizePixels, short[] obj_glyphRanges); /*MANUAL
|
||||
auto compressedFontData = obj_compressedFontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_compressedFontData, JNI_FALSE);
|
||||
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], (int)env->GetArrayLength(obj_compressedFontData), sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
|
||||
if (compressedFontData != NULL) env->ReleasePrimitiveArrayCritical(obj_compressedFontData, compressedFontData, JNI_FALSE);
|
||||
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
/**
|
||||
* 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
|
||||
*/
|
||||
public ImFont addFontFromMemoryCompressedTTF(final byte[] compressedFontData, final int compressedFontSize, final float sizePixels) {
|
||||
return new ImFont(nAddFontFromMemoryCompressedTTF(compressedFontData, compressedFontSize, sizePixels));
|
||||
}
|
||||
|
||||
/**
|
||||
* 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
|
||||
*/
|
||||
public ImFont addFontFromMemoryCompressedTTF(final byte[] compressedFontData, final int compressedFontSize, final float sizePixels, final ImFontConfig imFontConfig) {
|
||||
return new ImFont(nAddFontFromMemoryCompressedTTF(compressedFontData, compressedFontSize, sizePixels, imFontConfig.ptr));
|
||||
}
|
||||
|
||||
/**
|
||||
* 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
|
||||
*/
|
||||
public ImFont addFontFromMemoryCompressedTTF(final byte[] compressedFontData, final int compressedFontSize, final float sizePixels, final ImFontConfig imFontConfig, final short[] glyphRanges) {
|
||||
return new ImFont(nAddFontFromMemoryCompressedTTF(compressedFontData, compressedFontSize, sizePixels, imFontConfig.ptr, glyphRanges));
|
||||
}
|
||||
|
||||
/**
|
||||
* 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
|
||||
*/
|
||||
public ImFont addFontFromMemoryCompressedTTF(final byte[] compressedFontData, final int compressedFontSize, final float sizePixels, final short[] glyphRanges) {
|
||||
return new ImFont(nAddFontFromMemoryCompressedTTF(compressedFontData, compressedFontSize, sizePixels, glyphRanges));
|
||||
}
|
||||
|
||||
private native long nAddFontFromMemoryCompressedTTF(byte[] obj_compressedFontData, int compressedFontSize, float sizePixels); /*MANUAL
|
||||
auto compressedFontData = obj_compressedFontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_compressedFontData, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], compressedFontSize, sizePixels);
|
||||
if (compressedFontData != NULL) env->ReleasePrimitiveArrayCritical(obj_compressedFontData, compressedFontData, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryCompressedTTF(byte[] obj_compressedFontData, int compressedFontSize, float sizePixels, long imFontConfig); /*MANUAL
|
||||
auto compressedFontData = obj_compressedFontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_compressedFontData, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], compressedFontSize, sizePixels, reinterpret_cast<ImFontConfig*>(imFontConfig));
|
||||
if (compressedFontData != NULL) env->ReleasePrimitiveArrayCritical(obj_compressedFontData, compressedFontData, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryCompressedTTF(byte[] obj_compressedFontData, int compressedFontSize, float sizePixels, long imFontConfig, short[] obj_glyphRanges); /*MANUAL
|
||||
auto compressedFontData = obj_compressedFontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_compressedFontData, JNI_FALSE);
|
||||
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], compressedFontSize, sizePixels, reinterpret_cast<ImFontConfig*>(imFontConfig), (ImWchar*)&glyphRanges[0]);
|
||||
if (compressedFontData != NULL) env->ReleasePrimitiveArrayCritical(obj_compressedFontData, compressedFontData, JNI_FALSE);
|
||||
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryCompressedTTF(byte[] obj_compressedFontData, int compressedFontSize, float sizePixels, short[] obj_glyphRanges); /*MANUAL
|
||||
auto compressedFontData = obj_compressedFontData == NULL ? NULL : (char*)env->GetPrimitiveArrayCritical(obj_compressedFontData, JNI_FALSE);
|
||||
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], compressedFontSize, sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
|
||||
if (compressedFontData != NULL) env->ReleasePrimitiveArrayCritical(obj_compressedFontData, compressedFontData, JNI_FALSE);
|
||||
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
/**
|
||||
* 'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter.
|
||||
*/
|
||||
public ImFont addFontFromMemoryCompressedBase85TTF(final String compressedFontDataBase85, final float sizePixels, final ImFontConfig fontConfig) {
|
||||
return new ImFont(nAddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, fontConfig.ptr));
|
||||
}
|
||||
|
||||
/**
|
||||
* 'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter.
|
||||
*/
|
||||
public ImFont addFontFromMemoryCompressedBase85TTF(final String compressedFontDataBase85, final float sizePixels, final ImFontConfig fontConfig, final short[] glyphRanges) {
|
||||
return new ImFont(nAddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, fontConfig.ptr, glyphRanges));
|
||||
}
|
||||
|
||||
private native long nAddFontFromMemoryCompressedBase85TTF(String obj_compressedFontDataBase85, float sizePixels, long fontConfig); /*MANUAL
|
||||
auto compressedFontDataBase85 = obj_compressedFontDataBase85 == NULL ? NULL : (char*)env->GetStringUTFChars(obj_compressedFontDataBase85, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, reinterpret_cast<ImFontConfig*>(fontConfig));
|
||||
if (compressedFontDataBase85 != NULL) env->ReleaseStringUTFChars(obj_compressedFontDataBase85, compressedFontDataBase85);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native long nAddFontFromMemoryCompressedBase85TTF(String obj_compressedFontDataBase85, float sizePixels, long fontConfig, short[] obj_glyphRanges); /*MANUAL
|
||||
auto compressedFontDataBase85 = obj_compressedFontDataBase85 == NULL ? NULL : (char*)env->GetStringUTFChars(obj_compressedFontDataBase85, JNI_FALSE);
|
||||
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
|
||||
auto _result = (intptr_t)THIS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, reinterpret_cast<ImFontConfig*>(fontConfig), (ImWchar*)&glyphRanges[0]);
|
||||
if (compressedFontDataBase85 != NULL) env->ReleaseStringUTFChars(obj_compressedFontDataBase85, compressedFontDataBase85);
|
||||
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts.
|
||||
*/
|
||||
public void clearInputData() {
|
||||
nClearInputData();
|
||||
}
|
||||
|
||||
private native void nClearInputData(); /*
|
||||
THIS->ClearInputData();
|
||||
*/
|
||||
|
||||
/**
|
||||
* Clear output texture data (CPU side). Saves RAM once the texture has been copied to graphics memory.
|
||||
*/
|
||||
public void clearTexData() {
|
||||
nClearTexData();
|
||||
}
|
||||
|
||||
private native void nClearTexData(); /*
|
||||
THIS->ClearTexData();
|
||||
*/
|
||||
|
||||
/**
|
||||
* Clear output font data (glyphs storage, UV coordinates).
|
||||
*/
|
||||
public void clearFonts() {
|
||||
nClearFonts();
|
||||
}
|
||||
|
||||
private native void nClearFonts(); /*
|
||||
THIS->ClearFonts();
|
||||
*/
|
||||
|
||||
/**
|
||||
* Clear all input and output.
|
||||
*/
|
||||
public void clear() {
|
||||
nClear();
|
||||
}
|
||||
|
||||
private native void nClear(); /*
|
||||
THIS->Clear();
|
||||
*/
|
||||
|
||||
// Build atlas, retrieve pixel data.
|
||||
// User is in charge of copying the pixels into graphics memory (e.g. create a texture with your engine). Then store your texture handle with SetTexID().
|
||||
// The pitch is always = Width * BytesPerPixels (1 or 4)
|
||||
// Building in RGBA32 format is provided for convenience and compatibility, but note that unless you manually manipulate or copy color data into
|
||||
// the texture (e.g. when using the AddCustomRect*** api), then the RGB pixels emitted will always be white (~75% of memory/bandwidth waste.
|
||||
|
||||
/**
|
||||
* Build pixels data. This is called automatically for you by the GetTexData*** functions.
|
||||
*/
|
||||
public boolean build() {
|
||||
return nBuild();
|
||||
}
|
||||
|
||||
private native boolean nBuild(); /*
|
||||
return THIS->Build();
|
||||
*/
|
||||
|
||||
/**
|
||||
* 1 byte-per-pixel
|
||||
*/
|
||||
public ByteBuffer getTexDataAsAlpha8(final ImInt outWidth, final ImInt outHeight) {
|
||||
return getTexDataAsAlpha8(outWidth, outHeight, new ImInt());
|
||||
}
|
||||
|
||||
/**
|
||||
* 1 byte-per-pixel
|
||||
*/
|
||||
public ByteBuffer getTexDataAsAlpha8(final ImInt outWidth, final ImInt outHeight, final ImInt outBytesPerPixel) {
|
||||
getTexDataAsAlpha8(outWidth.getData(), outHeight.getData(), outBytesPerPixel.getData());
|
||||
return alpha8pixels;
|
||||
}
|
||||
|
||||
private ByteBuffer createAlpha8Pixels(final int size) {
|
||||
if (alpha8pixels == null || alpha8pixels.limit() != size) {
|
||||
alpha8pixels = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
|
||||
} else {
|
||||
alpha8pixels.clear();
|
||||
}
|
||||
return alpha8pixels;
|
||||
}
|
||||
|
||||
private native void getTexDataAsAlpha8(int[] outWidth, int[] outHeight, int[] outBytesPerPixel); /*
|
||||
unsigned char* pixels;
|
||||
THIS->GetTexDataAsAlpha8(&pixels, &outWidth[0], &outHeight[0], &outBytesPerPixel[0]);
|
||||
int size = outWidth[0] * outHeight[0] * outBytesPerPixel[0];
|
||||
jobject jBuffer = env->CallObjectMethod(object, jImFontAtlasCreateAlpha8PixelsMID, size);
|
||||
char* buffer = (char*)env->GetDirectBufferAddress(jBuffer);
|
||||
memcpy(buffer, pixels, size);
|
||||
*/
|
||||
|
||||
/**
|
||||
* 4 bytes-per-pixel
|
||||
*/
|
||||
public ByteBuffer getTexDataAsRGBA32(final ImInt outWidth, final ImInt outHeight) {
|
||||
return getTexDataAsRGBA32(outWidth, outHeight, new ImInt());
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 bytes-per-pixel
|
||||
*/
|
||||
public ByteBuffer getTexDataAsRGBA32(final ImInt outWidth, final ImInt outHeight, final ImInt outBytesPerPixel) {
|
||||
nGetTexDataAsRGBA32(outWidth.getData(), outHeight.getData(), outBytesPerPixel.getData());
|
||||
return rgba32pixels;
|
||||
}
|
||||
|
||||
private ByteBuffer createRgba32Pixels(final int size) {
|
||||
if (rgba32pixels == null || rgba32pixels.limit() != size) {
|
||||
rgba32pixels = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
|
||||
} else {
|
||||
rgba32pixels.clear();
|
||||
}
|
||||
return rgba32pixels;
|
||||
}
|
||||
|
||||
private native void nGetTexDataAsRGBA32(int[] outWidth, int[] outHeight, int[] outBytesPerPixel); /*
|
||||
unsigned char* pixels;
|
||||
THIS->GetTexDataAsRGBA32(&pixels, &outWidth[0], &outHeight[0], &outBytesPerPixel[0]);
|
||||
int size = outWidth[0] * outHeight[0] * outBytesPerPixel[0];
|
||||
jobject jBuffer = env->CallObjectMethod(object, jImFontAtlasCreateRgba32PixelsMID, size);
|
||||
char* buffer = (char*)env->GetDirectBufferAddress(jBuffer);
|
||||
memcpy(buffer, pixels, size);
|
||||
*/
|
||||
|
||||
public boolean isBuilt() {
|
||||
return nIsBuilt();
|
||||
}
|
||||
|
||||
private native boolean nIsBuilt(); /*
|
||||
return THIS->IsBuilt();
|
||||
*/
|
||||
|
||||
/**
|
||||
* User data to refer to the texture once it has been uploaded to user's graphic systems.
|
||||
* It is passed back to you during rendering via the ImDrawCmd structure.
|
||||
*/
|
||||
public void setTexID(final int textureID) {
|
||||
nSetTexID(textureID);
|
||||
}
|
||||
|
||||
private native void nSetTexID(int textureID); /*
|
||||
THIS->SetTexID((ImTextureID)(intptr_t)textureID);
|
||||
*/
|
||||
|
||||
//-------------------------------------------
|
||||
// Glyph Ranges
|
||||
//-------------------------------------------
|
||||
|
||||
// Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list)
|
||||
// NB: Make sure that your string are UTF-8 and NOT in your local code page. In C++11, you can create UTF-8 string literal using the u8"Hello world" syntax. See FAQ for details.
|
||||
// NB: Consider using ImFontGlyphRangesBuilder to build glyph ranges from textual data.
|
||||
|
||||
/*JNI
|
||||
#define RETURN_GLYPH_2_SHORT(glyphs) \
|
||||
const ImWchar* ranges = glyphs; \
|
||||
int size = 0; \
|
||||
for (; ranges[0]; ranges += 2) \
|
||||
size += 2; \
|
||||
jshortArray jShorts = env->NewShortArray(size); \
|
||||
env->SetShortArrayRegion(jShorts, 0, size, (jshort*)glyphs); \
|
||||
return jShorts;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Basic Latin, Extended Latin
|
||||
*/
|
||||
public native short[] getGlyphRangesDefault(); /*
|
||||
RETURN_GLYPH_2_SHORT(THIS->GetGlyphRangesDefault());
|
||||
*/
|
||||
|
||||
/**
|
||||
* Default + Korean characters
|
||||
*/
|
||||
public native short[] getGlyphRangesKorean(); /*
|
||||
RETURN_GLYPH_2_SHORT(THIS->GetGlyphRangesKorean());
|
||||
*/
|
||||
|
||||
/**
|
||||
* Default + Hiragana, Katakana, Half-Width, Selection of 2999 Ideographs
|
||||
*/
|
||||
public native short[] getGlyphRangesJapanese(); /*
|
||||
RETURN_GLYPH_2_SHORT(THIS->GetGlyphRangesJapanese());
|
||||
*/
|
||||
|
||||
/**
|
||||
* Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs
|
||||
*/
|
||||
public native short[] getGlyphRangesChineseFull(); /*
|
||||
RETURN_GLYPH_2_SHORT(THIS->GetGlyphRangesChineseFull());
|
||||
*/
|
||||
|
||||
/**
|
||||
* Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese
|
||||
*/
|
||||
public native short[] getGlyphRangesChineseSimplifiedCommon(); /*
|
||||
RETURN_GLYPH_2_SHORT(THIS->GetGlyphRangesChineseSimplifiedCommon());
|
||||
*/
|
||||
|
||||
/**
|
||||
* Default + about 400 Cyrillic characters
|
||||
*/
|
||||
public native short[] getGlyphRangesCyrillic(); /*
|
||||
RETURN_GLYPH_2_SHORT(THIS->GetGlyphRangesCyrillic());
|
||||
*/
|
||||
|
||||
/**
|
||||
* Default + Thai characters
|
||||
*/
|
||||
public native short[] getGlyphRangesThai(); /*
|
||||
RETURN_GLYPH_2_SHORT(THIS->GetGlyphRangesThai());
|
||||
*/
|
||||
|
||||
/**
|
||||
* Default + Vietnamese characters
|
||||
*/
|
||||
public native short[] getGlyphRangesVietnamese(); /*
|
||||
RETURN_GLYPH_2_SHORT(THIS->GetGlyphRangesVietnamese());
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef RETURN_GLYPH_2_SHORT
|
||||
*/
|
||||
|
||||
//-------------------------------------------
|
||||
// [BETA] Custom Rectangles/Glyphs API
|
||||
//-------------------------------------------
|
||||
|
||||
// You can request arbitrary rectangles to be packed into the atlas, for your own purposes.
|
||||
// After calling Build(), you can query the rectangle position and render your pixels.
|
||||
// You can also request your rectangles to be mapped as font glyph (given a font + Unicode point),
|
||||
// so you can render e.g. custom colorful icons and use them as regular glyphs.
|
||||
// Read docs/FONTS.md for more details about using colorful icons.
|
||||
// Note: this API may be redesigned later in order to support multi-monitor varying DPI settings.
|
||||
|
||||
public int addCustomRectRegular(final int width, final int height) {
|
||||
return nAddCustomRectRegular(width, height);
|
||||
}
|
||||
|
||||
private native int nAddCustomRectRegular(int width, int height); /*
|
||||
return THIS->AddCustomRectRegular(width, height);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Id needs to be {@code <} 0x110000 to register a rectangle to map into a specific font.
|
||||
*/
|
||||
public int addCustomRectFontGlyph(final ImFont imFont, final short id, final int width, final int height, final float advanceX) {
|
||||
return nAddCustomRectFontGlyph(imFont.ptr, id, width, height, advanceX);
|
||||
}
|
||||
|
||||
/**
|
||||
* Id needs to be {@code <} 0x110000 to register a rectangle to map into a specific font.
|
||||
*/
|
||||
public int addCustomRectFontGlyph(final ImFont imFont, final short id, final int width, final int height, final float advanceX, final ImVec2 offset) {
|
||||
return nAddCustomRectFontGlyph(imFont.ptr, id, width, height, advanceX, offset.x, offset.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Id needs to be {@code <} 0x110000 to register a rectangle to map into a specific font.
|
||||
*/
|
||||
public int addCustomRectFontGlyph(final ImFont imFont, final short id, final int width, final int height, final float advanceX, final float offsetX, final float offsetY) {
|
||||
return nAddCustomRectFontGlyph(imFont.ptr, id, width, height, advanceX, offsetX, offsetY);
|
||||
}
|
||||
|
||||
private native int nAddCustomRectFontGlyph(long imFont, short id, int width, int height, float advanceX); /*
|
||||
return THIS->AddCustomRectFontGlyph(reinterpret_cast<ImFont*>(imFont), (ImWchar)id, width, height, advanceX);
|
||||
*/
|
||||
|
||||
private native int nAddCustomRectFontGlyph(long imFont, short id, int width, int height, float advanceX, float offsetX, float offsetY); /*MANUAL
|
||||
ImVec2 offset = ImVec2(offsetX, offsetY);
|
||||
auto _result = THIS->AddCustomRectFontGlyph(reinterpret_cast<ImFont*>(imFont), (ImWchar)id, width, height, advanceX, offset);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
// TODO GetCustomRectByIndex
|
||||
|
||||
//-------------------------------------------
|
||||
// Members
|
||||
//-------------------------------------------
|
||||
|
||||
/**
|
||||
* Build flags (see {@link imgui.flag.ImFontAtlasFlags})
|
||||
*/
|
||||
public int getFlags() {
|
||||
return nGetFlags();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build flags (see {@link imgui.flag.ImFontAtlasFlags})
|
||||
*/
|
||||
public void setFlags(final int value) {
|
||||
nSetFlags(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build flags (see {@link imgui.flag.ImFontAtlasFlags})
|
||||
*/
|
||||
public void addFlags(final int flags) {
|
||||
setFlags(getFlags() | flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build flags (see {@link imgui.flag.ImFontAtlasFlags})
|
||||
*/
|
||||
public void removeFlags(final int flags) {
|
||||
setFlags(getFlags() & ~(flags));
|
||||
}
|
||||
|
||||
/**
|
||||
* Build flags (see {@link imgui.flag.ImFontAtlasFlags})
|
||||
*/
|
||||
public boolean hasFlags(final int flags) {
|
||||
return (getFlags() & flags) != 0;
|
||||
}
|
||||
|
||||
private native int nGetFlags(); /*
|
||||
return THIS->Flags;
|
||||
*/
|
||||
|
||||
private native void nSetFlags(int value); /*
|
||||
THIS->Flags = value;
|
||||
*/
|
||||
|
||||
// TexID implemented as SetTexID function
|
||||
|
||||
/**
|
||||
* Texture width desired by user before Build(). Must be a power-of-two.
|
||||
* If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
|
||||
*/
|
||||
public int getTexDesiredWidth() {
|
||||
return nGetTexDesiredWidth();
|
||||
}
|
||||
|
||||
/**
|
||||
* Texture width desired by user before Build(). Must be a power-of-two.
|
||||
* If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
|
||||
*/
|
||||
public void setTexDesiredWidth(final int value) {
|
||||
nSetTexDesiredWidth(value);
|
||||
}
|
||||
|
||||
private native int nGetTexDesiredWidth(); /*
|
||||
return THIS->TexDesiredWidth;
|
||||
*/
|
||||
|
||||
private native void nSetTexDesiredWidth(int value); /*
|
||||
THIS->TexDesiredWidth = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Padding between glyphs within texture in pixels. Defaults to 1.
|
||||
* If your rendering method doesn't rely on bilinear filtering you may set this to 0.
|
||||
*/
|
||||
public int getTexGlyphPadding() {
|
||||
return nGetTexGlyphPadding();
|
||||
}
|
||||
|
||||
/**
|
||||
* Padding between glyphs within texture in pixels. Defaults to 1.
|
||||
* If your rendering method doesn't rely on bilinear filtering you may set this to 0.
|
||||
*/
|
||||
public void setTexGlyphPadding(final int value) {
|
||||
nSetTexGlyphPadding(value);
|
||||
}
|
||||
|
||||
private native int nGetTexGlyphPadding(); /*
|
||||
return THIS->TexGlyphPadding;
|
||||
*/
|
||||
|
||||
private native void nSetTexGlyphPadding(int value); /*
|
||||
THIS->TexGlyphPadding = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
|
||||
*/
|
||||
public boolean getLocked() {
|
||||
return nGetLocked();
|
||||
}
|
||||
|
||||
/**
|
||||
* Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
|
||||
*/
|
||||
public void setLocked(final boolean value) {
|
||||
nSetLocked(value);
|
||||
}
|
||||
|
||||
private native boolean nGetLocked(); /*
|
||||
return THIS->Locked;
|
||||
*/
|
||||
|
||||
private native void nSetLocked(boolean value); /*
|
||||
THIS->Locked = value;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,501 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
|
||||
public final class ImFontConfig extends ImGuiStructDestroyable {
|
||||
public ImFontConfig() {
|
||||
super();
|
||||
}
|
||||
|
||||
ImFontConfig(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate();
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
#define THIS ((ImFontConfig*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
private native long nCreate(); /*
|
||||
ImFontConfig* cfg = new ImFontConfig();
|
||||
cfg->FontDataOwnedByAtlas = false;
|
||||
return (intptr_t)cfg;
|
||||
*/
|
||||
|
||||
// TODO: FontData
|
||||
|
||||
/**
|
||||
* TTF/OTF data size
|
||||
*/
|
||||
public int getFontDataSize() {
|
||||
return nGetFontDataSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* TTF/OTF data size
|
||||
*/
|
||||
public void setFontDataSize(final int value) {
|
||||
nSetFontDataSize(value);
|
||||
}
|
||||
|
||||
private native int nGetFontDataSize(); /*
|
||||
return THIS->FontDataSize;
|
||||
*/
|
||||
|
||||
private native void nSetFontDataSize(int value); /*
|
||||
THIS->FontDataSize = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
|
||||
*/
|
||||
public boolean getFontDataOwnedByAtlas() {
|
||||
return nGetFontDataOwnedByAtlas();
|
||||
}
|
||||
|
||||
/**
|
||||
* TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
|
||||
*/
|
||||
public void setFontDataOwnedByAtlas(final boolean value) {
|
||||
nSetFontDataOwnedByAtlas(value);
|
||||
}
|
||||
|
||||
private native boolean nGetFontDataOwnedByAtlas(); /*
|
||||
return THIS->FontDataOwnedByAtlas;
|
||||
*/
|
||||
|
||||
private native void nSetFontDataOwnedByAtlas(boolean value); /*
|
||||
THIS->FontDataOwnedByAtlas = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Index of font within TTF/OTF file
|
||||
*/
|
||||
public int getFontNo() {
|
||||
return nGetFontNo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Index of font within TTF/OTF file
|
||||
*/
|
||||
public void setFontNo(final int value) {
|
||||
nSetFontNo(value);
|
||||
}
|
||||
|
||||
private native int nGetFontNo(); /*
|
||||
return THIS->FontNo;
|
||||
*/
|
||||
|
||||
private native void nSetFontNo(int value); /*
|
||||
THIS->FontNo = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Size in pixels for rasterizer (more or less maps to the resulting font height).
|
||||
*/
|
||||
public float getSizePixels() {
|
||||
return nGetSizePixels();
|
||||
}
|
||||
|
||||
/**
|
||||
* Size in pixels for rasterizer (more or less maps to the resulting font height).
|
||||
*/
|
||||
public void setSizePixels(final float value) {
|
||||
nSetSizePixels(value);
|
||||
}
|
||||
|
||||
private native float nGetSizePixels(); /*
|
||||
return THIS->SizePixels;
|
||||
*/
|
||||
|
||||
private native void nSetSizePixels(float value); /*
|
||||
THIS->SizePixels = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Rasterize at higher quality for sub-pixel positioning.
|
||||
* Note the difference between 2 and 3 is minimal so you can reduce this to 2 to save memory.
|
||||
* Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details.
|
||||
*/
|
||||
public int getOversampleH() {
|
||||
return nGetOversampleH();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rasterize at higher quality for sub-pixel positioning.
|
||||
* Note the difference between 2 and 3 is minimal so you can reduce this to 2 to save memory.
|
||||
* Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details.
|
||||
*/
|
||||
public void setOversampleH(final int value) {
|
||||
nSetOversampleH(value);
|
||||
}
|
||||
|
||||
private native int nGetOversampleH(); /*
|
||||
return THIS->OversampleH;
|
||||
*/
|
||||
|
||||
private native void nSetOversampleH(int value); /*
|
||||
THIS->OversampleH = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Rasterize at higher quality for sub-pixel positioning.
|
||||
* This is not really useful as we don't use sub-pixel positions on the Y axis.
|
||||
*/
|
||||
public int getOversampleV() {
|
||||
return nGetOversampleV();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rasterize at higher quality for sub-pixel positioning.
|
||||
* This is not really useful as we don't use sub-pixel positions on the Y axis.
|
||||
*/
|
||||
public void setOversampleV(final int value) {
|
||||
nSetOversampleV(value);
|
||||
}
|
||||
|
||||
private native int nGetOversampleV(); /*
|
||||
return THIS->OversampleV;
|
||||
*/
|
||||
|
||||
private native void nSetOversampleV(int value); /*
|
||||
THIS->OversampleV = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font.
|
||||
* If enabled, you can set OversampleH/V to 1.
|
||||
*/
|
||||
public boolean getPixelSnapH() {
|
||||
return nGetPixelSnapH();
|
||||
}
|
||||
|
||||
/**
|
||||
* Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font.
|
||||
* If enabled, you can set OversampleH/V to 1.
|
||||
*/
|
||||
public void setPixelSnapH(final boolean value) {
|
||||
nSetPixelSnapH(value);
|
||||
}
|
||||
|
||||
private native boolean nGetPixelSnapH(); /*
|
||||
return THIS->PixelSnapH;
|
||||
*/
|
||||
|
||||
private native void nSetPixelSnapH(boolean value); /*
|
||||
THIS->PixelSnapH = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
|
||||
*/
|
||||
public ImVec2 getGlyphExtraSpacing() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetGlyphExtraSpacing(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
|
||||
*/
|
||||
public float getGlyphExtraSpacingX() {
|
||||
return nGetGlyphExtraSpacingX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
|
||||
*/
|
||||
public float getGlyphExtraSpacingY() {
|
||||
return nGetGlyphExtraSpacingY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
|
||||
*/
|
||||
public void getGlyphExtraSpacing(final ImVec2 dst) {
|
||||
nGetGlyphExtraSpacing(dst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
|
||||
*/
|
||||
public void setGlyphExtraSpacing(final ImVec2 value) {
|
||||
nSetGlyphExtraSpacing(value.x, value.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
|
||||
*/
|
||||
public void setGlyphExtraSpacing(final float valueX, final float valueY) {
|
||||
nSetGlyphExtraSpacing(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetGlyphExtraSpacing(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->GlyphExtraSpacing, dst);
|
||||
*/
|
||||
|
||||
private native float nGetGlyphExtraSpacingX(); /*
|
||||
return THIS->GlyphExtraSpacing.x;
|
||||
*/
|
||||
|
||||
private native float nGetGlyphExtraSpacingY(); /*
|
||||
return THIS->GlyphExtraSpacing.y;
|
||||
*/
|
||||
|
||||
private native void nSetGlyphExtraSpacing(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->GlyphExtraSpacing = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Offset all glyphs from this font input.
|
||||
*/
|
||||
public ImVec2 getGlyphOffset() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetGlyphOffset(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset all glyphs from this font input.
|
||||
*/
|
||||
public float getGlyphOffsetX() {
|
||||
return nGetGlyphOffsetX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset all glyphs from this font input.
|
||||
*/
|
||||
public float getGlyphOffsetY() {
|
||||
return nGetGlyphOffsetY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset all glyphs from this font input.
|
||||
*/
|
||||
public void getGlyphOffset(final ImVec2 dst) {
|
||||
nGetGlyphOffset(dst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset all glyphs from this font input.
|
||||
*/
|
||||
public void setGlyphOffset(final ImVec2 value) {
|
||||
nSetGlyphOffset(value.x, value.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset all glyphs from this font input.
|
||||
*/
|
||||
public void setGlyphOffset(final float valueX, final float valueY) {
|
||||
nSetGlyphOffset(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetGlyphOffset(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->GlyphOffset, dst);
|
||||
*/
|
||||
|
||||
private native float nGetGlyphOffsetX(); /*
|
||||
return THIS->GlyphOffset.x;
|
||||
*/
|
||||
|
||||
private native float nGetGlyphOffsetY(); /*
|
||||
return THIS->GlyphOffset.y;
|
||||
*/
|
||||
|
||||
private native void nSetGlyphOffset(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->GlyphOffset = value;
|
||||
*/
|
||||
|
||||
// TODO: GlyphRanges
|
||||
|
||||
/**
|
||||
* Minimum AdvanceX for glyphs, set Min to align font icons, set both Min/Max to enforce mono-space font
|
||||
*/
|
||||
public float getGlyphMinAdvanceX() {
|
||||
return nGetGlyphMinAdvanceX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Minimum AdvanceX for glyphs, set Min to align font icons, set both Min/Max to enforce mono-space font
|
||||
*/
|
||||
public void setGlyphMinAdvanceX(final float value) {
|
||||
nSetGlyphMinAdvanceX(value);
|
||||
}
|
||||
|
||||
private native float nGetGlyphMinAdvanceX(); /*
|
||||
return THIS->GlyphMinAdvanceX;
|
||||
*/
|
||||
|
||||
private native void nSetGlyphMinAdvanceX(float value); /*
|
||||
THIS->GlyphMinAdvanceX = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Maximum AdvanceX for glyphs
|
||||
*/
|
||||
public float getGlyphMaxAdvanceX() {
|
||||
return nGetGlyphMaxAdvanceX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Maximum AdvanceX for glyphs
|
||||
*/
|
||||
public void setGlyphMaxAdvanceX(final float value) {
|
||||
nSetGlyphMaxAdvanceX(value);
|
||||
}
|
||||
|
||||
private native float nGetGlyphMaxAdvanceX(); /*
|
||||
return THIS->GlyphMaxAdvanceX;
|
||||
*/
|
||||
|
||||
private native void nSetGlyphMaxAdvanceX(float value); /*
|
||||
THIS->GlyphMaxAdvanceX = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs).
|
||||
* You may want to use GlyphOffset.y when merge font of different heights.
|
||||
*/
|
||||
public boolean getMergeMode() {
|
||||
return nGetMergeMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs).
|
||||
* You may want to use GlyphOffset.y when merge font of different heights.
|
||||
*/
|
||||
public void setMergeMode(final boolean value) {
|
||||
nSetMergeMode(value);
|
||||
}
|
||||
|
||||
private native boolean nGetMergeMode(); /*
|
||||
return THIS->MergeMode;
|
||||
*/
|
||||
|
||||
private native void nSetMergeMode(boolean value); /*
|
||||
THIS->MergeMode = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Settings for custom font builder. THIS IS BUILDER IMPLEMENTATION DEPENDENT. Leave as zero if unsure.
|
||||
*/
|
||||
public int getFontBuilderFlags() {
|
||||
return nGetFontBuilderFlags();
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings for custom font builder. THIS IS BUILDER IMPLEMENTATION DEPENDENT. Leave as zero if unsure.
|
||||
*/
|
||||
public void setFontBuilderFlags(final int value) {
|
||||
nSetFontBuilderFlags(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings for custom font builder. THIS IS BUILDER IMPLEMENTATION DEPENDENT. Leave as zero if unsure.
|
||||
*/
|
||||
public void addFontBuilderFlags(final int flags) {
|
||||
setFontBuilderFlags(getFontBuilderFlags() | flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings for custom font builder. THIS IS BUILDER IMPLEMENTATION DEPENDENT. Leave as zero if unsure.
|
||||
*/
|
||||
public void removeFontBuilderFlags(final int flags) {
|
||||
setFontBuilderFlags(getFontBuilderFlags() & ~(flags));
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings for custom font builder. THIS IS BUILDER IMPLEMENTATION DEPENDENT. Leave as zero if unsure.
|
||||
*/
|
||||
public boolean hasFontBuilderFlags(final int flags) {
|
||||
return (getFontBuilderFlags() & flags) != 0;
|
||||
}
|
||||
|
||||
private native int nGetFontBuilderFlags(); /*
|
||||
return THIS->FontBuilderFlags;
|
||||
*/
|
||||
|
||||
private native void nSetFontBuilderFlags(int value); /*
|
||||
THIS->FontBuilderFlags = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Brighten ({@code >}1.0f) or darken ({@code <}1.0f) font output. Brightening small fonts may be a good workaround to make them more readable.
|
||||
*/
|
||||
public float getRasterizerMultiply() {
|
||||
return nGetRasterizerMultiply();
|
||||
}
|
||||
|
||||
/**
|
||||
* Brighten ({@code >}1.0f) or darken ({@code <}1.0f) font output. Brightening small fonts may be a good workaround to make them more readable.
|
||||
*/
|
||||
public void setRasterizerMultiply(final float value) {
|
||||
nSetRasterizerMultiply(value);
|
||||
}
|
||||
|
||||
private native float nGetRasterizerMultiply(); /*
|
||||
return THIS->RasterizerMultiply;
|
||||
*/
|
||||
|
||||
private native void nSetRasterizerMultiply(float value); /*
|
||||
THIS->RasterizerMultiply = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Explicitly specify unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used.
|
||||
*/
|
||||
public short getEllipsisChar() {
|
||||
return nGetEllipsisChar();
|
||||
}
|
||||
|
||||
/**
|
||||
* Explicitly specify unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used.
|
||||
*/
|
||||
public void setEllipsisChar(final short value) {
|
||||
nSetEllipsisChar(value);
|
||||
}
|
||||
|
||||
private native short nGetEllipsisChar(); /*
|
||||
return THIS->EllipsisChar;
|
||||
*/
|
||||
|
||||
private native void nSetEllipsisChar(short value); /*
|
||||
THIS->EllipsisChar = value;
|
||||
*/
|
||||
|
||||
// [Internal]
|
||||
|
||||
/**
|
||||
* Name (strictly to ease debugging)
|
||||
*/
|
||||
public native void setName(String name); /*
|
||||
strcpy(THIS->Name, name);
|
||||
*/
|
||||
|
||||
public ImFont getDstFont() {
|
||||
return new ImFont(nGetDstFont());
|
||||
}
|
||||
|
||||
public void setDstFont(final ImFont value) {
|
||||
nSetDstFont(value.ptr);
|
||||
}
|
||||
|
||||
private native long nGetDstFont(); /*
|
||||
return (intptr_t)THIS->DstFont;
|
||||
*/
|
||||
|
||||
private native void nSetDstFont(long value); /*
|
||||
THIS->DstFont = reinterpret_cast<ImFont*>(value);
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
|
||||
/**
|
||||
* Hold rendering data for one glyph.
|
||||
* (Note: some language parsers may fail to convert the 31+1 bitfield members, in this case maybe drop store a single u32 or we can rework this)
|
||||
*/
|
||||
public final class ImFontGlyph extends ImGuiStructDestroyable {
|
||||
public ImFontGlyph() {
|
||||
}
|
||||
|
||||
public ImFontGlyph(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate();
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
#define THIS ((ImFontGlyph*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
private native long nCreate(); /*
|
||||
return (intptr_t)(new ImFontGlyph());
|
||||
*/
|
||||
|
||||
/**
|
||||
* Flag to indicate glyph is colored and should generally ignore tinting (make it usable with no shift on little-endian as this is used in loops).
|
||||
*/
|
||||
public int getColored() {
|
||||
return nGetColored();
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag to indicate glyph is colored and should generally ignore tinting (make it usable with no shift on little-endian as this is used in loops).
|
||||
*/
|
||||
public void setColored(final int value) {
|
||||
nSetColored(value);
|
||||
}
|
||||
|
||||
private native int nGetColored(); /*
|
||||
return THIS->Colored;
|
||||
*/
|
||||
|
||||
private native void nSetColored(int value); /*
|
||||
THIS->Colored = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Flag to indicate glyph has no visible pixels (e.g. space). Allow early out when rendering.
|
||||
*/
|
||||
public int getVisible() {
|
||||
return nGetVisible();
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag to indicate glyph has no visible pixels (e.g. space). Allow early out when rendering.
|
||||
*/
|
||||
public void setVisible(final int value) {
|
||||
nSetVisible(value);
|
||||
}
|
||||
|
||||
private native int nGetVisible(); /*
|
||||
return THIS->Visible;
|
||||
*/
|
||||
|
||||
private native void nSetVisible(int value); /*
|
||||
THIS->Visible = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* 0x0000..0xFFFF
|
||||
*/
|
||||
public int getCodepoint() {
|
||||
return nGetCodepoint();
|
||||
}
|
||||
|
||||
/**
|
||||
* 0x0000..0xFFFF
|
||||
*/
|
||||
public void setCodepoint(final int value) {
|
||||
nSetCodepoint(value);
|
||||
}
|
||||
|
||||
private native int nGetCodepoint(); /*
|
||||
return THIS->Codepoint;
|
||||
*/
|
||||
|
||||
private native void nSetCodepoint(int value); /*
|
||||
THIS->Codepoint = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Distance to next character (= data from font + ImFontConfig::GlyphExtraSpacing.x baked in)
|
||||
*/
|
||||
public float getAdvanceX() {
|
||||
return nGetAdvanceX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Distance to next character (= data from font + ImFontConfig::GlyphExtraSpacing.x baked in)
|
||||
*/
|
||||
public void setAdvanceX(final float value) {
|
||||
nSetAdvanceX(value);
|
||||
}
|
||||
|
||||
private native float nGetAdvanceX(); /*
|
||||
return THIS->AdvanceX;
|
||||
*/
|
||||
|
||||
private native void nSetAdvanceX(float value); /*
|
||||
THIS->AdvanceX = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Glyph corners
|
||||
*/
|
||||
public float getX0() {
|
||||
return nGetX0();
|
||||
}
|
||||
|
||||
/**
|
||||
* Glyph corners
|
||||
*/
|
||||
public void setX0(final float value) {
|
||||
nSetX0(value);
|
||||
}
|
||||
|
||||
private native float nGetX0(); /*
|
||||
return THIS->X0;
|
||||
*/
|
||||
|
||||
private native void nSetX0(float value); /*
|
||||
THIS->X0 = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Glyph corners
|
||||
*/
|
||||
public float getY0() {
|
||||
return nGetY0();
|
||||
}
|
||||
|
||||
/**
|
||||
* Glyph corners
|
||||
*/
|
||||
public void setY0(final float value) {
|
||||
nSetY0(value);
|
||||
}
|
||||
|
||||
private native float nGetY0(); /*
|
||||
return THIS->Y0;
|
||||
*/
|
||||
|
||||
private native void nSetY0(float value); /*
|
||||
THIS->Y0 = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Glyph corners
|
||||
*/
|
||||
public float getX1() {
|
||||
return nGetX1();
|
||||
}
|
||||
|
||||
/**
|
||||
* Glyph corners
|
||||
*/
|
||||
public void setX1(final float value) {
|
||||
nSetX1(value);
|
||||
}
|
||||
|
||||
private native float nGetX1(); /*
|
||||
return THIS->X1;
|
||||
*/
|
||||
|
||||
private native void nSetX1(float value); /*
|
||||
THIS->X1 = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Glyph corners
|
||||
*/
|
||||
public float getY1() {
|
||||
return nGetY1();
|
||||
}
|
||||
|
||||
/**
|
||||
* Glyph corners
|
||||
*/
|
||||
public void setY1(final float value) {
|
||||
nSetY1(value);
|
||||
}
|
||||
|
||||
private native float nGetY1(); /*
|
||||
return THIS->Y1;
|
||||
*/
|
||||
|
||||
private native void nSetY1(float value); /*
|
||||
THIS->Y1 = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Texture coordinates
|
||||
*/
|
||||
public float getU0() {
|
||||
return nGetU0();
|
||||
}
|
||||
|
||||
/**
|
||||
* Texture coordinates
|
||||
*/
|
||||
public void setU0(final float value) {
|
||||
nSetU0(value);
|
||||
}
|
||||
|
||||
private native float nGetU0(); /*
|
||||
return THIS->U0;
|
||||
*/
|
||||
|
||||
private native void nSetU0(float value); /*
|
||||
THIS->U0 = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Texture coordinates
|
||||
*/
|
||||
public float getV0() {
|
||||
return nGetV0();
|
||||
}
|
||||
|
||||
/**
|
||||
* Texture coordinates
|
||||
*/
|
||||
public void setV0(final float value) {
|
||||
nSetV0(value);
|
||||
}
|
||||
|
||||
private native float nGetV0(); /*
|
||||
return THIS->V0;
|
||||
*/
|
||||
|
||||
private native void nSetV0(float value); /*
|
||||
THIS->V0 = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Texture coordinates
|
||||
*/
|
||||
public float getU1() {
|
||||
return nGetU1();
|
||||
}
|
||||
|
||||
/**
|
||||
* Texture coordinates
|
||||
*/
|
||||
public void setU1(final float value) {
|
||||
nSetU1(value);
|
||||
}
|
||||
|
||||
private native float nGetU1(); /*
|
||||
return THIS->U1;
|
||||
*/
|
||||
|
||||
private native void nSetU1(float value); /*
|
||||
THIS->U1 = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Texture coordinates
|
||||
*/
|
||||
public float getV1() {
|
||||
return nGetV1();
|
||||
}
|
||||
|
||||
/**
|
||||
* Texture coordinates
|
||||
*/
|
||||
public void setV1(final float value) {
|
||||
nSetV1(value);
|
||||
}
|
||||
|
||||
private native float nGetV1(); /*
|
||||
return THIS->V1;
|
||||
*/
|
||||
|
||||
private native void nSetV1(float value); /*
|
||||
THIS->V1 = value;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package imgui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Helper to build glyph ranges from text/string data. Feed your application strings/characters to it then call buildRanges().
|
||||
* <p>
|
||||
* You can use the ImFontGlyphRangesBuilder helper to create glyph ranges based on text input. For example: for a game where your script is known,
|
||||
* if you can feed your entire script to it and only build the characters the game needs.
|
||||
* <p>
|
||||
* Direct reimplementation of native ImFontGlyphRangesBuilder in java
|
||||
*/
|
||||
public final class ImFontGlyphRangesBuilder {
|
||||
private static final int UNICODE_CODEPOINT_MAX = 0xFFFF;
|
||||
|
||||
// have to use type long because values are unsigned integers
|
||||
private final long[] usedChars = new long[(UNICODE_CODEPOINT_MAX + 1) / 8];
|
||||
|
||||
public ImFontGlyphRangesBuilder() {
|
||||
clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds single character to resulting ranges
|
||||
*/
|
||||
public void addChar(final char c) {
|
||||
setBit(c);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds all characters from the given string to resulting ranges
|
||||
*/
|
||||
public void addText(final String text) {
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
addChar(text.charAt(i));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies all given ranges to resulting ranges
|
||||
*/
|
||||
public void addRanges(final short[] ranges) {
|
||||
for (int i = 0; i < ranges.length; i += 2) {
|
||||
if (ranges[i] == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
for (int k = ranges[i]; k <= ranges[i + 1]; k++) {
|
||||
addChar((char) k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the final result (ordered ranges with all the unique characters submitted)
|
||||
* Result of this function can be directly passed to ImFontAtlas
|
||||
*/
|
||||
public short[] buildRanges() {
|
||||
final List<Short> out = new ArrayList<>();
|
||||
for (int n = 0; n <= UNICODE_CODEPOINT_MAX; n++) {
|
||||
if (getBit(n)) {
|
||||
out.add((short) n);
|
||||
while (n < UNICODE_CODEPOINT_MAX && getBit(n + 1)) {
|
||||
n++;
|
||||
}
|
||||
out.add((short) n);
|
||||
}
|
||||
}
|
||||
|
||||
final short[] result = new short[out.size() + 1];
|
||||
for (int i = 0; i < out.size(); i++) {
|
||||
result[i] = out.get(i);
|
||||
}
|
||||
result[result.length - 1] = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
Arrays.fill(usedChars, 0L);
|
||||
}
|
||||
|
||||
public void setBit(final int n) {
|
||||
final int off = n >> 5;
|
||||
final long mask = 1L << (n & 31L);
|
||||
usedChars[off] |= mask;
|
||||
}
|
||||
|
||||
public boolean getBit(final int n) {
|
||||
final int off = n >> 5;
|
||||
final long mask = 1L << (n & 31L);
|
||||
return (usedChars[off] & mask) > 0;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,294 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.binding.ImGuiStruct;
|
||||
|
||||
/**
|
||||
* Shared state of InputText(), passed as an argument to your callback when a ImGuiInputTextFlags_Callback* flag is used.<p>
|
||||
* The callback function should return 0 by default.<p>
|
||||
* Callbacks (follow a flag name and see comments in ImGuiInputTextFlags_ declarations for more details)<p>
|
||||
* - ImGuiInputTextFlags_CallbackEdit: Callback on buffer edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active)<p>
|
||||
* - ImGuiInputTextFlags_CallbackAlways: Callback on each iteration<p>
|
||||
* - ImGuiInputTextFlags_CallbackCompletion: Callback on pressing TAB<p>
|
||||
* - ImGuiInputTextFlags_CallbackHistory: Callback on pressing Up/Down arrows<p>
|
||||
* - ImGuiInputTextFlags_CallbackCharFilter: Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard.<p>
|
||||
* - ImGuiInputTextFlags_CallbackResize: Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow.<p>
|
||||
*/
|
||||
public class ImGuiInputTextCallbackData extends ImGuiStruct {
|
||||
public ImGuiInputTextCallbackData(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
#define THIS ((ImGuiInputTextCallbackData*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
/**
|
||||
* One ImGuiInputTextFlags_Callback*
|
||||
*/
|
||||
public int getEventFlag() {
|
||||
return nGetEventFlag();
|
||||
}
|
||||
|
||||
/**
|
||||
* One ImGuiInputTextFlags_Callback*
|
||||
*/
|
||||
public boolean hasEventFlag(final int flags) {
|
||||
return (getEventFlag() & flags) != 0;
|
||||
}
|
||||
|
||||
private native int nGetEventFlag(); /*
|
||||
return THIS->EventFlag;
|
||||
*/
|
||||
|
||||
/**
|
||||
* What user passed to InputText()
|
||||
*/
|
||||
public int getFlags() {
|
||||
return nGetFlags();
|
||||
}
|
||||
|
||||
/**
|
||||
* What user passed to InputText()
|
||||
*/
|
||||
public boolean hasFlags(final int flags) {
|
||||
return (getFlags() & flags) != 0;
|
||||
}
|
||||
|
||||
private native int nGetFlags(); /*
|
||||
return THIS->Flags;
|
||||
*/
|
||||
|
||||
// TODO: UserData
|
||||
|
||||
/**
|
||||
* [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0;
|
||||
*/
|
||||
public int getEventChar() {
|
||||
return nGetEventChar();
|
||||
}
|
||||
|
||||
/**
|
||||
* [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0;
|
||||
*/
|
||||
public void setEventChar(final int value) {
|
||||
nSetEventChar(value);
|
||||
}
|
||||
|
||||
private native int nGetEventChar(); /*
|
||||
return THIS->EventChar;
|
||||
*/
|
||||
|
||||
private native void nSetEventChar(int value); /*
|
||||
THIS->EventChar = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* [Completion,History]
|
||||
*/
|
||||
public int getEventKey() {
|
||||
return nGetEventKey();
|
||||
}
|
||||
|
||||
private native int nGetEventKey(); /*
|
||||
return THIS->EventKey;
|
||||
*/
|
||||
|
||||
/**
|
||||
* [Resize] Can replace pointer <p>
|
||||
* [Completion,History,Always] Only write to pointed data, don't replace the actual pointer!
|
||||
*/
|
||||
public String getBuf() {
|
||||
return nGetBuf();
|
||||
}
|
||||
|
||||
/**
|
||||
* [Resize] Can replace pointer <p>
|
||||
* [Completion,History,Always] Only write to pointed data, don't replace the actual pointer!
|
||||
*/
|
||||
public void setBuf(final String value) {
|
||||
nSetBuf(value);
|
||||
}
|
||||
|
||||
private native String nGetBuf(); /*
|
||||
return env->NewStringUTF(THIS->Buf);
|
||||
*/
|
||||
|
||||
private native void nSetBuf(String value); /*MANUAL
|
||||
auto value = obj_value == NULL ? NULL : (char*)env->GetStringUTFChars(obj_value, JNI_FALSE);
|
||||
THIS->Buf = value;
|
||||
if (value != NULL) env->ReleaseStringUTFChars(obj_value, value);
|
||||
*/
|
||||
|
||||
/**
|
||||
* [Resize,Completion,History,Always] Exclude zero-terminator storage. In C land: == strlen(some_text), in C++ land: string.length()
|
||||
*/
|
||||
public int getBufTextLen() {
|
||||
return nGetBufTextLen();
|
||||
}
|
||||
|
||||
/**
|
||||
* [Resize,Completion,History,Always] Exclude zero-terminator storage. In C land: == strlen(some_text), in C++ land: string.length()
|
||||
*/
|
||||
public void setBufTextLen(final int value) {
|
||||
nSetBufTextLen(value);
|
||||
}
|
||||
|
||||
private native int nGetBufTextLen(); /*
|
||||
return THIS->BufTextLen;
|
||||
*/
|
||||
|
||||
private native void nSetBufTextLen(int value); /*
|
||||
THIS->BufTextLen = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set if you modify Buf/BufTextLen!
|
||||
*/
|
||||
public boolean getBufDirty() {
|
||||
return nGetBufDirty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if you modify Buf/BufTextLen!
|
||||
*/
|
||||
public void setBufDirty(final boolean value) {
|
||||
nSetBufDirty(value);
|
||||
}
|
||||
|
||||
private native boolean nGetBufDirty(); /*
|
||||
return THIS->BufDirty;
|
||||
*/
|
||||
|
||||
private native void nSetBufDirty(boolean value); /*
|
||||
THIS->BufDirty = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Current cursor position
|
||||
*/
|
||||
public int getCursorPos() {
|
||||
return nGetCursorPos();
|
||||
}
|
||||
|
||||
/**
|
||||
* Current cursor position
|
||||
*/
|
||||
public void setCursorPos(final int value) {
|
||||
nSetCursorPos(value);
|
||||
}
|
||||
|
||||
private native int nGetCursorPos(); /*
|
||||
return THIS->CursorPos;
|
||||
*/
|
||||
|
||||
private native void nSetCursorPos(int value); /*
|
||||
THIS->CursorPos = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Selection Start
|
||||
*/
|
||||
public int getSelectionStart() {
|
||||
return nGetSelectionStart();
|
||||
}
|
||||
|
||||
/**
|
||||
* Selection Start
|
||||
*/
|
||||
public void setSelectionStart(final int value) {
|
||||
nSetSelectionStart(value);
|
||||
}
|
||||
|
||||
private native int nGetSelectionStart(); /*
|
||||
return THIS->SelectionStart;
|
||||
*/
|
||||
|
||||
private native void nSetSelectionStart(int value); /*
|
||||
THIS->SelectionStart = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Selection End
|
||||
*/
|
||||
public int getSelectionEnd() {
|
||||
return nGetSelectionEnd();
|
||||
}
|
||||
|
||||
/**
|
||||
* Selection End
|
||||
*/
|
||||
public void setSelectionEnd(final int value) {
|
||||
nSetSelectionEnd(value);
|
||||
}
|
||||
|
||||
private native int nGetSelectionEnd(); /*
|
||||
return THIS->SelectionEnd;
|
||||
*/
|
||||
|
||||
private native void nSetSelectionEnd(int value); /*
|
||||
THIS->SelectionEnd = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Delete Chars
|
||||
*
|
||||
* @param pos
|
||||
* Start Delete Pos
|
||||
* @param bytesCount
|
||||
* Delete Char Count
|
||||
*/
|
||||
public void deleteChars(final int pos, final int bytesCount) {
|
||||
nDeleteChars(pos, bytesCount);
|
||||
}
|
||||
|
||||
private native void nDeleteChars(int pos, int bytesCount); /*
|
||||
THIS->DeleteChars(pos, bytesCount);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Insert Chars
|
||||
*
|
||||
* @param pos
|
||||
* insert Psos
|
||||
* @param str
|
||||
* insert String
|
||||
*/
|
||||
public void insertChars(final int pos, final String str) {
|
||||
nInsertChars(pos, str);
|
||||
}
|
||||
|
||||
private native void nInsertChars(int pos, String str); /*MANUAL
|
||||
auto str = obj_str == NULL ? NULL : (char*)env->GetStringUTFChars(obj_str, JNI_FALSE);
|
||||
THIS->InsertChars(pos, str);
|
||||
if (str != NULL) env->ReleaseStringUTFChars(obj_str, str);
|
||||
*/
|
||||
|
||||
public void selectAll() {
|
||||
nSelectAll();
|
||||
}
|
||||
|
||||
private native void nSelectAll(); /*
|
||||
THIS->SelectAll();
|
||||
*/
|
||||
|
||||
public void clearSelection() {
|
||||
nClearSelection();
|
||||
}
|
||||
|
||||
private native void nClearSelection(); /*
|
||||
THIS->ClearSelection();
|
||||
*/
|
||||
|
||||
public boolean hasSelection() {
|
||||
return nHasSelection();
|
||||
}
|
||||
|
||||
private native boolean nHasSelection(); /*
|
||||
return THIS->HasSelection();
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.callback.ImListClipperCallback;
|
||||
|
||||
/**
|
||||
* Helper: Manually clip large list of items.
|
||||
* If you are submitting lots of evenly spaced items and you have a random access to the list, you can perform coarse
|
||||
* clipping based on visibility to save yourself from processing those items at all.
|
||||
* The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped.
|
||||
* (Dear ImGui already clip items based on their bounds but it needs to measure text size to do so, whereas manual coarse clipping before submission makes this cost and your own data fetching/submission cost almost null)
|
||||
* <pre>
|
||||
* ImGuiListClipper clipper;
|
||||
* clipper.Begin(1000); // We have 1000 elements, evenly spaced.
|
||||
* while (clipper.Step())
|
||||
* for (int i = clipper.DisplayStart; i {@code <} clipper.DisplayEnd; i++)
|
||||
* ImGui::Text("line number %d", i);
|
||||
* </pre>
|
||||
* Generally what happens is:
|
||||
* - Clipper lets you process the first element (DisplayStart = 0, DisplayEnd = 1) regardless of it being visible or not.
|
||||
* - User code submit one element.
|
||||
* - Clipper can measure the height of the first element
|
||||
* - Clipper calculate the actual range of elements to display based on the current clipping rectangle, position the cursor before the first visible element.
|
||||
* - User code submit visible elements.
|
||||
* - The clipper also handles various subtleties related to keyboard/gamepad navigation, wrapping etc.
|
||||
* <p>
|
||||
* BINDING NOTICE:
|
||||
* It's impossible to implement the same API like in the original. Method {@link #forEach(int, int, ImListClipperCallback)} could be used instead.
|
||||
* <pre>
|
||||
* ImGuiListClipper.forEach(1000, new ImListClipperCallback() {
|
||||
* public void accept(int index) {
|
||||
* ImGui.text(String.format("line number %d", index));
|
||||
* }
|
||||
* });
|
||||
* </pre>
|
||||
*/
|
||||
public final class ImGuiListClipper {
|
||||
private ImGuiListClipper() {
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param itemsCount Use -1 to ignore (you can call Begin later).
|
||||
* Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step).
|
||||
* @param callback action to do in iterations
|
||||
*/
|
||||
public static void forEach(final int itemsCount, final ImListClipperCallback callback) {
|
||||
forEach(itemsCount, -1, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemsCount Use -1 to ignore (you can call Begin later).
|
||||
* Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step).
|
||||
* @param itemsHeight Use -1.0f to be calculated automatically on first step.
|
||||
* Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing().
|
||||
* @param callback action to do in iterations
|
||||
*/
|
||||
public static native void forEach(int itemsCount, int itemsHeight, ImListClipperCallback callback); /*
|
||||
ImGuiListClipper clipper;
|
||||
clipper.Begin(itemsCount, itemsHeight);
|
||||
while (clipper.Step()) {
|
||||
for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) {
|
||||
Jni::CallImListClipperCallback(env, callback, i);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package imgui;
|
||||
|
||||
/**
|
||||
* Helper: Execute a block of code at maximum once a frame.
|
||||
* Convenient if you want to quickly create an UI within deep-nested code that runs multiple times every frame.
|
||||
* Usage: static ImGuiOnceUponAFrame oaf; if (oaf) ImGui::Text("This will be called only once per frame");
|
||||
* <p>
|
||||
* BINDING NOTICE:
|
||||
* Java example: if (ImGuiOnceUponAFrame.get()) ImGui.text("This will be called only once per frame");
|
||||
*/
|
||||
public final class ImGuiOnceUponAFrame {
|
||||
private ImGuiOnceUponAFrame() {
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
*/
|
||||
|
||||
public static native boolean get(); /*
|
||||
ImGuiOnceUponAFrame oaf;
|
||||
return (bool)oaf;
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,540 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.binding.ImGuiStruct;
|
||||
import imgui.callback.ImPlatformFuncViewport;
|
||||
import imgui.callback.ImPlatformFuncViewportFloat;
|
||||
import imgui.callback.ImPlatformFuncViewportImVec2;
|
||||
import imgui.callback.ImPlatformFuncViewportString;
|
||||
import imgui.callback.ImPlatformFuncViewportSuppBoolean;
|
||||
import imgui.callback.ImPlatformFuncViewportSuppFloat;
|
||||
import imgui.callback.ImPlatformFuncViewportSuppImVec2;
|
||||
|
||||
/**
|
||||
* -----------------------------------------------------------------------------
|
||||
* [BETA] Platform interface for multi-viewport support
|
||||
* -----------------------------------------------------------------------------
|
||||
* (Optional) This is completely optional, for advanced users!
|
||||
* If you are new to Dear ImGui and trying to integrate it into your engine, you can probably ignore this for now.
|
||||
* This feature allows you to seamlessly drag Dear ImGui windows outside of your application viewport.
|
||||
* This is achieved by creating new Platform/OS windows on the fly, and rendering into them.
|
||||
* Dear ImGui manages the viewport structures, and the backend create and maintain one Platform/OS window for each of those viewports.
|
||||
* See Glossary https://github.com/ocornut/imgui/wiki/Glossary for details about some of the terminology.
|
||||
* See Thread https://github.com/ocornut/imgui/issues/1542 for gifs, news and questions about this evolving feature.
|
||||
* About the coordinates system:
|
||||
* - When multi-viewports are enabled, all Dear ImGui coordinates become absolute coordinates (same as OS coordinates!)
|
||||
* - So e.g. ImGui::SetNextWindowPos(ImVec2(0,0)) will position a window relative to your primary monitor!
|
||||
* - If you want to position windows relative to your main application viewport, use ImGui::GetMainViewport().Pos as a base position.
|
||||
* Steps to use multi-viewports in your application, when using a default backend from the examples/ folder:
|
||||
* - Application: Enable feature with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'.
|
||||
* - Backend: The backend initialization will setup all necessary ImGuiPlatformIO's functions and update monitors info every frame.
|
||||
* - Application: In your main loop, call ImGui::UpdatePlatformWindows(), ImGui::RenderPlatformWindowsDefault() after EndFrame() or Render().
|
||||
* - Application: Fix absolute coordinates used in ImGui::SetWindowPos() or ImGui::SetNextWindowPos() calls.
|
||||
* Steps to use multi-viewports in your application, when using a custom backend:
|
||||
* - Important: THIS IS NOT EASY TO DO and comes with many subtleties not described here!
|
||||
* It's also an experimental feature, so some of the requirements may evolve.
|
||||
* Consider using default backends if you can. Either way, carefully follow and refer to examples/ backends for details.
|
||||
* - Application: Enable feature with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'.
|
||||
* - Backend: Hook ImGuiPlatformIO's Platform_* and Renderer_* callbacks (see below).
|
||||
* Set 'io.BackendFlags |= ImGuiBackendFlags_PlatformHasViewports' and 'io.BackendFlags |= ImGuiBackendFlags_PlatformHasViewports'.
|
||||
* Update ImGuiPlatformIO's Monitors list every frame.
|
||||
* Update MousePos every frame, in absolute coordinates.
|
||||
* - Application: In your main loop, call ImGui::UpdatePlatformWindows(), ImGui::RenderPlatformWindowsDefault() after EndFrame() or Render().
|
||||
* You may skip calling RenderPlatformWindowsDefault() if its API is not convenient for your needs. Read comments below.
|
||||
* - Application: Fix absolute coordinates used in ImGui::SetWindowPos() or ImGui::SetNextWindowPos() calls.
|
||||
* About ImGui::RenderPlatformWindowsDefault():
|
||||
* - This function is a mostly a _helper_ for the common-most cases, and to facilitate using default backends.
|
||||
* - You can check its simple source code to understand what it does.
|
||||
* It basically iterates secondary viewports and call 4 functions that are setup in ImGuiPlatformIO, if available:
|
||||
* Platform_RenderWindow(), Renderer_RenderWindow(), Platform_SwapBuffers(), Renderer_SwapBuffers()
|
||||
* Those functions pointers exists only for the benefit of RenderPlatformWindowsDefault().
|
||||
* - If you have very specific rendering needs (e.g. flipping multiple swap-chain simultaneously, unusual sync/threading issues, etc.),
|
||||
* you may be tempted to ignore RenderPlatformWindowsDefault() and write customized code to perform your renderingg.
|
||||
* You may decide to setup the platform_io's *RenderWindow and *SwapBuffers pointers and call your functions through those pointers,
|
||||
* or you may decide to never setup those pointers and call your code directly. They are a convenience, not an obligatory interface.
|
||||
* -----------------------------------------------------------------------------
|
||||
* (Optional) Access via ImGui::GetPlatformIO()
|
||||
* <p>
|
||||
* ------------------------------------------------------------------
|
||||
* Input - Backend interface/functions + Monitor List
|
||||
* ------------------------------------------------------------------
|
||||
* (Optional) Platform functions (e.g. Win32, GLFW, SDL2)
|
||||
* For reference, the second column shows which function are generally calling the Platform Functions:
|
||||
* N = ImGui::NewFrame() ~ beginning of the dear imgui frame: read info from platform/OS windows (latest size/position)
|
||||
* F = ImGui::Begin(), ImGui::EndFrame() ~ during the dear imgui frame
|
||||
* U = ImGui::UpdatePlatformWindows() ~ after the dear imgui frame: create and update all platform/OS windows
|
||||
* R = ImGui::RenderPlatformWindowsDefault() ~ render
|
||||
* D = ImGui::DestroyPlatformWindows() ~ shutdown
|
||||
* The general idea is that NewFrame() we will read the current Platform/OS state, and UpdatePlatformWindows() will write to it.
|
||||
* The functions are designed so we can mix and match 2 imgui_impl_xxxx files, one for the Platform (~window/input handling), one for Renderer.
|
||||
* Custom engine backends will often provide both Platform and Renderer interfaces and so may not need to use all functions.
|
||||
* Platform functions are typically called before their Renderer counterpart, apart from Destroy which are called the other way.
|
||||
*/
|
||||
public final class ImGuiPlatformIO extends ImGuiStruct {
|
||||
private static final ImGuiViewport TMP_VIEWPORT = new ImGuiViewport(0);
|
||||
private static final ImGuiPlatformMonitor TMP_MONITOR = new ImGuiPlatformMonitor(0);
|
||||
private static final ImVec2 TMP_IM_VEC2 = new ImVec2();
|
||||
|
||||
public ImGuiPlatformIO(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
|
||||
#define IMGUI_PLATFORM_IO ((ImGuiPlatformIO*)STRUCT_PTR)
|
||||
|
||||
jobject jTmpViewport = NULL;
|
||||
jobject jTmpImVec2 = NULL;
|
||||
*/
|
||||
|
||||
static void init() {
|
||||
nInit(TMP_VIEWPORT, TMP_IM_VEC2);
|
||||
}
|
||||
|
||||
private static native void nInit(ImGuiViewport tmpViewport, ImVec2 tmpImVec2); /*
|
||||
jTmpViewport = env->NewGlobalRef(tmpViewport);
|
||||
jTmpImVec2 = env->NewGlobalRef(tmpImVec2);
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#define IM_PLATFORM_FUNC_VIEWPORT_TMPL(name)\
|
||||
jobject platformCallback##name = NULL;\
|
||||
void PlatformStub##name(ImGuiViewport* vp) {\
|
||||
if (platformCallback##name != NULL) {\
|
||||
JNIEnv* env = Jni::GetEnv();\
|
||||
env->SetLongField(jTmpViewport, Jni::GetBindingStructPtrID(), (intptr_t)vp);\
|
||||
Jni::CallImPlatformFuncViewport(env, platformCallback##name, jTmpViewport);\
|
||||
}\
|
||||
}\
|
||||
void PlatformStub##name(ImGuiViewport* vp, void*) {\
|
||||
PlatformStub##name(vp);\
|
||||
}
|
||||
|
||||
IM_PLATFORM_FUNC_VIEWPORT_TMPL(CreateWindow)
|
||||
|
||||
#define IM_PLATFORM_FUNC_VIEWPORT_METHOD_TMPL(name)\
|
||||
if (platformCallback##name != NULL) {\
|
||||
env->DeleteGlobalRef(platformCallback##name);\
|
||||
}\
|
||||
platformCallback##name = env->NewGlobalRef(func);\
|
||||
IMGUI_PLATFORM_IO->Platform_##name = PlatformStub##name;
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . U . . // Create a new platform window for the given viewport.
|
||||
*/
|
||||
public native void setPlatformCreateWindow(ImPlatformFuncViewport func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_METHOD_TMPL(CreateWindow)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_PLATFORM_FUNC_VIEWPORT_TMPL(DestroyWindow)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // N . U . D //
|
||||
*/
|
||||
public native void setPlatformDestroyWindow(ImPlatformFuncViewport func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_METHOD_TMPL(DestroyWindow)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_PLATFORM_FUNC_VIEWPORT_TMPL(ShowWindow)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . U . . // Newly created windows are initially hidden so SetWindowPos/Size/Title can be called on them before showing the window.
|
||||
*/
|
||||
public native void setPlatformShowWindow(ImPlatformFuncViewport func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_METHOD_TMPL(ShowWindow)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#define IM_PLATFORM_FUNC_VIEWPORT_IM_VEC2_TMPL(name)\
|
||||
jobject platformCallback##name = NULL;\
|
||||
void PlatformStub##name(ImGuiViewport* vp, ImVec2 pos) {\
|
||||
if (platformCallback##name != NULL) {\
|
||||
JNIEnv* env = Jni::GetEnv();\
|
||||
env->SetLongField(jTmpViewport, Jni::GetBindingStructPtrID(), (intptr_t)vp);\
|
||||
Jni::ImVec2Cpy(env, pos, jTmpImVec2);\
|
||||
Jni::CallImPlatformFuncViewportImVec2(env, platformCallback##name, jTmpViewport, jTmpImVec2);\
|
||||
}\
|
||||
}
|
||||
|
||||
IM_PLATFORM_FUNC_VIEWPORT_IM_VEC2_TMPL(SetWindowPos)
|
||||
|
||||
#define IM_PLATFORM_FUNC_VIEWPORT_IM_VEC2_METHOD_TMPL(name)\
|
||||
if (platformCallback##name != NULL) {\
|
||||
env->DeleteGlobalRef(platformCallback##name);\
|
||||
}\
|
||||
platformCallback##name = env->NewGlobalRef(func);\
|
||||
IMGUI_PLATFORM_IO->Platform_##name = PlatformStub##name;
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . U . . // Set platform window position (given the upper-left corner of client area).
|
||||
*/
|
||||
public native void setPlatformSetWindowPos(ImPlatformFuncViewportImVec2 func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_IM_VEC2_METHOD_TMPL(SetWindowPos)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#define IM_PLATFORM_FUNC_VIEWPORT_SUPP_IM_VEC2_TMPL(name)\
|
||||
jobject platformCallback##name = NULL;\
|
||||
ImVec2 PlatformStub##name(ImGuiViewport* vp) {\
|
||||
ImVec2 dst;\
|
||||
if (platformCallback##name != NULL) {\
|
||||
JNIEnv* env = Jni::GetEnv();\
|
||||
env->SetLongField(jTmpViewport, Jni::GetBindingStructPtrID(), (intptr_t)vp);\
|
||||
Jni::CallImPlatformFuncViewportSuppImVec2(env, platformCallback##name, jTmpViewport, jTmpImVec2);\
|
||||
Jni::ImVec2Cpy(env, jTmpImVec2, &dst);\
|
||||
}\
|
||||
return dst;\
|
||||
}
|
||||
|
||||
IM_PLATFORM_FUNC_VIEWPORT_SUPP_IM_VEC2_TMPL(GetWindowPos)
|
||||
|
||||
#define IM_PLATFORM_FUNC_VIEWPORT_SUPP_IM_VEC2_METHOD_TMPL(name)\
|
||||
if (platformCallback##name != NULL) {\
|
||||
env->DeleteGlobalRef(platformCallback##name);\
|
||||
}\
|
||||
platformCallback##name = env->NewGlobalRef(func);\
|
||||
IMGUI_PLATFORM_IO->Platform_##name = PlatformStub##name;
|
||||
*/
|
||||
|
||||
/**
|
||||
* // N . . . . //
|
||||
*/
|
||||
public native void setPlatformGetWindowPos(ImPlatformFuncViewportSuppImVec2 func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_SUPP_IM_VEC2_METHOD_TMPL(GetWindowPos)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_PLATFORM_FUNC_VIEWPORT_IM_VEC2_TMPL(SetWindowSize)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . U . . // Set platform window client area size (ignoring OS decorations such as OS title bar etc.)
|
||||
*/
|
||||
public native void setPlatformSetWindowSize(ImPlatformFuncViewportImVec2 func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_IM_VEC2_METHOD_TMPL(SetWindowSize)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_PLATFORM_FUNC_VIEWPORT_SUPP_IM_VEC2_TMPL(GetWindowSize)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // N . . . . // Get platform window client area size
|
||||
*/
|
||||
public native void setPlatformGetWindowSize(ImPlatformFuncViewportSuppImVec2 func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_SUPP_IM_VEC2_METHOD_TMPL(GetWindowSize)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_PLATFORM_FUNC_VIEWPORT_TMPL(SetWindowFocus)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // N . . . . // Move window to front and set input focus.
|
||||
*/
|
||||
public native void setPlatformSetWindowFocus(ImPlatformFuncViewport func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_METHOD_TMPL(SetWindowFocus)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#define IM_PLATFORM_FUNC_VIEWPORT_SUPP_BOOLEAN_TMPL(name)\
|
||||
jobject platformCallback##name = NULL;\
|
||||
bool PlatformStub##name(ImGuiViewport* vp) {\
|
||||
if (platformCallback##name != NULL) {\
|
||||
JNIEnv* env = Jni::GetEnv();\
|
||||
env->SetLongField(jTmpViewport, Jni::GetBindingStructPtrID(), (intptr_t)vp);\
|
||||
return Jni::CallImPlatformFuncViewportSuppBoolean(env, platformCallback##name, jTmpViewport);\
|
||||
}\
|
||||
return false;\
|
||||
}
|
||||
|
||||
IM_PLATFORM_FUNC_VIEWPORT_SUPP_BOOLEAN_TMPL(GetWindowFocus)
|
||||
|
||||
#define IM_PLATFORM_FUNC_VIEWPORT_SUPP_BOOLEAN_METHOD_TMPL(name)\
|
||||
if (platformCallback##name != NULL) {\
|
||||
env->DeleteGlobalRef(platformCallback##name);\
|
||||
}\
|
||||
platformCallback##name = env->NewGlobalRef(func);\
|
||||
IMGUI_PLATFORM_IO->Platform_##name = PlatformStub##name;
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . U . . //
|
||||
*/
|
||||
public native void setPlatformGetWindowFocus(ImPlatformFuncViewportSuppBoolean func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_SUPP_BOOLEAN_METHOD_TMPL(GetWindowFocus)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_PLATFORM_FUNC_VIEWPORT_SUPP_BOOLEAN_TMPL(GetWindowMinimized)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // N . . . . // Get platform window minimized state. When minimized, we generally won't attempt to get/set size and contents will be culled more easily.
|
||||
*/
|
||||
public native void setPlatformGetWindowMinimized(ImPlatformFuncViewportSuppBoolean func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_SUPP_BOOLEAN_METHOD_TMPL(GetWindowMinimized)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
jobject platformCallbackSetWindowTitle = NULL;
|
||||
void PlatformStubSetWindowTitle(ImGuiViewport* vp, const char* str) {
|
||||
if (platformCallbackSetWindowTitle != NULL) {
|
||||
JNIEnv* env = Jni::GetEnv();
|
||||
env->SetLongField(jTmpViewport, Jni::GetBindingStructPtrID(), (intptr_t)vp);
|
||||
Jni::CallImPlatformFuncViewportString(env, platformCallbackSetWindowTitle, jTmpViewport, str);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . U . . // Set platform window title (given an UTF-8 string)
|
||||
*/
|
||||
public native void setPlatformSetWindowTitle(ImPlatformFuncViewportString func); /*
|
||||
if (platformCallbackSetWindowTitle != NULL) {
|
||||
env->DeleteGlobalRef(platformCallbackSetWindowTitle);
|
||||
}
|
||||
platformCallbackSetWindowTitle = env->NewGlobalRef(func);
|
||||
IMGUI_PLATFORM_IO->Platform_SetWindowTitle = PlatformStubSetWindowTitle;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
jobject platformCallbackSetWindowAlpha = NULL;
|
||||
void PlatformStubSetWindowAlpha(ImGuiViewport* vp, float alpha) {
|
||||
if (platformCallbackSetWindowAlpha != NULL) {
|
||||
JNIEnv* env = Jni::GetEnv();
|
||||
env->SetLongField(jTmpViewport, Jni::GetBindingStructPtrID(), (intptr_t)vp);
|
||||
Jni::CallImPlatformFuncViewportFloat(env, platformCallbackSetWindowAlpha, jTmpViewport, alpha);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . U . . // (Optional) Setup window transparency
|
||||
*/
|
||||
public native void setPlatformSetWindowAlpha(ImPlatformFuncViewportFloat func); /*
|
||||
if (platformCallbackSetWindowAlpha != NULL) {
|
||||
env->DeleteGlobalRef(platformCallbackSetWindowAlpha);
|
||||
}
|
||||
platformCallbackSetWindowAlpha = env->NewGlobalRef(func);
|
||||
IMGUI_PLATFORM_IO->Platform_SetWindowAlpha = PlatformStubSetWindowAlpha;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_PLATFORM_FUNC_VIEWPORT_TMPL(UpdateWindow)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . U . . // (Optional) Called by UpdatePlatformWindows(). Optional hook to allow the platform backend from doing general book-keeping every frame.
|
||||
*/
|
||||
public native void setPlatformUpdateWindow(ImPlatformFuncViewport func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_METHOD_TMPL(UpdateWindow)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_PLATFORM_FUNC_VIEWPORT_TMPL(RenderWindow)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . . R . // (Optional) Main rendering (platform side! This is often unused, or just setting a "current" context for OpenGL bindings).
|
||||
*/
|
||||
public native void setPlatformRenderWindow(ImPlatformFuncViewport func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_METHOD_TMPL(RenderWindow)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_PLATFORM_FUNC_VIEWPORT_TMPL(SwapBuffers)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . . R . // (Optional) Call Present/SwapBuffers (platform side! This is often unused!).
|
||||
*/
|
||||
public native void setPlatformSwapBuffers(ImPlatformFuncViewport func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_METHOD_TMPL(SwapBuffers)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
jobject platformCallbackGetWindowDpiScale = NULL;
|
||||
float PlatformStubGetWindowDpiScale(ImGuiViewport* vp) {
|
||||
if (platformCallbackGetWindowDpiScale != NULL) {
|
||||
JNIEnv* env = Jni::GetEnv();
|
||||
env->SetLongField(jTmpViewport, Jni::GetBindingStructPtrID(), (intptr_t)vp);
|
||||
return Jni::CallImPlatformFuncViewportSuppFloat(env, platformCallbackGetWindowDpiScale, jTmpViewport);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* // N . . . . // (Optional) [BETA] FIXME-DPI: DPI handling: Return DPI scale for this viewport. 1.0f = 96 DPI.
|
||||
*/
|
||||
public native void setPlatformGetWindowDpiScale(ImPlatformFuncViewportSuppFloat func); /*
|
||||
if (platformCallbackGetWindowDpiScale != NULL) {
|
||||
env->DeleteGlobalRef(platformCallbackGetWindowDpiScale);
|
||||
}
|
||||
platformCallbackGetWindowDpiScale = env->NewGlobalRef(func);
|
||||
IMGUI_PLATFORM_IO->Platform_GetWindowDpiScale = PlatformStubGetWindowDpiScale;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_PLATFORM_FUNC_VIEWPORT_TMPL(OnChangedViewport)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // (Optional) [BETA] FIXME-DPI: DPI handling: Called during Begin() every time the viewport we are outputting into changes, so backend has a chance to swap fonts to adjust style.
|
||||
*/
|
||||
public native void setPlatformOnChangedViewport(ImPlatformFuncViewport func); /*
|
||||
IM_PLATFORM_FUNC_VIEWPORT_METHOD_TMPL(OnChangedViewport)
|
||||
*/
|
||||
|
||||
// (Optional) Renderer functions (e.g. DirectX, OpenGL, Vulkan)
|
||||
|
||||
/*JNI
|
||||
#define IM_RENDERER_FUNC_VIEWPORT_TMPL(name)\
|
||||
jobject rendererCallback##name = NULL;\
|
||||
void RendererStub##name(ImGuiViewport* vp) {\
|
||||
if (rendererCallback##name != NULL) {\
|
||||
JNIEnv* env = Jni::GetEnv();\
|
||||
env->SetLongField(jTmpViewport, Jni::GetBindingStructPtrID(), (intptr_t)vp);\
|
||||
Jni::CallImPlatformFuncViewport(env, rendererCallback##name, jTmpViewport);\
|
||||
}\
|
||||
}\
|
||||
void RendererStub##name(ImGuiViewport* vp, void*) {\
|
||||
RendererStub##name(vp);\
|
||||
}
|
||||
|
||||
IM_RENDERER_FUNC_VIEWPORT_TMPL(CreateWindow)
|
||||
|
||||
#define IM_RENDERER_FUNC_VIEWPORT_METHOD_TMPL(name)\
|
||||
if (rendererCallback##name != NULL) {\
|
||||
env->DeleteGlobalRef(rendererCallback##name);\
|
||||
}\
|
||||
rendererCallback##name = env->NewGlobalRef(func);\
|
||||
IMGUI_PLATFORM_IO->Renderer_##name = RendererStub##name;
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . U . . // Create swap chain, frame buffers etc. (called after Platform_CreateWindow)
|
||||
*/
|
||||
public native void setRendererCreateWindow(ImPlatformFuncViewport func); /*
|
||||
IM_RENDERER_FUNC_VIEWPORT_METHOD_TMPL(CreateWindow)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_RENDERER_FUNC_VIEWPORT_TMPL(DestroyWindow)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // N . U . D // Destroy swap chain, frame buffers etc. (called before Platform_DestroyWindow)
|
||||
*/
|
||||
public native void setRendererDestroyWindow(ImPlatformFuncViewport func); /*
|
||||
IM_RENDERER_FUNC_VIEWPORT_METHOD_TMPL(DestroyWindow)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
jobject rendererCallbackSetWindowSize = NULL;
|
||||
void RendererStubSetWindowSize(ImGuiViewport* vp, ImVec2 pos) {
|
||||
if (rendererCallbackSetWindowSize != NULL) {
|
||||
JNIEnv* env = Jni::GetEnv();
|
||||
env->SetLongField(jTmpViewport, Jni::GetBindingStructPtrID(), (intptr_t)vp);
|
||||
Jni::ImVec2Cpy(env, pos, jTmpImVec2);
|
||||
Jni::CallImPlatformFuncViewportImVec2(env, rendererCallbackSetWindowSize, jTmpViewport, jTmpImVec2);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . U . . // Resize swap chain, frame buffers etc. (called after Platform_SetWindowSize)
|
||||
*/
|
||||
public native void setRendererSetWindowPos(ImPlatformFuncViewportImVec2 func); /*
|
||||
if (rendererCallbackSetWindowSize != NULL) {
|
||||
env->DeleteGlobalRef(rendererCallbackSetWindowSize);
|
||||
}
|
||||
rendererCallbackSetWindowSize = env->NewGlobalRef(func);
|
||||
IMGUI_PLATFORM_IO->Renderer_SetWindowSize = RendererStubSetWindowSize;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_RENDERER_FUNC_VIEWPORT_TMPL(RenderWindow)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . . R . // (Optional) Clear framebuffer, setup render target,
|
||||
* then render the viewport.DrawData. 'render_arg' is the value passed to RenderPlatformWindowsDefault().
|
||||
*/
|
||||
public native void setRendererRenderWindow(ImPlatformFuncViewport func); /*
|
||||
IM_RENDERER_FUNC_VIEWPORT_METHOD_TMPL(RenderWindow)
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
IM_RENDERER_FUNC_VIEWPORT_TMPL(SwapBuffers)
|
||||
*/
|
||||
|
||||
/**
|
||||
* // . . . R . // (Optional) Call Present/SwapBuffers. 'render_arg' is the value passed to RenderPlatformWindowsDefault().
|
||||
*/
|
||||
public native void setRendererSwapBuffers(ImPlatformFuncViewport func); /*
|
||||
IM_RENDERER_FUNC_VIEWPORT_METHOD_TMPL(SwapBuffers)
|
||||
*/
|
||||
|
||||
// (Optional) Monitor list
|
||||
// - Updated by: app/backend. Update every frame to dynamically support changing monitor or DPI configuration.
|
||||
// - Used by: dear imgui to query DPI info, clamp popups/tooltips within same monitor and not have them straddle monitors.
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Output - List of viewports to render into platform windows
|
||||
//------------------------------------------------------------------
|
||||
|
||||
public native void resizeMonitors(int size); /*
|
||||
IMGUI_PLATFORM_IO->Monitors.resize(0);
|
||||
*/
|
||||
|
||||
public native int getMonitorsSize(); /*
|
||||
return IMGUI_PLATFORM_IO->Monitors.Size;
|
||||
*/
|
||||
|
||||
public native void pushMonitors(float mainPosX, float mainPosY, float mainSizeX, float mainSizeY, float workPosX, float workPosY, float workSizeX, float workSizeY, float dpiScale); /*
|
||||
ImGuiPlatformMonitor monitor;
|
||||
|
||||
monitor.MainPos = ImVec2(mainPosX, mainPosY);
|
||||
monitor.MainSize = ImVec2(mainSizeX, mainSizeY);
|
||||
|
||||
monitor.WorkPos = ImVec2(workPosX, workPosY);
|
||||
monitor.WorkSize = ImVec2(workSizeX, workSizeY);
|
||||
|
||||
monitor.DpiScale = dpiScale;
|
||||
|
||||
IMGUI_PLATFORM_IO->Monitors.push_back(monitor);
|
||||
*/
|
||||
|
||||
public ImGuiPlatformMonitor getMonitors(final int idx) {
|
||||
TMP_MONITOR.ptr = nGetMonitors(idx);
|
||||
return TMP_MONITOR;
|
||||
}
|
||||
|
||||
private native long nGetMonitors(int idx); /*
|
||||
return (intptr_t)&IMGUI_PLATFORM_IO->Monitors[idx];
|
||||
*/
|
||||
|
||||
// Viewports list (the list is updated by calling ImGui::EndFrame or ImGui::Render)
|
||||
// (in the future we will attempt to organize this feature to remove the need for a "main viewport")
|
||||
|
||||
public native int getViewportsSize(); /*
|
||||
return IMGUI_PLATFORM_IO->Viewports.Size;
|
||||
*/
|
||||
|
||||
public ImGuiViewport getViewports(final int idx) {
|
||||
TMP_VIEWPORT.ptr = nGetViewports(idx);
|
||||
return TMP_VIEWPORT;
|
||||
}
|
||||
|
||||
private native long nGetViewports(int idx); /*
|
||||
return (intptr_t)IMGUI_PLATFORM_IO->Viewports[idx];
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,300 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.binding.ImGuiStruct;
|
||||
|
||||
/**
|
||||
* (Optional) This is required when enabling multi-viewport. Represent the bounds of each connected monitor/display and their DPI.
|
||||
* We use this information for multiple DPI support + clamping the position of popups and tooltips so they don't straddle multiple monitors.
|
||||
*/
|
||||
public final class ImGuiPlatformMonitor extends ImGuiStruct {
|
||||
public ImGuiPlatformMonitor(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
#define THIS ((ImGuiPlatformMonitor*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
|
||||
*/
|
||||
public ImVec2 getMainPos() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetMainPos(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
|
||||
*/
|
||||
public float getMainPosX() {
|
||||
return nGetMainPosX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
|
||||
*/
|
||||
public float getMainPosY() {
|
||||
return nGetMainPosY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
|
||||
*/
|
||||
public void getMainPos(final ImVec2 dst) {
|
||||
nGetMainPos(dst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
|
||||
*/
|
||||
public void setMainPos(final ImVec2 value) {
|
||||
nSetMainPos(value.x, value.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
|
||||
*/
|
||||
public void setMainPos(final float valueX, final float valueY) {
|
||||
nSetMainPos(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetMainPos(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->MainPos, dst);
|
||||
*/
|
||||
|
||||
private native float nGetMainPosX(); /*
|
||||
return THIS->MainPos.x;
|
||||
*/
|
||||
|
||||
private native float nGetMainPosY(); /*
|
||||
return THIS->MainPos.y;
|
||||
*/
|
||||
|
||||
private native void nSetMainPos(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->MainPos = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
|
||||
*/
|
||||
public ImVec2 getMainSize() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetMainSize(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
|
||||
*/
|
||||
public float getMainSizeX() {
|
||||
return nGetMainSizeX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
|
||||
*/
|
||||
public float getMainSizeY() {
|
||||
return nGetMainSizeY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
|
||||
*/
|
||||
public void getMainSize(final ImVec2 dst) {
|
||||
nGetMainSize(dst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
|
||||
*/
|
||||
public void setMainSize(final ImVec2 value) {
|
||||
nSetMainSize(value.x, value.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
|
||||
*/
|
||||
public void setMainSize(final float valueX, final float valueY) {
|
||||
nSetMainSize(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetMainSize(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->MainSize, dst);
|
||||
*/
|
||||
|
||||
private native float nGetMainSizeX(); /*
|
||||
return THIS->MainSize.x;
|
||||
*/
|
||||
|
||||
private native float nGetMainSizeY(); /*
|
||||
return THIS->MainSize.y;
|
||||
*/
|
||||
|
||||
private native void nSetMainSize(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->MainSize = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Coordinates without task bars / side bars / menu bars.
|
||||
* Used to avoid positioning popups/tooltips inside this region. If you don't have this info, please copy the value for MainPos/MainSize.
|
||||
*/
|
||||
public ImVec2 getWorkPos() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetWorkPos(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates without task bars / side bars / menu bars.
|
||||
* Used to avoid positioning popups/tooltips inside this region. If you don't have this info, please copy the value for MainPos/MainSize.
|
||||
*/
|
||||
public float getWorkPosX() {
|
||||
return nGetWorkPosX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates without task bars / side bars / menu bars.
|
||||
* Used to avoid positioning popups/tooltips inside this region. If you don't have this info, please copy the value for MainPos/MainSize.
|
||||
*/
|
||||
public float getWorkPosY() {
|
||||
return nGetWorkPosY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates without task bars / side bars / menu bars.
|
||||
* Used to avoid positioning popups/tooltips inside this region. If you don't have this info, please copy the value for MainPos/MainSize.
|
||||
*/
|
||||
public void getWorkPos(final ImVec2 dst) {
|
||||
nGetWorkPos(dst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates without task bars / side bars / menu bars.
|
||||
* Used to avoid positioning popups/tooltips inside this region. If you don't have this info, please copy the value for MainPos/MainSize.
|
||||
*/
|
||||
public void setWorkPos(final ImVec2 value) {
|
||||
nSetWorkPos(value.x, value.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates without task bars / side bars / menu bars.
|
||||
* Used to avoid positioning popups/tooltips inside this region. If you don't have this info, please copy the value for MainPos/MainSize.
|
||||
*/
|
||||
public void setWorkPos(final float valueX, final float valueY) {
|
||||
nSetWorkPos(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetWorkPos(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->WorkPos, dst);
|
||||
*/
|
||||
|
||||
private native float nGetWorkPosX(); /*
|
||||
return THIS->WorkPos.x;
|
||||
*/
|
||||
|
||||
private native float nGetWorkPosY(); /*
|
||||
return THIS->WorkPos.y;
|
||||
*/
|
||||
|
||||
private native void nSetWorkPos(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->WorkPos = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Coordinates without task bars / side bars / menu bars.
|
||||
* Used to avoid positioning popups/tooltips inside this region. If you don't have this info, please copy the value for MainPos/MainSize.
|
||||
*/
|
||||
public ImVec2 getWorkSize() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetWorkSize(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates without task bars / side bars / menu bars.
|
||||
* Used to avoid positioning popups/tooltips inside this region. If you don't have this info, please copy the value for MainPos/MainSize.
|
||||
*/
|
||||
public float getWorkSizeX() {
|
||||
return nGetWorkSizeX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates without task bars / side bars / menu bars.
|
||||
* Used to avoid positioning popups/tooltips inside this region. If you don't have this info, please copy the value for MainPos/MainSize.
|
||||
*/
|
||||
public float getWorkSizeY() {
|
||||
return nGetWorkSizeY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates without task bars / side bars / menu bars.
|
||||
* Used to avoid positioning popups/tooltips inside this region. If you don't have this info, please copy the value for MainPos/MainSize.
|
||||
*/
|
||||
public void getWorkSize(final ImVec2 dst) {
|
||||
nGetWorkSize(dst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates without task bars / side bars / menu bars.
|
||||
* Used to avoid positioning popups/tooltips inside this region. If you don't have this info, please copy the value for MainPos/MainSize.
|
||||
*/
|
||||
public void setWorkSize(final ImVec2 value) {
|
||||
nSetWorkSize(value.x, value.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Coordinates without task bars / side bars / menu bars.
|
||||
* Used to avoid positioning popups/tooltips inside this region. If you don't have this info, please copy the value for MainPos/MainSize.
|
||||
*/
|
||||
public void setWorkSize(final float valueX, final float valueY) {
|
||||
nSetWorkSize(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetWorkSize(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->WorkSize, dst);
|
||||
*/
|
||||
|
||||
private native float nGetWorkSizeX(); /*
|
||||
return THIS->WorkSize.x;
|
||||
*/
|
||||
|
||||
private native float nGetWorkSizeY(); /*
|
||||
return THIS->WorkSize.y;
|
||||
*/
|
||||
|
||||
private native void nSetWorkSize(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->WorkSize = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* 1.0f = 96 DPI
|
||||
*/
|
||||
public float getDpiScale() {
|
||||
return nGetDpiScale();
|
||||
}
|
||||
|
||||
/**
|
||||
* 1.0f = 96 DPI
|
||||
*/
|
||||
public void setDpiScale(final float value) {
|
||||
nSetDpiScale(value);
|
||||
}
|
||||
|
||||
private native float nGetDpiScale(); /*
|
||||
return THIS->DpiScale;
|
||||
*/
|
||||
|
||||
private native void nSetDpiScale(float value); /*
|
||||
THIS->DpiScale = value;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
|
||||
/**
|
||||
* Helper: Key-Value storage
|
||||
* Typically you don't have to worry about this since a storage is held within each Window.
|
||||
* We use it to e.g. store collapse state for a tree (Int 0/1)
|
||||
* This is optimized for efficient lookup (dichotomy into a contiguous buffer) and rare insertion (typically tied to user interactions aka max once a frame)
|
||||
* You can use it as custom user storage for temporary values. Declare your own storage if, for example:
|
||||
* - You want to manipulate the open/close state of a particular sub-tree in your interface (tree node uses Int 0/1 to store their state).
|
||||
* - You want to store custom debug data easily without adding or editing structures in your code (probably not efficient, but convenient)
|
||||
* Types are NOT stored, so it is up to you to make sure your Key don't collide with different types.
|
||||
*/
|
||||
public final class ImGuiStorage extends ImGuiStructDestroyable {
|
||||
public ImGuiStorage() {
|
||||
}
|
||||
|
||||
public ImGuiStorage(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate();
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
#define THIS ((ImGuiStorage*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
private native long nCreate(); /*
|
||||
return (intptr_t)(new ImGuiStorage());
|
||||
*/
|
||||
|
||||
// - Get***() functions find pair, never add/allocate. Pairs are sorted so a query is O(log N)
|
||||
// - Set***() functions find pair, insertion on demand if missing.
|
||||
// - Sorted insertion is costly, paid once. A typical frame shouldn't need to insert any new pair.
|
||||
|
||||
public void clear() {
|
||||
nClear();
|
||||
}
|
||||
|
||||
private native void nClear(); /*
|
||||
THIS->Clear();
|
||||
*/
|
||||
|
||||
public int getInt(final int key) {
|
||||
return nGetInt(key);
|
||||
}
|
||||
|
||||
public int getInt(final int key, final int defaultVal) {
|
||||
return nGetInt(key, defaultVal);
|
||||
}
|
||||
|
||||
private native int nGetInt(int key); /*
|
||||
return THIS->GetInt(key);
|
||||
*/
|
||||
|
||||
private native int nGetInt(int key, int defaultVal); /*
|
||||
return THIS->GetInt(key, defaultVal);
|
||||
*/
|
||||
|
||||
public void setInt(final int key, final int val) {
|
||||
nSetInt(key, val);
|
||||
}
|
||||
|
||||
private native void nSetInt(int key, int val); /*
|
||||
THIS->SetInt(key, val);
|
||||
*/
|
||||
|
||||
public boolean getBool(final int key) {
|
||||
return nGetBool(key);
|
||||
}
|
||||
|
||||
public boolean getBool(final int key, final boolean defaultVal) {
|
||||
return nGetBool(key, defaultVal);
|
||||
}
|
||||
|
||||
private native boolean nGetBool(int key); /*
|
||||
return THIS->GetBool(key);
|
||||
*/
|
||||
|
||||
private native boolean nGetBool(int key, boolean defaultVal); /*
|
||||
return THIS->GetBool(key, defaultVal);
|
||||
*/
|
||||
|
||||
public void setBool(final int key, final boolean val) {
|
||||
nSetBool(key, val);
|
||||
}
|
||||
|
||||
private native void nSetBool(int key, boolean val); /*
|
||||
THIS->SetBool(key, val);
|
||||
*/
|
||||
|
||||
public float getFloat(final int key) {
|
||||
return nGetFloat(key);
|
||||
}
|
||||
|
||||
public float getFloat(final int key, final float defaultVal) {
|
||||
return nGetFloat(key, defaultVal);
|
||||
}
|
||||
|
||||
private native float nGetFloat(int key); /*
|
||||
return THIS->GetFloat(key);
|
||||
*/
|
||||
|
||||
private native float nGetFloat(int key, float defaultVal); /*
|
||||
return THIS->GetFloat(key, defaultVal);
|
||||
*/
|
||||
|
||||
public void setFloat(final int key, final float val) {
|
||||
nSetFloat(key, val);
|
||||
}
|
||||
|
||||
private native void nSetFloat(int key, float val); /*
|
||||
THIS->SetFloat(key, val);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Use on your own storage if you know only integer are being stored (open/close all tree nodes)
|
||||
*/
|
||||
public void setAllInt(final int val) {
|
||||
nSetAllInt(val);
|
||||
}
|
||||
|
||||
private native void nSetAllInt(int val); /*
|
||||
THIS->SetAllInt(val);
|
||||
*/
|
||||
|
||||
/**
|
||||
* For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once.
|
||||
*/
|
||||
public void buildSortByKey() {
|
||||
nBuildSortByKey();
|
||||
}
|
||||
|
||||
private native void nBuildSortByKey(); /*
|
||||
THIS->BuildSortByKey();
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,135 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
|
||||
/**
|
||||
* Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
|
||||
*/
|
||||
public final class ImGuiTextFilter extends ImGuiStructDestroyable {
|
||||
public ImGuiTextFilter() {
|
||||
this("");
|
||||
}
|
||||
|
||||
public ImGuiTextFilter(final String defaultFilter) {
|
||||
ptr = nCreate(defaultFilter);
|
||||
}
|
||||
|
||||
public ImGuiTextFilter(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate("");
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
#define THIS ((ImGuiTextFilter*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
private native long nCreate(String defaultFilter); /*
|
||||
return (intptr_t)(new ImGuiTextFilter(defaultFilter));
|
||||
*/
|
||||
|
||||
public boolean draw() {
|
||||
return nDraw();
|
||||
}
|
||||
|
||||
public boolean draw(final String label) {
|
||||
return nDraw(label);
|
||||
}
|
||||
|
||||
public boolean draw(final String label, final float width) {
|
||||
return nDraw(label, width);
|
||||
}
|
||||
|
||||
public boolean draw(final float width) {
|
||||
return nDraw(width);
|
||||
}
|
||||
|
||||
private native boolean nDraw(); /*
|
||||
return THIS->Draw();
|
||||
*/
|
||||
|
||||
private native boolean nDraw(String obj_label); /*MANUAL
|
||||
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
|
||||
auto _result = THIS->Draw(label);
|
||||
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native boolean nDraw(String obj_label, float width); /*MANUAL
|
||||
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
|
||||
auto _result = THIS->Draw(label, width);
|
||||
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
private native boolean nDraw(float width); /*
|
||||
return THIS->Draw("Filter (inc,-exc)", width);
|
||||
*/
|
||||
|
||||
public boolean passFilter(final String text) {
|
||||
return nPassFilter(text);
|
||||
}
|
||||
|
||||
private native boolean nPassFilter(String obj_text); /*MANUAL
|
||||
auto text = obj_text == NULL ? NULL : (char*)env->GetStringUTFChars(obj_text, JNI_FALSE);
|
||||
auto _result = THIS->PassFilter(text, NULL);
|
||||
if (text != NULL) env->ReleaseStringUTFChars(obj_text, text);
|
||||
return _result;
|
||||
*/
|
||||
|
||||
public void build() {
|
||||
nBuild();
|
||||
}
|
||||
|
||||
private native void nBuild(); /*
|
||||
THIS->Build();
|
||||
*/
|
||||
|
||||
public void clear() {
|
||||
nClear();
|
||||
}
|
||||
|
||||
private native void nClear(); /*
|
||||
THIS->Clear();
|
||||
*/
|
||||
|
||||
public boolean isActive() {
|
||||
return nIsActive();
|
||||
}
|
||||
|
||||
private native boolean nIsActive(); /*
|
||||
return THIS->IsActive();
|
||||
*/
|
||||
|
||||
public native String getInputBuffer(); /*
|
||||
return env->NewStringUTF(THIS->InputBuf);
|
||||
*/
|
||||
|
||||
public native void setInputBuffer(String inputBuf); /*
|
||||
strncpy(THIS->InputBuf, inputBuf, sizeof(THIS->InputBuf));
|
||||
*/
|
||||
|
||||
public int getCountGrep() {
|
||||
return nGetCountGrep();
|
||||
}
|
||||
|
||||
public void setCountGrep(final int value) {
|
||||
nSetCountGrep(value);
|
||||
}
|
||||
|
||||
private native int nGetCountGrep(); /*
|
||||
return THIS->CountGrep;
|
||||
*/
|
||||
|
||||
private native void nSetCountGrep(int value); /*
|
||||
THIS->CountGrep = value;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,593 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.binding.ImGuiStruct;
|
||||
|
||||
/**
|
||||
* The viewports created and managed by Dear ImGui. The role of the platform backend is to create the platform/OS windows corresponding to each viewport.
|
||||
* - Main Area = entire viewport.
|
||||
* - Work Area = entire viewport minus sections optionally used by menu bars, status bars. Some positioning code will prefer to use this. Window are also trying to stay within this area.
|
||||
*/
|
||||
public final class ImGuiViewport extends ImGuiStruct {
|
||||
public ImGuiViewport(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
#define THIS ((ImGuiViewport*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Unique identifier for the viewport.
|
||||
*/
|
||||
public int getID() {
|
||||
return nGetID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Unique identifier for the viewport.
|
||||
*/
|
||||
public void setID(final int value) {
|
||||
nSetID(value);
|
||||
}
|
||||
|
||||
private native int nGetID(); /*
|
||||
return THIS->ID;
|
||||
*/
|
||||
|
||||
private native void nSetID(int value); /*
|
||||
THIS->ID = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* See {@link imgui.flag.ImGuiViewportFlags}.
|
||||
*/
|
||||
public int getFlags() {
|
||||
return nGetFlags();
|
||||
}
|
||||
|
||||
/**
|
||||
* See {@link imgui.flag.ImGuiViewportFlags}.
|
||||
*/
|
||||
public void setFlags(final int value) {
|
||||
nSetFlags(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* See {@link imgui.flag.ImGuiViewportFlags}.
|
||||
*/
|
||||
public void addFlags(final int flags) {
|
||||
setFlags(getFlags() | flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* See {@link imgui.flag.ImGuiViewportFlags}.
|
||||
*/
|
||||
public void removeFlags(final int flags) {
|
||||
setFlags(getFlags() & ~(flags));
|
||||
}
|
||||
|
||||
/**
|
||||
* See {@link imgui.flag.ImGuiViewportFlags}.
|
||||
*/
|
||||
public boolean hasFlags(final int flags) {
|
||||
return (getFlags() & flags) != 0;
|
||||
}
|
||||
|
||||
private native int nGetFlags(); /*
|
||||
return THIS->Flags;
|
||||
*/
|
||||
|
||||
private native void nSetFlags(int value); /*
|
||||
THIS->Flags = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Main Area: Position of the viewport (the imgui coordinates are the same as OS desktop/native coordinates).
|
||||
*/
|
||||
public ImVec2 getPos() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetPos(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Area: Position of the viewport (the imgui coordinates are the same as OS desktop/native coordinates).
|
||||
*/
|
||||
public float getPosX() {
|
||||
return nGetPosX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Area: Position of the viewport (the imgui coordinates are the same as OS desktop/native coordinates).
|
||||
*/
|
||||
public float getPosY() {
|
||||
return nGetPosY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Area: Position of the viewport (the imgui coordinates are the same as OS desktop/native coordinates).
|
||||
*/
|
||||
public void getPos(final ImVec2 dst) {
|
||||
nGetPos(dst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Area: Position of the viewport (the imgui coordinates are the same as OS desktop/native coordinates).
|
||||
*/
|
||||
public void setPos(final ImVec2 value) {
|
||||
nSetPos(value.x, value.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Area: Position of the viewport (the imgui coordinates are the same as OS desktop/native coordinates).
|
||||
*/
|
||||
public void setPos(final float valueX, final float valueY) {
|
||||
nSetPos(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetPos(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->Pos, dst);
|
||||
*/
|
||||
|
||||
private native float nGetPosX(); /*
|
||||
return THIS->Pos.x;
|
||||
*/
|
||||
|
||||
private native float nGetPosY(); /*
|
||||
return THIS->Pos.y;
|
||||
*/
|
||||
|
||||
private native void nSetPos(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->Pos = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Main Area: Size of the viewport.
|
||||
*/
|
||||
public ImVec2 getSize() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetSize(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Area: Size of the viewport.
|
||||
*/
|
||||
public float getSizeX() {
|
||||
return nGetSizeX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Area: Size of the viewport.
|
||||
*/
|
||||
public float getSizeY() {
|
||||
return nGetSizeY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Area: Size of the viewport.
|
||||
*/
|
||||
public void getSize(final ImVec2 dst) {
|
||||
nGetSize(dst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Area: Size of the viewport.
|
||||
*/
|
||||
public void setSize(final ImVec2 value) {
|
||||
nSetSize(value.x, value.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Area: Size of the viewport.
|
||||
*/
|
||||
public void setSize(final float valueX, final float valueY) {
|
||||
nSetSize(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetSize(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->Size, dst);
|
||||
*/
|
||||
|
||||
private native float nGetSizeX(); /*
|
||||
return THIS->Size.x;
|
||||
*/
|
||||
|
||||
private native float nGetSizeY(); /*
|
||||
return THIS->Size.y;
|
||||
*/
|
||||
|
||||
private native void nSetSize(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->Size = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Work Area: Position of the viewport minus task bars, menus bars, status bars.
|
||||
*/
|
||||
public ImVec2 getWorkPos() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetWorkPos(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Work Area: Position of the viewport minus task bars, menus bars, status bars.
|
||||
*/
|
||||
public float getWorkPosX() {
|
||||
return nGetWorkPosX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Work Area: Position of the viewport minus task bars, menus bars, status bars.
|
||||
*/
|
||||
public float getWorkPosY() {
|
||||
return nGetWorkPosY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Work Area: Position of the viewport minus task bars, menus bars, status bars.
|
||||
*/
|
||||
public void getWorkPos(final ImVec2 dst) {
|
||||
nGetWorkPos(dst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Work Area: Position of the viewport minus task bars, menus bars, status bars.
|
||||
*/
|
||||
public void setWorkPos(final ImVec2 value) {
|
||||
nSetWorkPos(value.x, value.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Work Area: Position of the viewport minus task bars, menus bars, status bars.
|
||||
*/
|
||||
public void setWorkPos(final float valueX, final float valueY) {
|
||||
nSetWorkPos(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetWorkPos(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->WorkPos, dst);
|
||||
*/
|
||||
|
||||
private native float nGetWorkPosX(); /*
|
||||
return THIS->WorkPos.x;
|
||||
*/
|
||||
|
||||
private native float nGetWorkPosY(); /*
|
||||
return THIS->WorkPos.y;
|
||||
*/
|
||||
|
||||
private native void nSetWorkPos(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->WorkPos = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Work Area: Size of the viewport minus task bars, menu bars, status bars.
|
||||
*/
|
||||
public ImVec2 getWorkSize() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetWorkSize(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Work Area: Size of the viewport minus task bars, menu bars, status bars.
|
||||
*/
|
||||
public float getWorkSizeX() {
|
||||
return nGetWorkSizeX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Work Area: Size of the viewport minus task bars, menu bars, status bars.
|
||||
*/
|
||||
public float getWorkSizeY() {
|
||||
return nGetWorkSizeY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Work Area: Size of the viewport minus task bars, menu bars, status bars.
|
||||
*/
|
||||
public void getWorkSize(final ImVec2 dst) {
|
||||
nGetWorkSize(dst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Work Area: Size of the viewport minus task bars, menu bars, status bars.
|
||||
*/
|
||||
public void setWorkSize(final ImVec2 value) {
|
||||
nSetWorkSize(value.x, value.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Work Area: Size of the viewport minus task bars, menu bars, status bars.
|
||||
*/
|
||||
public void setWorkSize(final float valueX, final float valueY) {
|
||||
nSetWorkSize(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetWorkSize(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->WorkSize, dst);
|
||||
*/
|
||||
|
||||
private native float nGetWorkSizeX(); /*
|
||||
return THIS->WorkSize.x;
|
||||
*/
|
||||
|
||||
private native float nGetWorkSizeY(); /*
|
||||
return THIS->WorkSize.y;
|
||||
*/
|
||||
|
||||
private native void nSetWorkSize(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->WorkSize = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* 1.0f = 96 DPI = No extra scale.
|
||||
*/
|
||||
public float getDpiScale() {
|
||||
return nGetDpiScale();
|
||||
}
|
||||
|
||||
/**
|
||||
* 1.0f = 96 DPI = No extra scale.
|
||||
*/
|
||||
public void setDpiScale(final float value) {
|
||||
nSetDpiScale(value);
|
||||
}
|
||||
|
||||
private native float nGetDpiScale(); /*
|
||||
return THIS->DpiScale;
|
||||
*/
|
||||
|
||||
private native void nSetDpiScale(float value); /*
|
||||
THIS->DpiScale = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* (Advanced) 0: no parent. Instruct the platform backend to setup a parent/child relationship between platform windows.
|
||||
*/
|
||||
public int getParentViewportId() {
|
||||
return nGetParentViewportId();
|
||||
}
|
||||
|
||||
/**
|
||||
* (Advanced) 0: no parent. Instruct the platform backend to setup a parent/child relationship between platform windows.
|
||||
*/
|
||||
public void setParentViewportId(final int value) {
|
||||
nSetParentViewportId(value);
|
||||
}
|
||||
|
||||
private native int nGetParentViewportId(); /*
|
||||
return THIS->ParentViewportId;
|
||||
*/
|
||||
|
||||
private native void nSetParentViewportId(int value); /*
|
||||
THIS->ParentViewportId = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* The ImDrawData corresponding to this viewport. Valid after Render() and until the next call to NewFrame().
|
||||
*/
|
||||
public ImDrawData getDrawData() {
|
||||
return new ImDrawData(nGetDrawData());
|
||||
}
|
||||
|
||||
/**
|
||||
* The ImDrawData corresponding to this viewport. Valid after Render() and until the next call to NewFrame().
|
||||
*/
|
||||
public void setDrawData(final ImDrawData value) {
|
||||
nSetDrawData(value.ptr);
|
||||
}
|
||||
|
||||
private native long nGetDrawData(); /*
|
||||
return (intptr_t)THIS->DrawData;
|
||||
*/
|
||||
|
||||
private native void nSetDrawData(long value); /*
|
||||
THIS->DrawData = reinterpret_cast<ImDrawData*>(value);
|
||||
*/
|
||||
|
||||
// Our design separate the Renderer and Platform backends to facilitate combining default backends with each others.
|
||||
// When our create your own backend for a custom engine, it is possible that both Renderer and Platform will be handled
|
||||
// by the same system and you may not need to use all the UserData/Handle fields.
|
||||
// The library never uses those fields, they are merely storage to facilitate backend implementation.
|
||||
|
||||
/**
|
||||
* void* to hold custom data structure for the renderer (e.g. swap chain, framebuffers etc.). generally set by your Renderer_CreateWindow function.
|
||||
*/
|
||||
public native void setRendererUserData(Object data); /*
|
||||
if (THIS->RendererUserData != NULL) {
|
||||
env->DeleteGlobalRef((jobject)THIS->RendererUserData);
|
||||
}
|
||||
THIS->RendererUserData = (data == NULL ? NULL : (void*)env->NewGlobalRef(data));
|
||||
*/
|
||||
|
||||
/**
|
||||
* void* to hold custom data structure for the renderer (e.g. swap chain, framebuffers etc.). generally set by your Renderer_CreateWindow function.
|
||||
*/
|
||||
public native Object getRendererUserData(); /*
|
||||
return (jobject)THIS->RendererUserData;
|
||||
*/
|
||||
|
||||
/**
|
||||
* void* to hold custom data structure for the OS / platform (e.g. windowing info, render context). generally set by your Platform_CreateWindow function.
|
||||
*/
|
||||
public native void setPlatformUserData(Object data); /*
|
||||
if (THIS->PlatformUserData != NULL) {
|
||||
env->DeleteGlobalRef((jobject)THIS->PlatformUserData);
|
||||
}
|
||||
THIS->PlatformUserData = (data == NULL ? NULL : (void*)env->NewGlobalRef(data));
|
||||
*/
|
||||
|
||||
/**
|
||||
* void* to hold custom data structure for the OS / platform (e.g. windowing info, render context). generally set by your Platform_CreateWindow function.
|
||||
*/
|
||||
public native Object getPlatformUserData(); /*
|
||||
return (jobject)THIS->PlatformUserData;
|
||||
*/
|
||||
|
||||
/**
|
||||
* void* for FindViewportByPlatformHandle(). (e.g. suggested to use natural platform handle such as HWND, GLFWWindow*, SDL_Window*)
|
||||
*/
|
||||
public native void setPlatformHandle(long data); /*
|
||||
THIS->PlatformHandle = (void*)data;
|
||||
*/
|
||||
|
||||
/**
|
||||
* void* for FindViewportByPlatformHandle(). (e.g. suggested to use natural platform handle such as HWND, GLFWWindow*, SDL_Window*)
|
||||
*/
|
||||
public native long getPlatformHandle(); /*
|
||||
return (intptr_t)THIS->PlatformHandle;
|
||||
*/
|
||||
|
||||
/**
|
||||
* void* to hold lower-level, platform-native window handle (e.g. the HWND) when using an abstraction layer like GLFW or SDL (where PlatformHandle would be a SDL_Window*)
|
||||
*/
|
||||
public native void setPlatformHandleRaw(long data); /*
|
||||
THIS->PlatformHandleRaw = (void*)data;
|
||||
*/
|
||||
|
||||
/**
|
||||
* void* to hold lower-level, platform-native window handle (e.g. the HWND) when using an abstraction layer like GLFW or SDL (where PlatformHandle would be a SDL_Window*)
|
||||
*/
|
||||
public native long getPlatformHandleRaw(); /*
|
||||
return (intptr_t)THIS->PlatformHandleRaw;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Platform window requested move (e.g. window was moved by the OS / host window manager, authoritative position will be OS window position).
|
||||
*/
|
||||
public boolean getPlatformRequestMove() {
|
||||
return nGetPlatformRequestMove();
|
||||
}
|
||||
|
||||
/**
|
||||
* Platform window requested move (e.g. window was moved by the OS / host window manager, authoritative position will be OS window position).
|
||||
*/
|
||||
public void setPlatformRequestMove(final boolean value) {
|
||||
nSetPlatformRequestMove(value);
|
||||
}
|
||||
|
||||
private native boolean nGetPlatformRequestMove(); /*
|
||||
return THIS->PlatformRequestMove;
|
||||
*/
|
||||
|
||||
private native void nSetPlatformRequestMove(boolean value); /*
|
||||
THIS->PlatformRequestMove = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Platform window requested resize (e.g. window was resized by the OS / host window manager, authoritative size will be OS window size).
|
||||
*/
|
||||
public boolean getPlatformRequestResize() {
|
||||
return nGetPlatformRequestResize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Platform window requested resize (e.g. window was resized by the OS / host window manager, authoritative size will be OS window size).
|
||||
*/
|
||||
public void setPlatformRequestResize(final boolean value) {
|
||||
nSetPlatformRequestResize(value);
|
||||
}
|
||||
|
||||
private native boolean nGetPlatformRequestResize(); /*
|
||||
return THIS->PlatformRequestResize;
|
||||
*/
|
||||
|
||||
private native void nSetPlatformRequestResize(boolean value); /*
|
||||
THIS->PlatformRequestResize = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Platform window requested closure (e.g. window was moved by the OS / host window manager, e.g. pressing ALT-F4).
|
||||
*/
|
||||
public boolean getPlatformRequestClose() {
|
||||
return nGetPlatformRequestClose();
|
||||
}
|
||||
|
||||
/**
|
||||
* Platform window requested closure (e.g. window was moved by the OS / host window manager, e.g. pressing ALT-F4).
|
||||
*/
|
||||
public void setPlatformRequestClose(final boolean value) {
|
||||
nSetPlatformRequestClose(value);
|
||||
}
|
||||
|
||||
private native boolean nGetPlatformRequestClose(); /*
|
||||
return THIS->PlatformRequestClose;
|
||||
*/
|
||||
|
||||
private native void nSetPlatformRequestClose(boolean value); /*
|
||||
THIS->PlatformRequestClose = value;
|
||||
*/
|
||||
|
||||
// Helpers
|
||||
|
||||
public ImVec2 getCenter() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetCenter(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getCenterX() {
|
||||
return nGetCenterX();
|
||||
}
|
||||
|
||||
public float getCenterY() {
|
||||
return nGetCenterY();
|
||||
}
|
||||
|
||||
public void getCenter(final ImVec2 dst) {
|
||||
nGetCenter(dst);
|
||||
}
|
||||
|
||||
private native void nGetCenter(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->GetCenter(), dst);
|
||||
*/
|
||||
|
||||
private native float nGetCenterX(); /*
|
||||
return THIS->GetCenter().x;
|
||||
*/
|
||||
|
||||
private native float nGetCenterY(); /*
|
||||
return THIS->GetCenter().y;
|
||||
*/
|
||||
|
||||
public ImVec2 getWorkCenter() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetWorkCenter(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getWorkCenterX() {
|
||||
return nGetWorkCenterX();
|
||||
}
|
||||
|
||||
public float getWorkCenterY() {
|
||||
return nGetWorkCenterY();
|
||||
}
|
||||
|
||||
public void getWorkCenter(final ImVec2 dst) {
|
||||
nGetWorkCenter(dst);
|
||||
}
|
||||
|
||||
private native void nGetWorkCenter(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->GetWorkCenter(), dst);
|
||||
*/
|
||||
|
||||
private native float nGetWorkCenterX(); /*
|
||||
return THIS->GetWorkCenter().x;
|
||||
*/
|
||||
|
||||
private native float nGetWorkCenterY(); /*
|
||||
return THIS->GetWorkCenter().y;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
|
||||
/**
|
||||
* [ALPHA] Rarely used / very advanced uses only. Use with SetNextWindowClass() and DockSpace() functions.
|
||||
* Important: the content of this class is still highly WIP and likely to change and be refactored
|
||||
* before we stabilize Docking features. Please be mindful if using this.
|
||||
* Provide hints:
|
||||
* - To the platform backend via altered viewport flags (enable/disable OS decoration, OS task bar icons, etc.)
|
||||
* - To the platform backend for OS level parent/child relationships of viewport.
|
||||
* - To the docking system for various options and filtering.
|
||||
*/
|
||||
public final class ImGuiWindowClass extends ImGuiStructDestroyable {
|
||||
public ImGuiWindowClass() {
|
||||
}
|
||||
|
||||
public ImGuiWindowClass(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate();
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_common.h"
|
||||
#define THIS ((ImGuiWindowClass*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
private native long nCreate(); /*
|
||||
return (intptr_t)(new ImGuiWindowClass());
|
||||
*/
|
||||
|
||||
/**
|
||||
* User data. 0 = Default class (unclassed). Windows of different classes cannot be docked with each others.
|
||||
*/
|
||||
public int getClassId() {
|
||||
return nGetClassId();
|
||||
}
|
||||
|
||||
/**
|
||||
* User data. 0 = Default class (unclassed). Windows of different classes cannot be docked with each others.
|
||||
*/
|
||||
public void setClassId(final int value) {
|
||||
nSetClassId(value);
|
||||
}
|
||||
|
||||
private native int nGetClassId(); /*
|
||||
return THIS->ClassId;
|
||||
*/
|
||||
|
||||
private native void nSetClassId(int value); /*
|
||||
THIS->ClassId = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Hint for the platform backend. If non-zero, the platform backend can create a parent{@code <>}child relationship between the platform windows.
|
||||
* Not conforming backends are free to e.g. parent every viewport to the main viewport or not.
|
||||
*/
|
||||
public int getParentViewportId() {
|
||||
return nGetParentViewportId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Hint for the platform backend. If non-zero, the platform backend can create a parent{@code <>}child relationship between the platform windows.
|
||||
* Not conforming backends are free to e.g. parent every viewport to the main viewport or not.
|
||||
*/
|
||||
public void setParentViewportId(final int value) {
|
||||
nSetParentViewportId(value);
|
||||
}
|
||||
|
||||
private native int nGetParentViewportId(); /*
|
||||
return THIS->ParentViewportId;
|
||||
*/
|
||||
|
||||
private native void nSetParentViewportId(int value); /*
|
||||
THIS->ParentViewportId = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Viewport flags to set when a window of this class owns a viewport.
|
||||
* This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
||||
*/
|
||||
public int getViewportFlagsOverrideSet() {
|
||||
return nGetViewportFlagsOverrideSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Viewport flags to set when a window of this class owns a viewport.
|
||||
* This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
||||
*/
|
||||
public void setViewportFlagsOverrideSet(final int value) {
|
||||
nSetViewportFlagsOverrideSet(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Viewport flags to set when a window of this class owns a viewport.
|
||||
* This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
||||
*/
|
||||
public void addViewportFlagsOverrideSet(final int flags) {
|
||||
setViewportFlagsOverrideSet(getViewportFlagsOverrideSet() | flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Viewport flags to set when a window of this class owns a viewport.
|
||||
* This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
||||
*/
|
||||
public void removeViewportFlagsOverrideSet(final int flags) {
|
||||
setViewportFlagsOverrideSet(getViewportFlagsOverrideSet() & ~(flags));
|
||||
}
|
||||
|
||||
/**
|
||||
* Viewport flags to set when a window of this class owns a viewport.
|
||||
* This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
||||
*/
|
||||
public boolean hasViewportFlagsOverrideSet(final int flags) {
|
||||
return (getViewportFlagsOverrideSet() & flags) != 0;
|
||||
}
|
||||
|
||||
private native int nGetViewportFlagsOverrideSet(); /*
|
||||
return THIS->ViewportFlagsOverrideSet;
|
||||
*/
|
||||
|
||||
private native void nSetViewportFlagsOverrideSet(int value); /*
|
||||
THIS->ViewportFlagsOverrideSet = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Viewport flags to clear when a window of this class owns a viewport.
|
||||
* This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
||||
*/
|
||||
public int getViewportFlagsOverrideClear() {
|
||||
return nGetViewportFlagsOverrideClear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Viewport flags to clear when a window of this class owns a viewport.
|
||||
* This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
||||
*/
|
||||
public void setViewportFlagsOverrideClear(final int value) {
|
||||
nSetViewportFlagsOverrideClear(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Viewport flags to clear when a window of this class owns a viewport.
|
||||
* This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
||||
*/
|
||||
public void addViewportFlagsOverrideClear(final int flags) {
|
||||
setViewportFlagsOverrideClear(getViewportFlagsOverrideClear() | flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Viewport flags to clear when a window of this class owns a viewport.
|
||||
* This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
||||
*/
|
||||
public void removeViewportFlagsOverrideClear(final int flags) {
|
||||
setViewportFlagsOverrideClear(getViewportFlagsOverrideClear() & ~(flags));
|
||||
}
|
||||
|
||||
/**
|
||||
* Viewport flags to clear when a window of this class owns a viewport.
|
||||
* This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
||||
*/
|
||||
public boolean hasViewportFlagsOverrideClear(final int flags) {
|
||||
return (getViewportFlagsOverrideClear() & flags) != 0;
|
||||
}
|
||||
|
||||
private native int nGetViewportFlagsOverrideClear(); /*
|
||||
return THIS->ViewportFlagsOverrideClear;
|
||||
*/
|
||||
|
||||
private native void nSetViewportFlagsOverrideClear(int value); /*
|
||||
THIS->ViewportFlagsOverrideClear = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* [EXPERIMENTAL] TabItem flags to set when a window of this class gets submitted into a dock node tab bar.
|
||||
* May use with ImGuiTabItemFlags_Leading or ImGuiTabItemFlags_Trailing.
|
||||
*/
|
||||
public int getTabItemFlagsOverrideSet() {
|
||||
return nGetTabItemFlagsOverrideSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* [EXPERIMENTAL] TabItem flags to set when a window of this class gets submitted into a dock node tab bar.
|
||||
* May use with ImGuiTabItemFlags_Leading or ImGuiTabItemFlags_Trailing.
|
||||
*/
|
||||
public void setTabItemFlagsOverrideSet(final int value) {
|
||||
nSetTabItemFlagsOverrideSet(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* [EXPERIMENTAL] TabItem flags to set when a window of this class gets submitted into a dock node tab bar.
|
||||
* May use with ImGuiTabItemFlags_Leading or ImGuiTabItemFlags_Trailing.
|
||||
*/
|
||||
public void addTabItemFlagsOverrideSet(final int flags) {
|
||||
setTabItemFlagsOverrideSet(getTabItemFlagsOverrideSet() | flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* [EXPERIMENTAL] TabItem flags to set when a window of this class gets submitted into a dock node tab bar.
|
||||
* May use with ImGuiTabItemFlags_Leading or ImGuiTabItemFlags_Trailing.
|
||||
*/
|
||||
public void removeTabItemFlagsOverrideSet(final int flags) {
|
||||
setTabItemFlagsOverrideSet(getTabItemFlagsOverrideSet() & ~(flags));
|
||||
}
|
||||
|
||||
/**
|
||||
* [EXPERIMENTAL] TabItem flags to set when a window of this class gets submitted into a dock node tab bar.
|
||||
* May use with ImGuiTabItemFlags_Leading or ImGuiTabItemFlags_Trailing.
|
||||
*/
|
||||
public boolean hasTabItemFlagsOverrideSet(final int flags) {
|
||||
return (getTabItemFlagsOverrideSet() & flags) != 0;
|
||||
}
|
||||
|
||||
private native int nGetTabItemFlagsOverrideSet(); /*
|
||||
return THIS->TabItemFlagsOverrideSet;
|
||||
*/
|
||||
|
||||
private native void nSetTabItemFlagsOverrideSet(int value); /*
|
||||
THIS->TabItemFlagsOverrideSet = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* [EXPERIMENTAL] Dock node flags to set when a window of this class is hosted by a dock node (it doesn't have to be selected!)
|
||||
*/
|
||||
public int getDockNodeFlagsOverrideSet() {
|
||||
return nGetDockNodeFlagsOverrideSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* [EXPERIMENTAL] Dock node flags to set when a window of this class is hosted by a dock node (it doesn't have to be selected!)
|
||||
*/
|
||||
public void setDockNodeFlagsOverrideSet(final int value) {
|
||||
nSetDockNodeFlagsOverrideSet(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* [EXPERIMENTAL] Dock node flags to set when a window of this class is hosted by a dock node (it doesn't have to be selected!)
|
||||
*/
|
||||
public void addDockNodeFlagsOverrideSet(final int flags) {
|
||||
setDockNodeFlagsOverrideSet(getDockNodeFlagsOverrideSet() | flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* [EXPERIMENTAL] Dock node flags to set when a window of this class is hosted by a dock node (it doesn't have to be selected!)
|
||||
*/
|
||||
public void removeDockNodeFlagsOverrideSet(final int flags) {
|
||||
setDockNodeFlagsOverrideSet(getDockNodeFlagsOverrideSet() & ~(flags));
|
||||
}
|
||||
|
||||
/**
|
||||
* [EXPERIMENTAL] Dock node flags to set when a window of this class is hosted by a dock node (it doesn't have to be selected!)
|
||||
*/
|
||||
public boolean hasDockNodeFlagsOverrideSet(final int flags) {
|
||||
return (getDockNodeFlagsOverrideSet() & flags) != 0;
|
||||
}
|
||||
|
||||
private native int nGetDockNodeFlagsOverrideSet(); /*
|
||||
return THIS->DockNodeFlagsOverrideSet;
|
||||
*/
|
||||
|
||||
private native void nSetDockNodeFlagsOverrideSet(int value); /*
|
||||
THIS->DockNodeFlagsOverrideSet = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set to true to enforce single floating windows of this class always having their own docking node
|
||||
* (equivalent of setting the global io.ConfigDockingAlwaysTabBar)
|
||||
*/
|
||||
public boolean getDockingAlwaysTabBar() {
|
||||
return nGetDockingAlwaysTabBar();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set to true to enforce single floating windows of this class always having their own docking node
|
||||
* (equivalent of setting the global io.ConfigDockingAlwaysTabBar)
|
||||
*/
|
||||
public void setDockingAlwaysTabBar(final boolean value) {
|
||||
nSetDockingAlwaysTabBar(value);
|
||||
}
|
||||
|
||||
private native boolean nGetDockingAlwaysTabBar(); /*
|
||||
return THIS->DockingAlwaysTabBar;
|
||||
*/
|
||||
|
||||
private native void nSetDockingAlwaysTabBar(boolean value); /*
|
||||
THIS->DockingAlwaysTabBar = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set to true to allow windows of this class to be docked/merged with an unclassed window.
|
||||
*/
|
||||
public boolean getDockingAllowUnclassed() {
|
||||
return nGetDockingAllowUnclassed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set to true to allow windows of this class to be docked/merged with an unclassed window.
|
||||
*/
|
||||
public void setDockingAllowUnclassed(final boolean value) {
|
||||
nSetDockingAllowUnclassed(value);
|
||||
}
|
||||
|
||||
private native boolean nGetDockingAllowUnclassed(); /*
|
||||
return THIS->DockingAllowUnclassed;
|
||||
*/
|
||||
|
||||
private native void nSetDockingAllowUnclassed(boolean value); /*
|
||||
THIS->DockingAllowUnclassed = value;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package imgui;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 2D vector (often used to store positions or sizes).
|
||||
*/
|
||||
public final class ImVec2 implements Cloneable {
|
||||
public float x;
|
||||
public float y;
|
||||
|
||||
public ImVec2() {
|
||||
}
|
||||
|
||||
public ImVec2(final float x, final float y) {
|
||||
set(x, y);
|
||||
}
|
||||
|
||||
public ImVec2(final ImVec2 value) {
|
||||
set(value.x, value.y);
|
||||
}
|
||||
|
||||
public ImVec2 set(final float x, final float y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImVec2 set(final ImVec2 value) {
|
||||
return set(value.x, value.y);
|
||||
}
|
||||
|
||||
public ImVec2 plus(final float x, final float y) {
|
||||
this.x += x;
|
||||
this.y += y;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImVec2 plus(final ImVec2 value) {
|
||||
return plus(value.x, value.y);
|
||||
}
|
||||
|
||||
public ImVec2 minus(final float x, final float y) {
|
||||
this.x -= x;
|
||||
this.y -= y;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImVec2 minus(final ImVec2 value) {
|
||||
return minus(value.x, value.y);
|
||||
}
|
||||
|
||||
public ImVec2 times(final float x, final float y) {
|
||||
this.x *= x;
|
||||
this.y *= y;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImVec2 times(final ImVec2 value) {
|
||||
return times(value.x, value.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ImVec2{"
|
||||
+ "x=" + x
|
||||
+ ", y=" + y
|
||||
+ '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final ImVec2 imVec2 = (ImVec2) o;
|
||||
return Float.compare(imVec2.x, x) == 0 && Float.compare(imVec2.y, y) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("MethodDoesntCallSuperMethod")
|
||||
public ImVec2 clone() {
|
||||
return new ImVec2(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package imgui;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 4D vector (often used to store floating-point colors).
|
||||
*/
|
||||
public final class ImVec4 implements Cloneable {
|
||||
public float x;
|
||||
public float y;
|
||||
public float z;
|
||||
public float w;
|
||||
|
||||
public ImVec4() {
|
||||
}
|
||||
|
||||
public ImVec4(final float x, final float y, final float z, final float w) {
|
||||
set(x, y, z, w);
|
||||
}
|
||||
|
||||
public ImVec4(final ImVec4 value) {
|
||||
set(value.x, value.y, value.z, value.w);
|
||||
}
|
||||
|
||||
public ImVec4 set(final float x, final float y, final float z, final float w) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.w = w;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImVec4 set(final ImVec4 value) {
|
||||
return set(value.x, value.y, value.z, value.w);
|
||||
}
|
||||
|
||||
public ImVec4 plus(final float x, final float y, final float z, final float w) {
|
||||
this.x += x;
|
||||
this.y += y;
|
||||
this.z += z;
|
||||
this.w += w;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImVec4 plus(final ImVec4 value) {
|
||||
return plus(value.x, value.y, value.z, value.w);
|
||||
}
|
||||
|
||||
public ImVec4 minus(final float x, final float y, final float z, final float w) {
|
||||
this.x -= x;
|
||||
this.y -= y;
|
||||
this.z -= z;
|
||||
this.w -= w;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImVec4 minus(final ImVec4 value) {
|
||||
return minus(value.x, value.y, value.z, value.w);
|
||||
}
|
||||
|
||||
public ImVec4 times(final float x, final float y, final float z, final float w) {
|
||||
this.x *= x;
|
||||
this.y *= y;
|
||||
this.z *= z;
|
||||
this.w *= w;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImVec4 times(final ImVec4 value) {
|
||||
return times(value.x, value.y, value.z, value.w);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ImVec4{"
|
||||
+ "x=" + x
|
||||
+ ", y=" + y
|
||||
+ ", z=" + z
|
||||
+ ", w=" + w
|
||||
+ '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final ImVec4 imVec4 = (ImVec4) o;
|
||||
return Float.compare(imVec4.x, x) == 0 && Float.compare(imVec4.y, y) == 0 && Float.compare(imVec4.z, z) == 0 && Float.compare(imVec4.w, w) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(x, y, z, w);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("MethodDoesntCallSuperMethod")
|
||||
public ImVec4 clone() {
|
||||
return new ImVec4(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
package imgui.assertion;
|
||||
|
||||
/**
|
||||
* Callback for native IM_ASSERT calls.
|
||||
*/
|
||||
public abstract class ImAssertCallback {
|
||||
/**
|
||||
* Called from native code to bring the callback into java side.
|
||||
* Will force the application to terminate with exit code 1 after forwarding the callback, this is required, otherwise
|
||||
* if execution is returned to the native layer, a EXCEPTION_ACCESS_VIOLATION will be thrown.
|
||||
* If the callback throws an exception, it will be caught and printed along with a warning to prevent execution
|
||||
* from returning to the native layer.
|
||||
*
|
||||
* @param assertion The assertion string
|
||||
* @param line The line number of the assertion in the source file
|
||||
* @param file The source file where the assertion occurred
|
||||
*/
|
||||
public void imAssert(final String assertion, final int line, final String file) {
|
||||
try {
|
||||
imAssertCallback(assertion, line, file);
|
||||
} catch (Exception ex) {
|
||||
System.err.println("WARNING: Exception thrown in Dear ImGui Assertion Callback!");
|
||||
System.err.println("Dear ImGui Assertion Failed: " + assertion);
|
||||
System.err.println("Assertion Located At: " + file + ":" + line);
|
||||
ex.printStackTrace();
|
||||
}
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* The assertion callback from ImGui.
|
||||
* Do not throw an exception within this callback, to prevent
|
||||
* execution from returned to the native layer and cause a EXCEPTION_ACCESS_VIOLATION,
|
||||
* the callback will catch any exceptions and print a warning.
|
||||
* <p>
|
||||
* There is no way to catch the assertion and continue execution.
|
||||
* You may however call <code>System.exit(code)</code> with your own exit code.
|
||||
*
|
||||
* @param assertion The assertion string
|
||||
* @param line The line number of the assertion in the source file
|
||||
* @param file The source file where the assertion occurred
|
||||
*/
|
||||
public abstract void imAssertCallback(String assertion, int line, String file);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package imgui.binding;
|
||||
|
||||
import imgui.ImGui;
|
||||
|
||||
/**
|
||||
* Class provides a communication layer between binding and Dear ImGui library through the "pointer" field.
|
||||
*/
|
||||
public abstract class ImGuiStruct {
|
||||
/**
|
||||
* Pointer to the natively allocated object.
|
||||
* Could be zero if JNI returned NULL instead of the real object.
|
||||
* For such cases methods {@link #isValidPtr()} and {@link #isNotValidPtr()} could be used to verify that object points to the real object.
|
||||
*/
|
||||
public long ptr;
|
||||
|
||||
public ImGuiStruct(final long ptr) {
|
||||
ImGui.init();
|
||||
this.ptr = ptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows if object pointer is valid and does it point to the existing object.
|
||||
*
|
||||
* @return true, if pointer is valid
|
||||
*/
|
||||
public final boolean isValidPtr() {
|
||||
return ptr != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows if object pointer is valid and does it point to the existing object.
|
||||
*
|
||||
* @return true, if pointer is invalid
|
||||
*/
|
||||
public final boolean isNotValidPtr() {
|
||||
return !isValidPtr();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package imgui.binding;
|
||||
|
||||
/**
|
||||
* Class extends {@link ImGuiStruct} and provides additional API to allocated and de-allocate native objects.
|
||||
*/
|
||||
public abstract class ImGuiStructDestroyable extends ImGuiStruct {
|
||||
/**
|
||||
* Constructor, which creates natively allocated struct. Those structs should be manually disposed with {@link #destroy()} method.
|
||||
*/
|
||||
public ImGuiStructDestroyable() {
|
||||
this(0);
|
||||
ptr = create();
|
||||
}
|
||||
|
||||
public ImGuiStructDestroyable(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
protected abstract long create();
|
||||
|
||||
/**
|
||||
* Method to free natively allocated memory for the struct mapped with pointer.
|
||||
*/
|
||||
public void destroy() {
|
||||
nDestroy(ptr);
|
||||
}
|
||||
|
||||
private native void nDestroy(long ptr); /*
|
||||
delete (void*)ptr;
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package imgui.callback;
|
||||
|
||||
import imgui.ImGuiInputTextCallbackData;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* Callback to use in {@link imgui.ImGui#inputText(String, imgui.type.ImString, int, ImGuiInputTextCallback)}.
|
||||
*/
|
||||
public abstract class ImGuiInputTextCallback implements Consumer<ImGuiInputTextCallbackData> {
|
||||
/**
|
||||
* This function will be called by the native Callback and wrapped.
|
||||
*/
|
||||
public final void accept(final long ptr) {
|
||||
accept(new ImGuiInputTextCallbackData(ptr));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package imgui.callback;
|
||||
|
||||
/**
|
||||
* Callback for {@link imgui.ImGuiListClipper} class.
|
||||
*/
|
||||
public abstract class ImListClipperCallback {
|
||||
public abstract void accept(int index);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package imgui.callback;
|
||||
|
||||
import imgui.ImGuiViewport;
|
||||
|
||||
/**
|
||||
* Callback to represent ImGuiPlatformIO function with args: (ImGuiViewport*)
|
||||
*/
|
||||
public abstract class ImPlatformFuncViewport {
|
||||
public abstract void accept(ImGuiViewport vp);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package imgui.callback;
|
||||
|
||||
import imgui.ImGuiViewport;
|
||||
|
||||
/**
|
||||
* Callback to represent ImGuiPlatformIO function with args: (ImGuiViewport*, String)
|
||||
*/
|
||||
public abstract class ImPlatformFuncViewportFloat {
|
||||
public abstract void accept(ImGuiViewport vp, float f);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package imgui.callback;
|
||||
|
||||
import imgui.ImGuiViewport;
|
||||
import imgui.ImVec2;
|
||||
|
||||
/**
|
||||
* Callback to represent ImGuiPlatformIO function with args: (ImGuiViewport*, ImVec2)
|
||||
*/
|
||||
public abstract class ImPlatformFuncViewportImVec2 {
|
||||
public abstract void accept(ImGuiViewport vp, ImVec2 imVec2);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package imgui.callback;
|
||||
|
||||
import imgui.ImGuiViewport;
|
||||
|
||||
/**
|
||||
* Callback to represent ImGuiPlatformIO function with args: (ImGuiViewport*, String)
|
||||
*/
|
||||
public abstract class ImPlatformFuncViewportString {
|
||||
public abstract void accept(ImGuiViewport vp, String str);
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package imgui.callback;
|
||||
|
||||
import imgui.ImGuiViewport;
|
||||
|
||||
/**
|
||||
* Callback to represent ImGuiPlatformIO function with args: (ImGuiViewport*) - Boolean
|
||||
*/
|
||||
public abstract class ImPlatformFuncViewportSuppBoolean {
|
||||
public abstract boolean get(ImGuiViewport vp);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package imgui.callback;
|
||||
|
||||
import imgui.ImGuiViewport;
|
||||
|
||||
/**
|
||||
* Callback to represent ImGuiPlatformIO function with args: (ImGuiViewport*) - Boolean
|
||||
*/
|
||||
public abstract class ImPlatformFuncViewportSuppFloat {
|
||||
public abstract float get(ImGuiViewport vp);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package imgui.callback;
|
||||
|
||||
import imgui.ImGuiViewport;
|
||||
import imgui.ImVec2;
|
||||
|
||||
/**
|
||||
* Callback to represent ImGuiPlatformIO function with args: (ImGuiViewport*) - ImVec2
|
||||
*/
|
||||
public abstract class ImPlatformFuncViewportSuppImVec2 {
|
||||
public abstract void get(ImGuiViewport vp, ImVec2 dstImVec2);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package imgui.callback;
|
||||
|
||||
/**
|
||||
* Callback to supply Java string form native code.
|
||||
*/
|
||||
public abstract class ImStrConsumer {
|
||||
public abstract void accept(String str);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package imgui.callback;
|
||||
|
||||
/**
|
||||
* Callback to get Java string from native code.
|
||||
*/
|
||||
public abstract class ImStrSupplier {
|
||||
public abstract String get();
|
||||
}
|
||||
+1591
File diff suppressed because it is too large.
Load diff
+5
@@ -0,0 +1,5 @@
|
||||
package imgui.extension.imguifiledialog.callback;
|
||||
|
||||
public abstract class ImGuiFileDialogPaneFun {
|
||||
public abstract void accept(String filter, long userDatas, boolean canContinue);
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package imgui.extension.imguifiledialog.flag;
|
||||
|
||||
|
||||
public final class ImGuiFileDialogFlags {
|
||||
private ImGuiFileDialogFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* show confirm to overwrite dialog
|
||||
*
|
||||
* <p>Definition: {@code (1 << 0)}
|
||||
*/
|
||||
public static final int ConfirmOverwrite = 1;
|
||||
|
||||
/**
|
||||
* dont show hidden file (file starting with a .)
|
||||
*
|
||||
* <p>Definition: {@code (1 << 1)}
|
||||
*/
|
||||
public static final int DontShowHiddenFiles = 2;
|
||||
|
||||
/**
|
||||
* disable the create directory button
|
||||
*
|
||||
* <p>Definition: {@code (1 << 2)}
|
||||
*/
|
||||
public static final int DisableCreateDirectoryButton = 4;
|
||||
|
||||
/**
|
||||
* hide column file type
|
||||
*
|
||||
* <p>Definition: {@code (1 << 3)}
|
||||
*/
|
||||
public static final int HideColumnType = 8;
|
||||
|
||||
/**
|
||||
* hide column file size
|
||||
*
|
||||
* <p>Definition: {@code (1 << 4)}
|
||||
*/
|
||||
public static final int HideColumnSize = 16;
|
||||
|
||||
/**
|
||||
* hide column file date
|
||||
*
|
||||
* <p>Definition: {@code (1 << 5)}
|
||||
*/
|
||||
public static final int HideColumnDate = 32;
|
||||
|
||||
/**
|
||||
* Definition: {@code ImGuiFileDialogFlags_ConfirmOverwrite}
|
||||
*/
|
||||
public static final int Default = 1;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,29 @@
|
||||
package imgui.extension.imguiknobs.flag;
|
||||
|
||||
|
||||
public final class ImGuiKnobFlags {
|
||||
private ImGuiKnobFlags() {
|
||||
}
|
||||
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int NoTitle = 1;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int NoInput = 2;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int ValueTooltip = 4;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int DragHorizontal = 8;
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package imgui.extension.imguiknobs.flag;
|
||||
|
||||
|
||||
public final class ImGuiKnobVariant {
|
||||
private ImGuiKnobVariant() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int Tick = 1;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int Dot = 2;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int Wiper = 4;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int WiperOnly = 8;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 4}
|
||||
*/
|
||||
public static final int WiperDot = 16;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 5}
|
||||
*/
|
||||
public static final int Stepped = 32;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 6}
|
||||
*/
|
||||
public static final int Space = 64;
|
||||
}
|
||||
@@ -0,0 +1,542 @@
|
||||
package imgui.extension.imguizmo;
|
||||
|
||||
import imgui.ImDrawList;
|
||||
import imgui.ImVec2;
|
||||
import imgui.internal.ImGuiContext;
|
||||
|
||||
public final class ImGuizmo {
|
||||
private ImGuizmo() {
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_imguizmo.h"
|
||||
*/
|
||||
|
||||
/**
|
||||
* Call inside your own window and before Manipulate() in order to draw gizmo to that window.
|
||||
* Or pass a specific ImDrawList to draw to (e.g. ImGui::GetForegroundDrawList()).
|
||||
*/
|
||||
public static void setDrawList() {
|
||||
nSetDrawList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Call inside your own window and before Manipulate() in order to draw gizmo to that window.
|
||||
* Or pass a specific ImDrawList to draw to (e.g. ImGui::GetForegroundDrawList()).
|
||||
*/
|
||||
public static void setDrawList(final ImDrawList drawList) {
|
||||
nSetDrawList(drawList.ptr);
|
||||
}
|
||||
|
||||
private static native void nSetDrawList(); /*
|
||||
ImGuizmo::SetDrawlist();
|
||||
*/
|
||||
|
||||
private static native void nSetDrawList(long drawList); /*
|
||||
ImGuizmo::SetDrawlist(reinterpret_cast<ImDrawList*>(drawList));
|
||||
*/
|
||||
|
||||
/**
|
||||
* Call BeginFrame right after ImGui_XXXX_NewFrame();
|
||||
*/
|
||||
public static void beginFrame() {
|
||||
nBeginFrame();
|
||||
}
|
||||
|
||||
private static native void nBeginFrame(); /*
|
||||
ImGuizmo::BeginFrame();
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is necessary because when imguizmo is compiled into a dll, and imgui into another
|
||||
* Globals are not shared between them.
|
||||
* More details at https://stackoverflow.com/questions/19373061/what-happens-to-global-and-static-variables-in-a-shared-library-when-it-is-dynam
|
||||
* Expose method to set imgui context
|
||||
*/
|
||||
public static void setImGuiContext(final ImGuiContext ctx) {
|
||||
nSetImGuiContext(ctx.ptr);
|
||||
}
|
||||
|
||||
private static native void nSetImGuiContext(long ctx); /*
|
||||
ImGuizmo::SetImGuiContext(reinterpret_cast<ImGuiContext*>(ctx));
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return true if mouse cursor is over any gizmo control (axis, plan or screen component)
|
||||
*/
|
||||
public static boolean isOver() {
|
||||
return nIsOver();
|
||||
}
|
||||
|
||||
private static native boolean nIsOver(); /*
|
||||
return ImGuizmo::IsOver();
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return true if mouse IsOver or if the gizmo is in moving state
|
||||
*/
|
||||
public static boolean isUsing() {
|
||||
return nIsUsing();
|
||||
}
|
||||
|
||||
private static native boolean nIsUsing(); /*
|
||||
return ImGuizmo::IsUsing();
|
||||
*/
|
||||
|
||||
/**
|
||||
* Enable/disable the gizmo. Stay in the state until next call to Enable.
|
||||
* Gizmo is rendered with gray half transparent color when disabled
|
||||
*/
|
||||
public static void enable(final boolean enable) {
|
||||
nEnable(enable);
|
||||
}
|
||||
|
||||
private static native void nEnable(boolean enable); /*
|
||||
ImGuizmo::Enable(enable);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Helper function for manually editing Translation/Rotation/Scale with an input float.
|
||||
* Translation, Rotation and Scale float points to 3 floats each.
|
||||
* Angles are in degrees (more suitable for human editing).
|
||||
*
|
||||
* @param matrix
|
||||
* the model matrix
|
||||
* @param translation
|
||||
* the model translation
|
||||
* @param rotation
|
||||
* the model rotation
|
||||
* @param scale
|
||||
* the model scale
|
||||
* @see <a target="_blank" href="https://github.com/CedricGuillemet/ImGuizmo">Reference Page</a>
|
||||
*/
|
||||
public static void decomposeMatrixToComponents(final float[] matrix, final float[] translation, final float[] rotation, final float[] scale) {
|
||||
nDecomposeMatrixToComponents(matrix, translation, rotation, scale);
|
||||
}
|
||||
|
||||
private static native void nDecomposeMatrixToComponents(float[] matrix, float[] translation, float[] rotation, float[] scale); /*MANUAL
|
||||
auto matrix = obj_matrix == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_matrix, JNI_FALSE);
|
||||
auto translation = obj_translation == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_translation, JNI_FALSE);
|
||||
auto rotation = obj_rotation == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_rotation, JNI_FALSE);
|
||||
auto scale = obj_scale == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_scale, JNI_FALSE);
|
||||
ImGuizmo::DecomposeMatrixToComponents(&matrix[0], &translation[0], &rotation[0], &scale[0]);
|
||||
if (matrix != NULL) env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, JNI_FALSE);
|
||||
if (translation != NULL) env->ReleasePrimitiveArrayCritical(obj_translation, translation, JNI_FALSE);
|
||||
if (rotation != NULL) env->ReleasePrimitiveArrayCritical(obj_rotation, rotation, JNI_FALSE);
|
||||
if (scale != NULL) env->ReleasePrimitiveArrayCritical(obj_scale, scale, JNI_FALSE);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Helper function for manually editing Translation/Rotation/Scale with an input float.
|
||||
* Translation, Rotation and Scale float points to 3 floats each.
|
||||
* Angles are in degrees (more suitable for human editing).
|
||||
*
|
||||
* @param translation
|
||||
* the model translation
|
||||
* @param rotation
|
||||
* the model rotation
|
||||
* @param scale
|
||||
* the model scale
|
||||
* @param matrix
|
||||
* the model matrix
|
||||
* @see <a target="_blank" href="https://github.com/CedricGuillemet/ImGuizmo">Reference Page</a>
|
||||
*/
|
||||
public static void recomposeMatrixFromComponents(final float[] translation, final float[] rotation, final float[] scale, final float[] matrix) {
|
||||
nRecomposeMatrixFromComponents(translation, rotation, scale, matrix);
|
||||
}
|
||||
|
||||
private static native void nRecomposeMatrixFromComponents(float[] translation, float[] rotation, float[] scale, float[] matrix); /*MANUAL
|
||||
auto translation = obj_translation == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_translation, JNI_FALSE);
|
||||
auto rotation = obj_rotation == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_rotation, JNI_FALSE);
|
||||
auto scale = obj_scale == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_scale, JNI_FALSE);
|
||||
auto matrix = obj_matrix == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_matrix, JNI_FALSE);
|
||||
ImGuizmo::RecomposeMatrixFromComponents(&translation[0], &rotation[0], &scale[0], &matrix[0]);
|
||||
if (translation != NULL) env->ReleasePrimitiveArrayCritical(obj_translation, translation, JNI_FALSE);
|
||||
if (rotation != NULL) env->ReleasePrimitiveArrayCritical(obj_rotation, rotation, JNI_FALSE);
|
||||
if (scale != NULL) env->ReleasePrimitiveArrayCritical(obj_scale, scale, JNI_FALSE);
|
||||
if (matrix != NULL) env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, JNI_FALSE);
|
||||
*/
|
||||
|
||||
/**
|
||||
* This will set the rect position.
|
||||
*
|
||||
* @param x
|
||||
* x coordinate of the rectangle
|
||||
* @param y
|
||||
* y coordinate of the rectangle
|
||||
* @param width
|
||||
* width of the rectangle
|
||||
* @param height
|
||||
* height of the rectangle
|
||||
*/
|
||||
public static void setRect(final float x, final float y, final float width, final float height) {
|
||||
nSetRect(x, y, width, height);
|
||||
}
|
||||
|
||||
private static native void nSetRect(float x, float y, float width, float height); /*
|
||||
ImGuizmo::SetRect(x, y, width, height);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Making sure if we're set to ortho or not.
|
||||
*/
|
||||
public static void setOrthographic(final boolean isOrthographic) {
|
||||
nSetOrthographic(isOrthographic);
|
||||
}
|
||||
|
||||
private static native void nSetOrthographic(boolean isOrthographic); /*
|
||||
ImGuizmo::SetOrthographic(isOrthographic);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Drawing an arbitrary cube in the world.
|
||||
*
|
||||
* @param view
|
||||
* target camera view
|
||||
* @param projection
|
||||
* target camera projection
|
||||
* @param matrices
|
||||
* cube matrices (max. 4 cubes allowed)
|
||||
*/
|
||||
public static void drawCubes(final float[] view, final float[] projection, final float[] matrices) {
|
||||
nDrawCubes(view, projection, matrices);
|
||||
}
|
||||
|
||||
private static native void nDrawCubes(float[] view, float[] projection, float[] matrices); /*MANUAL
|
||||
auto view = obj_view == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_view, JNI_FALSE);
|
||||
auto projection = obj_projection == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_projection, JNI_FALSE);
|
||||
auto matrices = obj_matrices == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_matrices, JNI_FALSE);
|
||||
ImGuizmo::DrawCubes(&view[0], &projection[0], &matrices[0], (int)(env->GetArrayLength(obj_matrices)/16));
|
||||
if (view != NULL) env->ReleasePrimitiveArrayCritical(obj_view, view, JNI_FALSE);
|
||||
if (projection != NULL) env->ReleasePrimitiveArrayCritical(obj_projection, projection, JNI_FALSE);
|
||||
if (matrices != NULL) env->ReleasePrimitiveArrayCritical(obj_matrices, matrices, JNI_FALSE);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Drawing an arbitrary cube in the world.
|
||||
*
|
||||
* @param view
|
||||
* target camera view
|
||||
* @param projection
|
||||
* target camera projection
|
||||
* @param matrices
|
||||
* cube matrices (max. 4 cubes allowed)
|
||||
* @param matrixCount
|
||||
* number of matrices
|
||||
*/
|
||||
public static void drawCubes(final float[] view, final float[] projection, final float[] matrices, final int matrixCount) {
|
||||
nDrawCubes(view, projection, matrices, matrixCount);
|
||||
}
|
||||
|
||||
private static native void nDrawCubes(float[] view, float[] projection, float[] matrices, int matrixCount); /*MANUAL
|
||||
auto view = obj_view == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_view, JNI_FALSE);
|
||||
auto projection = obj_projection == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_projection, JNI_FALSE);
|
||||
auto matrices = obj_matrices == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_matrices, JNI_FALSE);
|
||||
ImGuizmo::DrawCubes(&view[0], &projection[0], &matrices[0], matrixCount);
|
||||
if (view != NULL) env->ReleasePrimitiveArrayCritical(obj_view, view, JNI_FALSE);
|
||||
if (projection != NULL) env->ReleasePrimitiveArrayCritical(obj_projection, projection, JNI_FALSE);
|
||||
if (matrices != NULL) env->ReleasePrimitiveArrayCritical(obj_matrices, matrices, JNI_FALSE);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Drawing an arbitrary cube in the world.
|
||||
*
|
||||
* @param view target camera view
|
||||
* @param projection target camera projection
|
||||
* @param matrices cube matrices (max. 4 cubes allowed)
|
||||
*/
|
||||
public static void drawCubes(final float[] view, final float[] projection, final float[]... matrices) {
|
||||
if (matrices.length > 4) {
|
||||
throw new IllegalArgumentException("Only up to 4 cubes matrices is supported");
|
||||
}
|
||||
|
||||
final float[] cubeMatrices = new float[matrices.length * 16];
|
||||
for (int i = 0, cubeMatricesLength = matrices.length; i < cubeMatricesLength; i++) {
|
||||
final float[] cubeMatrix = matrices[i];
|
||||
System.arraycopy(cubeMatrix, 0, cubeMatrices, i * cubeMatrix.length, cubeMatrix.length);
|
||||
}
|
||||
|
||||
drawCubes(view, projection, cubeMatrices, cubeMatrices.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drawing a grid to the world (should only be used for debugging purposes).
|
||||
*
|
||||
* @param view
|
||||
* target camera view
|
||||
* @param projection
|
||||
* target camera projection
|
||||
* @param matrix
|
||||
* grid matrix
|
||||
* @param gridSize
|
||||
* grid size
|
||||
*/
|
||||
public static void drawGrid(final float[] view, final float[] projection, final float[] matrix, final float gridSize) {
|
||||
nDrawGrid(view, projection, matrix, gridSize);
|
||||
}
|
||||
|
||||
private static native void nDrawGrid(float[] view, float[] projection, float[] matrix, float gridSize); /*MANUAL
|
||||
auto view = obj_view == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_view, JNI_FALSE);
|
||||
auto projection = obj_projection == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_projection, JNI_FALSE);
|
||||
auto matrix = obj_matrix == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_matrix, JNI_FALSE);
|
||||
ImGuizmo::DrawGrid(&view[0], &projection[0], &matrix[0], gridSize);
|
||||
if (view != NULL) env->ReleasePrimitiveArrayCritical(obj_view, view, JNI_FALSE);
|
||||
if (projection != NULL) env->ReleasePrimitiveArrayCritical(obj_projection, projection, JNI_FALSE);
|
||||
if (matrix != NULL) env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, JNI_FALSE);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Manipulating the given model matrix with delta matrix
|
||||
*
|
||||
* @param view
|
||||
* target camera view
|
||||
* @param projection
|
||||
* target camera projection
|
||||
* @param operation
|
||||
* target operation
|
||||
* @param mode
|
||||
* target mode
|
||||
* @param matrix
|
||||
* model matrix
|
||||
*/
|
||||
public static void manipulate(final float[] view, final float[] projection, final int operation, final int mode, final float[] matrix) {
|
||||
nManipulate(view, projection, operation, mode, matrix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manipulating the given model matrix with delta matrix
|
||||
*
|
||||
* @param view
|
||||
* target camera view
|
||||
* @param projection
|
||||
* target camera projection
|
||||
* @param operation
|
||||
* target operation
|
||||
* @param mode
|
||||
* target mode
|
||||
* @param matrix
|
||||
* model matrix
|
||||
* @param deltaMatrix
|
||||
* delta matrix
|
||||
*/
|
||||
public static void manipulate(final float[] view, final float[] projection, final int operation, final int mode, final float[] matrix, final float[] deltaMatrix) {
|
||||
nManipulate(view, projection, operation, mode, matrix, deltaMatrix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manipulating the given model matrix with delta matrix
|
||||
*
|
||||
* @param view
|
||||
* target camera view
|
||||
* @param projection
|
||||
* target camera projection
|
||||
* @param operation
|
||||
* target operation
|
||||
* @param mode
|
||||
* target mode
|
||||
* @param matrix
|
||||
* model matrix
|
||||
* @param deltaMatrix
|
||||
* delta matrix
|
||||
* @param snap
|
||||
* snap value
|
||||
*/
|
||||
public static void manipulate(final float[] view, final float[] projection, final int operation, final int mode, final float[] matrix, final float[] deltaMatrix, final float[] snap) {
|
||||
nManipulate(view, projection, operation, mode, matrix, deltaMatrix, snap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manipulating the given model matrix with delta matrix
|
||||
*
|
||||
* @param view
|
||||
* target camera view
|
||||
* @param projection
|
||||
* target camera projection
|
||||
* @param operation
|
||||
* target operation
|
||||
* @param mode
|
||||
* target mode
|
||||
* @param matrix
|
||||
* model matrix
|
||||
* @param deltaMatrix
|
||||
* delta matrix
|
||||
* @param snap
|
||||
* snap value
|
||||
* @param localBounds
|
||||
* bounds value
|
||||
*/
|
||||
public static void manipulate(final float[] view, final float[] projection, final int operation, final int mode, final float[] matrix, final float[] deltaMatrix, final float[] snap, final float[] localBounds) {
|
||||
nManipulate(view, projection, operation, mode, matrix, deltaMatrix, snap, localBounds);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manipulating the given model matrix with delta matrix
|
||||
*
|
||||
* @param view
|
||||
* target camera view
|
||||
* @param projection
|
||||
* target camera projection
|
||||
* @param operation
|
||||
* target operation
|
||||
* @param mode
|
||||
* target mode
|
||||
* @param matrix
|
||||
* model matrix
|
||||
* @param deltaMatrix
|
||||
* delta matrix
|
||||
* @param snap
|
||||
* snap value
|
||||
* @param localBounds
|
||||
* bounds value
|
||||
* @param boundsSnap
|
||||
* bounds snap value
|
||||
*/
|
||||
public static void manipulate(final float[] view, final float[] projection, final int operation, final int mode, final float[] matrix, final float[] deltaMatrix, final float[] snap, final float[] localBounds, final float[] boundsSnap) {
|
||||
nManipulate(view, projection, operation, mode, matrix, deltaMatrix, snap, localBounds, boundsSnap);
|
||||
}
|
||||
|
||||
private static native void nManipulate(float[] view, float[] projection, int operation, int mode, float[] matrix); /*MANUAL
|
||||
auto view = obj_view == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_view, JNI_FALSE);
|
||||
auto projection = obj_projection == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_projection, JNI_FALSE);
|
||||
auto matrix = obj_matrix == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_matrix, JNI_FALSE);
|
||||
ImGuizmo::Manipulate(&view[0], &projection[0], static_cast<ImGuizmo::OPERATION>(operation), static_cast<ImGuizmo::MODE>(mode), &matrix[0]);
|
||||
if (view != NULL) env->ReleasePrimitiveArrayCritical(obj_view, view, JNI_FALSE);
|
||||
if (projection != NULL) env->ReleasePrimitiveArrayCritical(obj_projection, projection, JNI_FALSE);
|
||||
if (matrix != NULL) env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, JNI_FALSE);
|
||||
*/
|
||||
|
||||
private static native void nManipulate(float[] view, float[] projection, int operation, int mode, float[] matrix, float[] deltaMatrix); /*MANUAL
|
||||
auto view = obj_view == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_view, JNI_FALSE);
|
||||
auto projection = obj_projection == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_projection, JNI_FALSE);
|
||||
auto matrix = obj_matrix == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_matrix, JNI_FALSE);
|
||||
auto deltaMatrix = obj_deltaMatrix == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_deltaMatrix, JNI_FALSE);
|
||||
ImGuizmo::Manipulate(&view[0], &projection[0], static_cast<ImGuizmo::OPERATION>(operation), static_cast<ImGuizmo::MODE>(mode), &matrix[0], &deltaMatrix[0]);
|
||||
if (view != NULL) env->ReleasePrimitiveArrayCritical(obj_view, view, JNI_FALSE);
|
||||
if (projection != NULL) env->ReleasePrimitiveArrayCritical(obj_projection, projection, JNI_FALSE);
|
||||
if (matrix != NULL) env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, JNI_FALSE);
|
||||
if (deltaMatrix != NULL) env->ReleasePrimitiveArrayCritical(obj_deltaMatrix, deltaMatrix, JNI_FALSE);
|
||||
*/
|
||||
|
||||
private static native void nManipulate(float[] view, float[] projection, int operation, int mode, float[] matrix, float[] deltaMatrix, float[] snap); /*MANUAL
|
||||
auto view = obj_view == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_view, JNI_FALSE);
|
||||
auto projection = obj_projection == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_projection, JNI_FALSE);
|
||||
auto matrix = obj_matrix == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_matrix, JNI_FALSE);
|
||||
auto deltaMatrix = obj_deltaMatrix == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_deltaMatrix, JNI_FALSE);
|
||||
auto snap = obj_snap == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_snap, JNI_FALSE);
|
||||
ImGuizmo::Manipulate(&view[0], &projection[0], static_cast<ImGuizmo::OPERATION>(operation), static_cast<ImGuizmo::MODE>(mode), &matrix[0], &deltaMatrix[0], &snap[0]);
|
||||
if (view != NULL) env->ReleasePrimitiveArrayCritical(obj_view, view, JNI_FALSE);
|
||||
if (projection != NULL) env->ReleasePrimitiveArrayCritical(obj_projection, projection, JNI_FALSE);
|
||||
if (matrix != NULL) env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, JNI_FALSE);
|
||||
if (deltaMatrix != NULL) env->ReleasePrimitiveArrayCritical(obj_deltaMatrix, deltaMatrix, JNI_FALSE);
|
||||
if (snap != NULL) env->ReleasePrimitiveArrayCritical(obj_snap, snap, JNI_FALSE);
|
||||
*/
|
||||
|
||||
private static native void nManipulate(float[] view, float[] projection, int operation, int mode, float[] matrix, float[] deltaMatrix, float[] snap, float[] localBounds); /*MANUAL
|
||||
auto view = obj_view == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_view, JNI_FALSE);
|
||||
auto projection = obj_projection == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_projection, JNI_FALSE);
|
||||
auto matrix = obj_matrix == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_matrix, JNI_FALSE);
|
||||
auto deltaMatrix = obj_deltaMatrix == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_deltaMatrix, JNI_FALSE);
|
||||
auto snap = obj_snap == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_snap, JNI_FALSE);
|
||||
auto localBounds = obj_localBounds == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_localBounds, JNI_FALSE);
|
||||
ImGuizmo::Manipulate(&view[0], &projection[0], static_cast<ImGuizmo::OPERATION>(operation), static_cast<ImGuizmo::MODE>(mode), &matrix[0], &deltaMatrix[0], &snap[0], &localBounds[0]);
|
||||
if (view != NULL) env->ReleasePrimitiveArrayCritical(obj_view, view, JNI_FALSE);
|
||||
if (projection != NULL) env->ReleasePrimitiveArrayCritical(obj_projection, projection, JNI_FALSE);
|
||||
if (matrix != NULL) env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, JNI_FALSE);
|
||||
if (deltaMatrix != NULL) env->ReleasePrimitiveArrayCritical(obj_deltaMatrix, deltaMatrix, JNI_FALSE);
|
||||
if (snap != NULL) env->ReleasePrimitiveArrayCritical(obj_snap, snap, JNI_FALSE);
|
||||
if (localBounds != NULL) env->ReleasePrimitiveArrayCritical(obj_localBounds, localBounds, JNI_FALSE);
|
||||
*/
|
||||
|
||||
private static native void nManipulate(float[] view, float[] projection, int operation, int mode, float[] matrix, float[] deltaMatrix, float[] snap, float[] localBounds, float[] boundsSnap); /*MANUAL
|
||||
auto view = obj_view == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_view, JNI_FALSE);
|
||||
auto projection = obj_projection == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_projection, JNI_FALSE);
|
||||
auto matrix = obj_matrix == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_matrix, JNI_FALSE);
|
||||
auto deltaMatrix = obj_deltaMatrix == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_deltaMatrix, JNI_FALSE);
|
||||
auto snap = obj_snap == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_snap, JNI_FALSE);
|
||||
auto localBounds = obj_localBounds == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_localBounds, JNI_FALSE);
|
||||
auto boundsSnap = obj_boundsSnap == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_boundsSnap, JNI_FALSE);
|
||||
ImGuizmo::Manipulate(&view[0], &projection[0], static_cast<ImGuizmo::OPERATION>(operation), static_cast<ImGuizmo::MODE>(mode), &matrix[0], &deltaMatrix[0], &snap[0], &localBounds[0], &boundsSnap[0]);
|
||||
if (view != NULL) env->ReleasePrimitiveArrayCritical(obj_view, view, JNI_FALSE);
|
||||
if (projection != NULL) env->ReleasePrimitiveArrayCritical(obj_projection, projection, JNI_FALSE);
|
||||
if (matrix != NULL) env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, JNI_FALSE);
|
||||
if (deltaMatrix != NULL) env->ReleasePrimitiveArrayCritical(obj_deltaMatrix, deltaMatrix, JNI_FALSE);
|
||||
if (snap != NULL) env->ReleasePrimitiveArrayCritical(obj_snap, snap, JNI_FALSE);
|
||||
if (localBounds != NULL) env->ReleasePrimitiveArrayCritical(obj_localBounds, localBounds, JNI_FALSE);
|
||||
if (boundsSnap != NULL) env->ReleasePrimitiveArrayCritical(obj_boundsSnap, boundsSnap, JNI_FALSE);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Manipulating the view
|
||||
*
|
||||
* @param view
|
||||
* target camera view
|
||||
* @param length
|
||||
* camera distance/length
|
||||
*/
|
||||
public static void viewManipulate(final float[] view, final float length, final ImVec2 position, final ImVec2 size, final int backgroundColor) {
|
||||
nViewManipulate(view, length, position.x, position.y, size.x, size.y, backgroundColor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manipulating the view
|
||||
*
|
||||
* @param view
|
||||
* target camera view
|
||||
* @param length
|
||||
* camera distance/length
|
||||
*/
|
||||
public static void viewManipulate(final float[] view, final float length, final float positionX, final float positionY, final float sizeX, final float sizeY, final int backgroundColor) {
|
||||
nViewManipulate(view, length, positionX, positionY, sizeX, sizeY, backgroundColor);
|
||||
}
|
||||
|
||||
private static native void nViewManipulate(float[] view, float length, float positionX, float positionY, float sizeX, float sizeY, int backgroundColor); /*MANUAL
|
||||
auto view = obj_view == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_view, JNI_FALSE);
|
||||
ImVec2 position = ImVec2(positionX, positionY);
|
||||
ImVec2 size = ImVec2(sizeX, sizeY);
|
||||
ImGuizmo::ViewManipulate(&view[0], length, position, size, backgroundColor);
|
||||
if (view != NULL) env->ReleasePrimitiveArrayCritical(obj_view, view, JNI_FALSE);
|
||||
*/
|
||||
|
||||
/**
|
||||
* This will update the current id
|
||||
*/
|
||||
public static void setID(final int id) {
|
||||
nSetID(id);
|
||||
}
|
||||
|
||||
private static native void nSetID(int id); /*
|
||||
ImGuizmo::SetID(id);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return true if the cursor is over the operation's gizmo
|
||||
*/
|
||||
public static boolean isOver(final int operation) {
|
||||
return nIsOver(operation);
|
||||
}
|
||||
|
||||
private static native boolean nIsOver(int operation); /*
|
||||
return ImGuizmo::IsOver(static_cast<ImGuizmo::OPERATION>(operation));
|
||||
*/
|
||||
|
||||
public static void setGizmoSizeClipSpace(final float value) {
|
||||
nSetGizmoSizeClipSpace(value);
|
||||
}
|
||||
|
||||
private static native void nSetGizmoSizeClipSpace(float value); /*
|
||||
ImGuizmo::SetGizmoSizeClipSpace(value);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Allow axis to flip.
|
||||
* When true (default), the guizmo axis flip for better visibility.
|
||||
* When false, they always stay along the positive world/local axis.
|
||||
*/
|
||||
public static void allowAxisFlip(final boolean value) {
|
||||
nAllowAxisFlip(value);
|
||||
}
|
||||
|
||||
private static native void nAllowAxisFlip(boolean value); /*
|
||||
ImGuizmo::AllowAxisFlip(value);
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package imgui.extension.imguizmo.flag;
|
||||
|
||||
|
||||
public final class Mode {
|
||||
private Mode() {
|
||||
}
|
||||
|
||||
public static final int LOCAL = 0;
|
||||
|
||||
public static final int WORLD = 1;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package imgui.extension.imguizmo.flag;
|
||||
|
||||
|
||||
/**
|
||||
* Needs view and projection matrices.
|
||||
* Matrix parameter is the source matrix (where will be gizmo be drawn) and might be transformed by the function. Return deltaMatrix is optional.
|
||||
* Translation is applied in world space.
|
||||
*/
|
||||
public final class Operation {
|
||||
private Operation() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code (1u << 0)}
|
||||
*/
|
||||
public static final int TRANSLATE_X = 1;
|
||||
|
||||
/**
|
||||
* Definition: {@code (1u << 1)}
|
||||
*/
|
||||
public static final int TRANSLATE_Y = 2;
|
||||
|
||||
/**
|
||||
* Definition: {@code (1u << 2)}
|
||||
*/
|
||||
public static final int TRANSLATE_Z = 4;
|
||||
|
||||
/**
|
||||
* Definition: {@code (1u << 3)}
|
||||
*/
|
||||
public static final int ROTATE_X = 8;
|
||||
|
||||
/**
|
||||
* Definition: {@code (1u << 4)}
|
||||
*/
|
||||
public static final int ROTATE_Y = 16;
|
||||
|
||||
/**
|
||||
* Definition: {@code (1u << 5)}
|
||||
*/
|
||||
public static final int ROTATE_Z = 32;
|
||||
|
||||
/**
|
||||
* Definition: {@code (1u << 6)}
|
||||
*/
|
||||
public static final int ROTATE_SCREEN = 64;
|
||||
|
||||
/**
|
||||
* Definition: {@code (1u << 7)}
|
||||
*/
|
||||
public static final int SCALE_X = 128;
|
||||
|
||||
/**
|
||||
* Definition: {@code (1u << 8)}
|
||||
*/
|
||||
public static final int SCALE_Y = 256;
|
||||
|
||||
/**
|
||||
* Definition: {@code (1u << 9)}
|
||||
*/
|
||||
public static final int SCALE_Z = 512;
|
||||
|
||||
/**
|
||||
* Definition: {@code (1u << 10)}
|
||||
*/
|
||||
public static final int BOUNDS = 1024;
|
||||
|
||||
/**
|
||||
* Definition: {@code TRANSLATE_X | TRANSLATE_Y | TRANSLATE_Z}
|
||||
*/
|
||||
public static final int TRANSLATE = 7;
|
||||
|
||||
/**
|
||||
* Definition: {@code ROTATE_X | ROTATE_Y | ROTATE_Z | ROTATE_SCREEN}
|
||||
*/
|
||||
public static final int ROTATE = 120;
|
||||
|
||||
/**
|
||||
* Definition: {@code SCALE_X | SCALE_Y | SCALE_Z}
|
||||
*/
|
||||
public static final int SCALE = 896;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,9 @@
|
||||
package imgui.extension.imnodes;
|
||||
|
||||
import imgui.binding.ImGuiStruct;
|
||||
|
||||
public final class ImNodesContext extends ImGuiStruct {
|
||||
public ImNodesContext(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package imgui.extension.imnodes;
|
||||
|
||||
import imgui.binding.ImGuiStruct;
|
||||
|
||||
public final class ImNodesEditorContext extends ImGuiStruct {
|
||||
public ImNodesEditorContext(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package imgui.extension.imnodes;
|
||||
|
||||
import imgui.binding.ImGuiStruct;
|
||||
|
||||
public final class ImNodesIO extends ImGuiStruct {
|
||||
public ImNodesIO(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_imnodes.h"
|
||||
#define THIS ((ImNodesIO*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Holding alt mouse button pans the node area, by default middle mouse button will be used
|
||||
* Set based on ImGuiMouseButton values
|
||||
*/
|
||||
public int getAltMouseButton() {
|
||||
return nGetAltMouseButton();
|
||||
}
|
||||
|
||||
/**
|
||||
* Holding alt mouse button pans the node area, by default middle mouse button will be used
|
||||
* Set based on ImGuiMouseButton values
|
||||
*/
|
||||
public void setAltMouseButton(final int value) {
|
||||
nSetAltMouseButton(value);
|
||||
}
|
||||
|
||||
private native int nGetAltMouseButton(); /*
|
||||
return THIS->AltMouseButton;
|
||||
*/
|
||||
|
||||
private native void nSetAltMouseButton(int value); /*
|
||||
THIS->AltMouseButton = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Panning speed when dragging an element and mouse is outside the main editor view.
|
||||
*/
|
||||
public float getAutoPanningSpeed() {
|
||||
return nGetAutoPanningSpeed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Panning speed when dragging an element and mouse is outside the main editor view.
|
||||
*/
|
||||
public void setAutoPanningSpeed(final float value) {
|
||||
nSetAutoPanningSpeed(value);
|
||||
}
|
||||
|
||||
private native float nGetAutoPanningSpeed(); /*
|
||||
return THIS->AutoPanningSpeed;
|
||||
*/
|
||||
|
||||
private native void nSetAutoPanningSpeed(float value); /*
|
||||
THIS->AutoPanningSpeed = value;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,494 @@
|
||||
package imgui.extension.imnodes;
|
||||
|
||||
import imgui.ImVec2;
|
||||
import imgui.ImVec4;
|
||||
import imgui.binding.ImGuiStruct;
|
||||
|
||||
public final class ImNodesStyle extends ImGuiStruct {
|
||||
public ImNodesStyle(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_imnodes.h"
|
||||
#define THIS ((ImNodesStyle*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
public float getGridSpacing() {
|
||||
return nGetGridSpacing();
|
||||
}
|
||||
|
||||
public void setGridSpacing(final float value) {
|
||||
nSetGridSpacing(value);
|
||||
}
|
||||
|
||||
private native float nGetGridSpacing(); /*
|
||||
return THIS->GridSpacing;
|
||||
*/
|
||||
|
||||
private native void nSetGridSpacing(float value); /*
|
||||
THIS->GridSpacing = value;
|
||||
*/
|
||||
|
||||
public float getNodeCornerRounding() {
|
||||
return nGetNodeCornerRounding();
|
||||
}
|
||||
|
||||
public void setNodeCornerRounding(final float value) {
|
||||
nSetNodeCornerRounding(value);
|
||||
}
|
||||
|
||||
private native float nGetNodeCornerRounding(); /*
|
||||
return THIS->NodeCornerRounding;
|
||||
*/
|
||||
|
||||
private native void nSetNodeCornerRounding(float value); /*
|
||||
THIS->NodeCornerRounding = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getNodePadding() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetNodePadding(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getNodePaddingX() {
|
||||
return nGetNodePaddingX();
|
||||
}
|
||||
|
||||
public float getNodePaddingY() {
|
||||
return nGetNodePaddingY();
|
||||
}
|
||||
|
||||
public void getNodePadding(final ImVec2 dst) {
|
||||
nGetNodePadding(dst);
|
||||
}
|
||||
|
||||
public void setNodePadding(final ImVec2 value) {
|
||||
nSetNodePadding(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setNodePadding(final float valueX, final float valueY) {
|
||||
nSetNodePadding(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetNodePadding(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->NodePadding, dst);
|
||||
*/
|
||||
|
||||
private native float nGetNodePaddingX(); /*
|
||||
return THIS->NodePadding.x;
|
||||
*/
|
||||
|
||||
private native float nGetNodePaddingY(); /*
|
||||
return THIS->NodePadding.y;
|
||||
*/
|
||||
|
||||
private native void nSetNodePadding(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->NodePadding = value;
|
||||
*/
|
||||
|
||||
public float getNodeBorderThickness() {
|
||||
return nGetNodeBorderThickness();
|
||||
}
|
||||
|
||||
public void setNodeBorderThickness(final float value) {
|
||||
nSetNodeBorderThickness(value);
|
||||
}
|
||||
|
||||
private native float nGetNodeBorderThickness(); /*
|
||||
return THIS->NodeBorderThickness;
|
||||
*/
|
||||
|
||||
private native void nSetNodeBorderThickness(float value); /*
|
||||
THIS->NodeBorderThickness = value;
|
||||
*/
|
||||
|
||||
public float getLinkThickness() {
|
||||
return nGetLinkThickness();
|
||||
}
|
||||
|
||||
public void setLinkThickness(final float value) {
|
||||
nSetLinkThickness(value);
|
||||
}
|
||||
|
||||
private native float nGetLinkThickness(); /*
|
||||
return THIS->LinkThickness;
|
||||
*/
|
||||
|
||||
private native void nSetLinkThickness(float value); /*
|
||||
THIS->LinkThickness = value;
|
||||
*/
|
||||
|
||||
public float getLinkLineSegmentsPerLength() {
|
||||
return nGetLinkLineSegmentsPerLength();
|
||||
}
|
||||
|
||||
public void setLinkLineSegmentsPerLength(final float value) {
|
||||
nSetLinkLineSegmentsPerLength(value);
|
||||
}
|
||||
|
||||
private native float nGetLinkLineSegmentsPerLength(); /*
|
||||
return THIS->LinkLineSegmentsPerLength;
|
||||
*/
|
||||
|
||||
private native void nSetLinkLineSegmentsPerLength(float value); /*
|
||||
THIS->LinkLineSegmentsPerLength = value;
|
||||
*/
|
||||
|
||||
public float getLinkHoverDistance() {
|
||||
return nGetLinkHoverDistance();
|
||||
}
|
||||
|
||||
public void setLinkHoverDistance(final float value) {
|
||||
nSetLinkHoverDistance(value);
|
||||
}
|
||||
|
||||
private native float nGetLinkHoverDistance(); /*
|
||||
return THIS->LinkHoverDistance;
|
||||
*/
|
||||
|
||||
private native void nSetLinkHoverDistance(float value); /*
|
||||
THIS->LinkHoverDistance = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* The circle radius used when the pin shape is either PinShape_Circle or PinShape_CircleFilled.
|
||||
*/
|
||||
public float getPinCircleRadius() {
|
||||
return nGetPinCircleRadius();
|
||||
}
|
||||
|
||||
/**
|
||||
* The circle radius used when the pin shape is either PinShape_Circle or PinShape_CircleFilled.
|
||||
*/
|
||||
public void setPinCircleRadius(final float value) {
|
||||
nSetPinCircleRadius(value);
|
||||
}
|
||||
|
||||
private native float nGetPinCircleRadius(); /*
|
||||
return THIS->PinCircleRadius;
|
||||
*/
|
||||
|
||||
private native void nSetPinCircleRadius(float value); /*
|
||||
THIS->PinCircleRadius = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* The quad side length used when the shape is either PinShape_Quad or PinShape_QuadFilled.
|
||||
*/
|
||||
public float getPinQuadSideLength() {
|
||||
return nGetPinQuadSideLength();
|
||||
}
|
||||
|
||||
/**
|
||||
* The quad side length used when the shape is either PinShape_Quad or PinShape_QuadFilled.
|
||||
*/
|
||||
public void setPinQuadSideLength(final float value) {
|
||||
nSetPinQuadSideLength(value);
|
||||
}
|
||||
|
||||
private native float nGetPinQuadSideLength(); /*
|
||||
return THIS->PinQuadSideLength;
|
||||
*/
|
||||
|
||||
private native void nSetPinQuadSideLength(float value); /*
|
||||
THIS->PinQuadSideLength = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* The equilateral triangle side length used when the pin shape is either PinShape_Triangle or PinShape_TriangleFilled.
|
||||
*/
|
||||
public float getPinTriangleSideLength() {
|
||||
return nGetPinTriangleSideLength();
|
||||
}
|
||||
|
||||
/**
|
||||
* The equilateral triangle side length used when the pin shape is either PinShape_Triangle or PinShape_TriangleFilled.
|
||||
*/
|
||||
public void setPinTriangleSideLength(final float value) {
|
||||
nSetPinTriangleSideLength(value);
|
||||
}
|
||||
|
||||
private native float nGetPinTriangleSideLength(); /*
|
||||
return THIS->PinTriangleSideLength;
|
||||
*/
|
||||
|
||||
private native void nSetPinTriangleSideLength(float value); /*
|
||||
THIS->PinTriangleSideLength = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* The thickness of the line used when the pin shape is not filled.
|
||||
*/
|
||||
public float getPinLineThickness() {
|
||||
return nGetPinLineThickness();
|
||||
}
|
||||
|
||||
/**
|
||||
* The thickness of the line used when the pin shape is not filled.
|
||||
*/
|
||||
public void setPinLineThickness(final float value) {
|
||||
nSetPinLineThickness(value);
|
||||
}
|
||||
|
||||
private native float nGetPinLineThickness(); /*
|
||||
return THIS->PinLineThickness;
|
||||
*/
|
||||
|
||||
private native void nSetPinLineThickness(float value); /*
|
||||
THIS->PinLineThickness = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* The radius from the pin's center position inside of which it is detected as being hovered over.
|
||||
*/
|
||||
public float getPinHoverRadius() {
|
||||
return nGetPinHoverRadius();
|
||||
}
|
||||
|
||||
/**
|
||||
* The radius from the pin's center position inside of which it is detected as being hovered over.
|
||||
*/
|
||||
public void setPinHoverRadius(final float value) {
|
||||
nSetPinHoverRadius(value);
|
||||
}
|
||||
|
||||
private native float nGetPinHoverRadius(); /*
|
||||
return THIS->PinHoverRadius;
|
||||
*/
|
||||
|
||||
private native void nSetPinHoverRadius(float value); /*
|
||||
THIS->PinHoverRadius = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Offsets the pins' positions from the edge of the node to the outside of the node.
|
||||
*/
|
||||
public float getPinOffset() {
|
||||
return nGetPinOffset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Offsets the pins' positions from the edge of the node to the outside of the node.
|
||||
*/
|
||||
public void setPinOffset(final float value) {
|
||||
nSetPinOffset(value);
|
||||
}
|
||||
|
||||
private native float nGetPinOffset(); /*
|
||||
return THIS->PinOffset;
|
||||
*/
|
||||
|
||||
private native void nSetPinOffset(float value); /*
|
||||
THIS->PinOffset = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mini-map padding size between mini-map edge and mini-map content.
|
||||
*/
|
||||
public ImVec2 getMiniMapPadding() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetMiniMapPadding(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini-map padding size between mini-map edge and mini-map content.
|
||||
*/
|
||||
public float getMiniMapPaddingX() {
|
||||
return nGetMiniMapPaddingX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini-map padding size between mini-map edge and mini-map content.
|
||||
*/
|
||||
public float getMiniMapPaddingY() {
|
||||
return nGetMiniMapPaddingY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini-map padding size between mini-map edge and mini-map content.
|
||||
*/
|
||||
public void getMiniMapPadding(final ImVec2 dst) {
|
||||
nGetMiniMapPadding(dst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini-map padding size between mini-map edge and mini-map content.
|
||||
*/
|
||||
public void setMiniMapPadding(final ImVec2 value) {
|
||||
nSetMiniMapPadding(value.x, value.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini-map padding size between mini-map edge and mini-map content.
|
||||
*/
|
||||
public void setMiniMapPadding(final float valueX, final float valueY) {
|
||||
nSetMiniMapPadding(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetMiniMapPadding(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->MiniMapPadding, dst);
|
||||
*/
|
||||
|
||||
private native float nGetMiniMapPaddingX(); /*
|
||||
return THIS->MiniMapPadding.x;
|
||||
*/
|
||||
|
||||
private native float nGetMiniMapPaddingY(); /*
|
||||
return THIS->MiniMapPadding.y;
|
||||
*/
|
||||
|
||||
private native void nSetMiniMapPadding(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->MiniMapPadding = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mini-map offset from the screen side.
|
||||
*/
|
||||
public ImVec2 getMiniMapOffset() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetMiniMapOffset(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini-map offset from the screen side.
|
||||
*/
|
||||
public float getMiniMapOffsetX() {
|
||||
return nGetMiniMapOffsetX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini-map offset from the screen side.
|
||||
*/
|
||||
public float getMiniMapOffsetY() {
|
||||
return nGetMiniMapOffsetY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini-map offset from the screen side.
|
||||
*/
|
||||
public void getMiniMapOffset(final ImVec2 dst) {
|
||||
nGetMiniMapOffset(dst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini-map offset from the screen side.
|
||||
*/
|
||||
public void setMiniMapOffset(final ImVec2 value) {
|
||||
nSetMiniMapOffset(value.x, value.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini-map offset from the screen side.
|
||||
*/
|
||||
public void setMiniMapOffset(final float valueX, final float valueY) {
|
||||
nSetMiniMapOffset(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetMiniMapOffset(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->MiniMapOffset, dst);
|
||||
*/
|
||||
|
||||
private native float nGetMiniMapOffsetX(); /*
|
||||
return THIS->MiniMapOffset.x;
|
||||
*/
|
||||
|
||||
private native float nGetMiniMapOffsetY(); /*
|
||||
return THIS->MiniMapOffset.y;
|
||||
*/
|
||||
|
||||
private native void nSetMiniMapOffset(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->MiniMapOffset = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* By default, ImNodesStyleFlags_NodeOutline and ImNodesStyleFlags_Gridlines are enabled.
|
||||
*/
|
||||
public int getFlags() {
|
||||
return nGetFlags();
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, ImNodesStyleFlags_NodeOutline and ImNodesStyleFlags_Gridlines are enabled.
|
||||
*/
|
||||
public void setFlags(final int value) {
|
||||
nSetFlags(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, ImNodesStyleFlags_NodeOutline and ImNodesStyleFlags_Gridlines are enabled.
|
||||
*/
|
||||
public void addFlags(final int flags) {
|
||||
setFlags(getFlags() | flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, ImNodesStyleFlags_NodeOutline and ImNodesStyleFlags_Gridlines are enabled.
|
||||
*/
|
||||
public void removeFlags(final int flags) {
|
||||
setFlags(getFlags() & ~(flags));
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, ImNodesStyleFlags_NodeOutline and ImNodesStyleFlags_Gridlines are enabled.
|
||||
*/
|
||||
public boolean hasFlags(final int flags) {
|
||||
return (getFlags() & flags) != 0;
|
||||
}
|
||||
|
||||
private native int nGetFlags(); /*
|
||||
return THIS->Flags;
|
||||
*/
|
||||
|
||||
private native void nSetFlags(int value); /*
|
||||
THIS->Flags = value;
|
||||
*/
|
||||
|
||||
public int[] getColors() {
|
||||
return nGetColors();
|
||||
}
|
||||
|
||||
public int getColors(final int idx) {
|
||||
return nGetColors(idx);
|
||||
}
|
||||
|
||||
public void setColors(final int[] value) {
|
||||
nSetColors(value);
|
||||
}
|
||||
|
||||
public void setColors(final int idx, final int value) {
|
||||
nSetColors(idx, value);
|
||||
}
|
||||
|
||||
private native int[] nGetColors(); /*
|
||||
jint jBuf[ImNodesCol_COUNT];
|
||||
for (int i = 0; i < ImNodesCol_COUNT; i++)
|
||||
jBuf[i] = THIS->Colors[i];
|
||||
jintArray result = env->NewIntArray(ImNodesCol_COUNT);
|
||||
env->SetIntArrayRegion(result, 0, ImNodesCol_COUNT, jBuf);
|
||||
return result;
|
||||
*/
|
||||
|
||||
private native int nGetColors(int idx); /*
|
||||
return THIS->Colors[idx];
|
||||
*/
|
||||
|
||||
private native void nSetColors(int[] value); /*
|
||||
for (int i = 0; i < ImNodesCol_COUNT; i++)
|
||||
THIS->Colors[i] = value[i];
|
||||
*/
|
||||
|
||||
private native int nSetColors(int idx, int value); /*
|
||||
THIS->Colors[idx] = value;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package imgui.extension.imnodes.flag;
|
||||
|
||||
|
||||
/**
|
||||
* This enum controls the way the attribute pins behave.
|
||||
*/
|
||||
public final class ImNodesAttributeFlags {
|
||||
private ImNodesAttributeFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* Allow detaching a link by left-clicking and dragging the link at a pin it is connected to. NOTE: the user has to actually delete the link for this to work. A deleted link can be detected by calling IsLinkDestroyed() after EndNodeEditor().
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int EnableLinkDetachWithDragClick = 1;
|
||||
|
||||
/**
|
||||
* Visual snapping of an in progress link will trigger IsLink Created/Destroyed events. Allows for previewing the creation of a link while dragging it across attributes. See here for demo: https://github.com/Nelarius/imnodes/issues/41#issuecomment-647132113 NOTE: the user has to actually delete the link for this to work. A deleted link can be detected by calling IsLinkDestroyed() after EndNodeEditor().
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int EnableLinkCreationOnSnap = 2;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package imgui.extension.imnodes.flag;
|
||||
|
||||
|
||||
public final class ImNodesCol {
|
||||
private ImNodesCol() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int NodeBackground = 0;
|
||||
|
||||
public static final int NodeBackgroundHovered = 1;
|
||||
|
||||
public static final int NodeBackgroundSelected = 2;
|
||||
|
||||
public static final int NodeOutline = 3;
|
||||
|
||||
public static final int TitleBar = 4;
|
||||
|
||||
public static final int TitleBarHovered = 5;
|
||||
|
||||
public static final int TitleBarSelected = 6;
|
||||
|
||||
public static final int Link = 7;
|
||||
|
||||
public static final int LinkHovered = 8;
|
||||
|
||||
public static final int LinkSelected = 9;
|
||||
|
||||
public static final int Pin = 10;
|
||||
|
||||
public static final int PinHovered = 11;
|
||||
|
||||
public static final int BoxSelector = 12;
|
||||
|
||||
public static final int BoxSelectorOutline = 13;
|
||||
|
||||
public static final int GridBackground = 14;
|
||||
|
||||
public static final int GridLine = 15;
|
||||
|
||||
public static final int MiniMapBackground = 16;
|
||||
|
||||
public static final int MiniMapBackgroundHovered = 17;
|
||||
|
||||
public static final int MiniMapOutline = 18;
|
||||
|
||||
public static final int MiniMapOutlineHovered = 19;
|
||||
|
||||
public static final int MiniMapNodeBackground = 20;
|
||||
|
||||
public static final int MiniMapNodeBackgroundHovered = 21;
|
||||
|
||||
public static final int MiniMapNodeBackgroundSelected = 22;
|
||||
|
||||
public static final int MiniMapNodeOutline = 23;
|
||||
|
||||
public static final int MiniMapLink = 24;
|
||||
|
||||
public static final int MiniMapLinkSelected = 25;
|
||||
|
||||
public static final int MiniMapCanvas = 26;
|
||||
|
||||
public static final int MiniMapCanvasOutline = 27;
|
||||
|
||||
public static final int COUNT = 28;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package imgui.extension.imnodes.flag;
|
||||
|
||||
|
||||
/**
|
||||
* This enum controls the minimap's location.
|
||||
*/
|
||||
public final class ImNodesMiniMapLocation {
|
||||
private ImNodesMiniMapLocation() {
|
||||
}
|
||||
|
||||
public static final int BottomLeft = 0;
|
||||
|
||||
public static final int BottomRight = 1;
|
||||
|
||||
public static final int TopLeft = 2;
|
||||
|
||||
public static final int TopRight = 3;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package imgui.extension.imnodes.flag;
|
||||
|
||||
|
||||
/**
|
||||
* This enum controls the way attribute pins look.
|
||||
*/
|
||||
public final class ImNodesPinShape {
|
||||
private ImNodesPinShape() {
|
||||
}
|
||||
|
||||
public static final int Circle = 0;
|
||||
|
||||
public static final int CircleFilled = 1;
|
||||
|
||||
public static final int Triangle = 2;
|
||||
|
||||
public static final int TriangleFilled = 3;
|
||||
|
||||
public static final int Quad = 4;
|
||||
|
||||
public static final int QuadFilled = 5;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package imgui.extension.imnodes.flag;
|
||||
|
||||
|
||||
public final class ImNodesStyleFlags {
|
||||
private ImNodesStyleFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int NodeOutline = 1;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int GridLines = 4;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package imgui.extension.imnodes.flag;
|
||||
|
||||
|
||||
public final class ImNodesStyleVar {
|
||||
private ImNodesStyleVar() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int GridSpacing = 0;
|
||||
|
||||
public static final int NodeCornerRounding = 1;
|
||||
|
||||
public static final int NodePadding = 2;
|
||||
|
||||
public static final int NodeBorderThickness = 3;
|
||||
|
||||
public static final int LinkThickness = 4;
|
||||
|
||||
public static final int LinkLineSegmentsPerLength = 5;
|
||||
|
||||
public static final int LinkHoverDistance = 6;
|
||||
|
||||
public static final int PinCircleRadius = 7;
|
||||
|
||||
public static final int PinQuadSideLength = 8;
|
||||
|
||||
public static final int PinTriangleSideLength = 9;
|
||||
|
||||
public static final int PinLineThickness = 10;
|
||||
|
||||
public static final int PinHoverRadius = 11;
|
||||
|
||||
public static final int PinOffset = 12;
|
||||
|
||||
public static final int MiniMapPadding = 13;
|
||||
|
||||
public static final int MiniMapOffset = 14;
|
||||
|
||||
public static final int COUNT = 15;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,9 @@
|
||||
package imgui.extension.implot;
|
||||
|
||||
import imgui.binding.ImGuiStruct;
|
||||
|
||||
public final class ImPlotContext extends ImGuiStruct {
|
||||
public ImPlotContext(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package imgui.extension.implot;
|
||||
|
||||
import imgui.ImVec2;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public final class ImPlotLimits implements Cloneable {
|
||||
public final ImPlotRange x = new ImPlotRange();
|
||||
public final ImPlotRange y = new ImPlotRange();
|
||||
|
||||
public ImPlotLimits() {
|
||||
}
|
||||
|
||||
public ImPlotLimits(final double xMin, final double yMin, final double xMax, final double yMax) {
|
||||
set(xMin, yMin, xMax, yMax);
|
||||
}
|
||||
|
||||
public ImPlotLimits(final ImVec2 min, final ImVec2 max) {
|
||||
set(min, max);
|
||||
}
|
||||
|
||||
public ImPlotLimits(final ImPlotLimits value) {
|
||||
set(value);
|
||||
}
|
||||
|
||||
public boolean contains(final double x, final double y) {
|
||||
return this.x.contains(x) && this.y.contains(y);
|
||||
}
|
||||
|
||||
public boolean contains(final ImPlotPoint value) {
|
||||
return contains(value.x, value.y);
|
||||
}
|
||||
|
||||
public ImPlotPoint min() {
|
||||
return new ImPlotPoint(x.min, y.min);
|
||||
}
|
||||
|
||||
public ImPlotPoint max() {
|
||||
return new ImPlotPoint(x.max, y.max);
|
||||
}
|
||||
|
||||
public void set(final double xMin, final double yMin, final double xMax, final double yMax) {
|
||||
this.x.min = xMin;
|
||||
this.x.max = xMax;
|
||||
this.y.min = yMin;
|
||||
this.y.max = yMax;
|
||||
}
|
||||
|
||||
public void set(final ImVec2 min, final ImVec2 max) {
|
||||
set(min.x, min.y, max.x, max.y);
|
||||
}
|
||||
|
||||
public void set(final ImPlotRange x, final ImPlotRange y) {
|
||||
set(x.min, y.min, x.max, y.max);
|
||||
}
|
||||
|
||||
public void set(final ImPlotLimits value) {
|
||||
set(value.x, value.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ImPlotLimits{"
|
||||
+ "x=" + x
|
||||
+ ", y=" + y
|
||||
+ '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final ImPlotLimits imPlotLimits = (ImPlotLimits) o;
|
||||
return Objects.equals(x, imPlotLimits.x) && Objects.equals(y, imPlotLimits.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("MethodDoesntCallSuperMethod")
|
||||
public ImPlotLimits clone() {
|
||||
return new ImPlotLimits(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package imgui.extension.implot;
|
||||
|
||||
import imgui.ImVec2;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public final class ImPlotPoint implements Cloneable {
|
||||
public double x;
|
||||
public double y;
|
||||
|
||||
public ImPlotPoint() {
|
||||
}
|
||||
|
||||
public ImPlotPoint(final double x, final double y) {
|
||||
set(x, y);
|
||||
}
|
||||
|
||||
public ImPlotPoint(final ImVec2 value) {
|
||||
set(value.x, value.y);
|
||||
}
|
||||
|
||||
public ImPlotPoint(final ImPlotPoint value) {
|
||||
set(value.x, value.y);
|
||||
}
|
||||
|
||||
public ImPlotPoint set(final double x, final double y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImPlotPoint set(final ImPlotPoint value) {
|
||||
return set(value.x, value.y);
|
||||
}
|
||||
|
||||
public ImPlotPoint set(final ImVec2 value) {
|
||||
return set(value.x, value.y);
|
||||
}
|
||||
|
||||
public ImPlotPoint plus(final double x, final double y) {
|
||||
this.x += x;
|
||||
this.y += y;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImPlotPoint plus(final ImPlotPoint value) {
|
||||
return plus(value.x, value.y);
|
||||
}
|
||||
|
||||
public ImPlotPoint minus(final double x, final double y) {
|
||||
this.x -= x;
|
||||
this.y -= y;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImPlotPoint minus(final ImPlotPoint value) {
|
||||
return minus(value.x, value.y);
|
||||
}
|
||||
|
||||
public ImPlotPoint times(final double x, final double y) {
|
||||
this.x *= x;
|
||||
this.y *= y;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImPlotPoint times(final ImPlotPoint value) {
|
||||
return times(value.x, value.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ImPlotPoint{"
|
||||
+ "x=" + x
|
||||
+ ", y=" + y
|
||||
+ '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final ImPlotPoint imPlotPoint = (ImPlotPoint) o;
|
||||
return Double.compare(imPlotPoint.x, x) == 0 && Double.compare(imPlotPoint.y, y) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("MethodDoesntCallSuperMethod")
|
||||
public ImPlotPoint clone() {
|
||||
return new ImPlotPoint(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package imgui.extension.implot;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public final class ImPlotRange implements Cloneable {
|
||||
public double min;
|
||||
public double max;
|
||||
|
||||
public ImPlotRange() {
|
||||
}
|
||||
|
||||
public ImPlotRange(final double min, final double max) {
|
||||
set(min, max);
|
||||
}
|
||||
|
||||
public ImPlotRange(final ImPlotRange value) {
|
||||
set(value.min, value.max);
|
||||
}
|
||||
|
||||
public boolean contains(final double value) {
|
||||
return value >= min && value <= max;
|
||||
}
|
||||
|
||||
public double size() {
|
||||
return max - min;
|
||||
}
|
||||
|
||||
public ImPlotRange set(final double min, final double max) {
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImPlotRange set(final ImPlotRange value) {
|
||||
return set(value.min, value.max);
|
||||
}
|
||||
|
||||
public ImPlotRange plus(final double min, final double max) {
|
||||
this.min += min;
|
||||
this.max += max;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImPlotRange plus(final ImPlotRange value) {
|
||||
return plus(value.min, value.max);
|
||||
}
|
||||
|
||||
public ImPlotRange minus(final double min, final double max) {
|
||||
this.min -= min;
|
||||
this.max -= max;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImPlotRange minus(final ImPlotRange value) {
|
||||
return minus(value.min, value.max);
|
||||
}
|
||||
|
||||
public ImPlotRange times(final double min, final double max) {
|
||||
this.min *= min;
|
||||
this.max *= max;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImPlotRange times(final ImPlotRange value) {
|
||||
return times(value.min, value.max);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ImPlotRange{"
|
||||
+ "min=" + min
|
||||
+ ", max=" + max
|
||||
+ '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final ImPlotRange ImPlotRange = (ImPlotRange) o;
|
||||
return Double.compare(ImPlotRange.min, min) == 0 && Double.compare(ImPlotRange.max, max) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(min, max);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("MethodDoesntCallSuperMethod")
|
||||
public ImPlotRange clone() {
|
||||
return new ImPlotRange(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,992 @@
|
||||
package imgui.extension.implot;
|
||||
|
||||
import imgui.ImVec2;
|
||||
import imgui.ImVec4;
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
|
||||
public final class ImPlotStyle extends ImGuiStructDestroyable {
|
||||
public ImPlotStyle() {
|
||||
}
|
||||
|
||||
public ImPlotStyle(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate();
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_implot.h"
|
||||
#define THIS ((ImPlotStyle*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
private native long nCreate(); /*
|
||||
return (intptr_t)(new ImPlotStyle());
|
||||
*/
|
||||
|
||||
public float getLineWeight() {
|
||||
return nGetLineWeight();
|
||||
}
|
||||
|
||||
public void setLineWeight(final float value) {
|
||||
nSetLineWeight(value);
|
||||
}
|
||||
|
||||
private native float nGetLineWeight(); /*
|
||||
return THIS->LineWeight;
|
||||
*/
|
||||
|
||||
private native void nSetLineWeight(float value); /*
|
||||
THIS->LineWeight = value;
|
||||
*/
|
||||
|
||||
public int getMarker() {
|
||||
return nGetMarker();
|
||||
}
|
||||
|
||||
public void setMarker(final int value) {
|
||||
nSetMarker(value);
|
||||
}
|
||||
|
||||
private native int nGetMarker(); /*
|
||||
return THIS->Marker;
|
||||
*/
|
||||
|
||||
private native void nSetMarker(int value); /*
|
||||
THIS->Marker = value;
|
||||
*/
|
||||
|
||||
public float getMarkerSize() {
|
||||
return nGetMarkerSize();
|
||||
}
|
||||
|
||||
public void setMarkerSize(final float value) {
|
||||
nSetMarkerSize(value);
|
||||
}
|
||||
|
||||
private native float nGetMarkerSize(); /*
|
||||
return THIS->MarkerSize;
|
||||
*/
|
||||
|
||||
private native void nSetMarkerSize(float value); /*
|
||||
THIS->MarkerSize = value;
|
||||
*/
|
||||
|
||||
public float getMarkerWeight() {
|
||||
return nGetMarkerWeight();
|
||||
}
|
||||
|
||||
public void setMarkerWeight(final float value) {
|
||||
nSetMarkerWeight(value);
|
||||
}
|
||||
|
||||
private native float nGetMarkerWeight(); /*
|
||||
return THIS->MarkerWeight;
|
||||
*/
|
||||
|
||||
private native void nSetMarkerWeight(float value); /*
|
||||
THIS->MarkerWeight = value;
|
||||
*/
|
||||
|
||||
public float getFillAlpha() {
|
||||
return nGetFillAlpha();
|
||||
}
|
||||
|
||||
public void setFillAlpha(final float value) {
|
||||
nSetFillAlpha(value);
|
||||
}
|
||||
|
||||
private native float nGetFillAlpha(); /*
|
||||
return THIS->FillAlpha;
|
||||
*/
|
||||
|
||||
private native void nSetFillAlpha(float value); /*
|
||||
THIS->FillAlpha = value;
|
||||
*/
|
||||
|
||||
public float getErrorBarSize() {
|
||||
return nGetErrorBarSize();
|
||||
}
|
||||
|
||||
public void setErrorBarSize(final float value) {
|
||||
nSetErrorBarSize(value);
|
||||
}
|
||||
|
||||
private native float nGetErrorBarSize(); /*
|
||||
return THIS->ErrorBarSize;
|
||||
*/
|
||||
|
||||
private native void nSetErrorBarSize(float value); /*
|
||||
THIS->ErrorBarSize = value;
|
||||
*/
|
||||
|
||||
public float getErrorBarWeight() {
|
||||
return nGetErrorBarWeight();
|
||||
}
|
||||
|
||||
public void setErrorBarWeight(final float value) {
|
||||
nSetErrorBarWeight(value);
|
||||
}
|
||||
|
||||
private native float nGetErrorBarWeight(); /*
|
||||
return THIS->ErrorBarWeight;
|
||||
*/
|
||||
|
||||
private native void nSetErrorBarWeight(float value); /*
|
||||
THIS->ErrorBarWeight = value;
|
||||
*/
|
||||
|
||||
public float getDigitalBitHeight() {
|
||||
return nGetDigitalBitHeight();
|
||||
}
|
||||
|
||||
public void setDigitalBitHeight(final float value) {
|
||||
nSetDigitalBitHeight(value);
|
||||
}
|
||||
|
||||
private native float nGetDigitalBitHeight(); /*
|
||||
return THIS->DigitalBitHeight;
|
||||
*/
|
||||
|
||||
private native void nSetDigitalBitHeight(float value); /*
|
||||
THIS->DigitalBitHeight = value;
|
||||
*/
|
||||
|
||||
public float getDigitalBitGap() {
|
||||
return nGetDigitalBitGap();
|
||||
}
|
||||
|
||||
public void setDigitalBitGap(final float value) {
|
||||
nSetDigitalBitGap(value);
|
||||
}
|
||||
|
||||
private native float nGetDigitalBitGap(); /*
|
||||
return THIS->DigitalBitGap;
|
||||
*/
|
||||
|
||||
private native void nSetDigitalBitGap(float value); /*
|
||||
THIS->DigitalBitGap = value;
|
||||
*/
|
||||
|
||||
public float getPlotBorderSize() {
|
||||
return nGetPlotBorderSize();
|
||||
}
|
||||
|
||||
public void setPlotBorderSize(final float value) {
|
||||
nSetPlotBorderSize(value);
|
||||
}
|
||||
|
||||
private native float nGetPlotBorderSize(); /*
|
||||
return THIS->PlotBorderSize;
|
||||
*/
|
||||
|
||||
private native void nSetPlotBorderSize(float value); /*
|
||||
THIS->PlotBorderSize = value;
|
||||
*/
|
||||
|
||||
public float getMinorAlpha() {
|
||||
return nGetMinorAlpha();
|
||||
}
|
||||
|
||||
public void setMinorAlpha(final float value) {
|
||||
nSetMinorAlpha(value);
|
||||
}
|
||||
|
||||
private native float nGetMinorAlpha(); /*
|
||||
return THIS->MinorAlpha;
|
||||
*/
|
||||
|
||||
private native void nSetMinorAlpha(float value); /*
|
||||
THIS->MinorAlpha = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getMajorTickLen() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetMajorTickLen(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getMajorTickLenX() {
|
||||
return nGetMajorTickLenX();
|
||||
}
|
||||
|
||||
public float getMajorTickLenY() {
|
||||
return nGetMajorTickLenY();
|
||||
}
|
||||
|
||||
public void getMajorTickLen(final ImVec2 dst) {
|
||||
nGetMajorTickLen(dst);
|
||||
}
|
||||
|
||||
public void setMajorTickLen(final ImVec2 value) {
|
||||
nSetMajorTickLen(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setMajorTickLen(final float valueX, final float valueY) {
|
||||
nSetMajorTickLen(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetMajorTickLen(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->MajorTickLen, dst);
|
||||
*/
|
||||
|
||||
private native float nGetMajorTickLenX(); /*
|
||||
return THIS->MajorTickLen.x;
|
||||
*/
|
||||
|
||||
private native float nGetMajorTickLenY(); /*
|
||||
return THIS->MajorTickLen.y;
|
||||
*/
|
||||
|
||||
private native void nSetMajorTickLen(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->MajorTickLen = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getMinorTickLen() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetMinorTickLen(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getMinorTickLenX() {
|
||||
return nGetMinorTickLenX();
|
||||
}
|
||||
|
||||
public float getMinorTickLenY() {
|
||||
return nGetMinorTickLenY();
|
||||
}
|
||||
|
||||
public void getMinorTickLen(final ImVec2 dst) {
|
||||
nGetMinorTickLen(dst);
|
||||
}
|
||||
|
||||
public void setMinorTickLen(final ImVec2 value) {
|
||||
nSetMinorTickLen(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setMinorTickLen(final float valueX, final float valueY) {
|
||||
nSetMinorTickLen(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetMinorTickLen(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->MinorTickLen, dst);
|
||||
*/
|
||||
|
||||
private native float nGetMinorTickLenX(); /*
|
||||
return THIS->MinorTickLen.x;
|
||||
*/
|
||||
|
||||
private native float nGetMinorTickLenY(); /*
|
||||
return THIS->MinorTickLen.y;
|
||||
*/
|
||||
|
||||
private native void nSetMinorTickLen(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->MinorTickLen = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getMajorTickSize() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetMajorTickSize(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getMajorTickSizeX() {
|
||||
return nGetMajorTickSizeX();
|
||||
}
|
||||
|
||||
public float getMajorTickSizeY() {
|
||||
return nGetMajorTickSizeY();
|
||||
}
|
||||
|
||||
public void getMajorTickSize(final ImVec2 dst) {
|
||||
nGetMajorTickSize(dst);
|
||||
}
|
||||
|
||||
public void setMajorTickSize(final ImVec2 value) {
|
||||
nSetMajorTickSize(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setMajorTickSize(final float valueX, final float valueY) {
|
||||
nSetMajorTickSize(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetMajorTickSize(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->MajorTickSize, dst);
|
||||
*/
|
||||
|
||||
private native float nGetMajorTickSizeX(); /*
|
||||
return THIS->MajorTickSize.x;
|
||||
*/
|
||||
|
||||
private native float nGetMajorTickSizeY(); /*
|
||||
return THIS->MajorTickSize.y;
|
||||
*/
|
||||
|
||||
private native void nSetMajorTickSize(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->MajorTickSize = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getMinorTickSize() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetMinorTickSize(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getMinorTickSizeX() {
|
||||
return nGetMinorTickSizeX();
|
||||
}
|
||||
|
||||
public float getMinorTickSizeY() {
|
||||
return nGetMinorTickSizeY();
|
||||
}
|
||||
|
||||
public void getMinorTickSize(final ImVec2 dst) {
|
||||
nGetMinorTickSize(dst);
|
||||
}
|
||||
|
||||
public void setMinorTickSize(final ImVec2 value) {
|
||||
nSetMinorTickSize(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setMinorTickSize(final float valueX, final float valueY) {
|
||||
nSetMinorTickSize(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetMinorTickSize(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->MinorTickSize, dst);
|
||||
*/
|
||||
|
||||
private native float nGetMinorTickSizeX(); /*
|
||||
return THIS->MinorTickSize.x;
|
||||
*/
|
||||
|
||||
private native float nGetMinorTickSizeY(); /*
|
||||
return THIS->MinorTickSize.y;
|
||||
*/
|
||||
|
||||
private native void nSetMinorTickSize(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->MinorTickSize = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getMajorGridSize() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetMajorGridSize(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getMajorGridSizeX() {
|
||||
return nGetMajorGridSizeX();
|
||||
}
|
||||
|
||||
public float getMajorGridSizeY() {
|
||||
return nGetMajorGridSizeY();
|
||||
}
|
||||
|
||||
public void getMajorGridSize(final ImVec2 dst) {
|
||||
nGetMajorGridSize(dst);
|
||||
}
|
||||
|
||||
public void setMajorGridSize(final ImVec2 value) {
|
||||
nSetMajorGridSize(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setMajorGridSize(final float valueX, final float valueY) {
|
||||
nSetMajorGridSize(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetMajorGridSize(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->MajorGridSize, dst);
|
||||
*/
|
||||
|
||||
private native float nGetMajorGridSizeX(); /*
|
||||
return THIS->MajorGridSize.x;
|
||||
*/
|
||||
|
||||
private native float nGetMajorGridSizeY(); /*
|
||||
return THIS->MajorGridSize.y;
|
||||
*/
|
||||
|
||||
private native void nSetMajorGridSize(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->MajorGridSize = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getMinorGridSize() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetMinorGridSize(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getMinorGridSizeX() {
|
||||
return nGetMinorGridSizeX();
|
||||
}
|
||||
|
||||
public float getMinorGridSizeY() {
|
||||
return nGetMinorGridSizeY();
|
||||
}
|
||||
|
||||
public void getMinorGridSize(final ImVec2 dst) {
|
||||
nGetMinorGridSize(dst);
|
||||
}
|
||||
|
||||
public void setMinorGridSize(final ImVec2 value) {
|
||||
nSetMinorGridSize(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setMinorGridSize(final float valueX, final float valueY) {
|
||||
nSetMinorGridSize(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetMinorGridSize(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->MinorGridSize, dst);
|
||||
*/
|
||||
|
||||
private native float nGetMinorGridSizeX(); /*
|
||||
return THIS->MinorGridSize.x;
|
||||
*/
|
||||
|
||||
private native float nGetMinorGridSizeY(); /*
|
||||
return THIS->MinorGridSize.y;
|
||||
*/
|
||||
|
||||
private native void nSetMinorGridSize(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->MinorGridSize = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getPlotPadding() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetPlotPadding(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getPlotPaddingX() {
|
||||
return nGetPlotPaddingX();
|
||||
}
|
||||
|
||||
public float getPlotPaddingY() {
|
||||
return nGetPlotPaddingY();
|
||||
}
|
||||
|
||||
public void getPlotPadding(final ImVec2 dst) {
|
||||
nGetPlotPadding(dst);
|
||||
}
|
||||
|
||||
public void setPlotPadding(final ImVec2 value) {
|
||||
nSetPlotPadding(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setPlotPadding(final float valueX, final float valueY) {
|
||||
nSetPlotPadding(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetPlotPadding(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->PlotPadding, dst);
|
||||
*/
|
||||
|
||||
private native float nGetPlotPaddingX(); /*
|
||||
return THIS->PlotPadding.x;
|
||||
*/
|
||||
|
||||
private native float nGetPlotPaddingY(); /*
|
||||
return THIS->PlotPadding.y;
|
||||
*/
|
||||
|
||||
private native void nSetPlotPadding(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->PlotPadding = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getLabelPadding() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetLabelPadding(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getLabelPaddingX() {
|
||||
return nGetLabelPaddingX();
|
||||
}
|
||||
|
||||
public float getLabelPaddingY() {
|
||||
return nGetLabelPaddingY();
|
||||
}
|
||||
|
||||
public void getLabelPadding(final ImVec2 dst) {
|
||||
nGetLabelPadding(dst);
|
||||
}
|
||||
|
||||
public void setLabelPadding(final ImVec2 value) {
|
||||
nSetLabelPadding(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setLabelPadding(final float valueX, final float valueY) {
|
||||
nSetLabelPadding(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetLabelPadding(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->LabelPadding, dst);
|
||||
*/
|
||||
|
||||
private native float nGetLabelPaddingX(); /*
|
||||
return THIS->LabelPadding.x;
|
||||
*/
|
||||
|
||||
private native float nGetLabelPaddingY(); /*
|
||||
return THIS->LabelPadding.y;
|
||||
*/
|
||||
|
||||
private native void nSetLabelPadding(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->LabelPadding = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getLegendPadding() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetLegendPadding(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getLegendPaddingX() {
|
||||
return nGetLegendPaddingX();
|
||||
}
|
||||
|
||||
public float getLegendPaddingY() {
|
||||
return nGetLegendPaddingY();
|
||||
}
|
||||
|
||||
public void getLegendPadding(final ImVec2 dst) {
|
||||
nGetLegendPadding(dst);
|
||||
}
|
||||
|
||||
public void setLegendPadding(final ImVec2 value) {
|
||||
nSetLegendPadding(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setLegendPadding(final float valueX, final float valueY) {
|
||||
nSetLegendPadding(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetLegendPadding(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->LegendPadding, dst);
|
||||
*/
|
||||
|
||||
private native float nGetLegendPaddingX(); /*
|
||||
return THIS->LegendPadding.x;
|
||||
*/
|
||||
|
||||
private native float nGetLegendPaddingY(); /*
|
||||
return THIS->LegendPadding.y;
|
||||
*/
|
||||
|
||||
private native void nSetLegendPadding(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->LegendPadding = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getLegendInnerPadding() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetLegendInnerPadding(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getLegendInnerPaddingX() {
|
||||
return nGetLegendInnerPaddingX();
|
||||
}
|
||||
|
||||
public float getLegendInnerPaddingY() {
|
||||
return nGetLegendInnerPaddingY();
|
||||
}
|
||||
|
||||
public void getLegendInnerPadding(final ImVec2 dst) {
|
||||
nGetLegendInnerPadding(dst);
|
||||
}
|
||||
|
||||
public void setLegendInnerPadding(final ImVec2 value) {
|
||||
nSetLegendInnerPadding(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setLegendInnerPadding(final float valueX, final float valueY) {
|
||||
nSetLegendInnerPadding(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetLegendInnerPadding(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->LegendInnerPadding, dst);
|
||||
*/
|
||||
|
||||
private native float nGetLegendInnerPaddingX(); /*
|
||||
return THIS->LegendInnerPadding.x;
|
||||
*/
|
||||
|
||||
private native float nGetLegendInnerPaddingY(); /*
|
||||
return THIS->LegendInnerPadding.y;
|
||||
*/
|
||||
|
||||
private native void nSetLegendInnerPadding(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->LegendInnerPadding = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getLegendSpacing() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetLegendSpacing(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getLegendSpacingX() {
|
||||
return nGetLegendSpacingX();
|
||||
}
|
||||
|
||||
public float getLegendSpacingY() {
|
||||
return nGetLegendSpacingY();
|
||||
}
|
||||
|
||||
public void getLegendSpacing(final ImVec2 dst) {
|
||||
nGetLegendSpacing(dst);
|
||||
}
|
||||
|
||||
public void setLegendSpacing(final ImVec2 value) {
|
||||
nSetLegendSpacing(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setLegendSpacing(final float valueX, final float valueY) {
|
||||
nSetLegendSpacing(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetLegendSpacing(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->LegendSpacing, dst);
|
||||
*/
|
||||
|
||||
private native float nGetLegendSpacingX(); /*
|
||||
return THIS->LegendSpacing.x;
|
||||
*/
|
||||
|
||||
private native float nGetLegendSpacingY(); /*
|
||||
return THIS->LegendSpacing.y;
|
||||
*/
|
||||
|
||||
private native void nSetLegendSpacing(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->LegendSpacing = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getMousePosPadding() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetMousePosPadding(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getMousePosPaddingX() {
|
||||
return nGetMousePosPaddingX();
|
||||
}
|
||||
|
||||
public float getMousePosPaddingY() {
|
||||
return nGetMousePosPaddingY();
|
||||
}
|
||||
|
||||
public void getMousePosPadding(final ImVec2 dst) {
|
||||
nGetMousePosPadding(dst);
|
||||
}
|
||||
|
||||
public void setMousePosPadding(final ImVec2 value) {
|
||||
nSetMousePosPadding(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setMousePosPadding(final float valueX, final float valueY) {
|
||||
nSetMousePosPadding(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetMousePosPadding(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->MousePosPadding, dst);
|
||||
*/
|
||||
|
||||
private native float nGetMousePosPaddingX(); /*
|
||||
return THIS->MousePosPadding.x;
|
||||
*/
|
||||
|
||||
private native float nGetMousePosPaddingY(); /*
|
||||
return THIS->MousePosPadding.y;
|
||||
*/
|
||||
|
||||
private native void nSetMousePosPadding(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->MousePosPadding = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getAnnotationPadding() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetAnnotationPadding(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getAnnotationPaddingX() {
|
||||
return nGetAnnotationPaddingX();
|
||||
}
|
||||
|
||||
public float getAnnotationPaddingY() {
|
||||
return nGetAnnotationPaddingY();
|
||||
}
|
||||
|
||||
public void getAnnotationPadding(final ImVec2 dst) {
|
||||
nGetAnnotationPadding(dst);
|
||||
}
|
||||
|
||||
public void setAnnotationPadding(final ImVec2 value) {
|
||||
nSetAnnotationPadding(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setAnnotationPadding(final float valueX, final float valueY) {
|
||||
nSetAnnotationPadding(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetAnnotationPadding(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->AnnotationPadding, dst);
|
||||
*/
|
||||
|
||||
private native float nGetAnnotationPaddingX(); /*
|
||||
return THIS->AnnotationPadding.x;
|
||||
*/
|
||||
|
||||
private native float nGetAnnotationPaddingY(); /*
|
||||
return THIS->AnnotationPadding.y;
|
||||
*/
|
||||
|
||||
private native void nSetAnnotationPadding(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->AnnotationPadding = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getFitPadding() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetFitPadding(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getFitPaddingX() {
|
||||
return nGetFitPaddingX();
|
||||
}
|
||||
|
||||
public float getFitPaddingY() {
|
||||
return nGetFitPaddingY();
|
||||
}
|
||||
|
||||
public void getFitPadding(final ImVec2 dst) {
|
||||
nGetFitPadding(dst);
|
||||
}
|
||||
|
||||
public void setFitPadding(final ImVec2 value) {
|
||||
nSetFitPadding(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setFitPadding(final float valueX, final float valueY) {
|
||||
nSetFitPadding(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetFitPadding(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->FitPadding, dst);
|
||||
*/
|
||||
|
||||
private native float nGetFitPaddingX(); /*
|
||||
return THIS->FitPadding.x;
|
||||
*/
|
||||
|
||||
private native float nGetFitPaddingY(); /*
|
||||
return THIS->FitPadding.y;
|
||||
*/
|
||||
|
||||
private native void nSetFitPadding(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->FitPadding = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getPlotDefaultSize() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetPlotDefaultSize(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getPlotDefaultSizeX() {
|
||||
return nGetPlotDefaultSizeX();
|
||||
}
|
||||
|
||||
public float getPlotDefaultSizeY() {
|
||||
return nGetPlotDefaultSizeY();
|
||||
}
|
||||
|
||||
public void getPlotDefaultSize(final ImVec2 dst) {
|
||||
nGetPlotDefaultSize(dst);
|
||||
}
|
||||
|
||||
public void setPlotDefaultSize(final ImVec2 value) {
|
||||
nSetPlotDefaultSize(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setPlotDefaultSize(final float valueX, final float valueY) {
|
||||
nSetPlotDefaultSize(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetPlotDefaultSize(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->PlotDefaultSize, dst);
|
||||
*/
|
||||
|
||||
private native float nGetPlotDefaultSizeX(); /*
|
||||
return THIS->PlotDefaultSize.x;
|
||||
*/
|
||||
|
||||
private native float nGetPlotDefaultSizeY(); /*
|
||||
return THIS->PlotDefaultSize.y;
|
||||
*/
|
||||
|
||||
private native void nSetPlotDefaultSize(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->PlotDefaultSize = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getPlotMinSize() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetPlotMinSize(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getPlotMinSizeX() {
|
||||
return nGetPlotMinSizeX();
|
||||
}
|
||||
|
||||
public float getPlotMinSizeY() {
|
||||
return nGetPlotMinSizeY();
|
||||
}
|
||||
|
||||
public void getPlotMinSize(final ImVec2 dst) {
|
||||
nGetPlotMinSize(dst);
|
||||
}
|
||||
|
||||
public void setPlotMinSize(final ImVec2 value) {
|
||||
nSetPlotMinSize(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setPlotMinSize(final float valueX, final float valueY) {
|
||||
nSetPlotMinSize(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetPlotMinSize(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->PlotMinSize, dst);
|
||||
*/
|
||||
|
||||
private native float nGetPlotMinSizeX(); /*
|
||||
return THIS->PlotMinSize.x;
|
||||
*/
|
||||
|
||||
private native float nGetPlotMinSizeY(); /*
|
||||
return THIS->PlotMinSize.y;
|
||||
*/
|
||||
|
||||
private native void nSetPlotMinSize(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->PlotMinSize = value;
|
||||
*/
|
||||
|
||||
public ImVec4[] getColors() {
|
||||
return nGetColors();
|
||||
}
|
||||
|
||||
public void setColors(final ImVec4[] value) {
|
||||
nSetColors(value);
|
||||
}
|
||||
|
||||
private native ImVec4[] nGetColors(); /*
|
||||
return Jni::NewImVec4Array(env, THIS->Colors, ImPlotCol_COUNT);
|
||||
*/
|
||||
|
||||
private native void nSetColors(ImVec4[] value); /*
|
||||
Jni::ImVec4ArrayCpy(env, value, THIS->Colors, ImPlotCol_COUNT);
|
||||
*/
|
||||
|
||||
public int getColormap() {
|
||||
return nGetColormap();
|
||||
}
|
||||
|
||||
public void setColormap(final int value) {
|
||||
nSetColormap(value);
|
||||
}
|
||||
|
||||
private native int nGetColormap(); /*
|
||||
return THIS->Colormap;
|
||||
*/
|
||||
|
||||
private native void nSetColormap(int value); /*
|
||||
THIS->Colormap = value;
|
||||
*/
|
||||
|
||||
public boolean getAntiAliasedLines() {
|
||||
return nGetAntiAliasedLines();
|
||||
}
|
||||
|
||||
public void setAntiAliasedLines(final boolean value) {
|
||||
nSetAntiAliasedLines(value);
|
||||
}
|
||||
|
||||
private native boolean nGetAntiAliasedLines(); /*
|
||||
return THIS->AntiAliasedLines;
|
||||
*/
|
||||
|
||||
private native void nSetAntiAliasedLines(boolean value); /*
|
||||
THIS->AntiAliasedLines = value;
|
||||
*/
|
||||
|
||||
public boolean getUseLocalTime() {
|
||||
return nGetUseLocalTime();
|
||||
}
|
||||
|
||||
public void setUseLocalTime(final boolean value) {
|
||||
nSetUseLocalTime(value);
|
||||
}
|
||||
|
||||
private native boolean nGetUseLocalTime(); /*
|
||||
return THIS->UseLocalTime;
|
||||
*/
|
||||
|
||||
private native void nSetUseLocalTime(boolean value); /*
|
||||
THIS->UseLocalTime = value;
|
||||
*/
|
||||
|
||||
public boolean getUseISO8601() {
|
||||
return nGetUseISO8601();
|
||||
}
|
||||
|
||||
public void setUseISO8601(final boolean value) {
|
||||
nSetUseISO8601(value);
|
||||
}
|
||||
|
||||
private native boolean nGetUseISO8601(); /*
|
||||
return THIS->UseISO8601;
|
||||
*/
|
||||
|
||||
private native void nSetUseISO8601(boolean value); /*
|
||||
THIS->UseISO8601 = value;
|
||||
*/
|
||||
|
||||
public boolean getUse24HourClock() {
|
||||
return nGetUse24HourClock();
|
||||
}
|
||||
|
||||
public void setUse24HourClock(final boolean value) {
|
||||
nSetUse24HourClock(value);
|
||||
}
|
||||
|
||||
private native boolean nGetUse24HourClock(); /*
|
||||
return THIS->Use24HourClock;
|
||||
*/
|
||||
|
||||
private native void nSetUse24HourClock(boolean value); /*
|
||||
THIS->Use24HourClock = value;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package imgui.extension.implot.flag;
|
||||
|
||||
|
||||
public final class ImPlotAxisFlags {
|
||||
private ImPlotAxisFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* default
|
||||
*
|
||||
* <p>Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* the axis label will not be displayed (axis labels also hidden if the supplied string name is NULL)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int NoLabel = 1;
|
||||
|
||||
/**
|
||||
* no grid lines will be displayed
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int NoGridLines = 2;
|
||||
|
||||
/**
|
||||
* no tick marks will be displayed
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int NoTickMarks = 4;
|
||||
|
||||
/**
|
||||
* no text labels will be displayed
|
||||
*
|
||||
* <p>Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int NoTickLabels = 8;
|
||||
|
||||
/**
|
||||
* grid lines will be displayed in the foreground (i.e. on top of data) in stead of the background
|
||||
*
|
||||
* <p>Definition: {@code 1 << 4}
|
||||
*/
|
||||
public static final int Foreground = 16;
|
||||
|
||||
/**
|
||||
* a logartithmic (base 10) axis scale will be used (mutually exclusive with ImPlotAxisFlags_Time)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 5}
|
||||
*/
|
||||
public static final int LogScale = 32;
|
||||
|
||||
/**
|
||||
* axis will display date/time formatted labels (mutually exclusive with ImPlotAxisFlags_LogScale)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 6}
|
||||
*/
|
||||
public static final int Time = 64;
|
||||
|
||||
/**
|
||||
* the axis will be inverted
|
||||
*
|
||||
* <p>Definition: {@code 1 << 7}
|
||||
*/
|
||||
public static final int Invert = 128;
|
||||
|
||||
/**
|
||||
* axis will not be initially fit to data extents on the first rendered frame (also the case if SetNextPlotLimits explicitly called)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 8}
|
||||
*/
|
||||
public static final int NoInitialFit = 256;
|
||||
|
||||
/**
|
||||
* axis will be auto-fitting to data extents
|
||||
*
|
||||
* <p>Definition: {@code 1 << 9}
|
||||
*/
|
||||
public static final int AutoFit = 512;
|
||||
|
||||
/**
|
||||
* axis will only fit points if the point is in the visible range of the **orthoganol** axis
|
||||
*
|
||||
* <p>Definition: {@code 1 << 10}
|
||||
*/
|
||||
public static final int RangeFit = 1024;
|
||||
|
||||
/**
|
||||
* the axis minimum value will be locked when panning/zooming
|
||||
*
|
||||
* <p>Definition: {@code 1 << 11}
|
||||
*/
|
||||
public static final int LockMin = 2048;
|
||||
|
||||
/**
|
||||
* the axis maximum value will be locked when panning/zooming
|
||||
*
|
||||
* <p>Definition: {@code 1 << 12}
|
||||
*/
|
||||
public static final int LockMax = 4096;
|
||||
|
||||
/**
|
||||
* Definition: {@code ImPlotAxisFlags_LockMin | ImPlotAxisFlags_LockMax}
|
||||
*/
|
||||
public static final int Lock = 6144;
|
||||
|
||||
/**
|
||||
* Definition: {@code ImPlotAxisFlags_NoLabel | ImPlotAxisFlags_NoGridLines | ImPlotAxisFlags_NoTickMarks | ImPlotAxisFlags_NoTickLabels}
|
||||
*/
|
||||
public static final int NoDecorations = 15;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package imgui.extension.implot.flag;
|
||||
|
||||
|
||||
public final class ImPlotBin {
|
||||
private ImPlotBin() {
|
||||
}
|
||||
|
||||
/**
|
||||
* k = sqrt(n)
|
||||
*
|
||||
* <p>Definition: {@code -1}
|
||||
*/
|
||||
public static final int Sqrt = -1;
|
||||
|
||||
/**
|
||||
* k = 1 + log2(n)
|
||||
*
|
||||
* <p>Definition: {@code -2}
|
||||
*/
|
||||
public static final int Sturges = -2;
|
||||
|
||||
/**
|
||||
* k = 2 * cbrt(n)
|
||||
*
|
||||
* <p>Definition: {@code -3}
|
||||
*/
|
||||
public static final int Rice = -3;
|
||||
|
||||
/**
|
||||
* w = 3.49 * sigma / cbrt(n)
|
||||
*
|
||||
* <p>Definition: {@code -4}
|
||||
*/
|
||||
public static final int Scott = -4;
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package imgui.extension.implot.flag;
|
||||
|
||||
|
||||
public final class ImPlotCol {
|
||||
private ImPlotCol() {
|
||||
}
|
||||
|
||||
/**
|
||||
* plot line/outline color (defaults to next unused color in current colormap)
|
||||
*/
|
||||
public static final int Line = 0;
|
||||
|
||||
/**
|
||||
* plot fill color for bars (defaults to the current line color)
|
||||
*/
|
||||
public static final int Fill = 1;
|
||||
|
||||
/**
|
||||
* marker outline color (defaults to the current line color)
|
||||
*/
|
||||
public static final int MarkerOutline = 2;
|
||||
|
||||
/**
|
||||
* marker fill color (defaults to the current line color)
|
||||
*/
|
||||
public static final int MarkerFill = 3;
|
||||
|
||||
/**
|
||||
* error bar color (defaults to ImGuiCol_Text)
|
||||
*/
|
||||
public static final int ErrorBar = 4;
|
||||
|
||||
/**
|
||||
* plot frame background color (defaults to ImGuiCol_FrameBg)
|
||||
*/
|
||||
public static final int FrameBg = 5;
|
||||
|
||||
/**
|
||||
* plot area background color (defaults to ImGuiCol_WindowBg)
|
||||
*/
|
||||
public static final int PlotBg = 6;
|
||||
|
||||
/**
|
||||
* plot area border color (defaults to ImGuiCol_Border)
|
||||
*/
|
||||
public static final int PlotBorder = 7;
|
||||
|
||||
/**
|
||||
* legend background color (defaults to ImGuiCol_PopupBg)
|
||||
*/
|
||||
public static final int LegendBg = 8;
|
||||
|
||||
/**
|
||||
* legend border color (defaults to ImPlotCol_PlotBorder)
|
||||
*/
|
||||
public static final int LegendBorder = 9;
|
||||
|
||||
/**
|
||||
* legend text color (defaults to ImPlotCol_InlayText)
|
||||
*/
|
||||
public static final int LegendText = 10;
|
||||
|
||||
/**
|
||||
* plot title text color (defaults to ImGuiCol_Text)
|
||||
*/
|
||||
public static final int TitleText = 11;
|
||||
|
||||
/**
|
||||
* color of text appearing inside of plots (defaults to ImGuiCol_Text)
|
||||
*/
|
||||
public static final int InlayText = 12;
|
||||
|
||||
/**
|
||||
* x-axis label and tick lables color (defaults to ImGuiCol_Text)
|
||||
*/
|
||||
public static final int XAxis = 13;
|
||||
|
||||
/**
|
||||
* x-axis grid color (defaults to 25% ImPlotCol_XAxis)
|
||||
*/
|
||||
public static final int XAxisGrid = 14;
|
||||
|
||||
/**
|
||||
* y-axis label and tick labels color (defaults to ImGuiCol_Text)
|
||||
*/
|
||||
public static final int YAxis = 15;
|
||||
|
||||
/**
|
||||
* y-axis grid color (defaults to 25% ImPlotCol_YAxis)
|
||||
*/
|
||||
public static final int YAxisGrid = 16;
|
||||
|
||||
/**
|
||||
* 2nd y-axis label and tick labels color (defaults to ImGuiCol_Text)
|
||||
*/
|
||||
public static final int YAxis2 = 17;
|
||||
|
||||
/**
|
||||
* 2nd y-axis grid/label color (defaults to 25% ImPlotCol_YAxis2)
|
||||
*/
|
||||
public static final int YAxisGrid2 = 18;
|
||||
|
||||
/**
|
||||
* 3rd y-axis label and tick labels color (defaults to ImGuiCol_Text)
|
||||
*/
|
||||
public static final int YAxis3 = 19;
|
||||
|
||||
/**
|
||||
* 3rd y-axis grid/label color (defaults to 25% ImPlotCol_YAxis3)
|
||||
*/
|
||||
public static final int YAxisGrid3 = 20;
|
||||
|
||||
/**
|
||||
* box-selection color (defaults to yellow)
|
||||
*/
|
||||
public static final int Selection = 21;
|
||||
|
||||
/**
|
||||
* box-query color (defaults to green)
|
||||
*/
|
||||
public static final int Query = 22;
|
||||
|
||||
/**
|
||||
* crosshairs color (defaults to ImPlotCol_PlotBorder)
|
||||
*/
|
||||
public static final int Crosshairs = 23;
|
||||
|
||||
public static final int COUNT = 24;
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package imgui.extension.implot.flag;
|
||||
|
||||
|
||||
public final class ImPlotColormap {
|
||||
private ImPlotColormap() {
|
||||
}
|
||||
|
||||
/**
|
||||
* a.k.a. seaborn deep (qual=true, n=10) (default)
|
||||
*
|
||||
* <p>Definition: {@code 0}
|
||||
*/
|
||||
public static final int Deep = 0;
|
||||
|
||||
/**
|
||||
* a.k.a. matplotlib "Set1" (qual=true, n=9 )
|
||||
*
|
||||
* <p>Definition: {@code 1}
|
||||
*/
|
||||
public static final int Dark = 1;
|
||||
|
||||
/**
|
||||
* a.k.a. matplotlib "Pastel1" (qual=true, n=9 )
|
||||
*
|
||||
* <p>Definition: {@code 2}
|
||||
*/
|
||||
public static final int Pastel = 2;
|
||||
|
||||
/**
|
||||
* a.k.a. matplotlib "Paired" (qual=true, n=12)
|
||||
*
|
||||
* <p>Definition: {@code 3}
|
||||
*/
|
||||
public static final int Paired = 3;
|
||||
|
||||
/**
|
||||
* a.k.a. matplotlib "viridis" (qual=false, n=11)
|
||||
*
|
||||
* <p>Definition: {@code 4}
|
||||
*/
|
||||
public static final int Viridis = 4;
|
||||
|
||||
/**
|
||||
* a.k.a. matplotlib "plasma" (qual=false, n=11)
|
||||
*
|
||||
* <p>Definition: {@code 5}
|
||||
*/
|
||||
public static final int Plasma = 5;
|
||||
|
||||
/**
|
||||
* a.k.a. matplotlib/MATLAB "hot" (qual=false, n=11)
|
||||
*
|
||||
* <p>Definition: {@code 6}
|
||||
*/
|
||||
public static final int Hot = 6;
|
||||
|
||||
/**
|
||||
* a.k.a. matplotlib/MATLAB "cool" (qual=false, n=11)
|
||||
*
|
||||
* <p>Definition: {@code 7}
|
||||
*/
|
||||
public static final int Cool = 7;
|
||||
|
||||
/**
|
||||
* a.k.a. matplotlib/MATLAB "pink" (qual=false, n=11)
|
||||
*
|
||||
* <p>Definition: {@code 8}
|
||||
*/
|
||||
public static final int Pink = 8;
|
||||
|
||||
/**
|
||||
* a.k.a. MATLAB "jet" (qual=false, n=11)
|
||||
*
|
||||
* <p>Definition: {@code 9}
|
||||
*/
|
||||
public static final int Jet = 9;
|
||||
|
||||
/**
|
||||
* a.k.a. matplotlib "twilight" (qual=false, n=11)
|
||||
*
|
||||
* <p>Definition: {@code 10}
|
||||
*/
|
||||
public static final int Twilight = 10;
|
||||
|
||||
/**
|
||||
* red/blue, Color Brewer (qual=false, n=11)
|
||||
*
|
||||
* <p>Definition: {@code 11}
|
||||
*/
|
||||
public static final int RdBu = 11;
|
||||
|
||||
/**
|
||||
* brown/blue-green, Color Brewer (qual=false, n=11)
|
||||
*
|
||||
* <p>Definition: {@code 12}
|
||||
*/
|
||||
public static final int BrBG = 12;
|
||||
|
||||
/**
|
||||
* pink/yellow-green, Color Brewer (qual=false, n=11)
|
||||
*
|
||||
* <p>Definition: {@code 13}
|
||||
*/
|
||||
public static final int PiYG = 13;
|
||||
|
||||
/**
|
||||
* color spectrum, Color Brewer (qual=false, n=11)
|
||||
*
|
||||
* <p>Definition: {@code 14}
|
||||
*/
|
||||
public static final int Spectral = 14;
|
||||
|
||||
/**
|
||||
* white/black (qual=false, n=2 )
|
||||
*
|
||||
* <p>Definition: {@code 15}
|
||||
*/
|
||||
public static final int Greys = 15;
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package imgui.extension.implot.flag;
|
||||
|
||||
|
||||
public final class ImPlotFlags {
|
||||
private ImPlotFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* default
|
||||
*
|
||||
* <p>Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* the plot title will not be displayed (titles are also hidden if preceeded by double hashes, e.g. "##MyPlot")
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int NoTitle = 1;
|
||||
|
||||
/**
|
||||
* the legend will not be displayed
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int NoLegend = 2;
|
||||
|
||||
/**
|
||||
* the user will not be able to open context menus with right-click
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int NoMenus = 4;
|
||||
|
||||
/**
|
||||
* the user will not be able to box-select with right-click drag
|
||||
*
|
||||
* <p>Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int NoBoxSelect = 8;
|
||||
|
||||
/**
|
||||
* the mouse position, in plot coordinates, will not be displayed inside of the plot
|
||||
*
|
||||
* <p>Definition: {@code 1 << 4}
|
||||
*/
|
||||
public static final int NoMousePos = 16;
|
||||
|
||||
/**
|
||||
* plot items will not be highlighted when their legend entry is hovered
|
||||
*
|
||||
* <p>Definition: {@code 1 << 5}
|
||||
*/
|
||||
public static final int NoHighlight = 32;
|
||||
|
||||
/**
|
||||
* a child window region will not be used to capture mouse scroll (can boost performance for single ImGui window applications)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 6}
|
||||
*/
|
||||
public static final int NoChild = 64;
|
||||
|
||||
/**
|
||||
* primary x and y axes will be constrained to have the same units/pixel (does not apply to auxiliary y-axes)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 7}
|
||||
*/
|
||||
public static final int Equal = 128;
|
||||
|
||||
/**
|
||||
* enable a 2nd y-axis on the right side
|
||||
*
|
||||
* <p>Definition: {@code 1 << 8}
|
||||
*/
|
||||
public static final int YAxis2 = 256;
|
||||
|
||||
/**
|
||||
* enable a 3rd y-axis on the right side
|
||||
*
|
||||
* <p>Definition: {@code 1 << 9}
|
||||
*/
|
||||
public static final int YAxis3 = 512;
|
||||
|
||||
/**
|
||||
* the user will be able to draw query rects with middle-mouse or CTRL + right-click drag
|
||||
*
|
||||
* <p>Definition: {@code 1 << 10}
|
||||
*/
|
||||
public static final int Query = 1024;
|
||||
|
||||
/**
|
||||
* the default mouse cursor will be replaced with a crosshair when hovered
|
||||
*
|
||||
* <p>Definition: {@code 1 << 11}
|
||||
*/
|
||||
public static final int Crosshairs = 2048;
|
||||
|
||||
/**
|
||||
* plot lines will be software anti-aliased (not recommended for high density plots, prefer MSAA)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 12}
|
||||
*/
|
||||
public static final int AntiAliased = 4096;
|
||||
|
||||
/**
|
||||
* Definition: {@code ImPlotFlags_NoTitle | ImPlotFlags_NoLegend | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMousePos}
|
||||
*/
|
||||
public static final int CanvasOnly = 31;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package imgui.extension.implot.flag;
|
||||
|
||||
|
||||
public final class ImPlotLocation {
|
||||
private ImPlotLocation() {
|
||||
}
|
||||
|
||||
/**
|
||||
* center-center
|
||||
*
|
||||
* <p>Definition: {@code 0}
|
||||
*/
|
||||
public static final int Center = 0;
|
||||
|
||||
/**
|
||||
* top-center
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int North = 1;
|
||||
|
||||
/**
|
||||
* bottom-center
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int South = 2;
|
||||
|
||||
/**
|
||||
* center-left
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int West = 4;
|
||||
|
||||
/**
|
||||
* center-right
|
||||
*
|
||||
* <p>Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int East = 8;
|
||||
|
||||
/**
|
||||
* top-left
|
||||
*
|
||||
* <p>Definition: {@code ImPlotLocation_North | ImPlotLocation_West}
|
||||
*/
|
||||
public static final int NorthWest = 5;
|
||||
|
||||
/**
|
||||
* top-right
|
||||
*
|
||||
* <p>Definition: {@code ImPlotLocation_North | ImPlotLocation_East}
|
||||
*/
|
||||
public static final int NorthEast = 9;
|
||||
|
||||
/**
|
||||
* bottom-left
|
||||
*
|
||||
* <p>Definition: {@code ImPlotLocation_South | ImPlotLocation_West}
|
||||
*/
|
||||
public static final int SouthWest = 6;
|
||||
|
||||
/**
|
||||
* bottom-right
|
||||
*
|
||||
* <p>Definition: {@code ImPlotLocation_South | ImPlotLocation_East}
|
||||
*/
|
||||
public static final int SouthEast = 10;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package imgui.extension.implot.flag;
|
||||
|
||||
|
||||
public final class ImPlotMarker {
|
||||
private ImPlotMarker() {
|
||||
}
|
||||
|
||||
/**
|
||||
* no marker
|
||||
*
|
||||
* <p>Definition: {@code -1}
|
||||
*/
|
||||
public static final int None = -1;
|
||||
|
||||
/**
|
||||
* a circle marker
|
||||
*/
|
||||
public static final int Circle = 0;
|
||||
|
||||
/**
|
||||
* a square maker
|
||||
*/
|
||||
public static final int Square = 1;
|
||||
|
||||
/**
|
||||
* a diamond marker
|
||||
*/
|
||||
public static final int Diamond = 2;
|
||||
|
||||
/**
|
||||
* an upward-pointing triangle marker
|
||||
*/
|
||||
public static final int Up = 3;
|
||||
|
||||
/**
|
||||
* an downward-pointing triangle marker
|
||||
*/
|
||||
public static final int Down = 4;
|
||||
|
||||
/**
|
||||
* an leftward-pointing triangle marker
|
||||
*/
|
||||
public static final int Left = 5;
|
||||
|
||||
/**
|
||||
* an rightward-pointing triangle marker
|
||||
*/
|
||||
public static final int Right = 6;
|
||||
|
||||
/**
|
||||
* a cross marker (not fillable)
|
||||
*/
|
||||
public static final int Cross = 7;
|
||||
|
||||
/**
|
||||
* a plus marker (not fillable)
|
||||
*/
|
||||
public static final int Plus = 8;
|
||||
|
||||
/**
|
||||
* a asterisk marker (not fillable)
|
||||
*/
|
||||
public static final int Asterisk = 9;
|
||||
|
||||
public static final int COUNT = 10;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package imgui.extension.implot.flag;
|
||||
|
||||
|
||||
public final class ImPlotOrientation {
|
||||
private ImPlotOrientation() {
|
||||
}
|
||||
|
||||
/**
|
||||
* left/right
|
||||
*/
|
||||
public static final int Horizontal = 0;
|
||||
|
||||
/**
|
||||
* up/down
|
||||
*/
|
||||
public static final int Vertical = 1;
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package imgui.extension.implot.flag;
|
||||
|
||||
|
||||
public final class ImPlotStyleVar {
|
||||
private ImPlotStyleVar() {
|
||||
}
|
||||
|
||||
/**
|
||||
* float, plot item line weight in pixels
|
||||
*/
|
||||
public static final int LineWeight = 0;
|
||||
|
||||
/**
|
||||
* int, marker specification
|
||||
*/
|
||||
public static final int Marker = 1;
|
||||
|
||||
/**
|
||||
* float, marker size in pixels (roughly the marker's "radius")
|
||||
*/
|
||||
public static final int MarkerSize = 2;
|
||||
|
||||
/**
|
||||
* float, plot outline weight of markers in pixels
|
||||
*/
|
||||
public static final int MarkerWeight = 3;
|
||||
|
||||
/**
|
||||
* float, alpha modifier applied to all plot item fills
|
||||
*/
|
||||
public static final int FillAlpha = 4;
|
||||
|
||||
/**
|
||||
* float, error bar whisker width in pixels
|
||||
*/
|
||||
public static final int ErrorBarSize = 5;
|
||||
|
||||
/**
|
||||
* float, error bar whisker weight in pixels
|
||||
*/
|
||||
public static final int ErrorBarWeight = 6;
|
||||
|
||||
/**
|
||||
* float, digital channels bit height (at 1) in pixels
|
||||
*/
|
||||
public static final int DigitalBitHeight = 7;
|
||||
|
||||
/**
|
||||
* float, digital channels bit padding gap in pixels
|
||||
*/
|
||||
public static final int DigitalBitGap = 8;
|
||||
|
||||
/**
|
||||
* float, thickness of border around plot area
|
||||
*/
|
||||
public static final int PlotBorderSize = 9;
|
||||
|
||||
/**
|
||||
* float, alpha multiplier applied to minor axis grid lines
|
||||
*/
|
||||
public static final int MinorAlpha = 10;
|
||||
|
||||
/**
|
||||
* ImVec2, major tick lengths for X and Y axes
|
||||
*/
|
||||
public static final int MajorTickLen = 11;
|
||||
|
||||
/**
|
||||
* ImVec2, minor tick lengths for X and Y axes
|
||||
*/
|
||||
public static final int MinorTickLen = 12;
|
||||
|
||||
/**
|
||||
* ImVec2, line thickness of major ticks
|
||||
*/
|
||||
public static final int MajorTickSize = 13;
|
||||
|
||||
/**
|
||||
* ImVec2, line thickness of minor ticks
|
||||
*/
|
||||
public static final int MinorTickSize = 14;
|
||||
|
||||
/**
|
||||
* ImVec2, line thickness of major grid lines
|
||||
*/
|
||||
public static final int MajorGridSize = 15;
|
||||
|
||||
/**
|
||||
* ImVec2, line thickness of minor grid lines
|
||||
*/
|
||||
public static final int MinorGridSize = 16;
|
||||
|
||||
/**
|
||||
* ImVec2, padding between widget frame and plot area, labels, or outside legends (i.e. main padding)
|
||||
*/
|
||||
public static final int PlotPadding = 17;
|
||||
|
||||
/**
|
||||
* ImVec2, padding between axes labels, tick labels, and plot edge
|
||||
*/
|
||||
public static final int LabelPadding = 18;
|
||||
|
||||
/**
|
||||
* ImVec2, legend padding from plot edges
|
||||
*/
|
||||
public static final int LegendPadding = 19;
|
||||
|
||||
/**
|
||||
* ImVec2, legend inner padding from legend edges
|
||||
*/
|
||||
public static final int LegendInnerPadding = 20;
|
||||
|
||||
/**
|
||||
* ImVec2, spacing between legend entries
|
||||
*/
|
||||
public static final int LegendSpacing = 21;
|
||||
|
||||
/**
|
||||
* ImVec2, padding between plot edge and interior info text
|
||||
*/
|
||||
public static final int MousePosPadding = 22;
|
||||
|
||||
/**
|
||||
* ImVec2, text padding around annotation labels
|
||||
*/
|
||||
public static final int AnnotationPadding = 23;
|
||||
|
||||
/**
|
||||
* ImVec2, additional fit padding as a percentage of the fit extents (e.g. ImVec2(0.1f,0.1f) adds 10% to the fit extents of X and Y)
|
||||
*/
|
||||
public static final int FitPadding = 24;
|
||||
|
||||
/**
|
||||
* ImVec2, default size used when ImVec2(0,0) is passed to BeginPlot
|
||||
*/
|
||||
public static final int PlotDefaultSize = 25;
|
||||
|
||||
/**
|
||||
* ImVec2, minimum size plot frame can be when shrunk
|
||||
*/
|
||||
public static final int PlotMinSize = 26;
|
||||
|
||||
public static final int COUNT = 27;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package imgui.extension.implot.flag;
|
||||
|
||||
|
||||
public final class ImPlotYAxis {
|
||||
private ImPlotYAxis() {
|
||||
}
|
||||
|
||||
/**
|
||||
* left (default)
|
||||
*
|
||||
* <p>Definition: {@code 0}
|
||||
*/
|
||||
public static final int YAxis_1 = 0;
|
||||
|
||||
/**
|
||||
* first on right side
|
||||
*
|
||||
* <p>Definition: {@code 1}
|
||||
*/
|
||||
public static final int YAxis_2 = 1;
|
||||
|
||||
/**
|
||||
* second on right side
|
||||
*
|
||||
* <p>Definition: {@code 2}
|
||||
*/
|
||||
public static final int YAxis_3 = 2;
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
package imgui.extension.memedit;
|
||||
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
|
||||
/**
|
||||
* ImGui Club Memory Editor extension for ImGui
|
||||
* Repo: <a href="https://github.com/ocornut/imgui_club">https://github.com/ocornut/imgui_club</a>
|
||||
*/
|
||||
public final class MemoryEditor extends ImGuiStructDestroyable {
|
||||
public MemoryEditor() {
|
||||
}
|
||||
|
||||
public MemoryEditor(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate();
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_memedit.h"
|
||||
#define THIS ((MemoryEditor*)STRUCT_PTR)
|
||||
#define MemoryEditorSizes MemoryEditor::Sizes
|
||||
*/
|
||||
|
||||
private native long nCreate(); /*
|
||||
return (intptr_t)(new MemoryEditor());
|
||||
*/
|
||||
|
||||
public boolean getOpen() {
|
||||
return nGetOpen();
|
||||
}
|
||||
|
||||
public void setOpen(final boolean value) {
|
||||
nSetOpen(value);
|
||||
}
|
||||
|
||||
private native boolean nGetOpen(); /*
|
||||
return THIS->Open;
|
||||
*/
|
||||
|
||||
private native void nSetOpen(boolean value); /*
|
||||
THIS->Open = value;
|
||||
*/
|
||||
|
||||
public boolean getReadOnly() {
|
||||
return nGetReadOnly();
|
||||
}
|
||||
|
||||
public void setReadOnly(final boolean value) {
|
||||
nSetReadOnly(value);
|
||||
}
|
||||
|
||||
private native boolean nGetReadOnly(); /*
|
||||
return THIS->ReadOnly;
|
||||
*/
|
||||
|
||||
private native void nSetReadOnly(boolean value); /*
|
||||
THIS->ReadOnly = value;
|
||||
*/
|
||||
|
||||
public int getCols() {
|
||||
return nGetCols();
|
||||
}
|
||||
|
||||
public void setCols(final int value) {
|
||||
nSetCols(value);
|
||||
}
|
||||
|
||||
private native int nGetCols(); /*
|
||||
return THIS->Cols;
|
||||
*/
|
||||
|
||||
private native void nSetCols(int value); /*
|
||||
THIS->Cols = value;
|
||||
*/
|
||||
|
||||
public boolean getOptShowOptions() {
|
||||
return nGetOptShowOptions();
|
||||
}
|
||||
|
||||
public void setOptShowOptions(final boolean value) {
|
||||
nSetOptShowOptions(value);
|
||||
}
|
||||
|
||||
private native boolean nGetOptShowOptions(); /*
|
||||
return THIS->OptShowOptions;
|
||||
*/
|
||||
|
||||
private native void nSetOptShowOptions(boolean value); /*
|
||||
THIS->OptShowOptions = value;
|
||||
*/
|
||||
|
||||
public boolean getOptShowDataPreview() {
|
||||
return nGetOptShowDataPreview();
|
||||
}
|
||||
|
||||
public void setOptShowDataPreview(final boolean value) {
|
||||
nSetOptShowDataPreview(value);
|
||||
}
|
||||
|
||||
private native boolean nGetOptShowDataPreview(); /*
|
||||
return THIS->OptShowDataPreview;
|
||||
*/
|
||||
|
||||
private native void nSetOptShowDataPreview(boolean value); /*
|
||||
THIS->OptShowDataPreview = value;
|
||||
*/
|
||||
|
||||
public boolean getOptShowHexII() {
|
||||
return nGetOptShowHexII();
|
||||
}
|
||||
|
||||
public void setOptShowHexII(final boolean value) {
|
||||
nSetOptShowHexII(value);
|
||||
}
|
||||
|
||||
private native boolean nGetOptShowHexII(); /*
|
||||
return THIS->OptShowHexII;
|
||||
*/
|
||||
|
||||
private native void nSetOptShowHexII(boolean value); /*
|
||||
THIS->OptShowHexII = value;
|
||||
*/
|
||||
|
||||
public boolean getOptShowAscii() {
|
||||
return nGetOptShowAscii();
|
||||
}
|
||||
|
||||
public void setOptShowAscii(final boolean value) {
|
||||
nSetOptShowAscii(value);
|
||||
}
|
||||
|
||||
private native boolean nGetOptShowAscii(); /*
|
||||
return THIS->OptShowAscii;
|
||||
*/
|
||||
|
||||
private native void nSetOptShowAscii(boolean value); /*
|
||||
THIS->OptShowAscii = value;
|
||||
*/
|
||||
|
||||
public boolean getOptGreyOutZeroes() {
|
||||
return nGetOptGreyOutZeroes();
|
||||
}
|
||||
|
||||
public void setOptGreyOutZeroes(final boolean value) {
|
||||
nSetOptGreyOutZeroes(value);
|
||||
}
|
||||
|
||||
private native boolean nGetOptGreyOutZeroes(); /*
|
||||
return THIS->OptGreyOutZeroes;
|
||||
*/
|
||||
|
||||
private native void nSetOptGreyOutZeroes(boolean value); /*
|
||||
THIS->OptGreyOutZeroes = value;
|
||||
*/
|
||||
|
||||
public boolean getOptUpperCaseHex() {
|
||||
return nGetOptUpperCaseHex();
|
||||
}
|
||||
|
||||
public void setOptUpperCaseHex(final boolean value) {
|
||||
nSetOptUpperCaseHex(value);
|
||||
}
|
||||
|
||||
private native boolean nGetOptUpperCaseHex(); /*
|
||||
return THIS->OptUpperCaseHex;
|
||||
*/
|
||||
|
||||
private native void nSetOptUpperCaseHex(boolean value); /*
|
||||
THIS->OptUpperCaseHex = value;
|
||||
*/
|
||||
|
||||
public int getOptMidColsCount() {
|
||||
return nGetOptMidColsCount();
|
||||
}
|
||||
|
||||
public void setOptMidColsCount(final int value) {
|
||||
nSetOptMidColsCount(value);
|
||||
}
|
||||
|
||||
private native int nGetOptMidColsCount(); /*
|
||||
return THIS->OptMidColsCount;
|
||||
*/
|
||||
|
||||
private native void nSetOptMidColsCount(int value); /*
|
||||
THIS->OptMidColsCount = value;
|
||||
*/
|
||||
|
||||
public int getOptAddrDigitsCount() {
|
||||
return nGetOptAddrDigitsCount();
|
||||
}
|
||||
|
||||
public void setOptAddrDigitsCount(final int value) {
|
||||
nSetOptAddrDigitsCount(value);
|
||||
}
|
||||
|
||||
private native int nGetOptAddrDigitsCount(); /*
|
||||
return THIS->OptAddrDigitsCount;
|
||||
*/
|
||||
|
||||
private native void nSetOptAddrDigitsCount(int value); /*
|
||||
THIS->OptAddrDigitsCount = value;
|
||||
*/
|
||||
|
||||
public float getOptFooterExtraHeight() {
|
||||
return nGetOptFooterExtraHeight();
|
||||
}
|
||||
|
||||
public void setOptFooterExtraHeight(final float value) {
|
||||
nSetOptFooterExtraHeight(value);
|
||||
}
|
||||
|
||||
private native float nGetOptFooterExtraHeight(); /*
|
||||
return THIS->OptFooterExtraHeight;
|
||||
*/
|
||||
|
||||
private native void nSetOptFooterExtraHeight(float value); /*
|
||||
THIS->OptFooterExtraHeight = value;
|
||||
*/
|
||||
|
||||
public int getHighlightColor() {
|
||||
return nGetHighlightColor();
|
||||
}
|
||||
|
||||
public void setHighlightColor(final int value) {
|
||||
nSetHighlightColor(value);
|
||||
}
|
||||
|
||||
private native int nGetHighlightColor(); /*
|
||||
return THIS->HighlightColor;
|
||||
*/
|
||||
|
||||
private native void nSetHighlightColor(int value); /*
|
||||
THIS->HighlightColor = value;
|
||||
*/
|
||||
|
||||
public void gotoAddrAndHighlight(final long addrMin, final long addrMax) {
|
||||
nGotoAddrAndHighlight(addrMin, addrMax);
|
||||
}
|
||||
|
||||
private native void nGotoAddrAndHighlight(long addrMin, long addrMax); /*
|
||||
THIS->GotoAddrAndHighlight(addrMin, addrMax);
|
||||
*/
|
||||
|
||||
public void calcSizes(final MemoryEditorSizes s, final long memSize, final long baseDisplayAddr) {
|
||||
nCalcSizes(s.ptr, memSize, baseDisplayAddr);
|
||||
}
|
||||
|
||||
private native void nCalcSizes(long s, long memSize, long baseDisplayAddr); /*
|
||||
THIS->CalcSizes(*reinterpret_cast<MemoryEditorSizes*>(s), memSize, baseDisplayAddr);
|
||||
*/
|
||||
|
||||
public void drawWindow(final String title, final long memData, final long memSize) {
|
||||
nDrawWindow(title, memData, memSize);
|
||||
}
|
||||
|
||||
public void drawWindow(final String title, final long memData, final long memSize, final long baseDisplayAddr) {
|
||||
nDrawWindow(title, memData, memSize, baseDisplayAddr);
|
||||
}
|
||||
|
||||
private native void nDrawWindow(String title, long memData, long memSize); /*MANUAL
|
||||
auto title = obj_title == NULL ? NULL : (char*)env->GetStringUTFChars(obj_title, JNI_FALSE);
|
||||
THIS->DrawWindow(title, reinterpret_cast<void*>(memData), memSize);
|
||||
if (title != NULL) env->ReleaseStringUTFChars(obj_title, title);
|
||||
*/
|
||||
|
||||
private native void nDrawWindow(String title, long memData, long memSize, long baseDisplayAddr); /*MANUAL
|
||||
auto title = obj_title == NULL ? NULL : (char*)env->GetStringUTFChars(obj_title, JNI_FALSE);
|
||||
THIS->DrawWindow(title, reinterpret_cast<void*>(memData), memSize, baseDisplayAddr);
|
||||
if (title != NULL) env->ReleaseStringUTFChars(obj_title, title);
|
||||
*/
|
||||
|
||||
public void drawContents(final long memData, final long memSize) {
|
||||
nDrawContents(memData, memSize);
|
||||
}
|
||||
|
||||
public void drawContents(final long memData, final long memSize, final long baseDisplayAddr) {
|
||||
nDrawContents(memData, memSize, baseDisplayAddr);
|
||||
}
|
||||
|
||||
private native void nDrawContents(long memData, long memSize); /*
|
||||
THIS->DrawContents(reinterpret_cast<void*>(memData), memSize);
|
||||
*/
|
||||
|
||||
private native void nDrawContents(long memData, long memSize, long baseDisplayAddr); /*
|
||||
THIS->DrawContents(reinterpret_cast<void*>(memData), memSize, baseDisplayAddr);
|
||||
*/
|
||||
|
||||
public void drawOptionsLine(final MemoryEditorSizes s, final long memData, final long memSize, final long baseDisplayAddr) {
|
||||
nDrawOptionsLine(s.ptr, memData, memSize, baseDisplayAddr);
|
||||
}
|
||||
|
||||
private native void nDrawOptionsLine(long s, long memData, long memSize, long baseDisplayAddr); /*
|
||||
THIS->DrawOptionsLine(*reinterpret_cast<MemoryEditorSizes*>(s), reinterpret_cast<void*>(memData), memSize, baseDisplayAddr);
|
||||
*/
|
||||
|
||||
public void drawPreviewLine(final MemoryEditorSizes s, final long memDataVoid, final long memSize, final long baseDisplayAddr) {
|
||||
nDrawPreviewLine(s.ptr, memDataVoid, memSize, baseDisplayAddr);
|
||||
}
|
||||
|
||||
private native void nDrawPreviewLine(long s, long memDataVoid, long memSize, long baseDisplayAddr); /*
|
||||
THIS->DrawPreviewLine(*reinterpret_cast<MemoryEditorSizes*>(s), reinterpret_cast<void*>(memDataVoid), memSize, baseDisplayAddr);
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef MemoryEditorSizes
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package imgui.extension.memedit;
|
||||
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
|
||||
public final class MemoryEditorSizes extends ImGuiStructDestroyable {
|
||||
public MemoryEditorSizes() {
|
||||
}
|
||||
|
||||
public MemoryEditorSizes(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate();
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_memedit.h"
|
||||
#define THIS ((MemoryEditor::Sizes*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
private native long nCreate(); /*
|
||||
return (intptr_t)(new MemoryEditor::Sizes());
|
||||
*/
|
||||
|
||||
public int getAddrDigitsCount() {
|
||||
return nGetAddrDigitsCount();
|
||||
}
|
||||
|
||||
public void setAddrDigitsCount(final int value) {
|
||||
nSetAddrDigitsCount(value);
|
||||
}
|
||||
|
||||
private native int nGetAddrDigitsCount(); /*
|
||||
return THIS->AddrDigitsCount;
|
||||
*/
|
||||
|
||||
private native void nSetAddrDigitsCount(int value); /*
|
||||
THIS->AddrDigitsCount = value;
|
||||
*/
|
||||
|
||||
public float getLineHeight() {
|
||||
return nGetLineHeight();
|
||||
}
|
||||
|
||||
public void setLineHeight(final float value) {
|
||||
nSetLineHeight(value);
|
||||
}
|
||||
|
||||
private native float nGetLineHeight(); /*
|
||||
return THIS->LineHeight;
|
||||
*/
|
||||
|
||||
private native void nSetLineHeight(float value); /*
|
||||
THIS->LineHeight = value;
|
||||
*/
|
||||
|
||||
public float getGlyphWidth() {
|
||||
return nGetGlyphWidth();
|
||||
}
|
||||
|
||||
public void setGlyphWidth(final float value) {
|
||||
nSetGlyphWidth(value);
|
||||
}
|
||||
|
||||
private native float nGetGlyphWidth(); /*
|
||||
return THIS->GlyphWidth;
|
||||
*/
|
||||
|
||||
private native void nSetGlyphWidth(float value); /*
|
||||
THIS->GlyphWidth = value;
|
||||
*/
|
||||
|
||||
public float getHexCellWidth() {
|
||||
return nGetHexCellWidth();
|
||||
}
|
||||
|
||||
public void setHexCellWidth(final float value) {
|
||||
nSetHexCellWidth(value);
|
||||
}
|
||||
|
||||
private native float nGetHexCellWidth(); /*
|
||||
return THIS->HexCellWidth;
|
||||
*/
|
||||
|
||||
private native void nSetHexCellWidth(float value); /*
|
||||
THIS->HexCellWidth = value;
|
||||
*/
|
||||
|
||||
public float getSpacingBetweenMidCols() {
|
||||
return nGetSpacingBetweenMidCols();
|
||||
}
|
||||
|
||||
public void setSpacingBetweenMidCols(final float value) {
|
||||
nSetSpacingBetweenMidCols(value);
|
||||
}
|
||||
|
||||
private native float nGetSpacingBetweenMidCols(); /*
|
||||
return THIS->SpacingBetweenMidCols;
|
||||
*/
|
||||
|
||||
private native void nSetSpacingBetweenMidCols(float value); /*
|
||||
THIS->SpacingBetweenMidCols = value;
|
||||
*/
|
||||
|
||||
public float getPosHexStart() {
|
||||
return nGetPosHexStart();
|
||||
}
|
||||
|
||||
public void setPosHexStart(final float value) {
|
||||
nSetPosHexStart(value);
|
||||
}
|
||||
|
||||
private native float nGetPosHexStart(); /*
|
||||
return THIS->PosHexStart;
|
||||
*/
|
||||
|
||||
private native void nSetPosHexStart(float value); /*
|
||||
THIS->PosHexStart = value;
|
||||
*/
|
||||
|
||||
public float getPosHexEnd() {
|
||||
return nGetPosHexEnd();
|
||||
}
|
||||
|
||||
public void setPosHexEnd(final float value) {
|
||||
nSetPosHexEnd(value);
|
||||
}
|
||||
|
||||
private native float nGetPosHexEnd(); /*
|
||||
return THIS->PosHexEnd;
|
||||
*/
|
||||
|
||||
private native void nSetPosHexEnd(float value); /*
|
||||
THIS->PosHexEnd = value;
|
||||
*/
|
||||
|
||||
public float getPosAsciiStart() {
|
||||
return nGetPosAsciiStart();
|
||||
}
|
||||
|
||||
public void setPosAsciiStart(final float value) {
|
||||
nSetPosAsciiStart(value);
|
||||
}
|
||||
|
||||
private native float nGetPosAsciiStart(); /*
|
||||
return THIS->PosAsciiStart;
|
||||
*/
|
||||
|
||||
private native void nSetPosAsciiStart(float value); /*
|
||||
THIS->PosAsciiStart = value;
|
||||
*/
|
||||
|
||||
public float getPosAsciiEnd() {
|
||||
return nGetPosAsciiEnd();
|
||||
}
|
||||
|
||||
public void setPosAsciiEnd(final float value) {
|
||||
nSetPosAsciiEnd(value);
|
||||
}
|
||||
|
||||
private native float nGetPosAsciiEnd(); /*
|
||||
return THIS->PosAsciiEnd;
|
||||
*/
|
||||
|
||||
private native void nSetPosAsciiEnd(float value); /*
|
||||
THIS->PosAsciiEnd = value;
|
||||
*/
|
||||
|
||||
public float getWindowWidth() {
|
||||
return nGetWindowWidth();
|
||||
}
|
||||
|
||||
public void setWindowWidth(final float value) {
|
||||
nSetWindowWidth(value);
|
||||
}
|
||||
|
||||
private native float nGetWindowWidth(); /*
|
||||
return THIS->WindowWidth;
|
||||
*/
|
||||
|
||||
private native void nSetWindowWidth(float value); /*
|
||||
THIS->WindowWidth = value;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,105 @@
|
||||
package imgui.extension.nodeditor;
|
||||
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
|
||||
public final class NodeEditorConfig extends ImGuiStructDestroyable {
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate();
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_nodeeditor.h"
|
||||
#define THIS ((ax::NodeEditor::Config*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
private native long nCreate(); /*
|
||||
return (intptr_t)(new ax::NodeEditor::Config());
|
||||
*/
|
||||
|
||||
public String getSettingsFile() {
|
||||
return nGetSettingsFile();
|
||||
}
|
||||
|
||||
public void setSettingsFile(final String value) {
|
||||
nSetSettingsFile(value);
|
||||
}
|
||||
|
||||
private native String nGetSettingsFile(); /*
|
||||
return env->NewStringUTF(THIS->SettingsFile);
|
||||
*/
|
||||
|
||||
private native void nSetSettingsFile(String value); /*MANUAL
|
||||
auto value = obj_value == NULL ? NULL : (char*)env->GetStringUTFChars(obj_value, JNI_FALSE);
|
||||
THIS->SettingsFile = value;
|
||||
if (value != NULL) env->ReleaseStringUTFChars(obj_value, value);
|
||||
*/
|
||||
|
||||
public int getDragButtonIndex() {
|
||||
return nGetDragButtonIndex();
|
||||
}
|
||||
|
||||
public void setDragButtonIndex(final int value) {
|
||||
nSetDragButtonIndex(value);
|
||||
}
|
||||
|
||||
private native int nGetDragButtonIndex(); /*
|
||||
return THIS->DragButtonIndex;
|
||||
*/
|
||||
|
||||
private native void nSetDragButtonIndex(int value); /*
|
||||
THIS->DragButtonIndex = value;
|
||||
*/
|
||||
|
||||
public int getSelectButtonIndex() {
|
||||
return nGetSelectButtonIndex();
|
||||
}
|
||||
|
||||
public void setSelectButtonIndex(final int value) {
|
||||
nSetSelectButtonIndex(value);
|
||||
}
|
||||
|
||||
private native int nGetSelectButtonIndex(); /*
|
||||
return THIS->SelectButtonIndex;
|
||||
*/
|
||||
|
||||
private native void nSetSelectButtonIndex(int value); /*
|
||||
THIS->SelectButtonIndex = value;
|
||||
*/
|
||||
|
||||
public int getNavigateButtonIndex() {
|
||||
return nGetNavigateButtonIndex();
|
||||
}
|
||||
|
||||
public void setNavigateButtonIndex(final int value) {
|
||||
nSetNavigateButtonIndex(value);
|
||||
}
|
||||
|
||||
private native int nGetNavigateButtonIndex(); /*
|
||||
return THIS->NavigateButtonIndex;
|
||||
*/
|
||||
|
||||
private native void nSetNavigateButtonIndex(int value); /*
|
||||
THIS->NavigateButtonIndex = value;
|
||||
*/
|
||||
|
||||
public int getContextMenuButtonIndex() {
|
||||
return nGetContextMenuButtonIndex();
|
||||
}
|
||||
|
||||
public void setContextMenuButtonIndex(final int value) {
|
||||
nSetContextMenuButtonIndex(value);
|
||||
}
|
||||
|
||||
private native int nGetContextMenuButtonIndex(); /*
|
||||
return THIS->ContextMenuButtonIndex;
|
||||
*/
|
||||
|
||||
private native void nSetContextMenuButtonIndex(int value); /*
|
||||
THIS->ContextMenuButtonIndex = value;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package imgui.extension.nodeditor;
|
||||
|
||||
import imgui.binding.ImGuiStruct;
|
||||
|
||||
public final class NodeEditorContext extends ImGuiStruct {
|
||||
public NodeEditorContext(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,582 @@
|
||||
package imgui.extension.nodeditor;
|
||||
|
||||
import imgui.ImVec2;
|
||||
import imgui.ImVec4;
|
||||
import imgui.binding.ImGuiStruct;
|
||||
|
||||
public final class NodeEditorStyle extends ImGuiStruct {
|
||||
public NodeEditorStyle(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_nodeeditor.h"
|
||||
#define THIS ((ax::NodeEditor::Style*)STRUCT_PTR)
|
||||
*/
|
||||
|
||||
public ImVec4 getNodePadding() {
|
||||
final ImVec4 dst = new ImVec4();
|
||||
nGetNodePadding(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getNodePaddingX() {
|
||||
return nGetNodePaddingX();
|
||||
}
|
||||
|
||||
public float getNodePaddingY() {
|
||||
return nGetNodePaddingY();
|
||||
}
|
||||
|
||||
public float getNodePaddingZ() {
|
||||
return nGetNodePaddingZ();
|
||||
}
|
||||
|
||||
public float getNodePaddingW() {
|
||||
return nGetNodePaddingW();
|
||||
}
|
||||
|
||||
public void getNodePadding(final ImVec4 dst) {
|
||||
nGetNodePadding(dst);
|
||||
}
|
||||
|
||||
public void setNodePadding(final ImVec4 value) {
|
||||
nSetNodePadding(value.x, value.y, value.z, value.w);
|
||||
}
|
||||
|
||||
public void setNodePadding(final float valueX, final float valueY, final float valueZ, final float valueW) {
|
||||
nSetNodePadding(valueX, valueY, valueZ, valueW);
|
||||
}
|
||||
|
||||
private native void nGetNodePadding(ImVec4 dst); /*
|
||||
Jni::ImVec4Cpy(env, THIS->NodePadding, dst);
|
||||
*/
|
||||
|
||||
private native float nGetNodePaddingX(); /*
|
||||
return THIS->NodePadding.x;
|
||||
*/
|
||||
|
||||
private native float nGetNodePaddingY(); /*
|
||||
return THIS->NodePadding.y;
|
||||
*/
|
||||
|
||||
private native float nGetNodePaddingZ(); /*
|
||||
return THIS->NodePadding.z;
|
||||
*/
|
||||
|
||||
private native float nGetNodePaddingW(); /*
|
||||
return THIS->NodePadding.w;
|
||||
*/
|
||||
|
||||
private native void nSetNodePadding(float valueX, float valueY, float valueZ, float valueW); /*MANUAL
|
||||
ImVec4 value = ImVec4(valueX, valueY, valueZ, valueW);
|
||||
THIS->NodePadding = value;
|
||||
*/
|
||||
|
||||
public float getNodeRounding() {
|
||||
return nGetNodeRounding();
|
||||
}
|
||||
|
||||
public void setNodeRounding(final float value) {
|
||||
nSetNodeRounding(value);
|
||||
}
|
||||
|
||||
private native float nGetNodeRounding(); /*
|
||||
return THIS->NodeRounding;
|
||||
*/
|
||||
|
||||
private native void nSetNodeRounding(float value); /*
|
||||
THIS->NodeRounding = value;
|
||||
*/
|
||||
|
||||
public float getNodeBorderWidth() {
|
||||
return nGetNodeBorderWidth();
|
||||
}
|
||||
|
||||
public void setNodeBorderWidth(final float value) {
|
||||
nSetNodeBorderWidth(value);
|
||||
}
|
||||
|
||||
private native float nGetNodeBorderWidth(); /*
|
||||
return THIS->NodeBorderWidth;
|
||||
*/
|
||||
|
||||
private native void nSetNodeBorderWidth(float value); /*
|
||||
THIS->NodeBorderWidth = value;
|
||||
*/
|
||||
|
||||
public float getHoveredNodeBorderWidth() {
|
||||
return nGetHoveredNodeBorderWidth();
|
||||
}
|
||||
|
||||
public void setHoveredNodeBorderWidth(final float value) {
|
||||
nSetHoveredNodeBorderWidth(value);
|
||||
}
|
||||
|
||||
private native float nGetHoveredNodeBorderWidth(); /*
|
||||
return THIS->HoveredNodeBorderWidth;
|
||||
*/
|
||||
|
||||
private native void nSetHoveredNodeBorderWidth(float value); /*
|
||||
THIS->HoveredNodeBorderWidth = value;
|
||||
*/
|
||||
|
||||
public float getSelectedNodeBorderWidth() {
|
||||
return nGetSelectedNodeBorderWidth();
|
||||
}
|
||||
|
||||
public void setSelectedNodeBorderWidth(final float value) {
|
||||
nSetSelectedNodeBorderWidth(value);
|
||||
}
|
||||
|
||||
private native float nGetSelectedNodeBorderWidth(); /*
|
||||
return THIS->SelectedNodeBorderWidth;
|
||||
*/
|
||||
|
||||
private native void nSetSelectedNodeBorderWidth(float value); /*
|
||||
THIS->SelectedNodeBorderWidth = value;
|
||||
*/
|
||||
|
||||
public float getPinRounding() {
|
||||
return nGetPinRounding();
|
||||
}
|
||||
|
||||
public void setPinRounding(final float value) {
|
||||
nSetPinRounding(value);
|
||||
}
|
||||
|
||||
private native float nGetPinRounding(); /*
|
||||
return THIS->PinRounding;
|
||||
*/
|
||||
|
||||
private native void nSetPinRounding(float value); /*
|
||||
THIS->PinRounding = value;
|
||||
*/
|
||||
|
||||
public float getPinBorderWidth() {
|
||||
return nGetPinBorderWidth();
|
||||
}
|
||||
|
||||
public void setPinBorderWidth(final float value) {
|
||||
nSetPinBorderWidth(value);
|
||||
}
|
||||
|
||||
private native float nGetPinBorderWidth(); /*
|
||||
return THIS->PinBorderWidth;
|
||||
*/
|
||||
|
||||
private native void nSetPinBorderWidth(float value); /*
|
||||
THIS->PinBorderWidth = value;
|
||||
*/
|
||||
|
||||
public float getLinkStrength() {
|
||||
return nGetLinkStrength();
|
||||
}
|
||||
|
||||
public void setLinkStrength(final float value) {
|
||||
nSetLinkStrength(value);
|
||||
}
|
||||
|
||||
private native float nGetLinkStrength(); /*
|
||||
return THIS->LinkStrength;
|
||||
*/
|
||||
|
||||
private native void nSetLinkStrength(float value); /*
|
||||
THIS->LinkStrength = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getSourceDirection() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetSourceDirection(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getSourceDirectionX() {
|
||||
return nGetSourceDirectionX();
|
||||
}
|
||||
|
||||
public float getSourceDirectionY() {
|
||||
return nGetSourceDirectionY();
|
||||
}
|
||||
|
||||
public void getSourceDirection(final ImVec2 dst) {
|
||||
nGetSourceDirection(dst);
|
||||
}
|
||||
|
||||
public void setSourceDirection(final ImVec2 value) {
|
||||
nSetSourceDirection(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setSourceDirection(final float valueX, final float valueY) {
|
||||
nSetSourceDirection(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetSourceDirection(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->SourceDirection, dst);
|
||||
*/
|
||||
|
||||
private native float nGetSourceDirectionX(); /*
|
||||
return THIS->SourceDirection.x;
|
||||
*/
|
||||
|
||||
private native float nGetSourceDirectionY(); /*
|
||||
return THIS->SourceDirection.y;
|
||||
*/
|
||||
|
||||
private native void nSetSourceDirection(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->SourceDirection = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getTargetDirection() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetTargetDirection(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getTargetDirectionX() {
|
||||
return nGetTargetDirectionX();
|
||||
}
|
||||
|
||||
public float getTargetDirectionY() {
|
||||
return nGetTargetDirectionY();
|
||||
}
|
||||
|
||||
public void getTargetDirection(final ImVec2 dst) {
|
||||
nGetTargetDirection(dst);
|
||||
}
|
||||
|
||||
public void setTargetDirection(final ImVec2 value) {
|
||||
nSetTargetDirection(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setTargetDirection(final float valueX, final float valueY) {
|
||||
nSetTargetDirection(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetTargetDirection(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->TargetDirection, dst);
|
||||
*/
|
||||
|
||||
private native float nGetTargetDirectionX(); /*
|
||||
return THIS->TargetDirection.x;
|
||||
*/
|
||||
|
||||
private native float nGetTargetDirectionY(); /*
|
||||
return THIS->TargetDirection.y;
|
||||
*/
|
||||
|
||||
private native void nSetTargetDirection(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->TargetDirection = value;
|
||||
*/
|
||||
|
||||
public float getScrollDuration() {
|
||||
return nGetScrollDuration();
|
||||
}
|
||||
|
||||
public void setScrollDuration(final float value) {
|
||||
nSetScrollDuration(value);
|
||||
}
|
||||
|
||||
private native float nGetScrollDuration(); /*
|
||||
return THIS->ScrollDuration;
|
||||
*/
|
||||
|
||||
private native void nSetScrollDuration(float value); /*
|
||||
THIS->ScrollDuration = value;
|
||||
*/
|
||||
|
||||
public float getFlowMarkerDistance() {
|
||||
return nGetFlowMarkerDistance();
|
||||
}
|
||||
|
||||
public void setFlowMarkerDistance(final float value) {
|
||||
nSetFlowMarkerDistance(value);
|
||||
}
|
||||
|
||||
private native float nGetFlowMarkerDistance(); /*
|
||||
return THIS->FlowMarkerDistance;
|
||||
*/
|
||||
|
||||
private native void nSetFlowMarkerDistance(float value); /*
|
||||
THIS->FlowMarkerDistance = value;
|
||||
*/
|
||||
|
||||
public float getFlowSpeed() {
|
||||
return nGetFlowSpeed();
|
||||
}
|
||||
|
||||
public void setFlowSpeed(final float value) {
|
||||
nSetFlowSpeed(value);
|
||||
}
|
||||
|
||||
private native float nGetFlowSpeed(); /*
|
||||
return THIS->FlowSpeed;
|
||||
*/
|
||||
|
||||
private native void nSetFlowSpeed(float value); /*
|
||||
THIS->FlowSpeed = value;
|
||||
*/
|
||||
|
||||
public float getFlowDuration() {
|
||||
return nGetFlowDuration();
|
||||
}
|
||||
|
||||
public void setFlowDuration(final float value) {
|
||||
nSetFlowDuration(value);
|
||||
}
|
||||
|
||||
private native float nGetFlowDuration(); /*
|
||||
return THIS->FlowDuration;
|
||||
*/
|
||||
|
||||
private native void nSetFlowDuration(float value); /*
|
||||
THIS->FlowDuration = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getPivotAlignment() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetPivotAlignment(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getPivotAlignmentX() {
|
||||
return nGetPivotAlignmentX();
|
||||
}
|
||||
|
||||
public float getPivotAlignmentY() {
|
||||
return nGetPivotAlignmentY();
|
||||
}
|
||||
|
||||
public void getPivotAlignment(final ImVec2 dst) {
|
||||
nGetPivotAlignment(dst);
|
||||
}
|
||||
|
||||
public void setPivotAlignment(final ImVec2 value) {
|
||||
nSetPivotAlignment(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setPivotAlignment(final float valueX, final float valueY) {
|
||||
nSetPivotAlignment(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetPivotAlignment(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->PivotAlignment, dst);
|
||||
*/
|
||||
|
||||
private native float nGetPivotAlignmentX(); /*
|
||||
return THIS->PivotAlignment.x;
|
||||
*/
|
||||
|
||||
private native float nGetPivotAlignmentY(); /*
|
||||
return THIS->PivotAlignment.y;
|
||||
*/
|
||||
|
||||
private native void nSetPivotAlignment(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->PivotAlignment = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getPivotSize() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetPivotSize(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getPivotSizeX() {
|
||||
return nGetPivotSizeX();
|
||||
}
|
||||
|
||||
public float getPivotSizeY() {
|
||||
return nGetPivotSizeY();
|
||||
}
|
||||
|
||||
public void getPivotSize(final ImVec2 dst) {
|
||||
nGetPivotSize(dst);
|
||||
}
|
||||
|
||||
public void setPivotSize(final ImVec2 value) {
|
||||
nSetPivotSize(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setPivotSize(final float valueX, final float valueY) {
|
||||
nSetPivotSize(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetPivotSize(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->PivotSize, dst);
|
||||
*/
|
||||
|
||||
private native float nGetPivotSizeX(); /*
|
||||
return THIS->PivotSize.x;
|
||||
*/
|
||||
|
||||
private native float nGetPivotSizeY(); /*
|
||||
return THIS->PivotSize.y;
|
||||
*/
|
||||
|
||||
private native void nSetPivotSize(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->PivotSize = value;
|
||||
*/
|
||||
|
||||
public ImVec2 getPivotScale() {
|
||||
final ImVec2 dst = new ImVec2();
|
||||
nGetPivotScale(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public float getPivotScaleX() {
|
||||
return nGetPivotScaleX();
|
||||
}
|
||||
|
||||
public float getPivotScaleY() {
|
||||
return nGetPivotScaleY();
|
||||
}
|
||||
|
||||
public void getPivotScale(final ImVec2 dst) {
|
||||
nGetPivotScale(dst);
|
||||
}
|
||||
|
||||
public void setPivotScale(final ImVec2 value) {
|
||||
nSetPivotScale(value.x, value.y);
|
||||
}
|
||||
|
||||
public void setPivotScale(final float valueX, final float valueY) {
|
||||
nSetPivotScale(valueX, valueY);
|
||||
}
|
||||
|
||||
private native void nGetPivotScale(ImVec2 dst); /*
|
||||
Jni::ImVec2Cpy(env, THIS->PivotScale, dst);
|
||||
*/
|
||||
|
||||
private native float nGetPivotScaleX(); /*
|
||||
return THIS->PivotScale.x;
|
||||
*/
|
||||
|
||||
private native float nGetPivotScaleY(); /*
|
||||
return THIS->PivotScale.y;
|
||||
*/
|
||||
|
||||
private native void nSetPivotScale(float valueX, float valueY); /*MANUAL
|
||||
ImVec2 value = ImVec2(valueX, valueY);
|
||||
THIS->PivotScale = value;
|
||||
*/
|
||||
|
||||
public float getPinCorners() {
|
||||
return nGetPinCorners();
|
||||
}
|
||||
|
||||
public void setPinCorners(final float value) {
|
||||
nSetPinCorners(value);
|
||||
}
|
||||
|
||||
private native float nGetPinCorners(); /*
|
||||
return THIS->PinCorners;
|
||||
*/
|
||||
|
||||
private native void nSetPinCorners(float value); /*
|
||||
THIS->PinCorners = value;
|
||||
*/
|
||||
|
||||
public float getPinRadius() {
|
||||
return nGetPinRadius();
|
||||
}
|
||||
|
||||
public void setPinRadius(final float value) {
|
||||
nSetPinRadius(value);
|
||||
}
|
||||
|
||||
private native float nGetPinRadius(); /*
|
||||
return THIS->PinRadius;
|
||||
*/
|
||||
|
||||
private native void nSetPinRadius(float value); /*
|
||||
THIS->PinRadius = value;
|
||||
*/
|
||||
|
||||
public float getPinArrowSize() {
|
||||
return nGetPinArrowSize();
|
||||
}
|
||||
|
||||
public void setPinArrowSize(final float value) {
|
||||
nSetPinArrowSize(value);
|
||||
}
|
||||
|
||||
private native float nGetPinArrowSize(); /*
|
||||
return THIS->PinArrowSize;
|
||||
*/
|
||||
|
||||
private native void nSetPinArrowSize(float value); /*
|
||||
THIS->PinArrowSize = value;
|
||||
*/
|
||||
|
||||
public float getPinArrowWidth() {
|
||||
return nGetPinArrowWidth();
|
||||
}
|
||||
|
||||
public void setPinArrowWidth(final float value) {
|
||||
nSetPinArrowWidth(value);
|
||||
}
|
||||
|
||||
private native float nGetPinArrowWidth(); /*
|
||||
return THIS->PinArrowWidth;
|
||||
*/
|
||||
|
||||
private native void nSetPinArrowWidth(float value); /*
|
||||
THIS->PinArrowWidth = value;
|
||||
*/
|
||||
|
||||
public float getGroupRounding() {
|
||||
return nGetGroupRounding();
|
||||
}
|
||||
|
||||
public void setGroupRounding(final float value) {
|
||||
nSetGroupRounding(value);
|
||||
}
|
||||
|
||||
private native float nGetGroupRounding(); /*
|
||||
return THIS->GroupRounding;
|
||||
*/
|
||||
|
||||
private native void nSetGroupRounding(float value); /*
|
||||
THIS->GroupRounding = value;
|
||||
*/
|
||||
|
||||
public float getGroupBorderWidth() {
|
||||
return nGetGroupBorderWidth();
|
||||
}
|
||||
|
||||
public void setGroupBorderWidth(final float value) {
|
||||
nSetGroupBorderWidth(value);
|
||||
}
|
||||
|
||||
private native float nGetGroupBorderWidth(); /*
|
||||
return THIS->GroupBorderWidth;
|
||||
*/
|
||||
|
||||
private native void nSetGroupBorderWidth(float value); /*
|
||||
THIS->GroupBorderWidth = value;
|
||||
*/
|
||||
|
||||
public ImVec4[] getColors() {
|
||||
return nGetColors();
|
||||
}
|
||||
|
||||
public void setColors(final ImVec4[] value) {
|
||||
nSetColors(value);
|
||||
}
|
||||
|
||||
private native ImVec4[] nGetColors(); /*
|
||||
return Jni::NewImVec4Array(env, THIS->Colors, ax::NodeEditor::StyleColor_Count);
|
||||
*/
|
||||
|
||||
private native void nSetColors(ImVec4[] value); /*
|
||||
Jni::ImVec4ArrayCpy(env, value, THIS->Colors, ax::NodeEditor::StyleColor_Count);
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package imgui.extension.nodeditor.flag;
|
||||
|
||||
|
||||
public final class NodeEditorFlowDirection {
|
||||
private NodeEditorFlowDirection() {
|
||||
}
|
||||
|
||||
public static final int Forward = 0;
|
||||
|
||||
public static final int Backward = 1;
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package imgui.extension.nodeditor.flag;
|
||||
|
||||
|
||||
public final class NodeEditorPinKind {
|
||||
private NodeEditorPinKind() {
|
||||
}
|
||||
|
||||
public static final int Input = 0;
|
||||
|
||||
public static final int Output = 1;
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package imgui.extension.nodeditor.flag;
|
||||
|
||||
|
||||
public final class NodeEditorStyleColor {
|
||||
private NodeEditorStyleColor() {
|
||||
}
|
||||
|
||||
public static final int Bg = 0;
|
||||
|
||||
public static final int Grid = 1;
|
||||
|
||||
public static final int NodeBg = 2;
|
||||
|
||||
public static final int NodeBorder = 3;
|
||||
|
||||
public static final int HovNodeBorder = 4;
|
||||
|
||||
public static final int SelNodeBorder = 5;
|
||||
|
||||
public static final int NodeSelRect = 6;
|
||||
|
||||
public static final int NodeSelRectBorder = 7;
|
||||
|
||||
public static final int HovLinkBorder = 8;
|
||||
|
||||
public static final int SelLinkBorder = 9;
|
||||
|
||||
public static final int LinkSelRect = 10;
|
||||
|
||||
public static final int LinkSelRectBorder = 11;
|
||||
|
||||
public static final int PinRect = 12;
|
||||
|
||||
public static final int PinRectBorder = 13;
|
||||
|
||||
public static final int Flow = 14;
|
||||
|
||||
public static final int FlowMarker = 15;
|
||||
|
||||
public static final int GroupBg = 16;
|
||||
|
||||
public static final int GroupBorder = 17;
|
||||
|
||||
public static final int Count = 18;
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package imgui.extension.nodeditor.flag;
|
||||
|
||||
|
||||
public final class NodeEditorStyleVar {
|
||||
private NodeEditorStyleVar() {
|
||||
}
|
||||
|
||||
public static final int NodePadding = 0;
|
||||
|
||||
public static final int NodeRounding = 1;
|
||||
|
||||
public static final int NodeBorderWidth = 2;
|
||||
|
||||
public static final int HoveredNodeBorderWidth = 3;
|
||||
|
||||
public static final int SelectedNodeBorderWidth = 4;
|
||||
|
||||
public static final int PinRounding = 5;
|
||||
|
||||
public static final int PinBorderWidth = 6;
|
||||
|
||||
public static final int LinkStrength = 7;
|
||||
|
||||
public static final int SourceDirection = 8;
|
||||
|
||||
public static final int TargetDirection = 9;
|
||||
|
||||
public static final int ScrollDuration = 10;
|
||||
|
||||
public static final int FlowMarkerDistance = 11;
|
||||
|
||||
public static final int FlowSpeed = 12;
|
||||
|
||||
public static final int FlowDuration = 13;
|
||||
|
||||
public static final int PivotAlignment = 14;
|
||||
|
||||
public static final int PivotSize = 15;
|
||||
|
||||
public static final int PivotScale = 16;
|
||||
|
||||
public static final int PinCorners = 17;
|
||||
|
||||
public static final int PinRadius = 18;
|
||||
|
||||
public static final int PinArrowSize = 19;
|
||||
|
||||
public static final int PinArrowWidth = 20;
|
||||
|
||||
public static final int GroupRounding = 21;
|
||||
|
||||
public static final int GroupBorderWidth = 22;
|
||||
|
||||
public static final int Count = 23;
|
||||
}
|
||||
@@ -0,0 +1,761 @@
|
||||
package imgui.extension.texteditor;
|
||||
|
||||
import imgui.ImVec2;
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public final class TextEditor extends ImGuiStructDestroyable {
|
||||
public TextEditor() {
|
||||
}
|
||||
|
||||
public TextEditor(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate();
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_texteditor.h"
|
||||
#define THIS ((TextEditor*)STRUCT_PTR)
|
||||
#define TextEditorLanguageDefinition TextEditor::LanguageDefinition
|
||||
*/
|
||||
|
||||
private native long nCreate(); /*
|
||||
return (intptr_t)(new TextEditor());
|
||||
*/
|
||||
|
||||
public void setLanguageDefinition(final TextEditorLanguageDefinition aLanguageDef) {
|
||||
nSetLanguageDefinition(aLanguageDef.ptr);
|
||||
}
|
||||
|
||||
private native void nSetLanguageDefinition(long aLanguageDef); /*
|
||||
THIS->SetLanguageDefinition(*reinterpret_cast<TextEditorLanguageDefinition*>(aLanguageDef));
|
||||
*/
|
||||
|
||||
public TextEditorLanguageDefinition getLanguageDefinition() {
|
||||
return new TextEditorLanguageDefinition(nGetLanguageDefinition());
|
||||
}
|
||||
|
||||
private native long nGetLanguageDefinition(); /*
|
||||
return (intptr_t)&THIS->GetLanguageDefinition();
|
||||
*/
|
||||
|
||||
public native int[] getPalette(); /*
|
||||
const auto& palette = THIS->GetPalette();
|
||||
jintArray res = env->NewIntArray(palette.size());
|
||||
jint arr[palette.size()];
|
||||
for (int i = 0; i < palette.size(); i++) {
|
||||
arr[i] = palette[i];
|
||||
}
|
||||
env->SetIntArrayRegion(res, 0, palette.size(), arr);
|
||||
return res;
|
||||
*/
|
||||
|
||||
public void setPalette(final int[] palette) {
|
||||
nSetPalette(palette, palette.length);
|
||||
}
|
||||
|
||||
public native void nSetPalette(int[] palette, int length); /*
|
||||
std::array<ImU32, (unsigned)TextEditor::PaletteIndex::Max> arr;
|
||||
for (int i = 0; i < length; i++) {
|
||||
arr[i] = palette[i];
|
||||
}
|
||||
THIS->SetPalette(arr);
|
||||
*/
|
||||
|
||||
public void setErrorMarkers(final Map<Integer, String> errorMarkers) {
|
||||
final int[] keys = errorMarkers.keySet().stream().mapToInt(i -> i).toArray();
|
||||
final String[] values = errorMarkers.values().toArray(new String[0]);
|
||||
nSetErrorMarkers(keys, keys.length, values, values.length);
|
||||
}
|
||||
|
||||
private native void nSetErrorMarkers(int[] keys, int keysLen, String[] values, int valuesLen); /*
|
||||
std::map<int, std::string> markers;
|
||||
for (int i = 0; i < keysLen; i++) {
|
||||
int key = keys[i];
|
||||
jstring string = (jstring)env->GetObjectArrayElement(values, i);
|
||||
const char* value = env->GetStringUTFChars(string, JNI_FALSE);
|
||||
markers.emplace(std::pair<int, std::string>(key, std::string(value)));
|
||||
env->ReleaseStringUTFChars(string, value);
|
||||
}
|
||||
THIS->SetErrorMarkers(markers);
|
||||
*/
|
||||
|
||||
public void setBreakpoints(final int[] breakpoints) {
|
||||
nSetBreakpoints(breakpoints, breakpoints.length);
|
||||
}
|
||||
|
||||
private native void nSetBreakpoints(int[] breakpoints, int length); /*
|
||||
std::unordered_set<int> set;
|
||||
for (int i = 0; i < length; i++) {
|
||||
set.emplace(breakpoints[i]);
|
||||
}
|
||||
THIS->SetBreakpoints(set);
|
||||
*/
|
||||
|
||||
public void render(final String title) {
|
||||
nRender(title);
|
||||
}
|
||||
|
||||
public void render(final String title, final ImVec2 aSize) {
|
||||
nRender(title, aSize.x, aSize.y);
|
||||
}
|
||||
|
||||
public void render(final String title, final float aSizeX, final float aSizeY) {
|
||||
nRender(title, aSizeX, aSizeY);
|
||||
}
|
||||
|
||||
public void render(final String title, final ImVec2 aSize, final boolean aBorder) {
|
||||
nRender(title, aSize.x, aSize.y, aBorder);
|
||||
}
|
||||
|
||||
public void render(final String title, final float aSizeX, final float aSizeY, final boolean aBorder) {
|
||||
nRender(title, aSizeX, aSizeY, aBorder);
|
||||
}
|
||||
|
||||
public void render(final String title, final boolean aBorder) {
|
||||
nRender(title, aBorder);
|
||||
}
|
||||
|
||||
private native void nRender(String title); /*MANUAL
|
||||
auto title = obj_title == NULL ? NULL : (char*)env->GetStringUTFChars(obj_title, JNI_FALSE);
|
||||
THIS->Render(title);
|
||||
if (title != NULL) env->ReleaseStringUTFChars(obj_title, title);
|
||||
*/
|
||||
|
||||
private native void nRender(String title, float aSizeX, float aSizeY); /*MANUAL
|
||||
auto title = obj_title == NULL ? NULL : (char*)env->GetStringUTFChars(obj_title, JNI_FALSE);
|
||||
ImVec2 aSize = ImVec2(aSizeX, aSizeY);
|
||||
THIS->Render(title, aSize);
|
||||
if (title != NULL) env->ReleaseStringUTFChars(obj_title, title);
|
||||
*/
|
||||
|
||||
private native void nRender(String title, float aSizeX, float aSizeY, boolean aBorder); /*MANUAL
|
||||
auto title = obj_title == NULL ? NULL : (char*)env->GetStringUTFChars(obj_title, JNI_FALSE);
|
||||
ImVec2 aSize = ImVec2(aSizeX, aSizeY);
|
||||
THIS->Render(title, aSize, aBorder);
|
||||
if (title != NULL) env->ReleaseStringUTFChars(obj_title, title);
|
||||
*/
|
||||
|
||||
private native void nRender(String title, boolean aBorder); /*MANUAL
|
||||
auto title = obj_title == NULL ? NULL : (char*)env->GetStringUTFChars(obj_title, JNI_FALSE);
|
||||
THIS->Render(title, ImVec2(), aBorder);
|
||||
if (title != NULL) env->ReleaseStringUTFChars(obj_title, title);
|
||||
*/
|
||||
|
||||
public void setText(final String text) {
|
||||
nSetText(text);
|
||||
}
|
||||
|
||||
private native void nSetText(String text); /*MANUAL
|
||||
auto text = obj_text == NULL ? NULL : (char*)env->GetStringUTFChars(obj_text, JNI_FALSE);
|
||||
THIS->SetText(text);
|
||||
if (text != NULL) env->ReleaseStringUTFChars(obj_text, text);
|
||||
*/
|
||||
|
||||
public String getText() {
|
||||
return nGetText();
|
||||
}
|
||||
|
||||
private native String nGetText(); /*
|
||||
return env->NewStringUTF(THIS->GetText().c_str());
|
||||
*/
|
||||
|
||||
public void setTextLines(final String[] lines) {
|
||||
nSetTextLines(lines, lines.length);
|
||||
}
|
||||
|
||||
private native void nSetTextLines(String[] lines, int length); /*
|
||||
std::vector<std::string> vec;
|
||||
vec.reserve(length);
|
||||
for (int i = 0; i < length; i++) {
|
||||
jstring string = (jstring)env->GetObjectArrayElement(lines, i);
|
||||
const char* raw = env->GetStringUTFChars(string, JNI_FALSE);
|
||||
vec.emplace_back(std::string(raw));
|
||||
env->ReleaseStringUTFChars(string, raw);
|
||||
}
|
||||
THIS->SetTextLines(vec);
|
||||
*/
|
||||
|
||||
public native String[] getTextLines(); /*
|
||||
const auto lines = THIS->GetTextLines();
|
||||
|
||||
jobjectArray arr = env->NewObjectArray(
|
||||
lines.size(),
|
||||
env->FindClass("java/lang/String"),
|
||||
env->NewStringUTF("")
|
||||
);
|
||||
|
||||
for (int i = 0; i < lines.size(); i++) {
|
||||
const auto& str = lines[i];
|
||||
env->SetObjectArrayElement(arr, i, env->NewStringUTF(str.c_str()));
|
||||
}
|
||||
return arr;
|
||||
*/
|
||||
|
||||
public String getSelectedText() {
|
||||
return nGetSelectedText();
|
||||
}
|
||||
|
||||
private native String nGetSelectedText(); /*
|
||||
return env->NewStringUTF(THIS->GetSelectedText().c_str());
|
||||
*/
|
||||
|
||||
public String getCurrentLineText() {
|
||||
return nGetCurrentLineText();
|
||||
}
|
||||
|
||||
private native String nGetCurrentLineText(); /*
|
||||
return env->NewStringUTF(THIS->GetCurrentLineText().c_str());
|
||||
*/
|
||||
|
||||
public int getTotalLines() {
|
||||
return nGetTotalLines();
|
||||
}
|
||||
|
||||
private native int nGetTotalLines(); /*
|
||||
return THIS->GetTotalLines();
|
||||
*/
|
||||
|
||||
public boolean isOverwrite() {
|
||||
return nIsOverwrite();
|
||||
}
|
||||
|
||||
private native boolean nIsOverwrite(); /*
|
||||
return THIS->IsOverwrite();
|
||||
*/
|
||||
|
||||
public void setReadOnly(final boolean aValue) {
|
||||
nSetReadOnly(aValue);
|
||||
}
|
||||
|
||||
private native void nSetReadOnly(boolean aValue); /*
|
||||
THIS->SetReadOnly(aValue);
|
||||
*/
|
||||
|
||||
public boolean isReadOnly() {
|
||||
return nIsReadOnly();
|
||||
}
|
||||
|
||||
private native boolean nIsReadOnly(); /*
|
||||
return THIS->IsReadOnly();
|
||||
*/
|
||||
|
||||
public boolean isTextChanged() {
|
||||
return nIsTextChanged();
|
||||
}
|
||||
|
||||
private native boolean nIsTextChanged(); /*
|
||||
return THIS->IsTextChanged();
|
||||
*/
|
||||
|
||||
public boolean isCursorPositionChanged() {
|
||||
return nIsCursorPositionChanged();
|
||||
}
|
||||
|
||||
private native boolean nIsCursorPositionChanged(); /*
|
||||
return THIS->IsCursorPositionChanged();
|
||||
*/
|
||||
|
||||
public boolean isColorizerEnabled() {
|
||||
return nIsColorizerEnabled();
|
||||
}
|
||||
|
||||
private native boolean nIsColorizerEnabled(); /*
|
||||
return THIS->IsColorizerEnabled();
|
||||
*/
|
||||
|
||||
public void setColorizerEnable(final boolean aValue) {
|
||||
nSetColorizerEnable(aValue);
|
||||
}
|
||||
|
||||
private native void nSetColorizerEnable(boolean aValue); /*
|
||||
THIS->SetColorizerEnable(aValue);
|
||||
*/
|
||||
|
||||
public TextEditorCoordinates getCursorPosition() {
|
||||
final TextEditorCoordinates dst = new TextEditorCoordinates();
|
||||
nGetCursorPosition(dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
public void getCursorPosition(final TextEditorCoordinates dst) {
|
||||
nGetCursorPosition(dst);
|
||||
}
|
||||
|
||||
private native void nGetCursorPosition(TextEditorCoordinates dst); /*
|
||||
Jni::TextEditorCoordinatesCpy(env, THIS->GetCursorPosition(), dst);
|
||||
*/
|
||||
|
||||
public void setCursorPosition(final TextEditorCoordinates aPosition) {
|
||||
nSetCursorPosition(aPosition.mLine, aPosition.mColumn);
|
||||
}
|
||||
|
||||
public void setCursorPosition(final int aPositionLine, final int aPositionColumn) {
|
||||
nSetCursorPosition(aPositionLine, aPositionColumn);
|
||||
}
|
||||
|
||||
private native void nSetCursorPosition(int aPositionLine, int aPositionColumn); /*
|
||||
THIS->SetCursorPosition(TextEditor::Coordinates(aPositionLine, aPositionColumn));
|
||||
*/
|
||||
|
||||
public void setHandleMouseInputs(final boolean aValue) {
|
||||
nSetHandleMouseInputs(aValue);
|
||||
}
|
||||
|
||||
private native void nSetHandleMouseInputs(boolean aValue); /*
|
||||
THIS->SetHandleMouseInputs(aValue);
|
||||
*/
|
||||
|
||||
public boolean isHandleMouseInputsEnabled() {
|
||||
return nIsHandleMouseInputsEnabled();
|
||||
}
|
||||
|
||||
private native boolean nIsHandleMouseInputsEnabled(); /*
|
||||
return THIS->IsHandleMouseInputsEnabled();
|
||||
*/
|
||||
|
||||
public void setHandleKeyboardInputs(final boolean aValue) {
|
||||
nSetHandleKeyboardInputs(aValue);
|
||||
}
|
||||
|
||||
private native void nSetHandleKeyboardInputs(boolean aValue); /*
|
||||
THIS->SetHandleKeyboardInputs(aValue);
|
||||
*/
|
||||
|
||||
public boolean isHandleKeyboardInputsEnabled() {
|
||||
return nIsHandleKeyboardInputsEnabled();
|
||||
}
|
||||
|
||||
private native boolean nIsHandleKeyboardInputsEnabled(); /*
|
||||
return THIS->IsHandleKeyboardInputsEnabled();
|
||||
*/
|
||||
|
||||
public void setImGuiChildIgnored(final boolean aValue) {
|
||||
nSetImGuiChildIgnored(aValue);
|
||||
}
|
||||
|
||||
private native void nSetImGuiChildIgnored(boolean aValue); /*
|
||||
THIS->SetImGuiChildIgnored(aValue);
|
||||
*/
|
||||
|
||||
public boolean isImGuiChildIgnored() {
|
||||
return nIsImGuiChildIgnored();
|
||||
}
|
||||
|
||||
private native boolean nIsImGuiChildIgnored(); /*
|
||||
return THIS->IsImGuiChildIgnored();
|
||||
*/
|
||||
|
||||
public void setShowWhitespaces(final boolean aValue) {
|
||||
nSetShowWhitespaces(aValue);
|
||||
}
|
||||
|
||||
private native void nSetShowWhitespaces(boolean aValue); /*
|
||||
THIS->SetShowWhitespaces(aValue);
|
||||
*/
|
||||
|
||||
public boolean isShowingWhitespaces() {
|
||||
return nIsShowingWhitespaces();
|
||||
}
|
||||
|
||||
private native boolean nIsShowingWhitespaces(); /*
|
||||
return THIS->IsShowingWhitespaces();
|
||||
*/
|
||||
|
||||
public void setTabSize(final int aValue) {
|
||||
nSetTabSize(aValue);
|
||||
}
|
||||
|
||||
private native void nSetTabSize(int aValue); /*
|
||||
THIS->SetTabSize(aValue);
|
||||
*/
|
||||
|
||||
public int getTabSize() {
|
||||
return nGetTabSize();
|
||||
}
|
||||
|
||||
private native int nGetTabSize(); /*
|
||||
return THIS->GetTabSize();
|
||||
*/
|
||||
|
||||
public void insertText(final String aValue) {
|
||||
nInsertText(aValue);
|
||||
}
|
||||
|
||||
private native void nInsertText(String aValue); /*MANUAL
|
||||
auto aValue = obj_aValue == NULL ? NULL : (char*)env->GetStringUTFChars(obj_aValue, JNI_FALSE);
|
||||
THIS->InsertText(aValue);
|
||||
if (aValue != NULL) env->ReleaseStringUTFChars(obj_aValue, aValue);
|
||||
*/
|
||||
|
||||
public void moveUp() {
|
||||
nMoveUp();
|
||||
}
|
||||
|
||||
public void moveUp(final int aAmount) {
|
||||
nMoveUp(aAmount);
|
||||
}
|
||||
|
||||
public void moveUp(final int aAmount, final boolean aSelect) {
|
||||
nMoveUp(aAmount, aSelect);
|
||||
}
|
||||
|
||||
private native void nMoveUp(); /*
|
||||
THIS->MoveUp();
|
||||
*/
|
||||
|
||||
private native void nMoveUp(int aAmount); /*
|
||||
THIS->MoveUp(aAmount);
|
||||
*/
|
||||
|
||||
private native void nMoveUp(int aAmount, boolean aSelect); /*
|
||||
THIS->MoveUp(aAmount, aSelect);
|
||||
*/
|
||||
|
||||
public void moveDown() {
|
||||
nMoveDown();
|
||||
}
|
||||
|
||||
public void moveDown(final int aAmount) {
|
||||
nMoveDown(aAmount);
|
||||
}
|
||||
|
||||
public void moveDown(final int aAmount, final boolean aSelect) {
|
||||
nMoveDown(aAmount, aSelect);
|
||||
}
|
||||
|
||||
private native void nMoveDown(); /*
|
||||
THIS->MoveDown();
|
||||
*/
|
||||
|
||||
private native void nMoveDown(int aAmount); /*
|
||||
THIS->MoveDown(aAmount);
|
||||
*/
|
||||
|
||||
private native void nMoveDown(int aAmount, boolean aSelect); /*
|
||||
THIS->MoveDown(aAmount, aSelect);
|
||||
*/
|
||||
|
||||
public void moveLeft() {
|
||||
nMoveLeft();
|
||||
}
|
||||
|
||||
public void moveLeft(final int aAmount) {
|
||||
nMoveLeft(aAmount);
|
||||
}
|
||||
|
||||
public void moveLeft(final int aAmount, final boolean aSelect) {
|
||||
nMoveLeft(aAmount, aSelect);
|
||||
}
|
||||
|
||||
public void moveLeft(final int aAmount, final boolean aSelect, final boolean aWordMode) {
|
||||
nMoveLeft(aAmount, aSelect, aWordMode);
|
||||
}
|
||||
|
||||
private native void nMoveLeft(); /*
|
||||
THIS->MoveLeft();
|
||||
*/
|
||||
|
||||
private native void nMoveLeft(int aAmount); /*
|
||||
THIS->MoveLeft(aAmount);
|
||||
*/
|
||||
|
||||
private native void nMoveLeft(int aAmount, boolean aSelect); /*
|
||||
THIS->MoveLeft(aAmount, aSelect);
|
||||
*/
|
||||
|
||||
private native void nMoveLeft(int aAmount, boolean aSelect, boolean aWordMode); /*
|
||||
THIS->MoveLeft(aAmount, aSelect, aWordMode);
|
||||
*/
|
||||
|
||||
public void moveRight() {
|
||||
nMoveRight();
|
||||
}
|
||||
|
||||
public void moveRight(final int aAmount) {
|
||||
nMoveRight(aAmount);
|
||||
}
|
||||
|
||||
public void moveRight(final int aAmount, final boolean aSelect) {
|
||||
nMoveRight(aAmount, aSelect);
|
||||
}
|
||||
|
||||
public void moveRight(final int aAmount, final boolean aSelect, final boolean aWordMode) {
|
||||
nMoveRight(aAmount, aSelect, aWordMode);
|
||||
}
|
||||
|
||||
private native void nMoveRight(); /*
|
||||
THIS->MoveRight();
|
||||
*/
|
||||
|
||||
private native void nMoveRight(int aAmount); /*
|
||||
THIS->MoveRight(aAmount);
|
||||
*/
|
||||
|
||||
private native void nMoveRight(int aAmount, boolean aSelect); /*
|
||||
THIS->MoveRight(aAmount, aSelect);
|
||||
*/
|
||||
|
||||
private native void nMoveRight(int aAmount, boolean aSelect, boolean aWordMode); /*
|
||||
THIS->MoveRight(aAmount, aSelect, aWordMode);
|
||||
*/
|
||||
|
||||
public void moveTop() {
|
||||
nMoveTop();
|
||||
}
|
||||
|
||||
public void moveTop(final boolean aSelect) {
|
||||
nMoveTop(aSelect);
|
||||
}
|
||||
|
||||
private native void nMoveTop(); /*
|
||||
THIS->MoveTop();
|
||||
*/
|
||||
|
||||
private native void nMoveTop(boolean aSelect); /*
|
||||
THIS->MoveTop(aSelect);
|
||||
*/
|
||||
|
||||
public void moveBottom() {
|
||||
nMoveBottom();
|
||||
}
|
||||
|
||||
public void moveBottom(final boolean aSelect) {
|
||||
nMoveBottom(aSelect);
|
||||
}
|
||||
|
||||
private native void nMoveBottom(); /*
|
||||
THIS->MoveBottom();
|
||||
*/
|
||||
|
||||
private native void nMoveBottom(boolean aSelect); /*
|
||||
THIS->MoveBottom(aSelect);
|
||||
*/
|
||||
|
||||
public void moveHome() {
|
||||
nMoveHome();
|
||||
}
|
||||
|
||||
public void moveHome(final boolean aSelect) {
|
||||
nMoveHome(aSelect);
|
||||
}
|
||||
|
||||
private native void nMoveHome(); /*
|
||||
THIS->MoveHome();
|
||||
*/
|
||||
|
||||
private native void nMoveHome(boolean aSelect); /*
|
||||
THIS->MoveHome(aSelect);
|
||||
*/
|
||||
|
||||
public void moveEnd() {
|
||||
nMoveEnd();
|
||||
}
|
||||
|
||||
public void moveEnd(final boolean aSelect) {
|
||||
nMoveEnd(aSelect);
|
||||
}
|
||||
|
||||
private native void nMoveEnd(); /*
|
||||
THIS->MoveEnd();
|
||||
*/
|
||||
|
||||
private native void nMoveEnd(boolean aSelect); /*
|
||||
THIS->MoveEnd(aSelect);
|
||||
*/
|
||||
|
||||
public void setSelectionStart(final TextEditorCoordinates aPosition) {
|
||||
nSetSelectionStart(aPosition.mLine, aPosition.mColumn);
|
||||
}
|
||||
|
||||
public void setSelectionStart(final int aPositionLine, final int aPositionColumn) {
|
||||
nSetSelectionStart(aPositionLine, aPositionColumn);
|
||||
}
|
||||
|
||||
private native void nSetSelectionStart(int aPositionLine, int aPositionColumn); /*
|
||||
THIS->SetSelectionStart(TextEditor::Coordinates(aPositionLine, aPositionColumn));
|
||||
*/
|
||||
|
||||
public void setSelectionEnd(final TextEditorCoordinates aPosition) {
|
||||
nSetSelectionEnd(aPosition.mLine, aPosition.mColumn);
|
||||
}
|
||||
|
||||
public void setSelectionEnd(final int aPositionLine, final int aPositionColumn) {
|
||||
nSetSelectionEnd(aPositionLine, aPositionColumn);
|
||||
}
|
||||
|
||||
private native void nSetSelectionEnd(int aPositionLine, int aPositionColumn); /*
|
||||
THIS->SetSelectionEnd(TextEditor::Coordinates(aPositionLine, aPositionColumn));
|
||||
*/
|
||||
|
||||
public void setSelection(final TextEditorCoordinates aStart, final TextEditorCoordinates aEnd) {
|
||||
nSetSelection(aStart.mLine, aStart.mColumn, aEnd.mLine, aEnd.mColumn);
|
||||
}
|
||||
|
||||
public void setSelection(final int aStartLine, final int aStartColumn, final int aEndLine, final int aEndColumn) {
|
||||
nSetSelection(aStartLine, aStartColumn, aEndLine, aEndColumn);
|
||||
}
|
||||
|
||||
public void setSelection(final TextEditorCoordinates aStart, final TextEditorCoordinates aEnd, final int aMode) {
|
||||
nSetSelection(aStart.mLine, aStart.mColumn, aEnd.mLine, aEnd.mColumn, aMode);
|
||||
}
|
||||
|
||||
public void setSelection(final int aStartLine, final int aStartColumn, final int aEndLine, final int aEndColumn, final int aMode) {
|
||||
nSetSelection(aStartLine, aStartColumn, aEndLine, aEndColumn, aMode);
|
||||
}
|
||||
|
||||
private native void nSetSelection(int aStartLine, int aStartColumn, int aEndLine, int aEndColumn); /*
|
||||
THIS->SetSelection(TextEditor::Coordinates(aStartLine, aStartColumn), TextEditor::Coordinates(aEndLine, aEndColumn));
|
||||
*/
|
||||
|
||||
private native void nSetSelection(int aStartLine, int aStartColumn, int aEndLine, int aEndColumn, int aMode); /*
|
||||
THIS->SetSelection(TextEditor::Coordinates(aStartLine, aStartColumn), TextEditor::Coordinates(aEndLine, aEndColumn), static_cast<TextEditor::SelectionMode>(aMode));
|
||||
*/
|
||||
|
||||
public void selectWordUnderCursor() {
|
||||
nSelectWordUnderCursor();
|
||||
}
|
||||
|
||||
private native void nSelectWordUnderCursor(); /*
|
||||
THIS->SelectWordUnderCursor();
|
||||
*/
|
||||
|
||||
public void selectAll() {
|
||||
nSelectAll();
|
||||
}
|
||||
|
||||
private native void nSelectAll(); /*
|
||||
THIS->SelectAll();
|
||||
*/
|
||||
|
||||
public boolean hasSelection() {
|
||||
return nHasSelection();
|
||||
}
|
||||
|
||||
private native boolean nHasSelection(); /*
|
||||
return THIS->HasSelection();
|
||||
*/
|
||||
|
||||
public void copy() {
|
||||
nCopy();
|
||||
}
|
||||
|
||||
private native void nCopy(); /*
|
||||
THIS->Copy();
|
||||
*/
|
||||
|
||||
public void cut() {
|
||||
nCut();
|
||||
}
|
||||
|
||||
private native void nCut(); /*
|
||||
THIS->Cut();
|
||||
*/
|
||||
|
||||
public void paste() {
|
||||
nPaste();
|
||||
}
|
||||
|
||||
private native void nPaste(); /*
|
||||
THIS->Paste();
|
||||
*/
|
||||
|
||||
public void delete() {
|
||||
nDelete();
|
||||
}
|
||||
|
||||
private native void nDelete(); /*
|
||||
THIS->Delete();
|
||||
*/
|
||||
|
||||
public boolean canUndo() {
|
||||
return nCanUndo();
|
||||
}
|
||||
|
||||
private native boolean nCanUndo(); /*
|
||||
return THIS->CanUndo();
|
||||
*/
|
||||
|
||||
public boolean canRedo() {
|
||||
return nCanRedo();
|
||||
}
|
||||
|
||||
private native boolean nCanRedo(); /*
|
||||
return THIS->CanRedo();
|
||||
*/
|
||||
|
||||
public void undo() {
|
||||
nUndo();
|
||||
}
|
||||
|
||||
public void undo(final int aSteps) {
|
||||
nUndo(aSteps);
|
||||
}
|
||||
|
||||
private native void nUndo(); /*
|
||||
THIS->Undo();
|
||||
*/
|
||||
|
||||
private native void nUndo(int aSteps); /*
|
||||
THIS->Undo(aSteps);
|
||||
*/
|
||||
|
||||
public void redo() {
|
||||
nRedo();
|
||||
}
|
||||
|
||||
public void redo(final int aSteps) {
|
||||
nRedo(aSteps);
|
||||
}
|
||||
|
||||
private native void nRedo(); /*
|
||||
THIS->Redo();
|
||||
*/
|
||||
|
||||
private native void nRedo(int aSteps); /*
|
||||
THIS->Redo(aSteps);
|
||||
*/
|
||||
|
||||
public native int[] getDarkPalette(); /*
|
||||
const auto& palette = THIS->GetDarkPalette();
|
||||
jintArray res = env->NewIntArray(palette.size());
|
||||
jint arr[palette.size()];
|
||||
for (int i = 0; i < palette.size(); i++) {
|
||||
arr[i] = palette[i];
|
||||
}
|
||||
env->SetIntArrayRegion(res, 0, palette.size(), arr);
|
||||
return res;
|
||||
*/
|
||||
|
||||
public native int[] getLightPalette(); /*
|
||||
const auto& palette = THIS->GetLightPalette();
|
||||
jintArray res = env->NewIntArray(palette.size());
|
||||
jint arr[palette.size()];
|
||||
for (int i = 0; i < palette.size(); i++) {
|
||||
arr[i] = palette[i];
|
||||
}
|
||||
env->SetIntArrayRegion(res, 0, palette.size(), arr);
|
||||
return res;
|
||||
*/
|
||||
|
||||
public native int[] getRetroBluePalette(); /*
|
||||
const auto& palette = THIS->GetRetroBluePalette();
|
||||
jintArray res = env->NewIntArray(palette.size());
|
||||
jint arr[palette.size()];
|
||||
for (int i = 0; i < palette.size(); i++) {
|
||||
arr[i] = palette[i];
|
||||
}
|
||||
env->SetIntArrayRegion(res, 0, palette.size(), arr);
|
||||
return res;
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef TextEditorLanguageDefinition
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package imgui.extension.texteditor;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public final class TextEditorCoordinates implements Cloneable {
|
||||
public int mLine;
|
||||
public int mColumn;
|
||||
|
||||
public TextEditorCoordinates() {
|
||||
}
|
||||
|
||||
public TextEditorCoordinates(final int mLine, final int mColumn) {
|
||||
set(mLine, mColumn);
|
||||
}
|
||||
|
||||
public TextEditorCoordinates(final TextEditorCoordinates value) {
|
||||
set(value.mLine, value.mColumn);
|
||||
}
|
||||
|
||||
public TextEditorCoordinates set(final int mLine, final int mColumn) {
|
||||
this.mLine = mLine;
|
||||
this.mColumn = mColumn;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TextEditorCoordinates set(final TextEditorCoordinates value) {
|
||||
return set(value.mLine, value.mColumn);
|
||||
}
|
||||
|
||||
public TextEditorCoordinates plus(final int mLine, final int mColumn) {
|
||||
this.mLine += mLine;
|
||||
this.mColumn += mColumn;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TextEditorCoordinates plus(final TextEditorCoordinates value) {
|
||||
return plus(value.mLine, value.mColumn);
|
||||
}
|
||||
|
||||
public TextEditorCoordinates minus(final int mLine, final int mColumn) {
|
||||
this.mLine -= mLine;
|
||||
this.mColumn -= mColumn;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TextEditorCoordinates minus(final TextEditorCoordinates value) {
|
||||
return minus(value.mLine, value.mColumn);
|
||||
}
|
||||
|
||||
public TextEditorCoordinates times(final int mLine, final int mColumn) {
|
||||
this.mLine *= mLine;
|
||||
this.mColumn *= mColumn;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TextEditorCoordinates times(final TextEditorCoordinates value) {
|
||||
return times(value.mLine, value.mColumn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TextEditorCoordinates{"
|
||||
+ "mLine=" + mLine
|
||||
+ ", mColumn=" + mColumn
|
||||
+ '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final TextEditorCoordinates textEditorCoordinates = (TextEditorCoordinates) o;
|
||||
return textEditorCoordinates.mLine == mLine && textEditorCoordinates.mColumn == mColumn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(mLine, mColumn);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("MethodDoesntCallSuperMethod")
|
||||
public TextEditorCoordinates clone() {
|
||||
return new TextEditorCoordinates(this);
|
||||
}
|
||||
}
|
||||
+313
@@ -0,0 +1,313 @@
|
||||
package imgui.extension.texteditor;
|
||||
|
||||
import imgui.binding.ImGuiStructDestroyable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public final class TextEditorLanguageDefinition extends ImGuiStructDestroyable {
|
||||
public TextEditorLanguageDefinition() {
|
||||
}
|
||||
|
||||
public TextEditorLanguageDefinition(final long ptr) {
|
||||
super(ptr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long create() {
|
||||
return nCreate();
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include "_texteditor.h"
|
||||
#define THIS ((TextEditor::LanguageDefinition*)STRUCT_PTR)
|
||||
#define TextEditorLanguageDefinition TextEditor::LanguageDefinition
|
||||
*/
|
||||
|
||||
private native long nCreate(); /*
|
||||
return (intptr_t)(new TextEditor::LanguageDefinition());
|
||||
*/
|
||||
|
||||
public String getName() {
|
||||
return nGetName();
|
||||
}
|
||||
|
||||
public void setName(final String value) {
|
||||
nSetName(value);
|
||||
}
|
||||
|
||||
private native String nGetName(); /*
|
||||
return env->NewStringUTF(THIS->mName.c_str());
|
||||
*/
|
||||
|
||||
private native void nSetName(String value); /*MANUAL
|
||||
auto value = obj_value == NULL ? NULL : (char*)env->GetStringUTFChars(obj_value, JNI_FALSE);
|
||||
THIS->mName = value;
|
||||
if (value != NULL) env->ReleaseStringUTFChars(obj_value, value);
|
||||
*/
|
||||
|
||||
public void setKeywords(final String[] keywords) {
|
||||
nSetKeywords(keywords, keywords.length);
|
||||
}
|
||||
|
||||
private native void nSetKeywords(String[] keywords, int length); /*
|
||||
std::unordered_set<std::string> set;
|
||||
for (int i = 0; i < length; i++) {
|
||||
jstring string = (jstring)env->GetObjectArrayElement(keywords, i);
|
||||
const char* raw = env->GetStringUTFChars(string, JNI_FALSE);
|
||||
set.emplace(std::string(raw));
|
||||
env->ReleaseStringUTFChars(string, raw);
|
||||
}
|
||||
THIS->mKeywords = set;
|
||||
*/
|
||||
|
||||
public void setIdentifiers(final Map<String, String> identifiers) {
|
||||
final String[] keys = identifiers.keySet().toArray(new String[0]);
|
||||
final String[] decl = identifiers.values().toArray(new String[0]);
|
||||
nSetIdentifiers(keys, keys.length, decl, decl.length);
|
||||
}
|
||||
|
||||
private native void nSetIdentifiers(String[] keys, int keysLen, String[] decl, int declLen); /*
|
||||
std::unordered_map<std::string, TextEditor::Identifier> identifiers;
|
||||
for (int i = 0; i < keysLen; i++) {
|
||||
jstring string1 = (jstring)env->GetObjectArrayElement(keys, i);
|
||||
jstring string2 = (jstring)env->GetObjectArrayElement(decl, i);
|
||||
const char* key = env->GetStringUTFChars(string1, JNI_FALSE);
|
||||
const char* value = env->GetStringUTFChars(string2, JNI_FALSE);
|
||||
TextEditor::Identifier id;
|
||||
id.mDeclaration = std::string(value);
|
||||
identifiers.insert(std::pair<std::string, TextEditor::Identifier>(std::string(key), id));
|
||||
env->ReleaseStringUTFChars(string1, key);
|
||||
env->ReleaseStringUTFChars(string2, value);
|
||||
}
|
||||
THIS->mIdentifiers = identifiers;
|
||||
*/
|
||||
|
||||
public void setPreprocIdentifiers(final Map<String, String> identifiers) {
|
||||
final String[] keys = identifiers.keySet().toArray(new String[0]);
|
||||
final String[] decl = identifiers.values().toArray(new String[0]);
|
||||
nSetPreprocIdentifiers(keys, keys.length, decl, decl.length);
|
||||
}
|
||||
|
||||
private native void nSetPreprocIdentifiers(String[] keys, int keysLen, String[] decl, int declLen); /*
|
||||
std::unordered_map<std::string, TextEditor::Identifier> preprocIdentifiers;
|
||||
for (int i = 0; i < keysLen; i++) {
|
||||
jstring string1 = (jstring)env->GetObjectArrayElement(keys, i);
|
||||
jstring string2 = (jstring)env->GetObjectArrayElement(decl, i);
|
||||
const char* key = env->GetStringUTFChars(string1, JNI_FALSE);
|
||||
const char* value = env->GetStringUTFChars(string2, JNI_FALSE);
|
||||
TextEditor::Identifier id;
|
||||
id.mDeclaration = std::string(value);
|
||||
preprocIdentifiers.insert(std::pair<std::string, TextEditor::Identifier>(std::string(key), id));
|
||||
env->ReleaseStringUTFChars(string1, key);
|
||||
env->ReleaseStringUTFChars(string2, value);
|
||||
}
|
||||
THIS->mPreprocIdentifiers = preprocIdentifiers;
|
||||
*/
|
||||
|
||||
public String getCommentStart() {
|
||||
return nGetCommentStart();
|
||||
}
|
||||
|
||||
public void setCommentStart(final String value) {
|
||||
nSetCommentStart(value);
|
||||
}
|
||||
|
||||
private native String nGetCommentStart(); /*
|
||||
return env->NewStringUTF(THIS->mCommentStart.c_str());
|
||||
*/
|
||||
|
||||
private native void nSetCommentStart(String value); /*MANUAL
|
||||
auto value = obj_value == NULL ? NULL : (char*)env->GetStringUTFChars(obj_value, JNI_FALSE);
|
||||
THIS->mCommentStart = value;
|
||||
if (value != NULL) env->ReleaseStringUTFChars(obj_value, value);
|
||||
*/
|
||||
|
||||
public String getCommentEnd() {
|
||||
return nGetCommentEnd();
|
||||
}
|
||||
|
||||
public void setCommentEnd(final String value) {
|
||||
nSetCommentEnd(value);
|
||||
}
|
||||
|
||||
private native String nGetCommentEnd(); /*
|
||||
return env->NewStringUTF(THIS->mCommentEnd.c_str());
|
||||
*/
|
||||
|
||||
private native void nSetCommentEnd(String value); /*MANUAL
|
||||
auto value = obj_value == NULL ? NULL : (char*)env->GetStringUTFChars(obj_value, JNI_FALSE);
|
||||
THIS->mCommentEnd = value;
|
||||
if (value != NULL) env->ReleaseStringUTFChars(obj_value, value);
|
||||
*/
|
||||
|
||||
public String getSingleLineComment() {
|
||||
return nGetSingleLineComment();
|
||||
}
|
||||
|
||||
public void setSingleLineComment(final String value) {
|
||||
nSetSingleLineComment(value);
|
||||
}
|
||||
|
||||
private native String nGetSingleLineComment(); /*
|
||||
return env->NewStringUTF(THIS->mSingleLineComment.c_str());
|
||||
*/
|
||||
|
||||
private native void nSetSingleLineComment(String value); /*MANUAL
|
||||
auto value = obj_value == NULL ? NULL : (char*)env->GetStringUTFChars(obj_value, JNI_FALSE);
|
||||
THIS->mSingleLineComment = value;
|
||||
if (value != NULL) env->ReleaseStringUTFChars(obj_value, value);
|
||||
*/
|
||||
|
||||
public char getPreprocChar() {
|
||||
return nGetPreprocChar();
|
||||
}
|
||||
|
||||
public void setPreprocChar(final char value) {
|
||||
nSetPreprocChar(value);
|
||||
}
|
||||
|
||||
private native char nGetPreprocChar(); /*
|
||||
return THIS->mPreprocChar;
|
||||
*/
|
||||
|
||||
private native void nSetPreprocChar(char value); /*
|
||||
THIS->mPreprocChar = value;
|
||||
*/
|
||||
|
||||
public boolean getAutoIndentation() {
|
||||
return nGetAutoIndentation();
|
||||
}
|
||||
|
||||
public void setAutoIndentation(final boolean value) {
|
||||
nSetAutoIndentation(value);
|
||||
}
|
||||
|
||||
private native boolean nGetAutoIndentation(); /*
|
||||
return THIS->mAutoIndentation;
|
||||
*/
|
||||
|
||||
private native void nSetAutoIndentation(boolean value); /*
|
||||
THIS->mAutoIndentation = value;
|
||||
*/
|
||||
|
||||
public void setTokenRegexStrings(final Map<String, Integer> tokenRegexStrings) {
|
||||
final String[] keys = tokenRegexStrings.keySet().toArray(new String[0]);
|
||||
final int[] paletteIndexes = tokenRegexStrings.values().stream().mapToInt(i -> i).toArray();
|
||||
nSetTokenRegexStrings(keys, keys.length, paletteIndexes, paletteIndexes.length);
|
||||
}
|
||||
|
||||
private native void nSetTokenRegexStrings(String[] keys, int keysLen, int[] paletteIndexes, int paletteIndexesLen); /*
|
||||
std::vector<std::pair<std::string, TextEditor::PaletteIndex>> tokenRegexStrings;
|
||||
for (int i = 0; i < keysLen; i++) {
|
||||
jstring string = (jstring)env->GetObjectArrayElement(keys, i);
|
||||
const char* key = env->GetStringUTFChars(string, JNI_FALSE);
|
||||
int value = paletteIndexes[i];
|
||||
tokenRegexStrings.emplace_back(
|
||||
std::pair<std::string, TextEditor::PaletteIndex>(
|
||||
std::string(key),
|
||||
static_cast<TextEditor::PaletteIndex>(value)
|
||||
)
|
||||
);
|
||||
env->ReleaseStringUTFChars(string, key);
|
||||
}
|
||||
THIS->mTokenRegexStrings = tokenRegexStrings;
|
||||
*/
|
||||
|
||||
public boolean getmCaseSensitive() {
|
||||
return nGetmCaseSensitive();
|
||||
}
|
||||
|
||||
public void setmCaseSensitive(final boolean value) {
|
||||
nSetmCaseSensitive(value);
|
||||
}
|
||||
|
||||
private native boolean nGetmCaseSensitive(); /*
|
||||
return THIS->mCaseSensitive;
|
||||
*/
|
||||
|
||||
private native void nSetmCaseSensitive(boolean value); /*
|
||||
THIS->mCaseSensitive = value;
|
||||
*/
|
||||
|
||||
private static final TextEditorLanguageDefinition _CPLUSPLUS_1 = new TextEditorLanguageDefinition(0);
|
||||
|
||||
public static TextEditorLanguageDefinition CPlusPlus() {
|
||||
_CPLUSPLUS_1.ptr = nCPlusPlus();
|
||||
return _CPLUSPLUS_1;
|
||||
}
|
||||
|
||||
private static native long nCPlusPlus(); /*
|
||||
return (intptr_t)&TextEditorLanguageDefinition::CPlusPlus();
|
||||
*/
|
||||
|
||||
private static final TextEditorLanguageDefinition _HLSL_1 = new TextEditorLanguageDefinition(0);
|
||||
|
||||
public static TextEditorLanguageDefinition HLSL() {
|
||||
_HLSL_1.ptr = nHLSL();
|
||||
return _HLSL_1;
|
||||
}
|
||||
|
||||
private static native long nHLSL(); /*
|
||||
return (intptr_t)&TextEditorLanguageDefinition::HLSL();
|
||||
*/
|
||||
|
||||
private static final TextEditorLanguageDefinition _GLSL_1 = new TextEditorLanguageDefinition(0);
|
||||
|
||||
public static TextEditorLanguageDefinition GLSL() {
|
||||
_GLSL_1.ptr = nGLSL();
|
||||
return _GLSL_1;
|
||||
}
|
||||
|
||||
private static native long nGLSL(); /*
|
||||
return (intptr_t)&TextEditorLanguageDefinition::GLSL();
|
||||
*/
|
||||
|
||||
private static final TextEditorLanguageDefinition _C_1 = new TextEditorLanguageDefinition(0);
|
||||
|
||||
public static TextEditorLanguageDefinition C() {
|
||||
_C_1.ptr = nC();
|
||||
return _C_1;
|
||||
}
|
||||
|
||||
private static native long nC(); /*
|
||||
return (intptr_t)&TextEditorLanguageDefinition::C();
|
||||
*/
|
||||
|
||||
private static final TextEditorLanguageDefinition _SQL_1 = new TextEditorLanguageDefinition(0);
|
||||
|
||||
public static TextEditorLanguageDefinition SQL() {
|
||||
_SQL_1.ptr = nSQL();
|
||||
return _SQL_1;
|
||||
}
|
||||
|
||||
private static native long nSQL(); /*
|
||||
return (intptr_t)&TextEditorLanguageDefinition::SQL();
|
||||
*/
|
||||
|
||||
private static final TextEditorLanguageDefinition _ANGELSCRIPT_1 = new TextEditorLanguageDefinition(0);
|
||||
|
||||
public static TextEditorLanguageDefinition AngelScript() {
|
||||
_ANGELSCRIPT_1.ptr = nAngelScript();
|
||||
return _ANGELSCRIPT_1;
|
||||
}
|
||||
|
||||
private static native long nAngelScript(); /*
|
||||
return (intptr_t)&TextEditorLanguageDefinition::AngelScript();
|
||||
*/
|
||||
|
||||
private static final TextEditorLanguageDefinition _LUA_1 = new TextEditorLanguageDefinition(0);
|
||||
|
||||
public static TextEditorLanguageDefinition Lua() {
|
||||
_LUA_1.ptr = nLua();
|
||||
return _LUA_1;
|
||||
}
|
||||
|
||||
private static native long nLua(); /*
|
||||
return (intptr_t)&TextEditorLanguageDefinition::Lua();
|
||||
*/
|
||||
|
||||
/*JNI
|
||||
#undef TextEditorLanguageDefinition
|
||||
#undef THIS
|
||||
*/
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package imgui.extension.texteditor.flag;
|
||||
|
||||
|
||||
public final class TextEditorPaletteIndex {
|
||||
private TextEditorPaletteIndex() {
|
||||
}
|
||||
|
||||
public static final int Default = 0;
|
||||
|
||||
public static final int Keyword = 1;
|
||||
|
||||
public static final int Number = 2;
|
||||
|
||||
public static final int String = 3;
|
||||
|
||||
public static final int CharLiteral = 4;
|
||||
|
||||
public static final int Punctuation = 5;
|
||||
|
||||
public static final int Preprocessor = 6;
|
||||
|
||||
public static final int Identifier = 7;
|
||||
|
||||
public static final int KnownIdentifier = 8;
|
||||
|
||||
public static final int PreprocIdentifier = 9;
|
||||
|
||||
public static final int Comment = 10;
|
||||
|
||||
public static final int MultiLineComment = 11;
|
||||
|
||||
public static final int Background = 12;
|
||||
|
||||
public static final int Cursor = 13;
|
||||
|
||||
public static final int Selection = 14;
|
||||
|
||||
public static final int ErrorMarker = 15;
|
||||
|
||||
public static final int Breakpoint = 16;
|
||||
|
||||
public static final int LineNumber = 17;
|
||||
|
||||
public static final int CurrentLineFill = 18;
|
||||
|
||||
public static final int CurrentLineFillInactive = 19;
|
||||
|
||||
public static final int CurrentLineEdge = 20;
|
||||
|
||||
public static final int Max = 21;
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package imgui.extension.texteditor.flag;
|
||||
|
||||
|
||||
public final class TextEditorSelectionMode {
|
||||
private TextEditorSelectionMode() {
|
||||
}
|
||||
|
||||
public static final int Normal = 0;
|
||||
|
||||
public static final int Word = 1;
|
||||
|
||||
public static final int Line = 2;
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
/**
|
||||
* Flags for ImDrawList functions
|
||||
*/
|
||||
public final class ImDrawFlags {
|
||||
private ImDrawFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* PathStroke(), AddPolyline(): specify that shape should be closed (Important: this is always == 1 for legacy reason)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int Closed = 1;
|
||||
|
||||
/**
|
||||
* AddRect(), AddRectFilled(), PathRect(): enable rounding top-left corner only (when rounding{@code >}0.0f, we default to all corners). Was 0x01.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 4}
|
||||
*/
|
||||
public static final int RoundCornersTopLeft = 16;
|
||||
|
||||
/**
|
||||
* AddRect(), AddRectFilled(), PathRect(): enable rounding top-right corner only (when rounding{@code >}0.0f, we default to all corners). Was 0x02.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 5}
|
||||
*/
|
||||
public static final int RoundCornersTopRight = 32;
|
||||
|
||||
/**
|
||||
* AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-left corner only (when rounding{@code >}0.0f, we default to all corners). Was 0x04.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 6}
|
||||
*/
|
||||
public static final int RoundCornersBottomLeft = 64;
|
||||
|
||||
/**
|
||||
* AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-right corner only (when rounding{@code >}0.0f, we default to all corners). Wax 0x08.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 7}
|
||||
*/
|
||||
public static final int RoundCornersBottomRight = 128;
|
||||
|
||||
/**
|
||||
* AddRect(), AddRectFilled(), PathRect(): disable rounding on all corners (when rounding{@code >}0.0f). This is NOT zero, NOT an implicit flag!
|
||||
*
|
||||
* <p>Definition: {@code 1 << 8}
|
||||
*/
|
||||
public static final int RoundCornersNone = 256;
|
||||
|
||||
/**
|
||||
* Definition: {@code ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight}
|
||||
*/
|
||||
public static final int RoundCornersTop = 48;
|
||||
|
||||
/**
|
||||
* Definition: {@code ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight}
|
||||
*/
|
||||
public static final int RoundCornersBottom = 192;
|
||||
|
||||
/**
|
||||
* Definition: {@code ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersTopLeft}
|
||||
*/
|
||||
public static final int RoundCornersLeft = 80;
|
||||
|
||||
/**
|
||||
* Definition: {@code ImDrawFlags_RoundCornersBottomRight | ImDrawFlags_RoundCornersTopRight}
|
||||
*/
|
||||
public static final int RoundCornersRight = 160;
|
||||
|
||||
/**
|
||||
* Definition: {@code ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight | ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight}
|
||||
*/
|
||||
public static final int RoundCornersAll = 240;
|
||||
|
||||
/**
|
||||
* Default to ALL corners if none of the _RoundCornersXX flags are specified.
|
||||
*
|
||||
* <p>Definition: {@code ImDrawFlags_RoundCornersAll}
|
||||
*/
|
||||
public static final int RoundCornersDefault_ = 240;
|
||||
|
||||
/**
|
||||
* Definition: {@code ImDrawFlags_RoundCornersAll | ImDrawFlags_RoundCornersNone}
|
||||
*/
|
||||
public static final int RoundCornersMask_ = 496;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
/**
|
||||
* Flags for ImDrawList. Those are set automatically by ImGui:: functions from ImGuiIO settings, and generally not manipulated directly.
|
||||
* It is however possible to temporarily alter flags between calls to ImDrawList:: functions.
|
||||
*/
|
||||
public final class ImDrawListFlags {
|
||||
private ImDrawListFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* Enable anti-aliased lines/borders (*2 the number of triangles for 1.0f wide line or lines thin enough to be drawn using textures, otherwise *3 the number of triangles)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int AntiAliasedLines = 1;
|
||||
|
||||
/**
|
||||
* Enable anti-aliased lines/borders using textures when possible. Require backend to render with bilinear filtering.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int AntiAliasedLinesUseTex = 2;
|
||||
|
||||
/**
|
||||
* Enable anti-aliased edge around filled shapes (rounded rectangles, circles).
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int AntiAliasedFill = 4;
|
||||
|
||||
/**
|
||||
* Can emit 'VtxOffset{@code >}0' to allow large meshes. Set when 'ImGuiBackendFlags_RendererHasVtxOffset' is enabled.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int AllowVtxOffset = 8;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
/**
|
||||
* Flags for ImFontAtlas build
|
||||
*/
|
||||
public final class ImFontAtlasFlags {
|
||||
private ImFontAtlasFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* Don't round the height to next power of two
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int NoPowerOfTwoHeight = 1;
|
||||
|
||||
/**
|
||||
* Don't build software mouse cursors into the atlas (save a little texture memory)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int NoMouseCursors = 2;
|
||||
|
||||
/**
|
||||
* Don't build thick line textures into the atlas (save a little texture memory). The AntiAliasedLinesUseTex features uses them, otherwise they will be rendered using polygons (more expensive for CPU/GPU).
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int NoBakedLines = 4;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
/**
|
||||
* Backend capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom backend.
|
||||
*/
|
||||
public final class ImGuiBackendFlags {
|
||||
private ImGuiBackendFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* Backend Platform supports gamepad and currently has one connected.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int HasGamepad = 1;
|
||||
|
||||
/**
|
||||
* Backend Platform supports honoring GetMouseCursor() value to change the OS cursor shape.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int HasMouseCursors = 2;
|
||||
|
||||
/**
|
||||
* Backend Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set).
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int HasSetMousePos = 4;
|
||||
|
||||
/**
|
||||
* Backend Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int RendererHasVtxOffset = 8;
|
||||
|
||||
/**
|
||||
* Backend Platform supports multiple viewports.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 10}
|
||||
*/
|
||||
public static final int PlatformHasViewports = 1024;
|
||||
|
||||
/**
|
||||
* Backend Platform supports setting io.MouseHoveredViewport to the viewport directly under the mouse _IGNORING_ viewports with the ImGuiViewportFlags_NoInputs flag and _REGARDLESS_ of whether another viewport is focused and may be capturing the mouse. This information is _NOT EASY_ to provide correctly with most high-level engines! Don't set this without studying _carefully_ how the backends handle ImGuiViewportFlags_NoInputs!
|
||||
*
|
||||
* <p>Definition: {@code 1 << 11}
|
||||
*/
|
||||
public static final int HasMouseHoveredViewport = 2048;
|
||||
|
||||
/**
|
||||
* Backend Renderer supports multiple viewports.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 12}
|
||||
*/
|
||||
public static final int RendererHasViewports = 4096;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
public final class ImGuiButtonFlags {
|
||||
private ImGuiButtonFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* React on left mouse button (default)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int MouseButtonLeft = 1;
|
||||
|
||||
/**
|
||||
* React on right mouse button
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int MouseButtonRight = 2;
|
||||
|
||||
/**
|
||||
* React on center mouse button
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int MouseButtonMiddle = 4;
|
||||
|
||||
/**
|
||||
* [Internal]
|
||||
*
|
||||
* <p>Definition: {@code ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle}
|
||||
*/
|
||||
public static final int MouseButtonMask_ = 7;
|
||||
|
||||
/**
|
||||
* [Internal]
|
||||
*
|
||||
* <p>Definition: {@code ImGuiButtonFlags_MouseButtonLeft}
|
||||
*/
|
||||
public static final int MouseButtonDefault_ = 1;
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
/**
|
||||
* Enumeration for PushStyleColor() / PopStyleColor()
|
||||
*/
|
||||
public final class ImGuiCol {
|
||||
private ImGuiCol() {
|
||||
}
|
||||
|
||||
public static final int Text = 0;
|
||||
|
||||
public static final int TextDisabled = 1;
|
||||
|
||||
/**
|
||||
* Background of normal windows
|
||||
*/
|
||||
public static final int WindowBg = 2;
|
||||
|
||||
/**
|
||||
* Background of child windows
|
||||
*/
|
||||
public static final int ChildBg = 3;
|
||||
|
||||
/**
|
||||
* Background of popups, menus, tooltips windows
|
||||
*/
|
||||
public static final int PopupBg = 4;
|
||||
|
||||
public static final int Border = 5;
|
||||
|
||||
public static final int BorderShadow = 6;
|
||||
|
||||
/**
|
||||
* Background of checkbox, radio button, plot, slider, text input
|
||||
*/
|
||||
public static final int FrameBg = 7;
|
||||
|
||||
public static final int FrameBgHovered = 8;
|
||||
|
||||
public static final int FrameBgActive = 9;
|
||||
|
||||
public static final int TitleBg = 10;
|
||||
|
||||
public static final int TitleBgActive = 11;
|
||||
|
||||
public static final int TitleBgCollapsed = 12;
|
||||
|
||||
public static final int MenuBarBg = 13;
|
||||
|
||||
public static final int ScrollbarBg = 14;
|
||||
|
||||
public static final int ScrollbarGrab = 15;
|
||||
|
||||
public static final int ScrollbarGrabHovered = 16;
|
||||
|
||||
public static final int ScrollbarGrabActive = 17;
|
||||
|
||||
public static final int CheckMark = 18;
|
||||
|
||||
public static final int SliderGrab = 19;
|
||||
|
||||
public static final int SliderGrabActive = 20;
|
||||
|
||||
public static final int Button = 21;
|
||||
|
||||
public static final int ButtonHovered = 22;
|
||||
|
||||
public static final int ButtonActive = 23;
|
||||
|
||||
/**
|
||||
* Header* colors are used for CollapsingHeader, TreeNode, Selectable, MenuItem
|
||||
*/
|
||||
public static final int Header = 24;
|
||||
|
||||
public static final int HeaderHovered = 25;
|
||||
|
||||
public static final int HeaderActive = 26;
|
||||
|
||||
public static final int Separator = 27;
|
||||
|
||||
public static final int SeparatorHovered = 28;
|
||||
|
||||
public static final int SeparatorActive = 29;
|
||||
|
||||
public static final int ResizeGrip = 30;
|
||||
|
||||
public static final int ResizeGripHovered = 31;
|
||||
|
||||
public static final int ResizeGripActive = 32;
|
||||
|
||||
public static final int Tab = 33;
|
||||
|
||||
public static final int TabHovered = 34;
|
||||
|
||||
public static final int TabActive = 35;
|
||||
|
||||
public static final int TabUnfocused = 36;
|
||||
|
||||
public static final int TabUnfocusedActive = 37;
|
||||
|
||||
/**
|
||||
* Preview overlay color when about to docking something
|
||||
*/
|
||||
public static final int DockingPreview = 38;
|
||||
|
||||
/**
|
||||
* Background color for empty node (e.g. CentralNode with no window docked into it)
|
||||
*/
|
||||
public static final int DockingEmptyBg = 39;
|
||||
|
||||
public static final int PlotLines = 40;
|
||||
|
||||
public static final int PlotLinesHovered = 41;
|
||||
|
||||
public static final int PlotHistogram = 42;
|
||||
|
||||
public static final int PlotHistogramHovered = 43;
|
||||
|
||||
/**
|
||||
* Table header background
|
||||
*/
|
||||
public static final int TableHeaderBg = 44;
|
||||
|
||||
/**
|
||||
* Table outer and header borders (prefer using Alpha=1.0 here)
|
||||
*/
|
||||
public static final int TableBorderStrong = 45;
|
||||
|
||||
/**
|
||||
* Table inner borders (prefer using Alpha=1.0 here)
|
||||
*/
|
||||
public static final int TableBorderLight = 46;
|
||||
|
||||
/**
|
||||
* Table row background (even rows)
|
||||
*/
|
||||
public static final int TableRowBg = 47;
|
||||
|
||||
/**
|
||||
* Table row background (odd rows)
|
||||
*/
|
||||
public static final int TableRowBgAlt = 48;
|
||||
|
||||
public static final int TextSelectedBg = 49;
|
||||
|
||||
public static final int DragDropTarget = 50;
|
||||
|
||||
/**
|
||||
* Gamepad/keyboard: current highlighted item
|
||||
*/
|
||||
public static final int NavHighlight = 51;
|
||||
|
||||
/**
|
||||
* Highlight window when using CTRL+TAB
|
||||
*/
|
||||
public static final int NavWindowingHighlight = 52;
|
||||
|
||||
/**
|
||||
* Darken/colorize entire screen behind the CTRL+TAB window list, when active
|
||||
*/
|
||||
public static final int NavWindowingDimBg = 53;
|
||||
|
||||
/**
|
||||
* Darken/colorize entire screen behind a modal window, when one is active
|
||||
*/
|
||||
public static final int ModalWindowDimBg = 54;
|
||||
|
||||
public static final int COUNT = 55;
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
/**
|
||||
* Flags for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4() / ColorButton()
|
||||
*/
|
||||
public final class ImGuiColorEditFlags {
|
||||
private ImGuiColorEditFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* ColorEdit, ColorPicker, ColorButton: ignore Alpha component (will only read 3 components from the input pointer).
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int NoAlpha = 2;
|
||||
|
||||
/**
|
||||
* ColorEdit: disable picker when clicking on color square.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int NoPicker = 4;
|
||||
|
||||
/**
|
||||
* ColorEdit: disable toggling options menu when right-clicking on inputs/small preview.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int NoOptions = 8;
|
||||
|
||||
/**
|
||||
* ColorEdit, ColorPicker: disable color square preview next to the inputs. (e.g. to show only the inputs)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 4}
|
||||
*/
|
||||
public static final int NoSmallPreview = 16;
|
||||
|
||||
/**
|
||||
* ColorEdit, ColorPicker: disable inputs sliders/text widgets (e.g. to show only the small preview color square).
|
||||
*
|
||||
* <p>Definition: {@code 1 << 5}
|
||||
*/
|
||||
public static final int NoInputs = 32;
|
||||
|
||||
/**
|
||||
* ColorEdit, ColorPicker, ColorButton: disable tooltip when hovering the preview.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 6}
|
||||
*/
|
||||
public static final int NoTooltip = 64;
|
||||
|
||||
/**
|
||||
* ColorEdit, ColorPicker: disable display of inline text label (the label is still forwarded to the tooltip and picker).
|
||||
*
|
||||
* <p>Definition: {@code 1 << 7}
|
||||
*/
|
||||
public static final int NoLabel = 128;
|
||||
|
||||
/**
|
||||
* ColorPicker: disable bigger color preview on right side of the picker, use small color square preview instead.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 8}
|
||||
*/
|
||||
public static final int NoSidePreview = 256;
|
||||
|
||||
/**
|
||||
* ColorEdit: disable drag and drop target. ColorButton: disable drag and drop source.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 9}
|
||||
*/
|
||||
public static final int NoDragDrop = 512;
|
||||
|
||||
/**
|
||||
* ColorButton: disable border (which is enforced by default)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 10}
|
||||
*/
|
||||
public static final int NoBorder = 1024;
|
||||
|
||||
/**
|
||||
* ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 16}
|
||||
*/
|
||||
public static final int AlphaBar = 65536;
|
||||
|
||||
/**
|
||||
* ColorEdit, ColorPicker, ColorButton: display preview as a transparent color over a checkerboard, instead of opaque.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 17}
|
||||
*/
|
||||
public static final int AlphaPreview = 131072;
|
||||
|
||||
/**
|
||||
* ColorEdit, ColorPicker, ColorButton: display half opaque / half checkerboard, instead of opaque.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 18}
|
||||
*/
|
||||
public static final int AlphaPreviewHalf = 262144;
|
||||
|
||||
/**
|
||||
* (WIP) ColorEdit: Currently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ImGuiColorEditFlags_Float flag as well).
|
||||
*
|
||||
* <p>Definition: {@code 1 << 19}
|
||||
*/
|
||||
public static final int HDR = 524288;
|
||||
|
||||
/**
|
||||
* [Display] // ColorEdit: override _display_ type among RGB/HSV/Hex. ColorPicker: select any combination using one or more of RGB/HSV/Hex.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 20}
|
||||
*/
|
||||
public static final int DisplayRGB = 1048576;
|
||||
|
||||
/**
|
||||
* [Display] // "
|
||||
*
|
||||
* <p>Definition: {@code 1 << 21}
|
||||
*/
|
||||
public static final int DisplayHSV = 2097152;
|
||||
|
||||
/**
|
||||
* [Display] // "
|
||||
*
|
||||
* <p>Definition: {@code 1 << 22}
|
||||
*/
|
||||
public static final int DisplayHex = 4194304;
|
||||
|
||||
/**
|
||||
* [DataType] // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0..255.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 23}
|
||||
*/
|
||||
public static final int Uint8 = 8388608;
|
||||
|
||||
/**
|
||||
* [DataType] // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 24}
|
||||
*/
|
||||
public static final int Float = 16777216;
|
||||
|
||||
/**
|
||||
* [Picker] // ColorPicker: bar for Hue, rectangle for Sat/Value.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 25}
|
||||
*/
|
||||
public static final int PickerHueBar = 33554432;
|
||||
|
||||
/**
|
||||
* [Picker] // ColorPicker: wheel for Hue, triangle for Sat/Value.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 26}
|
||||
*/
|
||||
public static final int PickerHueWheel = 67108864;
|
||||
|
||||
/**
|
||||
* [Input] // ColorEdit, ColorPicker: input and output data in RGB format.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 27}
|
||||
*/
|
||||
public static final int InputRGB = 134217728;
|
||||
|
||||
/**
|
||||
* [Input] // ColorEdit, ColorPicker: input and output data in HSV format.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 28}
|
||||
*/
|
||||
public static final int InputHSV = 268435456;
|
||||
|
||||
/**
|
||||
* Defaults Options. You can set application defaults using SetColorEditOptions(). The intent is that you probably don't want to override them in most of your calls. Let the user choose via the option menu and/or call SetColorEditOptions() once during startup.
|
||||
*
|
||||
* <p>Definition: {@code ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_PickerHueBar}
|
||||
*/
|
||||
public static final int DefaultOptions_ = 177209344;
|
||||
|
||||
/**
|
||||
* [Internal] Masks
|
||||
*
|
||||
* <p>Definition: {@code ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_DisplayHex}
|
||||
*/
|
||||
public static final int DisplayMask_ = 7340032;
|
||||
|
||||
/**
|
||||
* [Internal] Masks
|
||||
*
|
||||
* <p>Definition: {@code ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_Float}
|
||||
*/
|
||||
public static final int DataTypeMask_ = 25165824;
|
||||
|
||||
/**
|
||||
* [Internal] Masks
|
||||
*
|
||||
* <p>Definition: {@code ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_PickerHueBar}
|
||||
*/
|
||||
public static final int PickerMask_ = 100663296;
|
||||
|
||||
/**
|
||||
* [Internal] Masks
|
||||
*
|
||||
* <p>Definition: {@code ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_InputHSV}
|
||||
*/
|
||||
public static final int InputMask_ = 402653184;
|
||||
|
||||
/**
|
||||
* [renamed in 1.69]
|
||||
*
|
||||
* <p>Definition: {@code ImGuiColorEditFlags_DisplayRGB}
|
||||
*/
|
||||
public static final int RGB = 1048576;
|
||||
|
||||
/**
|
||||
* [renamed in 1.69]
|
||||
*
|
||||
* <p>Definition: {@code ImGuiColorEditFlags_DisplayHSV}
|
||||
*/
|
||||
public static final int HSV = 2097152;
|
||||
|
||||
/**
|
||||
* [renamed in 1.69]
|
||||
*
|
||||
* <p>Definition: {@code ImGuiColorEditFlags_DisplayHex}
|
||||
*/
|
||||
public static final int HEX = 4194304;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
/**
|
||||
* Flags for ImGui::BeginCombo()
|
||||
*/
|
||||
public final class ImGuiComboFlags {
|
||||
private ImGuiComboFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* Align the popup toward the left by default
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int PopupAlignLeft = 1;
|
||||
|
||||
/**
|
||||
* Max ~4 items visible. Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo()
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int HeightSmall = 2;
|
||||
|
||||
/**
|
||||
* Max ~8 items visible (default)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int HeightRegular = 4;
|
||||
|
||||
/**
|
||||
* Max ~20 items visible
|
||||
*
|
||||
* <p>Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int HeightLarge = 8;
|
||||
|
||||
/**
|
||||
* As many fitting items as possible
|
||||
*
|
||||
* <p>Definition: {@code 1 << 4}
|
||||
*/
|
||||
public static final int HeightLargest = 16;
|
||||
|
||||
/**
|
||||
* Display on the preview box without the square arrow button
|
||||
*
|
||||
* <p>Definition: {@code 1 << 5}
|
||||
*/
|
||||
public static final int NoArrowButton = 32;
|
||||
|
||||
/**
|
||||
* Display only a square arrow button
|
||||
*
|
||||
* <p>Definition: {@code 1 << 6}
|
||||
*/
|
||||
public static final int NoPreview = 64;
|
||||
|
||||
/**
|
||||
* Definition: {@code ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest}
|
||||
*/
|
||||
public static final int HeightMask_ = 30;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
/**
|
||||
* Enumeration for ImGui::SetWindow***(), SetNextWindow***(), SetNextItem***() functions
|
||||
* Represent a condition.
|
||||
* Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always.
|
||||
*/
|
||||
public final class ImGuiCond {
|
||||
private ImGuiCond() {
|
||||
}
|
||||
|
||||
/**
|
||||
* No condition (always set the variable), same as _Always
|
||||
*
|
||||
* <p>Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* No condition (always set the variable)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int Always = 1;
|
||||
|
||||
/**
|
||||
* Set the variable once per runtime session (only the first call will succeed)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int Once = 2;
|
||||
|
||||
/**
|
||||
* Set the variable if the object/window has no persistently saved data (no entry in .ini file)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int FirstUseEver = 4;
|
||||
|
||||
/**
|
||||
* Set the variable if the object/window is appearing after being hidden/inactive (or the first time)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int Appearing = 8;
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
/**
|
||||
* Configuration flags stored in io.ConfigFlags. Set by user/application.
|
||||
*/
|
||||
public final class ImGuiConfigFlags {
|
||||
private ImGuiConfigFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.KeysDown[].
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int NavEnableKeyboard = 1;
|
||||
|
||||
/**
|
||||
* Master gamepad navigation enable flag. This is mostly to instruct your imgui backend to fill io.NavInputs[]. Backend also needs to set ImGuiBackendFlags_HasGamepad.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 1}
|
||||
*/
|
||||
public static final int NavEnableGamepad = 2;
|
||||
|
||||
/**
|
||||
* Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your backend, otherwise ImGui will react as if the mouse is jumping around back and forth.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int NavEnableSetMousePos = 4;
|
||||
|
||||
/**
|
||||
* Instruct navigation to not set the io.WantCaptureKeyboard flag when io.NavActive is set.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int NavNoCaptureKeyboard = 8;
|
||||
|
||||
/**
|
||||
* Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information set by the backend.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 4}
|
||||
*/
|
||||
public static final int NoMouse = 16;
|
||||
|
||||
/**
|
||||
* Instruct backend to not alter mouse cursor shape and visibility. Use if the backend cursor changes are interfering with yours and you don't want to use SetMouseCursor() to change mouse cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 5}
|
||||
*/
|
||||
public static final int NoMouseCursorChange = 32;
|
||||
|
||||
/**
|
||||
* Docking enable flags.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 6}
|
||||
*/
|
||||
public static final int DockingEnable = 64;
|
||||
|
||||
/**
|
||||
* Viewport enable flags (require both ImGuiBackendFlags_PlatformHasViewports + ImGuiBackendFlags_RendererHasViewports set by the respective backends)
|
||||
*
|
||||
* <p>Definition: {@code 1 << 10}
|
||||
*/
|
||||
public static final int ViewportsEnable = 1024;
|
||||
|
||||
/**
|
||||
* [BETA: Don't use] FIXME-DPI: Reposition and resize imgui windows when the DpiScale of a viewport changed (mostly useful for the main viewport hosting other window). Note that resizing the main window itself is up to your application.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 14}
|
||||
*/
|
||||
public static final int DpiEnableScaleViewports = 16384;
|
||||
|
||||
/**
|
||||
* [BETA: Don't use] FIXME-DPI: Request bitmap-scaled fonts to match DpiScale. This is a very low-quality workaround. The correct way to handle DPI is _currently_ to replace the atlas and/or fonts in the Platform_OnChangedViewport callback, but this is all early work in progress.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 15}
|
||||
*/
|
||||
public static final int DpiEnableScaleFonts = 32768;
|
||||
|
||||
/**
|
||||
* Application is SRGB-aware.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 20}
|
||||
*/
|
||||
public static final int IsSRGB = 1048576;
|
||||
|
||||
/**
|
||||
* Application is using a touch screen instead of a mouse.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 21}
|
||||
*/
|
||||
public static final int IsTouchScreen = 2097152;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
/**
|
||||
* A primary data type
|
||||
*/
|
||||
public final class ImGuiDataType {
|
||||
private ImGuiDataType() {
|
||||
}
|
||||
|
||||
/**
|
||||
* signed char / char (with sensible compilers)
|
||||
*/
|
||||
public static final int S8 = 0;
|
||||
|
||||
/**
|
||||
* unsigned char
|
||||
*/
|
||||
public static final int U8 = 1;
|
||||
|
||||
/**
|
||||
* short
|
||||
*/
|
||||
public static final int S16 = 2;
|
||||
|
||||
/**
|
||||
* unsigned short
|
||||
*/
|
||||
public static final int U16 = 3;
|
||||
|
||||
/**
|
||||
* int
|
||||
*/
|
||||
public static final int S32 = 4;
|
||||
|
||||
/**
|
||||
* unsigned int
|
||||
*/
|
||||
public static final int U32 = 5;
|
||||
|
||||
/**
|
||||
* long long / __int64
|
||||
*/
|
||||
public static final int S64 = 6;
|
||||
|
||||
/**
|
||||
* unsigned long long / unsigned __int64
|
||||
*/
|
||||
public static final int U64 = 7;
|
||||
|
||||
/**
|
||||
* float
|
||||
*/
|
||||
public static final int Float = 8;
|
||||
|
||||
/**
|
||||
* double
|
||||
*/
|
||||
public static final int Double = 9;
|
||||
|
||||
public static final int COUNT = 10;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
/**
|
||||
* A cardinal direction
|
||||
*/
|
||||
public final class ImGuiDir {
|
||||
private ImGuiDir() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code -1}
|
||||
*/
|
||||
public static final int None = -1;
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int Left = 0;
|
||||
|
||||
/**
|
||||
* Definition: {@code 1}
|
||||
*/
|
||||
public static final int Right = 1;
|
||||
|
||||
/**
|
||||
* Definition: {@code 2}
|
||||
*/
|
||||
public static final int Up = 2;
|
||||
|
||||
/**
|
||||
* Definition: {@code 3}
|
||||
*/
|
||||
public static final int Down = 3;
|
||||
|
||||
public static final int COUNT = 4;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package imgui.flag;
|
||||
|
||||
|
||||
/**
|
||||
* Flags for ImGui::DockSpace(), shared/inherited by child nodes.
|
||||
* (Some flags can be applied to individual nodes directly)
|
||||
*/
|
||||
public final class ImGuiDockNodeFlags {
|
||||
private ImGuiDockNodeFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition: {@code 0}
|
||||
*/
|
||||
public static final int None = 0;
|
||||
|
||||
/**
|
||||
* Shared // Don't display the dockspace node but keep it alive. Windows docked into this dockspace node won't be undocked.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 0}
|
||||
*/
|
||||
public static final int KeepAliveOnly = 1;
|
||||
|
||||
/**
|
||||
* Shared // Disable docking inside the Central Node, which will be always kept empty.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 2}
|
||||
*/
|
||||
public static final int NoDockingInCentralNode = 4;
|
||||
|
||||
/**
|
||||
* Shared // Enable passthru dockspace: 1) DockSpace() will render a ImGuiCol_WindowBg background covering everything excepted the Central Node when empty. Meaning the host window should probably use SetNextWindowBgAlpha(0.0f) prior to Begin() when using this. 2) When Central Node is empty: let inputs pass-through + won't display a DockingEmptyBg background. See demo for details.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 3}
|
||||
*/
|
||||
public static final int PassthruCentralNode = 8;
|
||||
|
||||
/**
|
||||
* Shared/Local // Disable splitting the node into smaller nodes. Useful e.g. when embedding dockspaces into a main root one (the root one may have splitting disabled to reduce confusion). Note: when turned off, existing splits will be preserved.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 4}
|
||||
*/
|
||||
public static final int NoSplit = 16;
|
||||
|
||||
/**
|
||||
* Shared/Local // Disable resizing node using the splitter/separators. Useful with programmatically setup dockspaces.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 5}
|
||||
*/
|
||||
public static final int NoResize = 32;
|
||||
|
||||
/**
|
||||
* Shared/Local // Tab bar will automatically hide when there is a single window in the dock node.
|
||||
*
|
||||
* <p>Definition: {@code 1 << 6}
|
||||
*/
|
||||
public static final int AutoHideTabBar = 64;
|
||||
}
|
||||
Loaded 100 of 323 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user