Add checkstyle to imgui-binding and make everything compliant to Java codestyle

This commit is contained in:
SpaiR committed 2020-01-01 15:50:24 +03:00
1 parent 3f7698fc67
commit 2b8828dda4
20 files changed
+1732 -1670

No files matched your search

+11 -7
View File
@@ -3,12 +3,12 @@ package imgui;
import java.util.Objects;
public final class ImBool {
boolean[] data = new boolean[]{false};
final boolean[] data = new boolean[]{false};
public ImBool() {
}
public ImBool(boolean value) {
public ImBool(final boolean value) {
data[0] = value;
}
@@ -16,7 +16,7 @@ public final class ImBool {
return data[0];
}
public void set(boolean value) {
public void set(final boolean value) {
data[0] = value;
}
@@ -26,10 +26,14 @@ public final class ImBool {
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ImBool imBool = (ImBool) o;
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ImBool imBool = (ImBool) o;
return data[0] == imBool.data[0];
}
@@ -3,12 +3,12 @@ package imgui;
import java.util.Objects;
public final class ImDouble {
double[] data = new double[]{0.0d};
final double[] data = new double[]{0.0d};
public ImDouble() {
}
public ImDouble(double value) {
public ImDouble(final double value) {
set(value);
}
@@ -16,7 +16,7 @@ public final class ImDouble {
return this.data[0];
}
public void set(double value) {
public void set(final double value) {
this.data[0] = value;
}
@@ -26,10 +26,14 @@ public final class ImDouble {
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ImDouble imDouble = (ImDouble) o;
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ImDouble imDouble = (ImDouble) o;
return data[0] == imDouble.data[0];
}
@@ -9,9 +9,9 @@ import java.nio.ByteOrder;
* BINDING NOTICE: DO NOT TRY TO MODIFY FIELDS OF THIS CLASS MANUALLY! You should only access their values after {@link ImGui#Render()} call.
*/
public final class ImDrawData {
public static int V_BUFFER_SIZE = (4 + 1) * 4;
public static int I_BUFFER_SIZE = 2;
public static int CMD_BUFFER_SIZE = (1 + 4 + 1) * 4;
public static final int V_BUFFER_SIZE = (4 + 1) * 4;
public static final int I_BUFFER_SIZE = 2;
public static final int CMD_BUFFER_SIZE = (1 + 4 + 1) * 4;
public ByteBuffer vByteBuffer;
public ByteBuffer iByteBuffer;
@@ -37,7 +37,7 @@ public final class ImDrawData {
public float framebufferScaleX;
public float framebufferScaleY;
ImDrawData(int maxVertices, int maxIndices, int maxCmd) {
ImDrawData(final int maxVertices, final int maxIndices, final int maxCmd) {
vByteBuffer = ByteBuffer.allocateDirect(maxVertices * V_BUFFER_SIZE).order(ByteOrder.nativeOrder());
iByteBuffer = ByteBuffer.allocateDirect(maxIndices * I_BUFFER_SIZE).order(ByteOrder.nativeOrder());
cmdByteBuffer = ByteBuffer.allocateDirect(maxCmd * CMD_BUFFER_SIZE).order(ByteOrder.nativeOrder());
+107 -107
View File
@@ -18,7 +18,7 @@ public final class ImDrawList {
private final int drawListType;
ImDrawList(int drawListType) {
ImDrawList(final int drawListType) {
this.drawListType = drawListType;
}
@@ -61,103 +61,103 @@ public final class ImDrawList {
*/
// Primitives
// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
// - For rectangular primitives, "pMin" and "pMax" represent the upper-left and lower-right corners.
public native void AddLine(float p1_x, float p1_y, float p2_x, float p2_y, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddLine(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), col);
public native void addLine(float p1X, float p1Y, float p2X, float p2Y, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddLine(ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), col);
*/
public native void AddLine(float p1_x, float p1_y, float p2_x, float p2_y, long col, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddLine(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), col, thickness);
public native void addLine(float p1X, float p1Y, float p2X, float p2Y, long col, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddLine(ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), col, thickness);
*/
public native void AddRect(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRect(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col);
public native void addRect(float pMinX, float pMinY, float pMaxX, float pMaxY, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRect(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col);
*/
public native void AddRect(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col, float rounding); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRect(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col, rounding);
public native void addRect(float pMinX, float pMinY, float pMaxX, float pMaxY, long col, float rounding); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRect(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding);
*/
public native void AddRect(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col, float rounding, int rounding_corners_flags); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRect(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col, rounding, rounding_corners_flags);
public native void addRect(float pMinX, float pMinY, float pMaxX, float pMaxY, long col, float rounding, int roundingCornersFlags); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRect(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding, roundingCornersFlags);
*/
public native void AddRect(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col, float rounding, int rounding_corners_flags, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRect(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col, rounding, rounding_corners_flags, thickness);
public native void addRect(float pMinX, float pMinY, float pMaxX, float pMaxY, long col, float rounding, int roundingCornersFlags, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRect(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding, roundingCornersFlags, thickness);
*/
public native void AddRectFilled(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRectFilled(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col);
public native void addRectFilled(float pMinX, float pMinY, float pMaxX, float pMaxY, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRectFilled(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col);
*/
public native void AddRectFilled(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col, float rounding); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRectFilled(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col, rounding);
public native void addRectFilled(float pMinX, float pMinY, float pMaxX, float pMaxY, long col, float rounding); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRectFilled(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding);
*/
public native void AddRectFilled(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col, float rounding, int rounding_corners_flags); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRectFilled(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col, rounding, rounding_corners_flags);
public native void addRectFilled(float pMinX, float pMinY, float pMaxX, float pMaxY, long col, float rounding, int roundingCornersFlags); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRectFilled(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding, roundingCornersFlags);
*/
public native void AddRectFilledMultiColor(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col_upr_left, long col_upr_right, long col_bot_right, long col_bot_left); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRectFilledMultiColor(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col_upr_left, col_upr_right, col_bot_right, col_bot_left);
public native void addRectFilledMultiColor(float pMinX, float pMinY, float pMaxX, float pMaxY, long colUprLeft, long colUprRight, long colBotRight, long colBotLeft); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddRectFilledMultiColor(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), colUprLeft, colUprRight, colBotRight, colBotLeft);
*/
public native void AddQuad(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddQuad(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), col);
public native void addQuad(float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, float p4X, float p4Y, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddQuad(ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), ImVec2(p4X, p4Y), col);
*/
public native void AddQuad(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, long col, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddQuad(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), col, thickness);
public native void addQuad(float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, float p4X, float p4Y, long col, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddQuad(ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), ImVec2(p4X, p4Y), col, thickness);
*/
public native void AddQuadFilled(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddQuadFilled(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), col);
public native void addQuadFilled(float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, float p4X, float p4Y, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddQuadFilled(ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), ImVec2(p4X, p4Y), col);
*/
public native void AddTriangle(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddTriangle(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), col);
public native void addTriangle(float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddTriangle(ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), col);
*/
public native void AddTriangle(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, long col, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddTriangle(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), col, thickness);
public native void addTriangle(float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, long col, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddTriangle(ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), col, thickness);
*/
public native void AddTriangleFilled(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddTriangleFilled(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), col);
public native void addTriangleFilled(float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddTriangleFilled(ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), col);
*/
public native void AddCircle(float centre_x, float centre_y, float radius, float col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircle(ImVec2(centre_x, centre_y), radius, col);
public native void addCircle(float centreX, float centreY, float radius, float col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircle(ImVec2(centreX, centreY), radius, col);
*/
public native void AddCircle(float centre_x, float centre_y, float radius, float col, int num_segments); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircle(ImVec2(centre_x, centre_y), radius, col, num_segments);
public native void addCircle(float centreX, float centreY, float radius, float col, int numSegments); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircle(ImVec2(centreX, centreY), radius, col, numSegments);
*/
public native void AddCircle(float centre_x, float centre_y, float radius, float col, int num_segments, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircle(ImVec2(centre_x, centre_y), radius, col, num_segments, thickness);
public native void addCircle(float centreX, float centreY, float radius, float col, int numSegments, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircle(ImVec2(centreX, centreY), radius, col, numSegments, thickness);
*/
public native void AddCircleFilled(float centre_x, float centre_y, float radius, float col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircleFilled(ImVec2(centre_x, centre_y), radius, col);
public native void addCircleFilled(float centreX, float centreY, float radius, float col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircleFilled(ImVec2(centreX, centreY), radius, col);
*/
public native void AddCircleFilled(float centre_x, float centre_y, float radius, float col, int num_segments); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircleFilled(ImVec2(centre_x, centre_y), radius, col, num_segments);
public native void addCircleFilled(float centreX, float centreY, float radius, float col, int numSegments); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircleFilled(ImVec2(centreX, centreY), radius, col, numSegments);
*/
public native void AddText(float pos_x, float pos_y, int col, String text_begin); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddText(ImVec2(pos_x, pos_y), col, text_begin);
public native void addText(float posX, float posY, int col, String textBegin); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddText(ImVec2(posX, posY), col, textBegin);
*/
public native void AddText(float pos_x, float pos_y, int col, String text_begin, String text_end); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddText(ImVec2(pos_x, pos_y), col, text_begin, text_end);
public native void addText(float posX, float posY, int col, String textBegin, String textEnd); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddText(ImVec2(posX, posY), col, textBegin, textEnd);
*/
// TODO add text with font support
public native void AddPolyline(ImVec2[] points, int num_points, long col, boolean closed, float thickness); /*
public native void addPolyline(ImVec2[] points, int numPoints, long col, boolean closed, float thickness); /*
int points_num = env->GetArrayLength(points);
ImVec2 _points[points_num];
for (int i = 0; i < points_num; i++) {
@@ -166,11 +166,11 @@ public final class ImDrawList {
Jni::ImVec2Cpy(env, jImVec2, &dst);
_points[i] = dst;
}
getDrawList(env->GetIntField(object, drawListTypeID))->AddPolyline(_points, num_points, col, closed, thickness);
getDrawList(env->GetIntField(object, drawListTypeID))->AddPolyline(_points, numPoints, col, closed, thickness);
*/
// Note: Anti-aliased filling requires points to be in clockwise order.
public native void AddConvexPolyFilled(ImVec2[] points, int num_points, long col); /*
public native void addConvexPolyFilled(ImVec2[] points, int numPoints, long col); /*
int points_num = env->GetArrayLength(points);
ImVec2 _points[points_num];
for (int i = 0; i < points_num; i++) {
@@ -179,153 +179,153 @@ public final class ImDrawList {
Jni::ImVec2Cpy(env, jImVec2, &dst);
_points[i] = dst;
}
getDrawList(env->GetIntField(object, drawListTypeID))->AddConvexPolyFilled(_points, num_points, col);
getDrawList(env->GetIntField(object, drawListTypeID))->AddConvexPolyFilled(_points, numPoints, col);
*/
public native void AddBezierCurve(float pos0_x, float pos0_y, float cp0_x, float cp0_y, float cp1_x, float cp1_y, float pos1_x, float pos1_y, long col, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddBezierCurve(ImVec2(pos0_x, pos0_y), ImVec2(cp0_x, cp0_y), ImVec2(cp1_x, cp1_y), ImVec2(pos1_x, pos1_y), col, thickness);
public native void addBezierCurve(float pos0X, float pos0Y, float cp0X, float cp0Y, float cp1X, float cp1Y, float pos1X, float pos1Y, long col, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddBezierCurve(ImVec2(pos0X, pos0Y), ImVec2(cp0X, cp0Y), ImVec2(cp1X, cp1Y), ImVec2(pos1X, pos1Y), col, thickness);
*/
public native void AddBezierCurve(float pos0_x, float pos0_y, float cp0_x, float cp0_y, float cp1_x, float cp1_y, float pos1_x, float pos1_y, long col, float thickness, int num_segments); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddBezierCurve(ImVec2(pos0_x, pos0_y), ImVec2(cp0_x, cp0_y), ImVec2(cp1_x, cp1_y), ImVec2(pos1_x, pos1_y), col, thickness, num_segments);
public native void addBezierCurve(float pos0X, float pos0Y, float cp0X, float cp0Y, float cp1X, float cp1Y, float pos1X, float pos1Y, long col, float thickness, int numSegments); /*
getDrawList(env->GetIntField(object, drawListTypeID))->AddBezierCurve(ImVec2(pos0X, pos0Y), ImVec2(cp0X, cp0Y), ImVec2(cp1X, cp1Y), ImVec2(pos1X, pos1Y), col, thickness, numSegments);
*/
// Image primitives
// - Read FAQ to understand what ImTextureID is.
// - "p_min" and "p_max" represent the upper-left and lower-right corners of the rectangle.
// - "uv_min" and "uv_max" represent the normalized texture coordinates to use for those corners. Using (0,0)->(1,1) texture coordinates will generally display the entire texture.
// - "pMin" and "pMax" represent the upper-left and lower-right corners of the rectangle.
// - "uvMin" and "uvMax" represent the normalized texture coordinates to use for those corners. Using (0,0)->(1,1) texture coordinates will generally display the entire texture.
public native void AddImage(int textureID, float p_min_x, float p_min_y, float p_max_x, float p_max_y); /*
public native void addImage(int textureID, float pMinX, float pMinY, float pMaxX, float pMaxY); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->AddImage((ImTextureID)textureID, ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y));
drawList->AddImage((ImTextureID)textureID, ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY));
*/
public native void AddImage(int textureID, float p_min_x, float p_min_y, float p_max_x, float p_max_y, float uv_min_x, float uv_min_y); /*
public native void addImage(int textureID, float pMinX, float pMinY, float pMaxX, float pMaxY, float uvMinX, float uvMinY); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->AddImage((ImTextureID)textureID, ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), ImVec2(uv_min_x, uv_min_y));
drawList->AddImage((ImTextureID)textureID, ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), ImVec2(uvMinX, uvMinY));
*/
public native void AddImage(int textureID, float p_min_x, float p_min_y, float p_max_x, float p_max_y, float uv_min_x, float uv_min_y, float uv_max_x, float uv_max_y); /*
public native void addImage(int textureID, float pMinX, float pMinY, float pMaxX, float pMaxY, float uvMinX, float uvMinY, float uvMaxX, float uvMaxY); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->AddImage((ImTextureID)textureID, ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), ImVec2(uv_min_x, uv_min_y), ImVec2(uv_max_x, uv_max_y));
drawList->AddImage((ImTextureID)textureID, ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), ImVec2(uvMinX, uvMinY), ImVec2(uvMaxX, uvMaxY));
*/
public native void AddImage(int textureID, float p_min_x, float p_min_y, float p_max_x, float p_max_y, float uv_min_x, float uv_min_y, float uv_max_x, float uv_max_y, long col); /*
public native void addImage(int textureID, float pMinX, float pMinY, float pMaxX, float pMaxY, float uvMinX, float uvMinY, float uvMaxX, float uvMaxY, long col); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->AddImage((ImTextureID)textureID, ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), ImVec2(uv_min_x, uv_min_y), ImVec2(uv_max_x, uv_max_y), col);
drawList->AddImage((ImTextureID)textureID, ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), ImVec2(uvMinX, uvMinY), ImVec2(uvMaxX, uvMaxY), col);
*/
public native void AddImageQuad(int textureID, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y); /*
public native void addImageQuad(int textureID, float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, float p4X, float p4Y); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y));
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), ImVec2(p4X, p4Y));
*/
public native void AddImageQuad(int textureID, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, float uv1_x, float uv1_y); /*
public native void addImageQuad(int textureID, float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, float p4X, float p4Y, float uv1X, float uv1Y); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), ImVec2(uv1_x, uv1_y));
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), ImVec2(p4X, p4Y), ImVec2(uv1X, uv1Y));
*/
public native void AddImageQuad(int textureID, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, float uv1_x, float uv1_y, float uv2_x, float uv2_y); /*
public native void addImageQuad(int textureID, float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, float p4X, float p4Y, float uv1X, float uv1Y, float uv2X, float uv2Y); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), ImVec2(uv1_x, uv1_y), ImVec2(uv2_x, uv2_y));
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), ImVec2(p4X, p4Y), ImVec2(uv1X, uv1Y), ImVec2(uv2X, uv2Y));
*/
public native void AddImageQuad(int textureID, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, float uv1_x, float uv1_y, float uv2_x, float uv2_y, float uv3_x, float uv3_y); /*
public native void addImageQuad(int textureID, float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, float p4X, float p4Y, float uv1X, float uv1Y, float uv2X, float uv2Y, float uv3X, float uv3Y); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), ImVec2(uv1_x, uv1_y), ImVec2(uv2_x, uv2_y), ImVec2(uv3_x, uv3_y));
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), ImVec2(p4X, p4Y), ImVec2(uv1X, uv1Y), ImVec2(uv2X, uv2Y), ImVec2(uv3X, uv3Y));
*/
public native void AddImageQuad(int textureID, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, float uv1_x, float uv1_y, float uv2_x, float uv2_y, float uv3_x, float uv3_y, float uv4_x, float uv4_y); /*
public native void addImageQuad(int textureID, float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, float p4X, float p4Y, float uv1X, float uv1Y, float uv2X, float uv2Y, float uv3X, float uv3Y, float uv4X, float uv4Y); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), ImVec2(uv1_x, uv1_y), ImVec2(uv2_x, uv2_y), ImVec2(uv3_x, uv3_y), ImVec2(uv4_x, uv4_y));
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), ImVec2(p4X, p4Y), ImVec2(uv1X, uv1Y), ImVec2(uv2X, uv2Y), ImVec2(uv3X, uv3Y), ImVec2(uv4X, uv4Y));
*/
public native void AddImageQuad(int textureID, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, float uv1_x, float uv1_y, float uv2_x, float uv2_y, float uv3_x, float uv3_y, float uv4_x, float uv4_y, long col); /*
public native void addImageQuad(int textureID, float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, float p4X, float p4Y, float uv1X, float uv1Y, float uv2X, float uv2Y, float uv3X, float uv3Y, float uv4X, float uv4Y, long col); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), ImVec2(uv1_x, uv1_y), ImVec2(uv2_x, uv2_y), ImVec2(uv3_x, uv3_y), ImVec2(uv4_x, uv4_y), col);
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), ImVec2(p4X, p4Y), ImVec2(uv1X, uv1Y), ImVec2(uv2X, uv2Y), ImVec2(uv3X, uv3Y), ImVec2(uv4X, uv4Y), col);
*/
public native void AddImageRounded(int textureID, float p_min_x, float p_min_y, float p_max_x, float p_max_y, float uv_min_x, float uv_min_y, float uv_max_x, float uv_max_y, long col, float rounding); /*
public native void addImageRounded(int textureID, float pMinX, float pMinY, float pMaxX, float pMaxY, float uvMinX, float uvMinY, float uvMaxX, float uvMaxY, long col, float rounding); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->AddImageRounded((ImTextureID)textureID, ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), ImVec2(uv_min_x, uv_min_y), ImVec2(uv_max_x, uv_max_y), col, rounding);
drawList->AddImageRounded((ImTextureID)textureID, ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), ImVec2(uvMinX, uvMinY), ImVec2(uvMaxX, uvMaxY), col, rounding);
*/
public native void AddImageRounded(int textureID, float p_min_x, float p_min_y, float p_max_x, float p_max_y, float uv_min_x, float uv_min_y, float uv_max_x, float uv_max_y, long col, float rounding, int imDrawCornerFlags); /*
public native void addImageRounded(int textureID, float pMinX, float pMinY, float pMaxX, float pMaxY, float uvMinX, float uvMinY, float uvMaxX, float uvMaxY, long col, float rounding, int imDrawCornerFlags); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->AddImageRounded((ImTextureID)textureID, ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), ImVec2(uv_min_x, uv_min_y), ImVec2(uv_max_x, uv_max_y), col, rounding, imDrawCornerFlags);
drawList->AddImageRounded((ImTextureID)textureID, ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), ImVec2(uvMinX, uvMinY), ImVec2(uvMaxX, uvMaxY), col, rounding, imDrawCornerFlags);
*/
// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
public native void PathClear(); /*
public native void pathClear(); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathClear();
*/
public native void PathLineTo(float pos_x, float pos_y); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathLineTo(ImVec2(pos_x, pos_y));
public native void pathLineTo(float posX, float posY); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathLineTo(ImVec2(posX, posY));
*/
public native void PathLineToMergeDuplicate(float pos_x, float pos_y); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathLineToMergeDuplicate(ImVec2(pos_x, pos_y));
public native void pathLineToMergeDuplicate(float posX, float posY); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathLineToMergeDuplicate(ImVec2(posX, posY));
*/
// Note: Anti-aliased filling requires points to be in clockwise order.
public native void PathFillConvex(long col); /*
public native void pathFillConvex(long col); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathFillConvex(col);
*/
public native void PathStroke(long col, boolean closed); /*
public native void pathStroke(long col, boolean closed); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathStroke(col, closed);
*/
public native void PathStroke(long col, boolean closed, float thickness); /*
public native void pathStroke(long col, boolean closed, float thickness); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathStroke(col, closed, thickness);
*/
public native void PathArcTo(float center_x, float center_y, float radius, float a_min, float a_max); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathArcTo(ImVec2(center_x, center_y), radius, a_min, a_max);
public native void pathArcTo(float centerX, float centerY, float radius, float aMin, float aMax); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathArcTo(ImVec2(centerX, centerY), radius, aMin, aMax);
*/
public native void PathArcTo(float center_x, float center_y, float radius, float a_min, float a_max, int num_segments); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathArcTo(ImVec2(center_x, center_y), radius, a_min, a_max, num_segments);
public native void pathArcTo(float centerX, float centerY, float radius, float aMin, float aMax, int numSegments); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathArcTo(ImVec2(centerX, centerY), radius, aMin, aMax, numSegments);
*/
// Use precomputed angles for a 12 steps circle
public native void PathArcToFast(float center_x, float center_y, float radius, int a_min_of_12, int a_max_of_12); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathArcToFast(ImVec2(center_x, center_y), radius, a_min_of_12, a_max_of_12);
public native void pathArcToFast(float centerX, float centerY, float radius, int aMinOf12, int aMaxOf12); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathArcToFast(ImVec2(centerX, centerY), radius, aMinOf12, aMaxOf12);
*/
public native void PathBezierCurveTo(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, int num_segments); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathBezierCurveTo(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), num_segments);
public native void pathBezierCurveTo(float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, int numSegments); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathBezierCurveTo(ImVec2(p1X, p1Y), ImVec2(p2X, p2Y), ImVec2(p3X, p3Y), numSegments);
*/
public native void PathRect(float rect_min_x, float rect_min_y, float rect_max_x, float rect_max_y); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathRect(ImVec2(rect_min_x, rect_min_y), ImVec2(rect_max_x, rect_max_y));
public native void pathRect(float rectMinX, float rectMinY, float rectMaxX, float rectMaxY); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathRect(ImVec2(rectMinX, rectMinY), ImVec2(rectMaxX, rectMaxY));
*/
public native void PathRect(float rect_min_x, float rect_min_y, float rect_max_x, float rect_max_y, float rounding); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathRect(ImVec2(rect_min_x, rect_min_y), ImVec2(rect_max_x, rect_max_y), rounding);
public native void pathRect(float rectMinX, float rectMinY, float rectMaxX, float rectMaxY, float rounding); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathRect(ImVec2(rectMinX, rectMinY), ImVec2(rectMaxX, rectMaxY), rounding);
*/
public native void PathRect(float rect_min_x, float rect_min_y, float rect_max_x, float rect_max_y, float rounding, int imDrawCornerFlags); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathRect(ImVec2(rect_min_x, rect_min_y), ImVec2(rect_max_x, rect_max_y), rounding, imDrawCornerFlags);
public native void pathRect(float rectMinX, float rectMinY, float rectMaxX, float rectMaxY, float rounding, int imDrawCornerFlags); /*
getDrawList(env->GetIntField(object, drawListTypeID))->PathRect(ImVec2(rectMinX, rectMinY), ImVec2(rectMaxX, rectMaxY), rounding, imDrawCornerFlags);
*/
// Advanced: Channels
// - Use to split render into layers. By switching channels to can render out-of-order (e.g. submit foreground primitives before background primitives)
// - Use to minimize draw calls (e.g. if going back-and-forth between multiple non-overlapping clipping rectangles, prefer to append into separate channels then merge at the end)
public native void ChannelsSplit(int count); /*
public native void channelsSplit(int count); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->ChannelsSplit(count);
*/
public native void ChannelsMerge(); /*
public native void channelsMerge(); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->ChannelsMerge();
*/
public native void ChannelsSetCurrent(int n); /*
public native void channelsSetCurrent(int n); /*
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
drawList->ChannelsSetCurrent(n);
*/
+11 -7
View File
@@ -3,12 +3,12 @@ package imgui;
import java.util.Objects;
public final class ImFloat {
float[] data = new float[]{0.0f};
final float[] data = new float[]{0};
public ImFloat() {
}
public ImFloat(float value) {
public ImFloat(final float value) {
set(value);
}
@@ -16,7 +16,7 @@ public final class ImFloat {
return this.data[0];
}
public void set(float value) {
public void set(final float value) {
this.data[0] = value;
}
@@ -26,10 +26,14 @@ public final class ImFloat {
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ImFloat imFloat = (ImFloat) o;
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ImFloat imFloat = (ImFloat) o;
return data[0] == imFloat.data[0];
}
File diff suppressed because it is too large. Load diff
+82 -82
View File
@@ -124,34 +124,34 @@ public final class ImGuiIO {
public native void setKeyMap(int[] keyMap); /*
for (int i = 0; i < ImGuiKey_COUNT; i++)
ImGui::GetIO().KeyMap[i] = keyMap[i];
*/
*/
// KeyRepeatDelay
// When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
//
public native float getKeyRepeatDelay(); /*
return ImGui::GetIO().KeyRepeatDelay;
*/
*/
public native void setKeyRepeatDelay(float keyRepeatDelay); /*
ImGui::GetIO().KeyRepeatDelay = keyRepeatDelay;
*/
*/
// KeyRepeatRate
// When holding a key/button, rate at which it repeats, in seconds.
//
public native float getKeyRepeatRate(); /*
return ImGui::GetIO().KeyRepeatRate;
*/
*/
public native void setKeyRepeatRate(float keyRepeatRate); /*
ImGui::GetIO().KeyRepeatRate = keyRepeatRate;
*/
*/
// TODO fonts configuration
// BINDING NOTICE: this is a stub to pass important for ImGui info
public native void SetFontsTexID(int id); /*
public native void setFontsTexID(int id); /*
ImGui::GetIO().Fonts->TexID = (ImTextureID)id;
*/
@@ -163,11 +163,11 @@ public final class ImGuiIO {
//
public native boolean getMouseDrawCursor(); /*
return ImGui::GetIO().MouseDrawCursor;
*/
*/
public native void setMouseDrawCursor(boolean mouseDrawCursor); /*
ImGui::GetIO().MouseDrawCursor = mouseDrawCursor;
*/
*/
// ConfigMacOSXBehaviors
// OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl,
@@ -176,22 +176,22 @@ public final class ImGuiIO {
//
public native boolean getConfigMacOSXBehaviors(); /*
return ImGui::GetIO().ConfigMacOSXBehaviors;
*/
*/
public native void setConfigMacOSXBehaviors(boolean configMacOSXBehaviors); /*
ImGui::GetIO().ConfigMacOSXBehaviors = configMacOSXBehaviors;
*/
*/
// ConfigInputTextCursorBlink
// Set to false to disable blinking cursor, for users who consider it distracting. (was called: io.OptCursorBlink prior to 1.63)
//
public native boolean getConfigInputTextCursorBlink(); /*
return ImGui::GetIO().ConfigInputTextCursorBlink;
*/
*/
public native void setConfigInputTextCursorBlink(boolean configInputTextCursorBlink); /*
ImGui::GetIO().ConfigInputTextCursorBlink = configInputTextCursorBlink;
*/
*/
// ConfigWindowsResizeFromEdges
// Enable resizing of windows from their edges and from the lower-left corner.
@@ -200,33 +200,33 @@ public final class ImGuiIO {
//
public native boolean getConfigWindowsResizeFromEdges(); /*
return ImGui::GetIO().ConfigWindowsResizeFromEdges;
*/
*/
public native void setConfigWindowsResizeFromEdges(boolean configWindowsResizeFromEdges); /*
ImGui::GetIO().ConfigWindowsResizeFromEdges = configWindowsResizeFromEdges;
*/
*/
// ConfigWindowsMoveFromTitleBarOnly
// [BETA] Set to true to only allow moving windows when clicked+dragged from the title bar. Windows without a title bar are not affected.
//
public native boolean getConfigWindowsMoveFromTitleBarOnly(); /*
return ImGui::GetIO().ConfigWindowsMoveFromTitleBarOnly;
*/
*/
public native void setConfigWindowsMoveFromTitleBarOnly(boolean configWindowsMoveFromTitleBarOnly); /*
ImGui::GetIO().ConfigWindowsMoveFromTitleBarOnly = configWindowsMoveFromTitleBarOnly;
*/
*/
// ConfigWindowsMemoryCompactTimer
// [BETA] Compact window memory usage when unused. Set to -1.0f to disable.
//
public native float getConfigWindowsMemoryCompactTimer(); /*
return ImGui::GetIO().ConfigWindowsMemoryCompactTimer;
*/
*/
public native void setConfigWindowsMemoryCompactTimer(float configWindowsMemoryCompactTimer); /*
ImGui::GetIO().ConfigWindowsMemoryCompactTimer = configWindowsMemoryCompactTimer;
*/
*/
//------------------------------------------------------------------
// Platform Functions
@@ -237,7 +237,7 @@ public final class ImGuiIO {
//
public native String getBackendPlatformName(); /*
return env -> NewStringUTF(ImGui::GetIO().BackendPlatformName);
*/
*/
public native void setBackendPlatformName(String backendPlatformName); /*MANUAL
ImGui::GetIO().BackendPlatformName = obj_backendPlatformName == NULL ? NULL : (char*)env->GetStringUTFChars(obj_backendPlatformName, JNI_FALSE);
@@ -247,7 +247,7 @@ public final class ImGuiIO {
//
public native String getBackendRendererName(); /*
return env -> NewStringUTF(ImGui::GetIO().BackendRendererName);
*/
*/
public native void setBackendRendererName(String backendRendererName); /*MANUAL
ImGui::GetIO().BackendRendererName = obj_backendRendererName == NULL ? NULL : (char*)env->GetStringUTFChars(obj_backendRendererName, JNI_FALSE);
@@ -265,12 +265,12 @@ public final class ImGuiIO {
//
public native void getDisplaySize(ImVec2 dstImVec2); /*
Jni::ImVec2Cpy(env, &ImGui::GetIO().DisplaySize, dstImVec2);
*/
*/
public native void setDisplaySize(float x, float y); /*
ImGui::GetIO().DisplaySize.x = x;
ImGui::GetIO().DisplaySize.y = y;
*/
*/
// DisplayFramebufferScale
// For retina display or other situations where window coordinates are different from framebuffer coordinates. This generally ends up in ImDrawData::FramebufferScale.
@@ -278,12 +278,12 @@ public final class ImGuiIO {
//
public native void getDisplayFramebufferScale(ImVec2 dstImVec2); /*
Jni::ImVec2Cpy(env, &ImGui::GetIO().DisplayFramebufferScale, dstImVec2);
*/
*/
public native void setDisplayFramebufferScale(float x, float y); /*
ImGui::GetIO().DisplayFramebufferScale.x = x;
ImGui::GetIO().DisplayFramebufferScale.y = y;
*/
*/
// DeltaTime
// Time elapsed since last frame, in seconds.
@@ -291,23 +291,23 @@ public final class ImGuiIO {
//
public native float getDeltaTime(); /*
return ImGui::GetIO().DeltaTime;
*/
*/
public native void setDeltaTime(float deltaTime); /*
ImGui::GetIO().DeltaTime = deltaTime;
*/
*/
// MousePos
// Mouse position, in pixels. Set to ImVec2(-FLT_MAX,-FLT_MAX) if mouse is unavailable (on another screen, etc.)
//
public native void getMousePos(ImVec2 dstImVec2); /*
Jni::ImVec2Cpy(env, &ImGui::GetIO().MousePos, dstImVec2);
*/
*/
public native void setMousePos(float x, float y); /*
ImGui::GetIO().MousePos.x = x;
ImGui::GetIO().MousePos.y = y;
*/
*/
// MouseDown
// Mouse buttons: 0=left, 1=right, 2=middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button).
@@ -316,86 +316,86 @@ public final class ImGuiIO {
public native void getMouseDown(boolean[] buff); /*
for (int i = 0; i < 5; i++)
buff[i] = ImGui::GetIO().MouseDown[i];
*/
*/
public native boolean getMouseDown(int idx); /*
return ImGui::GetIO().MouseDown[idx];
*/
*/
public native void setMouseDown(int idx, boolean down); /*
ImGui::GetIO().MouseDown[idx] = down;
*/
*/
public native void setMouseDown(boolean[] mouseDown); /*
for (int i = 0; i < 5; i++)
ImGui::GetIO().MouseDown[i] = mouseDown[i];
*/
*/
// MouseWheel
// Mouse wheel Vertical: 1 unit scrolls about 5 lines text.
//
public native float getMouseWheel(); /*
return ImGui::GetIO().MouseWheel;
*/
*/
public native void setMouseWheel(float mouseDeltaY); /*
ImGui::GetIO().MouseWheel = mouseDeltaY;
*/
*/
// MouseWheelH
// Mouse wheel Horizontal. Most users don't have a mouse with an horizontal wheel, may not be filled by all back-ends.
//
public native float getMouseWheelH(); /*
return ImGui::GetIO().MouseWheelH;
*/
*/
public native void setMouseWheelH(float mouseDeltaX); /*
ImGui::GetIO().MouseWheelH = mouseDeltaX;
*/
*/
// KeyCtrl
// Keyboard modifier pressed: Control
//
public native boolean getKeyCtrl(); /*
return ImGui::GetIO().KeyCtrl;
*/
*/
public native void setKeyCtrl(boolean value); /*
ImGui::GetIO().KeyCtrl = value;
*/
*/
// KeyShift
// Keyboard modifier pressed: Shift
//
public native boolean getKeyShift(); /*
return ImGui::GetIO().KeyShift;
*/
*/
public native void setKeyShift(boolean value); /*
ImGui::GetIO().KeyShift = value;
*/
*/
// KeyAlt
// Keyboard modifier pressed: Alt
//
public native boolean getKeyAlt(); /*
return ImGui::GetIO().KeyAlt;
*/
*/
public native void setKeyAlt(boolean value); /*
ImGui::GetIO().KeyAlt = value;
*/
*/
// KeySuper
// Keyboard modifier pressed: Cmd/Super/Windows
//
public native boolean getKeySuper(); /*
return ImGui::GetIO().KeySuper;
*/
*/
public native void setKeySuper(boolean value); /*
ImGui::GetIO().KeySuper = value;
*/
*/
// KeysDown
// Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys).
@@ -403,20 +403,20 @@ public final class ImGuiIO {
public native void getKeysDown(boolean[] buff); /*
for (int i = 0; i < 512; i++)
buff[i] = ImGui::GetIO().KeysDown[i];
*/
*/
public native boolean getKeysDown(int idx); /*
return ImGui::GetIO().KeysDown[idx];
*/
*/
public native void setKeysDown(int idx, boolean pressed); /*
ImGui::GetIO().KeysDown[idx] = pressed;
*/
*/
public native void setKeysDown(boolean[] keysDown); /*
for (int i = 0; i < 512; i++)
ImGui::GetIO().KeysDown[i] = keysDown[i];
*/
*/
//------------------------------------------------------------------
// Output - Retrieve after calling NewFrame()
@@ -428,11 +428,11 @@ public final class ImGuiIO {
//
public native boolean getWantCaptureMouse(); /*
return ImGui::GetIO().WantCaptureMouse;
*/
*/
public native void setWantCaptureMouse(boolean wantCaptureMouse); /*
ImGui::GetIO().WantCaptureMouse = wantCaptureMouse;
*/
*/
// WantCaptureKeyboard
// When io.WantCaptureKeyboard is true, imgui will use the keyboard inputs, do not dispatch them to your main game/application (in both cases, always pass keyboard inputs to imgui).
@@ -440,11 +440,11 @@ public final class ImGuiIO {
//
public native boolean getWantCaptureKeyboard(); /*
return ImGui::GetIO().WantCaptureKeyboard;
*/
*/
public native void setWantCaptureKeyboard(boolean wantCaptureKeyboard); /*
ImGui::GetIO().WantCaptureKeyboard = wantCaptureKeyboard;
*/
*/
// WantTextInput
// Mobile/console: when io.WantTextInput is true, you may display an on-screen keyboard.
@@ -452,22 +452,22 @@ public final class ImGuiIO {
//
public native boolean getWantTextInput(); /*
return ImGui::GetIO().WantTextInput;
*/
*/
public native void setWantTextInput(boolean wantTextInput); /*
ImGui::GetIO().WantTextInput = wantTextInput;
*/
*/
// WantSetMousePos
// MousePos has been altered, back-end should reposition mouse on next frame. Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled.
//
public native boolean getWantSetMousePos(); /*
return ImGui::GetIO().WantSetMousePos;
*/
*/
public native void setWantSetMousePos(boolean wantSetMousePos); /*
ImGui::GetIO().WantSetMousePos = wantSetMousePos;
*/
*/
// WantSaveIniSettings
// When manual .ini load/save is active (io.IniFilename == NULL),
@@ -476,133 +476,133 @@ public final class ImGuiIO {
//
public native boolean getWantSaveIniSettings(); /*
return ImGui::GetIO().WantSaveIniSettings;
*/
*/
public native void setWantSaveIniSettings(boolean wantSaveIniSettings); /*
ImGui::GetIO().WantSaveIniSettings = wantSaveIniSettings;
*/
*/
// NavActive
// Directional navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag.
//
public native boolean getNavActive(); /*
return ImGui::GetIO().NavActive;
*/
*/
public native void setNavActive(boolean navActive); /*
ImGui::GetIO().NavActive = navActive;
*/
*/
// NavVisible
// Directional navigation is visible and allowed (will handle ImGuiKey_NavXXX events).
//
public native boolean getNavVisible(); /*
return ImGui::GetIO().NavVisible;
*/
*/
public native void setNavVisible(boolean navVisible); /*
ImGui::GetIO().NavVisible = navVisible;
*/
*/
// Framerate
// Application framerate estimation, in frame per second. Solely for convenience. Rolling average estimation based on IO.DeltaTime over 120 frames
//
public native float getFramerate(); /*
return ImGui::GetIO().Framerate;
*/
*/
public native void setFramerate(float framerate); /*
ImGui::GetIO().Framerate = framerate;
*/
*/
// MetricsRenderVertices
// Vertices output during last call to Render()
//
public native int getMetricsRenderVertices(); /*
return ImGui::GetIO().MetricsRenderVertices;
*/
*/
public native void setMetricsRenderVertices(int metricsRenderVertices); /*
ImGui::GetIO().MetricsRenderVertices = metricsRenderVertices;
*/
*/
// MetricsRenderIndices
// Indices output during last call to Render() = number of triangles * 3
//
public native int getMetricsRenderIndices(); /*
return ImGui::GetIO().MetricsRenderIndices;
*/
*/
public native void setMetricsRenderIndices(int metricsRenderIndices); /*
ImGui::GetIO().MetricsRenderIndices = metricsRenderIndices;
*/
*/
// MetricsRenderWindows
// Number of visible windows
//
public native int getMetricsRenderWindows(); /*
return ImGui::GetIO().MetricsRenderWindows;
*/
*/
public native void setMetricsRenderWindows(int metricsRenderWindows); /*
ImGui::GetIO().MetricsRenderWindows = metricsRenderWindows;
*/
*/
// MetricsActiveWindows
// Number of active windows
//
public native int getMetricsActiveWindows(); /*
return ImGui::GetIO().MetricsActiveWindows;
*/
*/
public native void setMetricsActiveWindows(int metricsActiveWindows); /*
ImGui::GetIO().MetricsActiveWindows = metricsActiveWindows;
*/
*/
// MetricsActiveAllocations
// Number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts.
//
public native int getMetricsActiveAllocations(); /*
return ImGui::GetIO().MetricsActiveAllocations;
*/
*/
public native void setMetricsActiveAllocations(int metricsActiveAllocations); /*
ImGui::GetIO().MetricsActiveAllocations = metricsActiveAllocations;
*/
*/
// MouseDelta
// Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta.
//
public native void getMouseDelta(ImVec2 dstImVec2); /*
Jni::ImVec2Cpy(env, &ImGui::GetIO().MouseDelta, dstImVec2);
*/
*/
public native void setMouseDelta(float x, float y); /*
ImGui::GetIO().MouseDelta.x = x;
ImGui::GetIO().MouseDelta.y = y;
*/
*/
// Functions
/**
* Queue new character input.
*/
public native void AddInputCharacter(int c); /*
public native void addInputCharacter(int c); /*
if (c > 0 && c < 0x10000)
ImGui::GetIO().AddInputCharacter((unsigned short)c);
*/;
*/
/**
* Queue new characters input from an UTF-8 string.
*/
public native void AddInputCharactersUTF8(String str); /*
public native void addInputCharactersUTF8(String str); /*
ImGui::GetIO().AddInputCharactersUTF8(str);
*/
*/
/**
* Clear the text input buffer manually.
*/
public native void ClearInputCharacters(); /*
public native void clearInputCharacters(); /*
ImGui::GetIO().ClearInputCharacters();
*/
*/
}
@@ -4,7 +4,7 @@ package imgui;
* You may modify the ImGui::GetStyle() main instance during initialization and before NewFrame().
* During the frame, use ImGui::PushStyleVar(ImGuiStyleVar_XXXX)/PopStyleVar() to alter the main style values,
* and ImGui::PushStyleColor(ImGuiCol_XXX)/PopStyleColor() for colors.
*
* <p>
* BINDING NOTICE: This is not a fully featured representation of ImGuiStyle struct from C++.
* Mostly it's a stub which communicates with default ImGuiStyle used by ImGuiIO.
* Still can be used to make your interface look different, since all of the fields from the original header file are represented here.
@@ -34,12 +34,12 @@ public final class ImGuiStyle {
//
public native void getWindowPadding(ImVec2 dstImVec2); /*
Jni::ImVec2Cpy(env, &ImGui::GetStyle().WindowPadding, dstImVec2);
*/
*/
public native void setWindowPadding(float x, float y); /*
ImGui::GetStyle().WindowPadding.x = x;
ImGui::GetStyle().WindowPadding.y = y;
*/
*/
// WindowRounding
// Radius of window corners rounding. Set to 0.0f to have rectangular windows.
@@ -68,24 +68,24 @@ public final class ImGuiStyle {
//
public native void getWindowMinSize(ImVec2 dstImVec2); /*
Jni::ImVec2Cpy(env, &ImGui::GetStyle().WindowMinSize, dstImVec2);
*/
*/
public native void setWindowMinSize(float x, float y); /*
ImGui::GetStyle().WindowMinSize.x = x;
ImGui::GetStyle().WindowMinSize.y = y;
*/
*/
// WindowTitleAlign
// Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
//
public native void getWindowTitleAlign(ImVec2 dstImVec2); /*
Jni::ImVec2Cpy(env, &ImGui::GetStyle().WindowTitleAlign, dstImVec2);
*/
*/
public native void setWindowTitleAlign(float x, float y); /*
ImGui::GetStyle().WindowTitleAlign.x = x;
ImGui::GetStyle().WindowTitleAlign.y = y;
*/
*/
// WindowMenuButtonPosition
// Side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to ImGuiDir_Left.
@@ -147,12 +147,12 @@ public final class ImGuiStyle {
//
public native void getFramePadding(ImVec2 dstImVec2); /*
Jni::ImVec2Cpy(env, &ImGui::GetStyle().FramePadding, dstImVec2);
*/
*/
public native void setFramePadding(float x, float y); /*
ImGui::GetStyle().FramePadding.x = x;
ImGui::GetStyle().FramePadding.y = y;
*/
*/
// FrameRounding
// Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
@@ -187,6 +187,7 @@ public final class ImGuiStyle {
ImGui::GetStyle().ItemSpacing.x = x;
ImGui::GetStyle().ItemSpacing.y = y;
*/
// ItemInnerSpacing
// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
//
@@ -198,6 +199,7 @@ public final class ImGuiStyle {
ImGui::GetStyle().ItemInnerSpacing.x = x;
ImGui::GetStyle().ItemInnerSpacing.y = y;
*/
// TouchExtraPadding
// Expand reactive bounding box for touch-based system where touch position is not accurate enough.
// Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
@@ -305,6 +307,7 @@ public final class ImGuiStyle {
public native int getColorButtonPosition(); /*
return ImGui::GetStyle().ColorButtonPosition;
*/
public native void setColorButtonPosition(int colorButtonPosition); /*
ImGui::GetStyle().ColorButtonPosition = colorButtonPosition;
*/
+11 -7
View File
@@ -3,12 +3,12 @@ package imgui;
import java.util.Objects;
public final class ImInt {
int[] data = new int[]{0};
final int[] data = new int[]{0};
public ImInt() {
}
public ImInt(int value) {
public ImInt(final int value) {
set(value);
}
@@ -16,7 +16,7 @@ public final class ImInt {
return this.data[0];
}
public void set(int value) {
public void set(final int value) {
this.data[0] = value;
}
@@ -26,10 +26,14 @@ public final class ImInt {
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ImInt imInt = (ImInt) o;
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ImInt imInt = (ImInt) o;
return data[0] == imInt.data[0];
}
+12 -8
View File
@@ -2,13 +2,13 @@ package imgui;
import java.util.Objects;
public class ImLong {
long[] data = new long[]{0};
public final class ImLong {
final long[] data = new long[]{0};
public ImLong() {
}
public ImLong(long value) {
public ImLong(final long value) {
set(value);
}
@@ -16,7 +16,7 @@ public class ImLong {
return this.data[0];
}
public void set(long value) {
public void set(final long value) {
this.data[0] = value;
}
@@ -26,10 +26,14 @@ public class ImLong {
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ImLong imLong = (ImLong) o;
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ImLong imLong = (ImLong) o;
return data[0] == imLong.data[0];
}
+12 -8
View File
@@ -2,13 +2,13 @@ package imgui;
import java.util.Objects;
public class ImShort {
short[] data = new short[]{0};
public final class ImShort {
final short[] data = new short[]{0};
public ImShort() {
}
public ImShort(short value) {
public ImShort(final short value) {
set(value);
}
@@ -16,7 +16,7 @@ public class ImShort {
return this.data[0];
}
public void set(short value) {
public void set(final short value) {
this.data[0] = value;
}
@@ -26,10 +26,14 @@ public class ImShort {
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ImShort imShort = (ImShort) o;
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ImShort imShort = (ImShort) o;
return data[0] == imShort.data[0];
}
+16 -12
View File
@@ -23,16 +23,16 @@ public final class ImString {
this(DEFAULT_LENGTH);
}
public ImString(int length) {
public ImString(final int length) {
data = new byte[length + CARET_LEN];
}
public ImString(String text) {
public ImString(final String text) {
this(text.length());
set(text);
}
public ImString(String text, int length) {
public ImString(final String text, final int length) {
this(length);
set(text);
}
@@ -45,12 +45,12 @@ public final class ImString {
return text;
}
public void set(String value) {
public void set(final String value) {
set(value.getBytes());
}
public void set(String value, boolean resize) {
byte[] str = value.getBytes();
public void set(final String value, final boolean resize) {
final byte[] str = value.getBytes();
if (resize && data.length - CARET_LEN < str.length) {
data = new byte[str.length + resizeFactor + CARET_LEN];
}
@@ -73,8 +73,8 @@ public final class ImString {
return data.length;
}
private void set(byte[] str) {
int len = Math.min(str.length, data.length);
private void set(final byte[] str) {
final int len = Math.min(str.length, data.length);
System.arraycopy(str, 0, data, 0, len);
inputData.isDirty = true;
inputData.size = len;
@@ -86,10 +86,14 @@ public final class ImString {
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ImString imString = (ImString) o;
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ImString imString = (ImString) o;
return Objects.equals(text, imString.text);
}
+13 -9
View File
@@ -9,24 +9,28 @@ public final class ImVec2 {
public ImVec2() {
}
public ImVec2(float x, float y) {
public ImVec2(final float x, final float y) {
this.x = x;
this.y = y;
}
@Override
public String toString() {
return "ImVec2{" +
"x=" + x +
", y=" + y +
'}';
return "ImVec2{"
+ "x=" + x
+ ", y=" + y
+ '}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ImVec2 imVec2 = (ImVec2) o;
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;
}
+15 -11
View File
@@ -11,7 +11,7 @@ public final class ImVec4 {
public ImVec4() {
}
public ImVec4(float x, float y, float z, float w) {
public ImVec4(final float x, final float y, final float z, final float w) {
this.x = x;
this.y = y;
this.z = z;
@@ -20,19 +20,23 @@ public final class ImVec4 {
@Override
public String toString() {
return "ImVec4{" +
"x=" + x +
", y=" + y +
", z=" + z +
", w=" + w +
'}';
return "ImVec4{"
+ "x=" + x
+ ", y=" + y
+ ", z=" + z
+ ", w=" + w
+ '}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ImVec4 imVec4 = (ImVec4) o;
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;
}
@@ -11,12 +11,12 @@ public final class TexDataRGBA32 {
public ByteBuffer pixelBuffer;
private TexDataRGBA32() {
int pixelMax = 131072;
final int pixelMax = 131072;
pixelBuffer = ByteBuffer.allocateDirect(pixelMax).order(ByteOrder.nativeOrder());
}
public static TexDataRGBA32 create() {
TexDataRGBA32 data = new TexDataRGBA32();
final TexDataRGBA32 data = new TexDataRGBA32();
data.nFillData(data.pixelBuffer);
return data;
}
@@ -25,7 +25,7 @@ public final class TexDataRGBA32 {
#include <imgui.h>
*/
private native void nFillData(Buffer pixelBuffer); /*
private native void nFillData(Buffer pixelBuf); /*
jclass jTexDataClass = env->GetObjectClass(object);
if(jTexDataClass == NULL)
@@ -43,6 +43,6 @@ public final class TexDataRGBA32 {
env->SetIntField(object, widthID, width);
env->SetIntField(object, heightID, height);
memcpy(pixelBuffer, pixels, width * height * 4);
memcpy(pixelBuf, pixels, width * height * 4);
*/
}