feat: introduce binding generator
A squash of hundreds of commits with a binding API generator. The API generator works with a hybrid model: 1. We define methods and fields in the code. 2. Mark them with API annotations. 3. For specific use cases, we use the old approach with JNI generation comments. There is also an API to generate an AST tree, which is saved to JSON. This JSON can be used for full API generation by declaring only field/method names. Currently, it is used to generate constants. By eyeballing, 95% of the API has been converted to the new approach. This is sufficient for the current moment. Only edge cases with specific API calls are left. fix: ambiguous call for ImGui::GetColorU32 build: disable checkstyle for imgui-binding module Since the module is heavily generated, checkstyle for it doesn't make sense. build: make buildSrc to use JDK 11 build: make generateApi optional when compiling project Initially generated module was not included to the project VCS. Since it's now in the separate src folder, we don't need to call generator every time. Only when a new generation result is required.
This commit is contained in:
1 parent
e64df5a433
commit
8a8cd22ed6
323 files changed
+113518
-15318
No files matched your search
@@ -1,10 +1,13 @@
|
||||
package imgui.internal.flag;
|
||||
|
||||
import imgui.binding.annotation.BindingAstEnum;
|
||||
import imgui.binding.annotation.BindingSource;
|
||||
|
||||
@BindingSource
|
||||
public final class ImGuiAxis {
|
||||
private ImGuiAxis() {
|
||||
}
|
||||
|
||||
public static final int None = -1;
|
||||
public static final int X = 0;
|
||||
public static final int Y = 1;
|
||||
@BindingAstEnum(file = "ast-imgui_internal.json", qualType = "ImGuiAxis", sanitizeName = "ImGuiAxis_")
|
||||
public Void __;
|
||||
}
|
||||
@@ -1,13 +1,16 @@
|
||||
package imgui.internal.flag;
|
||||
|
||||
import imgui.binding.annotation.BindingAstEnum;
|
||||
import imgui.binding.annotation.BindingSource;
|
||||
|
||||
/**
|
||||
* Store the source authority (dock node vs window) of a field
|
||||
*/
|
||||
@BindingSource
|
||||
public final class ImGuiDataAuthority {
|
||||
private ImGuiDataAuthority() {
|
||||
}
|
||||
|
||||
public static final int Auto = 0;
|
||||
public static final int DockNode = 1;
|
||||
public static final int Window = 2;
|
||||
@BindingAstEnum(file = "ast-imgui_internal.json", qualType = "ImGuiDataAuthority_")
|
||||
public Void __;
|
||||
}
|
||||
@@ -1,53 +1,19 @@
|
||||
package imgui.internal.flag;
|
||||
|
||||
import imgui.binding.annotation.BindingAstEnum;
|
||||
import imgui.binding.annotation.BindingSource;
|
||||
|
||||
/**
|
||||
* Extend ImGuiDockNodeFlags
|
||||
*/
|
||||
public final class ImGuiDockNodeFlags extends imgui.flag.ImGuiDockNodeFlags {
|
||||
@BindingSource
|
||||
public final class ImGuiDockNodeFlags {
|
||||
private ImGuiDockNodeFlags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* A dockspace is a node that occupy space within an existing user window. Otherwise the node is floating and create its own window.
|
||||
*/
|
||||
public static final int DockSpace = 1 << 10;
|
||||
/**
|
||||
* The central node has 2 main properties: stay visible when empty, only use "remaining" spaces from its neighbor.
|
||||
*/
|
||||
public static final int CentralNode = 1 << 11;
|
||||
/**
|
||||
* Tab bar is completely unavailable. No triangle in the corner to enable it back.
|
||||
*/
|
||||
public static final int NoTabBar = 1 << 12;
|
||||
/**
|
||||
* Tab bar is hidden, with a triangle in the corner to show it again (NB: actual tab-bar instance may be destroyed as this is only used for single-window tab bar)
|
||||
*/
|
||||
public static final int HiddenTabBar = 1 << 13;
|
||||
/**
|
||||
* Disable window/docking menu (that one that appears instead of the collapse button)
|
||||
*/
|
||||
public static final int NoWindowMenuButton = 1 << 14;
|
||||
public static final int NoCloseButton = 1 << 15;
|
||||
/**
|
||||
* Disable any form of docking in this dockspace or individual node. (On a whole dockspace, this pretty much defeat the purpose of using a dockspace at all). Note: when turned on, existing docked nodes will be preserved.
|
||||
*/
|
||||
public static final int NoDocking = 1 << 16;
|
||||
/**
|
||||
* [EXPERIMENTAL] Prevent another window/node from splitting this node.
|
||||
*/
|
||||
public static final int NoDockingSplitMe = 1 << 17;
|
||||
/**
|
||||
* [EXPERIMENTAL] Prevent this node from splitting another window/node.
|
||||
*/
|
||||
public static final int NoDockingSplitOther = 1 << 18;
|
||||
/**
|
||||
* [EXPERIMENTAL] Prevent another window/node to be docked over this node.
|
||||
*/
|
||||
public static final int NoDockingOverMe = 1 << 19;
|
||||
/**
|
||||
* [EXPERIMENTAL] Prevent this node to be docked over another window/node.
|
||||
*/
|
||||
public static final int NoDockingOverOther = 1 << 20;
|
||||
public static final int NoResizeX = 1 << 21;
|
||||
public static final int NoResizeY = 1 << 22;
|
||||
@BindingAstEnum(file = "ast-imgui.json", qualType = "ImGuiDockNodeFlags_")
|
||||
public Void __;
|
||||
|
||||
@BindingAstEnum(file = "ast-imgui_internal.json", qualType = "ImGuiDockNodeFlagsPrivate_", sanitizeName = "ImGuiDockNodeFlags_")
|
||||
public Void ___;
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
package imgui.internal.flag;
|
||||
|
||||
import imgui.binding.annotation.BindingAstEnum;
|
||||
import imgui.binding.annotation.BindingSource;
|
||||
|
||||
@BindingSource
|
||||
public final class ImGuiDockNodeState {
|
||||
private ImGuiDockNodeState() {
|
||||
}
|
||||
|
||||
public static final int Unknown = 0;
|
||||
public static final int HostWindowHiddenBecauseSingleWindow = 1;
|
||||
public static final int HostWindowHiddenBecauseWindowsAreResizing = 2;
|
||||
public static final int HostWindowVisible = 3;
|
||||
@BindingAstEnum(file = "ast-imgui_internal.json", qualType = "ImGuiDockNodeState", sanitizeName = "ImGuiDockNodeState_")
|
||||
public Void __;
|
||||
}
|
||||
@@ -1,36 +1,17 @@
|
||||
package imgui.internal.flag;
|
||||
|
||||
import imgui.binding.annotation.BindingAstEnum;
|
||||
import imgui.binding.annotation.BindingSource;
|
||||
|
||||
/**
|
||||
* Transient per-window flags, reset at the beginning of the frame. For child window, inherited from parent on first Begin().
|
||||
* This is going to be exposed in imgui.h when stabilized enough.
|
||||
*/
|
||||
@BindingSource
|
||||
public final class ImGuiItemFlags {
|
||||
private ImGuiItemFlags() {
|
||||
}
|
||||
|
||||
public static final int None = 0;
|
||||
public static final int NoTabStop = 1;
|
||||
/**
|
||||
* Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
|
||||
*/
|
||||
public static final int ButtonRepeat = 1 << 1;
|
||||
/**
|
||||
* [BETA] Disable interactions but doesn't affect visuals yet. See github.com/ocornut/imgui/issues/211
|
||||
*/
|
||||
public static final int Disabled = 1 << 2;
|
||||
public static final int NoNav = 1 << 3;
|
||||
public static final int NoNavDefaultFocus = 1 << 4;
|
||||
/**
|
||||
* MenuItem/Selectable() automatically closes current Popup window
|
||||
*/
|
||||
public static final int SelectableDontClosePopup = 1 << 5;
|
||||
/**
|
||||
* [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ.
|
||||
* Currently only supported by Checkbox() (later should support all sorts of widgets)
|
||||
*/
|
||||
public static final int MixedValue = 1 << 6;
|
||||
/**
|
||||
* [ALPHA] Allow hovering interactions but underlying value is not changed.
|
||||
*/
|
||||
public static final int ReadOnly = 1 << 7;
|
||||
@BindingAstEnum(file = "ast-imgui_internal.json", qualType = "ImGuiItemFlags_")
|
||||
public Void __;
|
||||
}
|
||||
Reference in new issue
Block a user