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

@@ -0,0 +1,71 @@
package imgui.flag;
/**
* Flags for ImGui::BeginTabItem()
*/
public final class ImGuiTabItemFlags {
private ImGuiTabItemFlags() {
}
/**
* Definition: {@code 0}
*/
public static final int None = 0;
/**
* Display a dot next to the title + tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar.
*
* <p>Definition: {@code 1 << 0}
*/
public static final int UnsavedDocument = 1;
/**
* Trigger flag to programmatically make the tab selected when calling BeginTabItem()
*
* <p>Definition: {@code 1 << 1}
*/
public static final int SetSelected = 2;
/**
* Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() {@code &} {@code &} IsMouseClicked(2)) *p_open = false.
*
* <p>Definition: {@code 1 << 2}
*/
public static final int NoCloseWithMiddleMouseButton = 4;
/**
* Don't call PushID(tab{@code ->}ID)/PopID() on BeginTabItem()/EndTabItem()
*
* <p>Definition: {@code 1 << 3}
*/
public static final int NoPushId = 8;
/**
* Disable tooltip for the given tab
*
* <p>Definition: {@code 1 << 4}
*/
public static final int NoTooltip = 16;
/**
* Disable reordering this tab or having another tab cross over this tab
*
* <p>Definition: {@code 1 << 5}
*/
public static final int NoReorder = 32;
/**
* Enforce the tab position to the left of the tab bar (after the tab list popup button)
*
* <p>Definition: {@code 1 << 6}
*/
public static final int Leading = 64;
/**
* Enforce the tab position to the right of the tab bar (before the scrolling buttons)
*
* <p>Definition: {@code 1 << 7}
*/
public static final int Trailing = 128;
}