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:
SpaiR committed 2024-08-08 14:46:23 +03:00
1 parent e64df5a433
commit 8a8cd22ed6
323 files changed
+113518 -15318

No files matched your search

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