Compare commits

...
15 Commits
Author SHA1 Message Date
RobotandClaude Sonnet 4.6 c755c9a86b chore: bump to +mrlokop4, rebuild natives with real UTF-8 jni_common fix
CI / Build Java (push) Has been cancelled
CI / Build Native (macos-latest - macos) (push) Has been cancelled
CI / Build Native (ubuntu-latest - linux) (push) Has been cancelled
CI / Build Native (ubuntu-latest - windows) (push) Has been cancelled
CI / Archive Natives (push) Has been cancelled
CI / Update Binaries (push) Has been cancelled
CI / Release (push) Has been cancelled
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 12:18:51 +03:00
MRLokop 30b731de54 fix: make Jni::FreeTrueUtf8 const-safe
CI / Build Java (push) Has been cancelled
CI / Build Native (macos-latest - macos) (push) Has been cancelled
CI / Build Native (ubuntu-latest - linux) (push) Has been cancelled
CI / Build Native (ubuntu-latest - windows) (push) Has been cancelled
CI / Archive Natives (push) Has been cancelled
CI / Update Binaries (push) Has been cancelled
CI / Release (push) Has been cancelled
TextEditor/TextEditorLanguageDefinition use 'const char* value =
env->GetStringUTFChars(...)' then release via the same pointer. After
the mass replace the release side called FreeTrueUtf8(char*) with a
const char* argument, which fails to compile. Switch the helper
signature to take const char* so both const and non-const call sites
build.
2026-04-20 11:27:00 +03:00
RobotandClaude Sonnet 4.6 fcfec0506f chore: bump to +mrlokop3, recompile natives with UTF-8 jstring fix
CI / Build Java (push) Has been cancelled
CI / Build Native (macos-latest - macos) (push) Has been cancelled
CI / Build Native (ubuntu-latest - linux) (push) Has been cancelled
CI / Build Native (ubuntu-latest - windows) (push) Has been cancelled
CI / Archive Natives (push) Has been cancelled
CI / Update Binaries (push) Has been cancelled
CI / Release (push) Has been cancelled
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 11:20:49 +03:00
MRLokop d9aa2c811b fix: use real UTF-8 for jstring -> native conversion
CI / Build Java (push) Has been cancelled
CI / Build Native (macos-latest - macos) (push) Has been cancelled
CI / Build Native (ubuntu-latest - linux) (push) Has been cancelled
CI / Build Native (ubuntu-latest - windows) (push) Has been cancelled
CI / Archive Natives (push) Has been cancelled
CI / Update Binaries (push) Has been cancelled
CI / Release (push) Has been cancelled
JNI's GetStringUTFChars emits MUTF-8, which encodes codepoints above
U+FFFF as a surrogate-pair of two 3-byte sequences. ImGui's UTF-8 decoder
rejects those, so SMP emoji (U+1F000+) never reach the glyph atlas even
when the glyph is registered.

Add Jni::ToTrueUtf8 / Jni::FreeTrueUtf8 helpers in jni_common that decode
via GetStringChars (UTF-16) and emit proper 1/2/3/4-byte UTF-8, then
route every generator- and manually-written JNI call site through them
(1921 occurrences across the generated tree and 3 hand-written files,
plus the jni_content.kt generator template so future regenerations stay
consistent).
2026-04-20 11:04:08 +03:00
RobotandClaude Sonnet 4.6 34c40304f6 feat: add IMGUI_USE_WCHAR32 support, cross-compile natives, publish to mvn.mrlokop.dev
CI / Build Java (push) Has been cancelled
CI / Build Native (macos-latest - macos) (push) Has been cancelled
CI / Build Native (ubuntu-latest - linux) (push) Has been cancelled
CI / Build Native (ubuntu-latest - windows) (push) Has been cancelled
CI / Archive Natives (push) Has been cancelled
CI / Update Binaries (push) Has been cancelled
CI / Release (push) Has been cancelled
- Enable IMGUI_USE_WCHAR32 in imconfig.h (ImWchar = uint32_t)
- Extend ImFontGlyphRangesBuilder, ImFontConfig, ImFontAtlas for 32-bit codepoints
- Cross-compile natives for macOS universal, Linux x86_64 (glibc), Windows x86_64
- Publish as org.nnstd.imgui:...:1.90.0-wchar32+mrlokop2 to mvn.mrlokop.dev
- Add BUILDING.md with full rebuild and publish instructions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 10:29:43 +03:00
dependabot[bot] 2fcd517b3e build(deps): bump actions/upload-artifact from 4 to 5 (#357)
CI / Build Java (push) Has been cancelled
CI / Build Native (macos-latest - macos) (push) Has been cancelled
CI / Build Native (ubuntu-latest - linux) (push) Has been cancelled
CI / Build Native (ubuntu-latest - windows) (push) Has been cancelled
CI / Archive Natives (push) Has been cancelled
CI / Update Binaries (push) Has been cancelled
CI / Release (push) Has been cancelled
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-09 15:23:50 +02:00
dependabot[bot] fa5daaf21f build(deps): bump actions/download-artifact from 4 to 6 (#356)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-09 15:23:38 +02:00
dependabot[bot] aefb1be537 build(deps): bump gradle/actions from 4 to 5 (#354)
Bumps [gradle/actions](https://github.com/gradle/actions) from 4 to 5.
- [Release notes](https://github.com/gradle/actions/releases)
- [Commits](https://github.com/gradle/actions/compare/v4...v5)

---
updated-dependencies:
- dependency-name: gradle/actions
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-09 15:22:51 +02:00
dependabot[bot] cbb7b26916 build(deps): bump actions/setup-java from 4 to 5 (#350)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4 to 5.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-09 15:22:36 +02:00
dependabot[bot] 65275bb47b build(deps): bump com.fasterxml.jackson.core:jackson-databind (#348)
Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) from 2.18.0 to 2.20.0.
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-version: 2.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-09 15:22:20 +02:00
dependabot[bot] 64b2fbe01b build(deps): bump com.fasterxml.jackson.core:jackson-core (#347)
Bumps [com.fasterxml.jackson.core:jackson-core](https://github.com/FasterXML/jackson-core) from 2.18.0 to 2.20.0.
- [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.18.0...jackson-core-2.20.0)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-core
  dependency-version: 2.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-09 15:22:09 +02:00
dependabot[bot] 93c790fa6d build(deps): bump actions/checkout from 4 to 5 (#345)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-09 15:21:43 +02:00
SpaiR c80552861d v1.90.0 2025-08-26 16:11:08 +03:00
SpaiR 7b8f06a37b build: migrate to Central Portal publishing 2025-08-26 16:11:08 +03:00
dependabot[bot] 4b274163ec build(deps): bump org.junit.jupiter:junit-jupiter-api (#331)
Bumps [org.junit.jupiter:junit-jupiter-api](https://github.com/junit-team/junit5) from 5.11.3 to 5.12.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.3...r5.12.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-26 14:01:34 +03:00
39 changed files with 4356 additions and 3918 deletions

No files matched your search

+15 -15
View File
@@ -16,12 +16,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: liberica
java-version: |
@@ -29,7 +29,7 @@ jobs:
17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v5
- name: Build
run: ./gradlew buildAll
@@ -43,7 +43,7 @@ jobs:
cp imgui-lwjgl3/build/libs/*.jar tmp/
- name: Upload Artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: java-libraries
path: tmp/*.jar
@@ -64,13 +64,13 @@ jobs:
runs-on: ${{ matrix.target.os }}
steps:
- name: Checkout Repository and Submodules
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: liberica
java-version: |
@@ -78,7 +78,7 @@ jobs:
17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v5
- name: Install Dependencies (for Windows build)
if: matrix.target.type == 'windows'
@@ -90,7 +90,7 @@ jobs:
buildSrc/scripts/build.sh ${{ matrix.target.type }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: native-library-${{ matrix.target.type }}
path: /tmp/imgui/dst/
@@ -102,7 +102,7 @@ jobs:
needs: build-natives
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
uses: actions/upload-artifact/merge@v5
with:
name: native-libraries
pattern: native-library-*
@@ -114,10 +114,10 @@ jobs:
needs: archive-natives
steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Download Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v6
with:
path: /tmp/artifacts
@@ -154,12 +154,12 @@ jobs:
needs: [ build-java, archive-natives ]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: liberica
java-version: |
@@ -167,10 +167,10 @@ jobs:
17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v5
- name: Download Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v6
with:
path: out/artifacts
+230
View File
@@ -0,0 +1,230 @@
# Building imgui-java WCHAR32 Fork
This fork adds `IMGUI_USE_WCHAR32=1` support so that ImGui can handle Unicode codepoints above U+FFFF (emoji, CJK extensions, etc.). Published as `org.nnstd.imgui:imgui-java-*:1.90.0-wchar32+mrlokopN`.
## Repository
- **Maven**: `https://mvn.mrlokop.dev/releases`
- **Git**: `https://git.mrlokop.dev/shlepa/imgui-java`
## Coordinates
```xml
<repository>
<id>mrlokop</id>
<url>https://mvn.mrlokop.dev/releases</url>
</repository>
<dependency>
<groupId>org.nnstd.imgui</groupId>
<artifactId>imgui-java-binding</artifactId>
<version>1.90.0-wchar32+mrlokop2</version>
</dependency>
<dependency>
<groupId>org.nnstd.imgui</groupId>
<artifactId>imgui-java-lwjgl3</artifactId>
<version>1.90.0-wchar32+mrlokop2</version>
</dependency>
<!-- Pick one natives artifact for your platform: -->
<dependency>
<groupId>org.nnstd.imgui</groupId>
<artifactId>imgui-java-natives-macos</artifactId>
<version>1.90.0-wchar32+mrlokop2</version>
</dependency>
<dependency>
<groupId>org.nnstd.imgui</groupId>
<artifactId>imgui-java-natives-linux</artifactId>
<version>1.90.0-wchar32+mrlokop2</version>
</dependency>
<dependency>
<groupId>org.nnstd.imgui</groupId>
<artifactId>imgui-java-natives-windows</artifactId>
<version>1.90.0-wchar32+mrlokop2</version>
</dependency>
<!-- Or use the fat jar (includes all natives + LWJGL3): -->
<dependency>
<groupId>org.nnstd.imgui</groupId>
<artifactId>imgui-java-app</artifactId>
<version>1.90.0-wchar32+mrlokop2</version>
</dependency>
```
For Gradle (Kotlin DSL):
```kotlin
repositories {
maven("https://mvn.mrlokop.dev/releases")
}
dependencies {
implementation("org.nnstd.imgui:imgui-java-binding:1.90.0-wchar32+mrlokop2")
implementation("org.nnstd.imgui:imgui-java-lwjgl3:1.90.0-wchar32+mrlokop2")
runtimeOnly("org.nnstd.imgui:imgui-java-natives-linux:1.90.0-wchar32+mrlokop2")
}
```
## Version History
| Version | Linux toolchain | Notes |
|---------|-----------------|-------|
| `+mrlokop1` | musl (`x86_64-unknown-linux-musl`) | No glibc dependency; static stdlib |
| `+mrlokop2` | glibc (`x86_64-unknown-linux-gnu`) | Standard Linux distros; links libc.so.6 |
## Prerequisites (macOS build host)
All cross-compilation is done from a macOS machine.
```bash
# Java 17 (build toolchain)
sdk install java 17.0.18.1-sem # via SDKMAN
# Native build tools
brew install ant
brew install mingw-w64 # Windows cross-compiler
# Linux glibc cross-compiler (for +mrlokop2 / recommended)
brew tap messense/macos-cross-toolchains
brew install x86_64-unknown-linux-gnu
# Linux musl cross-compiler (for +mrlokop1 / no-glibc builds)
brew install x86_64-unknown-linux-musl
```
## Build Steps
### 1. Clone and initialise submodules
```bash
git clone https://git.mrlokop.dev/shlepa/imgui-java
cd imgui-java
git submodule update --init --recursive
```
### 2. Build vendored FreeType for each platform
FreeType must be cross-compiled before the JNI natives.
```bash
buildSrc/scripts/vendor_freetype.sh macos
buildSrc/scripts/vendor_freetype.sh linux
buildSrc/scripts/vendor_freetype.sh windows
```
Each invocation drops a static `libfreetype.a` into `build/vendor/freetype/lib/`. The macOS build uses `lipo` to create a universal (arm64 + x86_64) library automatically.
### 3. Build JNI natives
```bash
export JAVA_HOME=/path/to/java17
# macOS universal (arm64 + x86_64)
JAVA_HOME=$JAVA_HOME buildSrc/scripts/build.sh macos
# Linux x86_64 (glibc)
JAVA_HOME=$JAVA_HOME buildSrc/scripts/build.sh linux
# Windows x86_64 (mingw)
JAVA_HOME=$JAVA_HOME buildSrc/scripts/build.sh windows
```
Compiled natives land in:
- `bin/macos64/libimgui-java64.dylib`
- `bin/macosarm64/libimgui-java64.dylib`
- `bin/linux64/libimgui-java64.so`
- `bin/windows64/imgui-java64.dll`
### 4. Bump the version (when releasing a new patch)
Edit `build.gradle` (root), increment the `+mrlokopN` suffix:
```groovy
version = '1.90.0-wchar32+mrlokop3' // was +mrlokop2
```
### 5. Publish to Maven
Publish each platform's natives separately because the artifact classifier differs. Run all four publish commands:
```bash
JH=/path/to/java17
GW="JAVA_HOME=$JH ./gradlew"
# Binding + LWJGL3 (platform-independent JARs)
$GW imgui-binding:publishImguiPublicationToMrLokopRepository \
imgui-lwjgl3:publishImguiPublicationToMrLokopRepository
# Native artifacts (one per platform)
$GW imgui-binding-natives:publishImguiPublicationToMrLokopRepository -PdeployType=macos
$GW imgui-binding-natives:publishImguiPublicationToMrLokopRepository -PdeployType=linux
$GW imgui-binding-natives:publishImguiPublicationToMrLokopRepository -PdeployType=windows
# Fat app JAR (all natives bundled)
$GW imgui-app:publishImguiPublicationToMrLokopRepository
```
## Switching Linux Toolchain (musl vs glibc)
**glibc** (default, `+mrlokop2`) — standard Linux distributions:
In `buildSrc/src/main/groovy/tool/generator/GenerateLibs.groovy`:
```groovy
linux64.compilerPrefix = 'x86_64-unknown-linux-gnu-'
```
In `buildSrc/scripts/vendor_freetype.sh`:
```bash
linux) build_freetype "-fPIC" "--host=x86_64-unknown-linux-gnu" "lib/libfreetype.a" "x86_64-unknown-linux-gnu-gcc" ;;
```
**musl** (`+mrlokop1`) — no glibc dependency, portable:
In `GenerateLibs.groovy`:
```groovy
linux64.compilerPrefix = 'x86_64-unknown-linux-musl-'
linux64.linkerFlags = linux64.linkerFlags.replace('-Wl,-wrap,memcpy', '')
// After AntScriptGenerator.generate(), neutralise memcpy_wrap.c:
def memcpyWrap = new File("$jniDir/memcpy_wrap.c")
if (memcpyWrap.exists()) {
memcpyWrap.text = '/* disabled for musl */'
}
```
In `vendor_freetype.sh`:
```bash
linux) build_freetype "-fPIC" "--host=x86_64-unknown-linux-musl" "lib/libfreetype.a" "x86_64-unknown-linux-musl-gcc" ;;
```
## Key Changes vs Upstream
| File | Change |
|------|--------|
| `imgui-binding/src/main/native/imconfig.h` | Uncommented `#define IMGUI_USE_WCHAR32` |
| `ImFontGlyphRangesBuilder.java` | `UNICODE_CODEPOINT_MAX=0x10FFFF`; `addChar(int)`; 32-bit LE encoding in `addRanges`/`buildRanges` |
| `ImFontConfig.java` | Added `setGlyphRanges(int[])` overload |
| `ImFontAtlas.java` | `RETURN_GLYPH_2_SHORT` macro uses `sizeof(ImWchar)/sizeof(jshort)` multiplier |
| `build.gradle` | Version hardcoded to `1.90.0-wchar32+mrlokopN` |
| `publish.gradle` | `groupId=org.nnstd.imgui`, repo=`https://mvn.mrlokop.dev/releases` |
| `GenerateLibs.groovy` | Linux uses `x86_64-unknown-linux-gnu-` prefix |
| `vendor_freetype.sh` | `--host=` flags for all platforms; macOS universal via `lipo` |
## 32-bit Glyph Range Encoding
With `IMGUI_USE_WCHAR32`, `ImWchar` is `uint32_t` (4 bytes). The Java binding stores glyph ranges as `short[]` where each 32-bit codepoint is packed as two little-endian `jshort`s:
```
ranges = [lo_lo, lo_hi, hi_lo, hi_hi, ..., 0, 0]
^--- pair 1 ---^ ^--- pair 2+ ---^ terminator
```
Use `ImFontGlyphRangesBuilder.buildRanges()` or `ImFontConfig.setGlyphRanges(int[])` to handle this automatically:
```java
// int[] variant (simplest)
fontConfig.setGlyphRanges(new int[]{ 0x1F000, 0x1F9FF, 0 });
// Builder variant
ImFontGlyphRangesBuilder builder = new ImFontGlyphRangesBuilder();
builder.addText("Hello 🌍");
short[] ranges = builder.buildRanges();
fontConfig.setGlyphRanges(ranges);
```
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -8,7 +8,7 @@ ext {
allprojects {
group = 'imgui-java'
version = 'git describe --tags --always'.execute().text.trim().substring(1)
version = '1.90.0-wchar32+mrlokop4'
repositories {
mavenCentral()
+2 -2
View File
@@ -16,6 +16,6 @@ dependencies {
implementation("com.lordcodes.turtle:turtle:0.6.0")
implementation("fr.inria.gforge.spoon:spoon-core:10.3.0")
implementation("com.fasterxml.jackson.core:jackson-core:2.18.0")
implementation("com.fasterxml.jackson.core:jackson-databind:2.18.0")
implementation("com.fasterxml.jackson.core:jackson-core:2.20.0")
implementation("com.fasterxml.jackson.core:jackson-databind:2.20.0")
}
+3
View File
@@ -42,4 +42,7 @@ publish_natives "windows"
publish_natives "linux"
publish_natives "macos"
echo "> Nexus manual upload..."
curl -D - -X POST -u "${NEXUS_UPD_ID}:${NEXUS_UPD_PASS}" "https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/io.github.spair"
echo "All modules and natives published successfully."
+12 -5
View File
@@ -35,16 +35,23 @@ echo "FreeType unzipped to $LIBDIR"
COMMON_FLAGS="--enable-static --disable-shared --without-zlib --without-bzip2 --without-png --without-harfbuzz --without-brotli"
# Function to configure and build FreeType
# Args: cflags prefix output_dir [cc]
build_freetype() {
cflags=$1
prefix=$2
output_dir=$3
cc=${4:-}
echo "Cleaning previous builds..."
make clean
echo "Configuring FreeType with CFLAGS='$cflags' and PREFIX='$prefix'..."
./configure CFLAGS="$cflags" $COMMON_FLAGS $prefix
if [ -n "$cc" ]; then
echo "Configuring FreeType with CC='$cc' CFLAGS='$cflags' and PREFIX='$prefix'..."
./configure CC="$cc" CFLAGS="$cflags" $COMMON_FLAGS $prefix
else
echo "Configuring FreeType with CFLAGS='$cflags' and PREFIX='$prefix'..."
./configure CFLAGS="$cflags" $COMMON_FLAGS $prefix
fi
if [ $? -ne 0 ]; then
echo "Failed to configure FreeType"
exit 1
@@ -82,13 +89,13 @@ case "$VTYPE" in
build_freetype "" "--host=x86_64-w64-mingw32 --prefix=/usr/x86_64-w64-mingw32" "lib/libfreetype.a"
;;
linux)
build_freetype "-fPIC" "" "lib/libfreetype.a"
build_freetype "-fPIC" "--host=x86_64-unknown-linux-gnu" "lib/libfreetype.a" "x86_64-unknown-linux-gnu-gcc"
;;
macos)
MACOS_VERSION=10.15
build_freetype "-arch x86_64 -mmacosx-version-min=$MACOS_VERSION" "" "tmp/libfreetype-x86_64.a"
build_freetype "-arch arm64 -mmacosx-version-min=$MACOS_VERSION" "" "tmp/libfreetype-arm64.a"
build_freetype "-arch x86_64 -mmacosx-version-min=$MACOS_VERSION" "--host=x86_64-apple-darwin" "tmp/libfreetype-x86_64.a"
build_freetype "-arch arm64 -mmacosx-version-min=$MACOS_VERSION" "--host=aarch64-apple-darwin" "tmp/libfreetype-arm64.a"
echo "Creating universal library using lipo..."
lipo -create -output lib/libfreetype.a tmp/libfreetype-x86_64.a tmp/libfreetype-arm64.a
@@ -108,12 +108,14 @@ class GenerateLibs extends DefaultTask {
if (forWindows) {
def win64 = BuildTarget.newDefaultTarget(Os.Windows, Architecture.Bitness._64)
win64.compilerPrefix = 'x86_64-w64-mingw32-'
addFreeTypeIfEnabled(win64)
buildTargets += win64
}
if (forLinux) {
def linux64 = BuildTarget.newDefaultTarget(Os.Linux, Architecture.Bitness._64)
linux64.compilerPrefix = 'x86_64-unknown-linux-gnu-'
addFreeTypeIfEnabled(linux64)
buildTargets += linux64
}
@@ -350,8 +350,8 @@ private fun convertManualJni(mOrig: CtMethod<*>, method: CtMethod<*>): CtMethod<
}
if (p.isType("String")) {
getLines += "auto ${p.simpleName} = obj_${p.simpleName} == NULL ? NULL : (char*)env->GetStringUTFChars(obj_${p.simpleName}, JNI_FALSE)"
releaseLines += "if (${p.simpleName} != NULL) env->ReleaseStringUTFChars(obj_${p.simpleName}, ${p.simpleName})"
getLines += "auto ${p.simpleName} = Jni::ToTrueUtf8(env, obj_${p.simpleName})"
releaseLines += "Jni::FreeTrueUtf8(${p.simpleName})"
isConverted = true
}
@@ -361,14 +361,12 @@ private fun convertManualJni(mOrig: CtMethod<*>, method: CtMethod<*>): CtMethod<
const char* ${p.simpleName}[$countParam];
for (int i = 0; i < ${p.simpleName}$PARAM_ARR_LEN_POSTFIX; i++) {
const jstring str = (jstring)env->GetObjectArrayElement(obj_${p.simpleName}, i);
auto rawStr = (char*)env->GetStringUTFChars(str, JNI_FALSE);
${p.simpleName}[i] = rawStr;
${p.simpleName}[i] = Jni::ToTrueUtf8(env, str);
}
""".trimIndent()
releaseLines += """
for (int i = 0; i < $countParam; i++) {
const jstring str = (jstring)env->GetObjectArrayElement(obj_${p.simpleName}, i);
env->ReleaseStringUTFChars(str, ${p.simpleName}[i]);
Jni::FreeTrueUtf8((char*)${p.simpleName}[i]);
}
""".trimIndent()
isConverted = true
+1
View File
@@ -1,3 +1,4 @@
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.jvmargs=-Xms2G -Xmx4G
org.gradle.java.installations.paths=/Users/user/.sdkman/candidates/java/8.0.472-amzn,/Users/user/.sdkman/candidates/java/17.0.18.1-sem,/Users/user/.sdkman/candidates/java/25-amzn
@@ -734,19 +734,19 @@ public final class ImDrawList extends ImGuiStruct {
}
private native void nAddText(float posX, float posY, int col, String textBegin); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
ImVec2 pos = ImVec2(posX, posY);
THIS->AddText(pos, col, textBegin);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
*/
private native void nAddText(float posX, float posY, int col, String textBegin, String textEnd); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
ImVec2 pos = ImVec2(posX, posY);
THIS->AddText(pos, col, textBegin, textEnd);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
*/
public void addText(final ImFont font, final int fontSize, final ImVec2 pos, final int col, final String textBegin) {
@@ -806,64 +806,64 @@ public final class ImDrawList extends ImGuiStruct {
}
private native void nAddText(long font, int fontSize, float posX, float posY, int col, String textBegin); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
ImVec2 pos = ImVec2(posX, posY);
THIS->AddText(reinterpret_cast<ImFont*>(font), fontSize, pos, col, textBegin);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
*/
private native void nAddText(long font, int fontSize, float posX, float posY, int col, String textBegin, String textEnd); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
ImVec2 pos = ImVec2(posX, posY);
THIS->AddText(reinterpret_cast<ImFont*>(font), fontSize, pos, col, textBegin, textEnd);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
*/
private native void nAddText(long font, int fontSize, float posX, float posY, int col, String textBegin, String textEnd, float wrapWidth); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
ImVec2 pos = ImVec2(posX, posY);
THIS->AddText(reinterpret_cast<ImFont*>(font), fontSize, pos, col, textBegin, textEnd, wrapWidth);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
*/
private native void nAddText(long font, int fontSize, float posX, float posY, int col, String textBegin, String textEnd, float wrapWidth, float cpuFineClipRectX, float cpuFineClipRectY, float cpuFineClipRectZ, float cpuFineClipRectW); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
ImVec2 pos = ImVec2(posX, posY);
ImVec4 cpuFineClipRect = ImVec4(cpuFineClipRectX, cpuFineClipRectY, cpuFineClipRectZ, cpuFineClipRectW);
THIS->AddText(reinterpret_cast<ImFont*>(font), fontSize, pos, col, textBegin, textEnd, wrapWidth, &cpuFineClipRect);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
*/
private native void nAddText(long font, int fontSize, float posX, float posY, int col, String textBegin, float wrapWidth, float cpuFineClipRectX, float cpuFineClipRectY, float cpuFineClipRectZ, float cpuFineClipRectW); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
ImVec2 pos = ImVec2(posX, posY);
ImVec4 cpuFineClipRect = ImVec4(cpuFineClipRectX, cpuFineClipRectY, cpuFineClipRectZ, cpuFineClipRectW);
THIS->AddText(reinterpret_cast<ImFont*>(font), fontSize, pos, col, textBegin, NULL, wrapWidth, &cpuFineClipRect);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
*/
private native void nAddText(long font, int fontSize, float posX, float posY, int col, String textBegin, float cpuFineClipRectX, float cpuFineClipRectY, float cpuFineClipRectZ, float cpuFineClipRectW); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
ImVec2 pos = ImVec2(posX, posY);
ImVec4 cpuFineClipRect = ImVec4(cpuFineClipRectX, cpuFineClipRectY, cpuFineClipRectZ, cpuFineClipRectW);
THIS->AddText(reinterpret_cast<ImFont*>(font), fontSize, pos, col, textBegin, NULL, 0.0f, &cpuFineClipRect);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
*/
private native void nAddText(long font, int fontSize, float posX, float posY, int col, String textBegin, String textEnd, float cpuFineClipRectX, float cpuFineClipRectY, float cpuFineClipRectZ, float cpuFineClipRectW); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
ImVec2 pos = ImVec2(posX, posY);
ImVec4 cpuFineClipRect = ImVec4(cpuFineClipRectX, cpuFineClipRectY, cpuFineClipRectZ, cpuFineClipRectW);
THIS->AddText(reinterpret_cast<ImFont*>(font), fontSize, pos, col, textBegin, textEnd, 0.0f, &cpuFineClipRect);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
*/
/**
@@ -407,48 +407,48 @@ public final class ImFont extends ImGuiStructDestroyable {
}
private native void nCalcTextSizeA(ImVec2 dst, float size, float maxWidth, float wrapWidth, String textBegin); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
Jni::ImVec2Cpy(env, THIS->CalcTextSizeA(size, maxWidth, wrapWidth, textBegin), dst);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
*/
private native float nCalcTextSizeAX(float size, float maxWidth, float wrapWidth, String obj_textBegin); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto _result = THIS->CalcTextSizeA(size, maxWidth, wrapWidth, textBegin).x;
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
return _result;
*/
private native float nCalcTextSizeAY(float size, float maxWidth, float wrapWidth, String obj_textBegin); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto _result = THIS->CalcTextSizeA(size, maxWidth, wrapWidth, textBegin).y;
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
return _result;
*/
private native void nCalcTextSizeA(ImVec2 dst, float size, float maxWidth, float wrapWidth, String textBegin, String textEnd); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
Jni::ImVec2Cpy(env, THIS->CalcTextSizeA(size, maxWidth, wrapWidth, textBegin, textEnd), dst);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
*/
private native float nCalcTextSizeAX(float size, float maxWidth, float wrapWidth, String obj_textBegin, String obj_textEnd); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
auto _result = THIS->CalcTextSizeA(size, maxWidth, wrapWidth, textBegin, textEnd).x;
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
return _result;
*/
private native float nCalcTextSizeAY(float size, float maxWidth, float wrapWidth, String obj_textBegin, String obj_textEnd); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
auto _result = THIS->CalcTextSizeA(size, maxWidth, wrapWidth, textBegin, textEnd).y;
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
return _result;
*/
@@ -457,11 +457,11 @@ public final class ImFont extends ImGuiStructDestroyable {
}
private native String nCalcWordWrapPositionA(float scale, String obj_text, String obj_textEnd, float wrapWidth); /*MANUAL
auto text = obj_text == NULL ? NULL : (char*)env->GetStringUTFChars(obj_text, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto text = obj_text == NULL ? NULL : Jni::ToTrueUtf8(env, obj_text);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
auto _result = env->NewStringUTF(THIS->CalcWordWrapPositionA(scale, text, textEnd, wrapWidth));
if (text != NULL) env->ReleaseStringUTFChars(obj_text, text);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (text != NULL) Jni::FreeTrueUtf8(text);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
return _result;
*/
@@ -511,43 +511,43 @@ public final class ImFont extends ImGuiStructDestroyable {
}
private native void nRenderText(long drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
ImVec2 pos = ImVec2(posX, posY);
ImVec4 clipRect = ImVec4(clipRectX, clipRectY, clipRectZ, clipRectW);
THIS->RenderText(reinterpret_cast<ImDrawList*>(drawList), size, pos, col, clipRect, textBegin, textEnd);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
*/
private native void nRenderText(long drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd, float wrapWidth); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
ImVec2 pos = ImVec2(posX, posY);
ImVec4 clipRect = ImVec4(clipRectX, clipRectY, clipRectZ, clipRectW);
THIS->RenderText(reinterpret_cast<ImDrawList*>(drawList), size, pos, col, clipRect, textBegin, textEnd, wrapWidth);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
*/
private native void nRenderText(long drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd, float wrapWidth, boolean cpuFineClip); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
ImVec2 pos = ImVec2(posX, posY);
ImVec4 clipRect = ImVec4(clipRectX, clipRectY, clipRectZ, clipRectW);
THIS->RenderText(reinterpret_cast<ImDrawList*>(drawList), size, pos, col, clipRect, textBegin, textEnd, wrapWidth, cpuFineClip);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
*/
private native void nRenderText(long drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd, boolean cpuFineClip); /*MANUAL
auto textBegin = obj_textBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textBegin, JNI_FALSE);
auto textEnd = obj_textEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_textEnd, JNI_FALSE);
auto textBegin = obj_textBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textBegin);
auto textEnd = obj_textEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_textEnd);
ImVec2 pos = ImVec2(posX, posY);
ImVec4 clipRect = ImVec4(clipRectX, clipRectY, clipRectZ, clipRectW);
THIS->RenderText(reinterpret_cast<ImDrawList*>(drawList), size, pos, col, clipRect, textBegin, textEnd, 0.0f, cpuFineClip);
if (textBegin != NULL) env->ReleaseStringUTFChars(obj_textBegin, textBegin);
if (textEnd != NULL) env->ReleaseStringUTFChars(obj_textEnd, textEnd);
if (textBegin != NULL) Jni::FreeTrueUtf8(textBegin);
if (textEnd != NULL) Jni::FreeTrueUtf8(textEnd);
*/
/*JNI
@@ -101,33 +101,33 @@ public final class ImFontAtlas extends ImGuiStructDestroyable {
}
private native long nAddFontFromFileTTF(String obj_filename, float sizePixels); /*MANUAL
auto filename = obj_filename == NULL ? NULL : (char*)env->GetStringUTFChars(obj_filename, JNI_FALSE);
auto filename = obj_filename == NULL ? NULL : Jni::ToTrueUtf8(env, obj_filename);
auto _result = (uintptr_t)THIS->AddFontFromFileTTF(filename, sizePixels);
if (filename != NULL) env->ReleaseStringUTFChars(obj_filename, filename);
if (filename != NULL) Jni::FreeTrueUtf8(filename);
return _result;
*/
private native long nAddFontFromFileTTF(String obj_filename, float sizePixels, long fontConfig); /*MANUAL
auto filename = obj_filename == NULL ? NULL : (char*)env->GetStringUTFChars(obj_filename, JNI_FALSE);
auto filename = obj_filename == NULL ? NULL : Jni::ToTrueUtf8(env, obj_filename);
auto _result = (uintptr_t)THIS->AddFontFromFileTTF(filename, sizePixels, reinterpret_cast<ImFontConfig*>(fontConfig));
if (filename != NULL) env->ReleaseStringUTFChars(obj_filename, filename);
if (filename != NULL) Jni::FreeTrueUtf8(filename);
return _result;
*/
private native long nAddFontFromFileTTF(String obj_filename, float sizePixels, long fontConfig, short[] obj_glyphRanges); /*MANUAL
auto filename = obj_filename == NULL ? NULL : (char*)env->GetStringUTFChars(obj_filename, JNI_FALSE);
auto filename = obj_filename == NULL ? NULL : Jni::ToTrueUtf8(env, obj_filename);
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
auto _result = (uintptr_t)THIS->AddFontFromFileTTF(filename, sizePixels, reinterpret_cast<ImFontConfig*>(fontConfig), (ImWchar*)&glyphRanges[0]);
if (filename != NULL) env->ReleaseStringUTFChars(obj_filename, filename);
if (filename != NULL) Jni::FreeTrueUtf8(filename);
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
return _result;
*/
private native long nAddFontFromFileTTF(String obj_filename, float sizePixels, short[] obj_glyphRanges); /*MANUAL
auto filename = obj_filename == NULL ? NULL : (char*)env->GetStringUTFChars(obj_filename, JNI_FALSE);
auto filename = obj_filename == NULL ? NULL : Jni::ToTrueUtf8(env, obj_filename);
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
auto _result = (uintptr_t)THIS->AddFontFromFileTTF(filename, sizePixels, NULL, (ImWchar*)&glyphRanges[0]);
if (filename != NULL) env->ReleaseStringUTFChars(obj_filename, filename);
if (filename != NULL) Jni::FreeTrueUtf8(filename);
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
return _result;
*/
@@ -395,17 +395,17 @@ public final class ImFontAtlas extends ImGuiStructDestroyable {
}
private native long nAddFontFromMemoryCompressedBase85TTF(String obj_compressedFontDataBase85, float sizePixels, long fontConfig); /*MANUAL
auto compressedFontDataBase85 = obj_compressedFontDataBase85 == NULL ? NULL : (char*)env->GetStringUTFChars(obj_compressedFontDataBase85, JNI_FALSE);
auto compressedFontDataBase85 = obj_compressedFontDataBase85 == NULL ? NULL : Jni::ToTrueUtf8(env, obj_compressedFontDataBase85);
auto _result = (uintptr_t)THIS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, reinterpret_cast<ImFontConfig*>(fontConfig));
if (compressedFontDataBase85 != NULL) env->ReleaseStringUTFChars(obj_compressedFontDataBase85, compressedFontDataBase85);
if (compressedFontDataBase85 != NULL) Jni::FreeTrueUtf8(compressedFontDataBase85);
return _result;
*/
private native long nAddFontFromMemoryCompressedBase85TTF(String obj_compressedFontDataBase85, float sizePixels, long fontConfig, short[] obj_glyphRanges); /*MANUAL
auto compressedFontDataBase85 = obj_compressedFontDataBase85 == NULL ? NULL : (char*)env->GetStringUTFChars(obj_compressedFontDataBase85, JNI_FALSE);
auto compressedFontDataBase85 = obj_compressedFontDataBase85 == NULL ? NULL : Jni::ToTrueUtf8(env, obj_compressedFontDataBase85);
auto glyphRanges = obj_glyphRanges == NULL ? NULL : (short*)env->GetPrimitiveArrayCritical(obj_glyphRanges, JNI_FALSE);
auto _result = (uintptr_t)THIS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, reinterpret_cast<ImFontConfig*>(fontConfig), (ImWchar*)&glyphRanges[0]);
if (compressedFontDataBase85 != NULL) env->ReleaseStringUTFChars(obj_compressedFontDataBase85, compressedFontDataBase85);
if (compressedFontDataBase85 != NULL) Jni::FreeTrueUtf8(compressedFontDataBase85);
if (glyphRanges != NULL) env->ReleasePrimitiveArrayCritical(obj_glyphRanges, glyphRanges, JNI_FALSE);
return _result;
*/
@@ -594,9 +594,11 @@ public final class ImFontAtlas extends ImGuiStructDestroyable {
/*JNI
#define RETURN_GLYPH_2_SHORT(glyphs) \
const ImWchar* ranges = glyphs; \
int size = 0; \
int pairCount = 0; \
for (; ranges[0]; ranges += 2) \
size += 2; \
pairCount++; \
int shortsPerImWchar = (int)(sizeof(ImWchar) / sizeof(jshort)); \
int size = pairCount * 2 * shortsPerImWchar + shortsPerImWchar; \
jshortArray jShorts = env->NewShortArray(size); \
env->SetShortArrayRegion(jShorts, 0, size, (jshort*)glyphs); \
return jShorts;
@@ -347,6 +347,33 @@ public final class ImFontConfig extends ImGuiStructDestroyable {
nSetGlyphRanges(glyphRanges);
}
/**
* Convenience overload: encodes int[] codepoint pairs into WCHAR32 short[] layout and calls setGlyphRanges.
* Expects int[] pairs [ lo, hi, lo, hi, ..., 0 ] (zero-terminated).
* THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE.
*/
public void setGlyphRanges(final int[] codepoints) {
// count pairs
int pairCount = 0;
for (int i = 0; i + 1 < codepoints.length; i += 2) {
if (codepoints[i] == 0) break;
pairCount++;
}
// each pair = 4 shorts (2 per endpoint), plus 2 terminator shorts
final short[] encoded = new short[pairCount * 4 + 2];
int out = 0;
for (int i = 0; i < pairCount; i++) {
final int lo = codepoints[i * 2];
final int hi = codepoints[i * 2 + 1];
encoded[out++] = (short) (lo & 0xFFFF);
encoded[out++] = (short) ((lo >> 16) & 0xFFFF);
encoded[out++] = (short) (hi & 0xFFFF);
encoded[out++] = (short) ((hi >> 16) & 0xFFFF);
}
// terminator already zero from array initialisation
setGlyphRanges(encoded);
}
private native void nSetGlyphRanges(short[] glyphRanges); /*
THIS->GlyphRanges = glyphRanges != NULL ? (ImWchar*)&glyphRanges[0] : NULL;
*/
@@ -10,12 +10,14 @@ import java.util.List;
* You can use the ImFontGlyphRangesBuilder helper to create glyph ranges based on text input. For example: for a game where your script is known,
* if you can feed your entire script to it and only build the characters the game needs.
* <p>
* Direct reimplementation of native ImFontGlyphRangesBuilder in java
* Direct reimplementation of native ImFontGlyphRangesBuilder in java.
* Built with IMGUI_USE_WCHAR32=1: supports full Unicode range U+0000..U+10FFFF.
* buildRanges() emits each range endpoint as two little-endian shorts (32-bit ImWchar layout).
*/
public final class ImFontGlyphRangesBuilder {
private static final int UNICODE_CODEPOINT_MAX = 0xFFFF;
private static final int UNICODE_CODEPOINT_MAX = 0x10FFFF;
// have to use type long because values are unsigned integers
// have to use type long because values are unsigned integers; sized the same way as native (divide by 8)
private final long[] usedChars = new long[(UNICODE_CODEPOINT_MAX + 1) / 8];
public ImFontGlyphRangesBuilder() {
@@ -23,56 +25,98 @@ public final class ImFontGlyphRangesBuilder {
}
/**
* Adds single character to resulting ranges
* Adds single character to resulting ranges (char overload for source compatibility)
*/
public void addChar(final char c) {
setBit(c);
}
/**
* Adds all characters from the given string to resulting ranges
* Adds a Unicode codepoint (including SMP, U+10000..U+10FFFF) to resulting ranges
*/
public void addText(final String text) {
for (int i = 0; i < text.length(); i++) {
addChar(text.charAt(i));
public void addChar(final int codepoint) {
if (codepoint >= 0 && codepoint <= UNICODE_CODEPOINT_MAX) {
setBit(codepoint);
}
}
/**
* Copies all given ranges to resulting ranges
* Adds all codepoints from the given string to resulting ranges.
* Handles supplementary characters (emoji, etc.) via codePointAt iteration.
*/
public void addText(final String text) {
int i = 0;
while (i < text.length()) {
final int cp = text.codePointAt(i);
addChar(cp);
i += Character.charCount(cp);
}
}
/**
* Copies all given ranges to resulting ranges.
* Expects the WCHAR32 short[] layout: each 32-bit codepoint encoded as two little-endian shorts,
* pairs of codepoints form a [lo, hi] range, terminated by two zero shorts.
* Format: [ lo_lo16, lo_hi16, hi_lo16, hi_hi16, ..., 0, 0 ]
*/
public void addRanges(final short[] ranges) {
for (int i = 0; i < ranges.length; i += 2) {
for (int i = 0; i + 3 < ranges.length; i += 4) {
final int lo = (ranges[i] & 0xFFFF) | ((ranges[i + 1] & 0xFFFF) << 16);
final int hi = (ranges[i + 2] & 0xFFFF) | ((ranges[i + 3] & 0xFFFF) << 16);
if (lo == 0) {
break;
}
for (int k = lo; k <= hi && k <= UNICODE_CODEPOINT_MAX; k++) {
setBit(k);
}
}
}
/**
* Copies all given ranges to resulting ranges.
* Expects int[] pairs: [ lo, hi, lo, hi, ..., 0 ] (zero-terminated).
*/
public void addRanges(final int[] ranges) {
for (int i = 0; i + 1 < ranges.length; i += 2) {
if (ranges[i] == 0) {
break;
}
for (int k = ranges[i]; k <= ranges[i + 1]; k++) {
addChar((char) k);
for (int k = ranges[i]; k <= ranges[i + 1] && k <= UNICODE_CODEPOINT_MAX; k++) {
setBit(k);
}
}
}
/**
* Builds the final result (ordered ranges with all the unique characters submitted)
* Result of this function can be directly passed to ImFontAtlas
* Builds the final result (ordered ranges with all the unique characters submitted).
* Result is in WCHAR32 short[] layout: each range endpoint is two little-endian shorts,
* terminated by two zero shorts.
* Format: [ lo_lo16, lo_hi16, hi_lo16, hi_hi16, ..., 0, 0 ]
*/
public short[] buildRanges() {
final List<Short> out = new ArrayList<>();
for (int n = 0; n <= UNICODE_CODEPOINT_MAX; n++) {
if (getBit(n)) {
out.add((short) n);
final int lo = n;
while (n < UNICODE_CODEPOINT_MAX && getBit(n + 1)) {
n++;
}
out.add((short) n);
final int hi = n;
// emit lo as two LE shorts
out.add((short) (lo & 0xFFFF));
out.add((short) ((lo >> 16) & 0xFFFF));
// emit hi as two LE shorts
out.add((short) (hi & 0xFFFF));
out.add((short) ((hi >> 16) & 0xFFFF));
}
}
final short[] result = new short[out.size() + 1];
// terminator: two zero shorts (= one 32-bit zero ImWchar)
final short[] result = new short[out.size() + 2];
for (int i = 0; i < out.size(); i++) {
result[i] = out.get(i);
}
result[result.length - 2] = 0;
result[result.length - 1] = 0;
return result;
}
File diff suppressed because it is too large. Load diff
@@ -233,9 +233,9 @@ public final class ImGuiIO extends ImGuiStruct {
*/
private native void nSetIniFilename(String value); /*MANUAL
auto value = obj_value == NULL ? NULL : (char*)env->GetStringUTFChars(obj_value, JNI_FALSE);
auto value = obj_value == NULL ? NULL : Jni::ToTrueUtf8(env, obj_value);
SET_STRING_FIELD(THIS->IniFilename, value);
if (value != NULL) env->ReleaseStringUTFChars(obj_value, value);
if (value != NULL) Jni::FreeTrueUtf8(value);
*/
/**
@@ -257,9 +257,9 @@ public final class ImGuiIO extends ImGuiStruct {
*/
private native void nSetLogFilename(String value); /*MANUAL
auto value = obj_value == NULL ? NULL : (char*)env->GetStringUTFChars(obj_value, JNI_FALSE);
auto value = obj_value == NULL ? NULL : Jni::ToTrueUtf8(env, obj_value);
SET_STRING_FIELD(THIS->LogFilename, value);
if (value != NULL) env->ReleaseStringUTFChars(obj_value, value);
if (value != NULL) Jni::FreeTrueUtf8(value);
*/
private static final ImFontAtlas _GETFONTS_1 = new ImFontAtlas(0);
@@ -1075,9 +1075,9 @@ public final class ImGuiIO extends ImGuiStruct {
*/
private native void nSetBackendPlatformName(String value); /*MANUAL
auto value = obj_value == NULL ? NULL : (char*)env->GetStringUTFChars(obj_value, JNI_FALSE);
auto value = obj_value == NULL ? NULL : Jni::ToTrueUtf8(env, obj_value);
SET_STRING_FIELD(THIS->BackendPlatformName, value);
if (value != NULL) env->ReleaseStringUTFChars(obj_value, value);
if (value != NULL) Jni::FreeTrueUtf8(value);
*/
public String getBackendRendererName() {
@@ -1093,9 +1093,9 @@ public final class ImGuiIO extends ImGuiStruct {
*/
private native void nSetBackendRendererName(String value); /*MANUAL
auto value = obj_value == NULL ? NULL : (char*)env->GetStringUTFChars(obj_value, JNI_FALSE);
auto value = obj_value == NULL ? NULL : Jni::ToTrueUtf8(env, obj_value);
SET_STRING_FIELD(THIS->BackendRendererName, value);
if (value != NULL) env->ReleaseStringUTFChars(obj_value, value);
if (value != NULL) Jni::FreeTrueUtf8(value);
*/
// Optional: Access OS clipboard
@@ -1112,7 +1112,7 @@ public final class ImGuiIO extends ImGuiStruct {
const char* getClipboardTextStub(void* user_data) {
JNIEnv* env = Jni::GetEnv();
jstring jstr = Jni::CallImStrSupplier(env, _getClipboardTextCallback);
return env->GetStringUTFChars(jstr, 0);
return Jni::ToTrueUtf8(env, jstr);
}
*/
@@ -1280,9 +1280,9 @@ public final class ImGuiIO extends ImGuiStruct {
}
private native void nAddInputCharactersUTF8(String str); /*MANUAL
auto str = obj_str == NULL ? NULL : (char*)env->GetStringUTFChars(obj_str, JNI_FALSE);
auto str = obj_str == NULL ? NULL : Jni::ToTrueUtf8(env, obj_str);
THIS->AddInputCharactersUTF8(str);
if (str != NULL) env->ReleaseStringUTFChars(obj_str, str);
if (str != NULL) Jni::FreeTrueUtf8(str);
*/
/**
@@ -141,9 +141,9 @@ public class ImGuiInputTextCallbackData extends ImGuiStruct {
*/
private native void nSetBuf(String value); /*MANUAL
auto value = obj_value == NULL ? NULL : (char*)env->GetStringUTFChars(obj_value, JNI_FALSE);
auto value = obj_value == NULL ? NULL : Jni::ToTrueUtf8(env, obj_value);
SET_STRING_FIELD(THIS->Buf, value);
if (value != NULL) env->ReleaseStringUTFChars(obj_value, value);
if (value != NULL) Jni::FreeTrueUtf8(value);
*/
/**
@@ -285,9 +285,9 @@ public class ImGuiInputTextCallbackData extends ImGuiStruct {
}
private native void nInsertChars(int pos, String str); /*MANUAL
auto str = obj_str == NULL ? NULL : (char*)env->GetStringUTFChars(obj_str, JNI_FALSE);
auto str = obj_str == NULL ? NULL : Jni::ToTrueUtf8(env, obj_str);
THIS->InsertChars(pos, str);
if (str != NULL) env->ReleaseStringUTFChars(obj_str, str);
if (str != NULL) Jni::FreeTrueUtf8(str);
*/
public void selectAll() {
@@ -53,16 +53,16 @@ public final class ImGuiTextFilter extends ImGuiStructDestroyable {
*/
private native boolean nDraw(String obj_label); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto _result = THIS->Draw(label);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
return _result;
*/
private native boolean nDraw(String obj_label, float width); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto _result = THIS->Draw(label, width);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
return _result;
*/
@@ -75,9 +75,9 @@ public final class ImGuiTextFilter extends ImGuiStructDestroyable {
}
private native boolean nPassFilter(String obj_text); /*MANUAL
auto text = obj_text == NULL ? NULL : (char*)env->GetStringUTFChars(obj_text, JNI_FALSE);
auto text = obj_text == NULL ? NULL : Jni::ToTrueUtf8(env, obj_text);
auto _result = THIS->PassFilter(text, NULL);
if (text != NULL) env->ReleaseStringUTFChars(obj_text, text);
if (text != NULL) Jni::FreeTrueUtf8(text);
return _result;
*/
@@ -352,164 +352,164 @@ public final class ImGuiKnobs {
}
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed, String obj_format); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed, String obj_format, int variant); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, variant);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed, String obj_format, int variant, float size); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, variant, size);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed, String obj_format, int variant, float size, int flags); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, variant, size, flags);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed, String obj_format, int variant, float size, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, variant, size, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, String obj_format, int variant, float size, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, 0, format, variant, size, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, int variant, float size, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, 0, NULL, variant, size, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed, int variant, float size, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, NULL, variant, size, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed, float size, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, NULL, ImGuiKnobVariant_Tick, size, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, NULL, ImGuiKnobVariant_Tick, 0, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, NULL, ImGuiKnobVariant_Tick, 0, 0, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed, String obj_format, float size, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, ImGuiKnobVariant_Tick, size, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed, String obj_format, int variant, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, variant, 0, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, float[] obj_pValue, float vMin, float vMax, float speed, String obj_format, int variant, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (float*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::Knob(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, variant, 0, 0, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
@@ -850,164 +850,164 @@ public final class ImGuiKnobs {
}
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed, String obj_format); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed, String obj_format, int variant); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, variant);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed, String obj_format, int variant, float size); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, variant, size);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed, String obj_format, int variant, float size, int flags); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, variant, size, flags);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed, String obj_format, int variant, float size, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, variant, size, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, String obj_format, int variant, float size, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, 0, format, variant, size, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, int variant, float size, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, 0, NULL, variant, size, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed, int variant, float size, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, NULL, variant, size, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed, float size, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, NULL, ImGuiKnobVariant_Tick, size, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, NULL, ImGuiKnobVariant_Tick, 0, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, NULL, ImGuiKnobVariant_Tick, 0, 0, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed, String obj_format, float size, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, ImGuiKnobVariant_Tick, size, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed, String obj_format, int variant, int flags, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, variant, 0, flags, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
private static native boolean nKnob(String obj_label, int[] obj_pValue, int vMin, int vMax, float speed, String obj_format, int variant, int steps); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto pValue = obj_pValue == NULL ? NULL : (int*)env->GetPrimitiveArrayCritical(obj_pValue, JNI_FALSE);
auto format = obj_format == NULL ? NULL : (char*)env->GetStringUTFChars(obj_format, JNI_FALSE);
auto format = obj_format == NULL ? NULL : Jni::ToTrueUtf8(env, obj_format);
auto _result = ImGuiKnobs::KnobInt(label, (pValue != NULL ? &pValue[0] : NULL), vMin, vMax, speed, format, variant, 0, 0, steps);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (pValue != NULL) env->ReleasePrimitiveArrayCritical(obj_pValue, pValue, JNI_FALSE);
if (format != NULL) env->ReleaseStringUTFChars(obj_format, format);
if (format != NULL) Jni::FreeTrueUtf8(format);
return _result;
*/
}
@@ -1123,9 +1123,9 @@ public final class ImNodes {
}
private static native void nLoadCurrentEditorStateFromIniString(String data, int dataSize); /*MANUAL
auto data = obj_data == NULL ? NULL : (char*)env->GetStringUTFChars(obj_data, JNI_FALSE);
auto data = obj_data == NULL ? NULL : Jni::ToTrueUtf8(env, obj_data);
ImNodes::LoadCurrentEditorStateFromIniString(data, dataSize);
if (data != NULL) env->ReleaseStringUTFChars(obj_data, data);
if (data != NULL) Jni::FreeTrueUtf8(data);
*/
public static void loadEditorStateFromIniString(final ImNodesEditorContext editor, final String data, final int dataSize) {
@@ -1133,9 +1133,9 @@ public final class ImNodes {
}
private static native void nLoadEditorStateFromIniString(long editor, String data, int dataSize); /*MANUAL
auto data = obj_data == NULL ? NULL : (char*)env->GetStringUTFChars(obj_data, JNI_FALSE);
auto data = obj_data == NULL ? NULL : Jni::ToTrueUtf8(env, obj_data);
ImNodes::LoadEditorStateFromIniString(reinterpret_cast<ImNodesEditorContext*>(editor), data, dataSize);
if (data != NULL) env->ReleaseStringUTFChars(obj_data, data);
if (data != NULL) Jni::FreeTrueUtf8(data);
*/
public static void saveCurrentEditorStateToIniFile(final String fileName) {
@@ -1143,9 +1143,9 @@ public final class ImNodes {
}
private static native void nSaveCurrentEditorStateToIniFile(String fileName); /*MANUAL
auto fileName = obj_fileName == NULL ? NULL : (char*)env->GetStringUTFChars(obj_fileName, JNI_FALSE);
auto fileName = obj_fileName == NULL ? NULL : Jni::ToTrueUtf8(env, obj_fileName);
ImNodes::SaveCurrentEditorStateToIniFile(fileName);
if (fileName != NULL) env->ReleaseStringUTFChars(obj_fileName, fileName);
if (fileName != NULL) Jni::FreeTrueUtf8(fileName);
*/
public static void saveEditorStateToIniFile(final ImNodesEditorContext editor, final String fileName) {
@@ -1153,9 +1153,9 @@ public final class ImNodes {
}
private static native void nSaveEditorStateToIniFile(long editor, String fileName); /*MANUAL
auto fileName = obj_fileName == NULL ? NULL : (char*)env->GetStringUTFChars(obj_fileName, JNI_FALSE);
auto fileName = obj_fileName == NULL ? NULL : Jni::ToTrueUtf8(env, obj_fileName);
ImNodes::SaveEditorStateToIniFile(reinterpret_cast<ImNodesEditorContext*>(editor), fileName);
if (fileName != NULL) env->ReleaseStringUTFChars(obj_fileName, fileName);
if (fileName != NULL) Jni::FreeTrueUtf8(fileName);
*/
public static void loadCurrentEditorStateFromIniFile(final String fileName) {
@@ -1163,9 +1163,9 @@ public final class ImNodes {
}
private static native void nLoadCurrentEditorStateFromIniFile(String fileName); /*MANUAL
auto fileName = obj_fileName == NULL ? NULL : (char*)env->GetStringUTFChars(obj_fileName, JNI_FALSE);
auto fileName = obj_fileName == NULL ? NULL : Jni::ToTrueUtf8(env, obj_fileName);
ImNodes::LoadCurrentEditorStateFromIniFile(fileName);
if (fileName != NULL) env->ReleaseStringUTFChars(obj_fileName, fileName);
if (fileName != NULL) Jni::FreeTrueUtf8(fileName);
*/
public static void loadEditorStateFromIniFile(final ImNodesEditorContext editor, final String fileName) {
@@ -1173,8 +1173,8 @@ public final class ImNodes {
}
private static native void nLoadEditorStateFromIniFile(long editor, String fileName); /*MANUAL
auto fileName = obj_fileName == NULL ? NULL : (char*)env->GetStringUTFChars(obj_fileName, JNI_FALSE);
auto fileName = obj_fileName == NULL ? NULL : Jni::ToTrueUtf8(env, obj_fileName);
ImNodes::LoadEditorStateFromIniFile(reinterpret_cast<ImNodesEditorContext*>(editor), fileName);
if (fileName != NULL) env->ReleaseStringUTFChars(obj_fileName, fileName);
if (fileName != NULL) Jni::FreeTrueUtf8(fileName);
*/
}
File diff suppressed because it is too large. Load diff
@@ -263,15 +263,15 @@ public final class MemoryEditor extends ImGuiStructDestroyable {
}
private native void nDrawWindow(String title, long memData, long memSize); /*MANUAL
auto title = obj_title == NULL ? NULL : (char*)env->GetStringUTFChars(obj_title, JNI_FALSE);
auto title = obj_title == NULL ? NULL : Jni::ToTrueUtf8(env, obj_title);
THIS->DrawWindow(title, reinterpret_cast<void*>(memData), memSize);
if (title != NULL) env->ReleaseStringUTFChars(obj_title, title);
if (title != NULL) Jni::FreeTrueUtf8(title);
*/
private native void nDrawWindow(String title, long memData, long memSize, long baseDisplayAddr); /*MANUAL
auto title = obj_title == NULL ? NULL : (char*)env->GetStringUTFChars(obj_title, JNI_FALSE);
auto title = obj_title == NULL ? NULL : Jni::ToTrueUtf8(env, obj_title);
THIS->DrawWindow(title, reinterpret_cast<void*>(memData), memSize, baseDisplayAddr);
if (title != NULL) env->ReleaseStringUTFChars(obj_title, title);
if (title != NULL) Jni::FreeTrueUtf8(title);
*/
public void drawContents(final long memData, final long memSize) {
@@ -183,16 +183,16 @@ public final class NodeEditor {
}
private static native void nBegin(String id); /*MANUAL
auto id = obj_id == NULL ? NULL : (char*)env->GetStringUTFChars(obj_id, JNI_FALSE);
auto id = obj_id == NULL ? NULL : Jni::ToTrueUtf8(env, obj_id);
ax::NodeEditor::Begin(id);
if (id != NULL) env->ReleaseStringUTFChars(obj_id, id);
if (id != NULL) Jni::FreeTrueUtf8(id);
*/
private static native void nBegin(String id, float sizeX, float sizeY); /*MANUAL
auto id = obj_id == NULL ? NULL : (char*)env->GetStringUTFChars(obj_id, JNI_FALSE);
auto id = obj_id == NULL ? NULL : Jni::ToTrueUtf8(env, obj_id);
ImVec2 size = ImVec2(sizeX, sizeY);
ax::NodeEditor::Begin(id, size);
if (id != NULL) env->ReleaseStringUTFChars(obj_id, id);
if (id != NULL) Jni::FreeTrueUtf8(id);
*/
public static void end() {
@@ -30,9 +30,9 @@ public final class NodeEditorConfig extends ImGuiStructDestroyable {
*/
private native void nSetSettingsFile(String value); /*MANUAL
auto value = obj_value == NULL ? NULL : (char*)env->GetStringUTFChars(obj_value, JNI_FALSE);
auto value = obj_value == NULL ? NULL : Jni::ToTrueUtf8(env, obj_value);
SET_STRING_FIELD(THIS->SettingsFile, value);
if (value != NULL) env->ReleaseStringUTFChars(obj_value, value);
if (value != NULL) Jni::FreeTrueUtf8(value);
*/
public int getCanvasSizeMode() {
@@ -62,9 +62,9 @@ public final class ImGui extends imgui.ImGui {
}
private static native long nFindWindowByName(String obj_name); /*MANUAL
auto name = obj_name == NULL ? NULL : (char*)env->GetStringUTFChars(obj_name, JNI_FALSE);
auto name = obj_name == NULL ? NULL : Jni::ToTrueUtf8(env, obj_name);
auto _result = (uintptr_t)ImGui::FindWindowByName(name);
if (name != NULL) env->ReleaseStringUTFChars(obj_name, name);
if (name != NULL) Jni::FreeTrueUtf8(name);
return _result;
*/
@@ -723,11 +723,11 @@ public final class ImGui extends imgui.ImGui {
}
private static native int nGetIDWithSeed(String obj_strIdBegin, String obj_strIdEnd, int seed); /*MANUAL
auto strIdBegin = obj_strIdBegin == NULL ? NULL : (char*)env->GetStringUTFChars(obj_strIdBegin, JNI_FALSE);
auto strIdEnd = obj_strIdEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_strIdEnd, JNI_FALSE);
auto strIdBegin = obj_strIdBegin == NULL ? NULL : Jni::ToTrueUtf8(env, obj_strIdBegin);
auto strIdEnd = obj_strIdEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_strIdEnd);
auto _result = ImGui::GetIDWithSeed(strIdBegin, strIdEnd, seed);
if (strIdBegin != NULL) env->ReleaseStringUTFChars(obj_strIdBegin, strIdBegin);
if (strIdEnd != NULL) env->ReleaseStringUTFChars(obj_strIdEnd, strIdEnd);
if (strIdBegin != NULL) Jni::FreeTrueUtf8(strIdBegin);
if (strIdEnd != NULL) Jni::FreeTrueUtf8(strIdEnd);
return _result;
*/
@@ -969,9 +969,9 @@ public final class ImGui extends imgui.ImGui {
}
private static native void nDockBuilderDockWindow(String windowName, int nodeId); /*MANUAL
auto windowName = obj_windowName == NULL ? NULL : (char*)env->GetStringUTFChars(obj_windowName, JNI_FALSE);
auto windowName = obj_windowName == NULL ? NULL : Jni::ToTrueUtf8(env, obj_windowName);
ImGui::DockBuilderDockWindow(windowName, nodeId);
if (windowName != NULL) env->ReleaseStringUTFChars(obj_windowName, windowName);
if (windowName != NULL) Jni::FreeTrueUtf8(windowName);
*/
public static ImGuiDockNode dockBuilderGetNode(final int nodeId) {
@@ -1101,11 +1101,11 @@ public final class ImGui extends imgui.ImGui {
}
private static native void nDockBuilderCopyWindowSettings(String srcName, String dstName); /*MANUAL
auto srcName = obj_srcName == NULL ? NULL : (char*)env->GetStringUTFChars(obj_srcName, JNI_FALSE);
auto dstName = obj_dstName == NULL ? NULL : (char*)env->GetStringUTFChars(obj_dstName, JNI_FALSE);
auto srcName = obj_srcName == NULL ? NULL : Jni::ToTrueUtf8(env, obj_srcName);
auto dstName = obj_dstName == NULL ? NULL : Jni::ToTrueUtf8(env, obj_dstName);
ImGui::DockBuilderCopyWindowSettings(srcName, dstName);
if (srcName != NULL) env->ReleaseStringUTFChars(obj_srcName, srcName);
if (dstName != NULL) env->ReleaseStringUTFChars(obj_dstName, dstName);
if (srcName != NULL) Jni::FreeTrueUtf8(srcName);
if (dstName != NULL) Jni::FreeTrueUtf8(dstName);
*/
public static void dockBuilderFinish(final int nodeId) {
@@ -1212,25 +1212,25 @@ public final class ImGui extends imgui.ImGui {
}
private static native void nTextEx(String beginText); /*MANUAL
auto beginText = obj_beginText == NULL ? NULL : (char*)env->GetStringUTFChars(obj_beginText, JNI_FALSE);
auto beginText = obj_beginText == NULL ? NULL : Jni::ToTrueUtf8(env, obj_beginText);
ImGui::TextEx(beginText);
if (beginText != NULL) env->ReleaseStringUTFChars(obj_beginText, beginText);
if (beginText != NULL) Jni::FreeTrueUtf8(beginText);
*/
private static native void nTextEx(String beginText, String endText); /*MANUAL
auto beginText = obj_beginText == NULL ? NULL : (char*)env->GetStringUTFChars(obj_beginText, JNI_FALSE);
auto endText = obj_endText == NULL ? NULL : (char*)env->GetStringUTFChars(obj_endText, JNI_FALSE);
auto beginText = obj_beginText == NULL ? NULL : Jni::ToTrueUtf8(env, obj_beginText);
auto endText = obj_endText == NULL ? NULL : Jni::ToTrueUtf8(env, obj_endText);
ImGui::TextEx(beginText, endText);
if (beginText != NULL) env->ReleaseStringUTFChars(obj_beginText, beginText);
if (endText != NULL) env->ReleaseStringUTFChars(obj_endText, endText);
if (beginText != NULL) Jni::FreeTrueUtf8(beginText);
if (endText != NULL) Jni::FreeTrueUtf8(endText);
*/
private static native void nTextEx(String beginText, String endText, int flags); /*MANUAL
auto beginText = obj_beginText == NULL ? NULL : (char*)env->GetStringUTFChars(obj_beginText, JNI_FALSE);
auto endText = obj_endText == NULL ? NULL : (char*)env->GetStringUTFChars(obj_endText, JNI_FALSE);
auto beginText = obj_beginText == NULL ? NULL : Jni::ToTrueUtf8(env, obj_beginText);
auto endText = obj_endText == NULL ? NULL : Jni::ToTrueUtf8(env, obj_endText);
ImGui::TextEx(beginText, endText, static_cast<ImGuiTextFlags>(flags));
if (beginText != NULL) env->ReleaseStringUTFChars(obj_beginText, beginText);
if (endText != NULL) env->ReleaseStringUTFChars(obj_endText, endText);
if (beginText != NULL) Jni::FreeTrueUtf8(beginText);
if (endText != NULL) Jni::FreeTrueUtf8(endText);
*/
public static boolean buttonEx(final String label) {
@@ -1258,32 +1258,32 @@ public final class ImGui extends imgui.ImGui {
}
private static native boolean nButtonEx(String obj_label); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto _result = ImGui::ButtonEx(label);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
return _result;
*/
private static native boolean nButtonEx(String obj_label, float sizeX, float sizeY); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
ImVec2 size = ImVec2(sizeX, sizeY);
auto _result = ImGui::ButtonEx(label, size);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
return _result;
*/
private static native boolean nButtonEx(String obj_label, float sizeX, float sizeY, int flags); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
ImVec2 size = ImVec2(sizeX, sizeY);
auto _result = ImGui::ButtonEx(label, size, static_cast<ImGuiButtonFlags>(flags));
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
return _result;
*/
private static native boolean nButtonEx(String obj_label, int flags); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto _result = ImGui::ButtonEx(label, ImVec2(0,0), static_cast<ImGuiButtonFlags>(flags));
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (label != NULL) Jni::FreeTrueUtf8(label);
return _result;
*/
@@ -1304,18 +1304,18 @@ public final class ImGui extends imgui.ImGui {
}
private static native boolean nArrowButtonEx(String obj_strId, int dir, float sizeX, float sizeY); /*MANUAL
auto strId = obj_strId == NULL ? NULL : (char*)env->GetStringUTFChars(obj_strId, JNI_FALSE);
auto strId = obj_strId == NULL ? NULL : Jni::ToTrueUtf8(env, obj_strId);
ImVec2 size = ImVec2(sizeX, sizeY);
auto _result = ImGui::ArrowButtonEx(strId, static_cast<ImGuiDir>(dir), size);
if (strId != NULL) env->ReleaseStringUTFChars(obj_strId, strId);
if (strId != NULL) Jni::FreeTrueUtf8(strId);
return _result;
*/
private static native boolean nArrowButtonEx(String obj_strId, int dir, float sizeX, float sizeY, int flags); /*MANUAL
auto strId = obj_strId == NULL ? NULL : (char*)env->GetStringUTFChars(obj_strId, JNI_FALSE);
auto strId = obj_strId == NULL ? NULL : Jni::ToTrueUtf8(env, obj_strId);
ImVec2 size = ImVec2(sizeX, sizeY);
auto _result = ImGui::ArrowButtonEx(strId, static_cast<ImGuiDir>(dir), size, static_cast<ImGuiButtonFlags>(flags));
if (strId != NULL) env->ReleaseStringUTFChars(obj_strId, strId);
if (strId != NULL) Jni::FreeTrueUtf8(strId);
return _result;
*/
@@ -1358,11 +1358,11 @@ public final class ImGui extends imgui.ImGui {
}
private static native void nSeparatorTextEx(int id, String label, String labelEnd, float extraWidth); /*MANUAL
auto label = obj_label == NULL ? NULL : (char*)env->GetStringUTFChars(obj_label, JNI_FALSE);
auto labelEnd = obj_labelEnd == NULL ? NULL : (char*)env->GetStringUTFChars(obj_labelEnd, JNI_FALSE);
auto label = obj_label == NULL ? NULL : Jni::ToTrueUtf8(env, obj_label);
auto labelEnd = obj_labelEnd == NULL ? NULL : Jni::ToTrueUtf8(env, obj_labelEnd);
ImGui::SeparatorTextEx((ImGuiID)id, label, labelEnd, extraWidth);
if (label != NULL) env->ReleaseStringUTFChars(obj_label, label);
if (labelEnd != NULL) env->ReleaseStringUTFChars(obj_labelEnd, labelEnd);
if (label != NULL) Jni::FreeTrueUtf8(label);
if (labelEnd != NULL) Jni::FreeTrueUtf8(labelEnd);
*/
// Widgets: Window Decorations
@@ -256,9 +256,11 @@ public final class ImFontAtlas extends ImGuiStructDestroyable {
/*JNI
#define RETURN_GLYPH_2_SHORT(glyphs) \
const ImWchar* ranges = glyphs; \
int size = 0; \
int pairCount = 0; \
for (; ranges[0]; ranges += 2) \
size += 2; \
pairCount++; \
int shortsPerImWchar = (int)(sizeof(ImWchar) / sizeof(jshort)); \
int size = pairCount * 2 * shortsPerImWchar + shortsPerImWchar; \
jshortArray jShorts = env->NewShortArray(size); \
env->SetShortArrayRegion(jShorts, 0, size, (jshort*)glyphs); \
return jShorts;
@@ -124,6 +124,33 @@ public final class ImFontConfig extends ImGuiStructDestroyable {
nSetGlyphRanges(glyphRanges);
}
/**
* Convenience overload: encodes int[] codepoint pairs into WCHAR32 short[] layout and calls setGlyphRanges.
* Expects int[] pairs [ lo, hi, lo, hi, ..., 0 ] (zero-terminated).
* THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE.
*/
public void setGlyphRanges(final int[] codepoints) {
// count pairs
int pairCount = 0;
for (int i = 0; i + 1 < codepoints.length; i += 2) {
if (codepoints[i] == 0) break;
pairCount++;
}
// each pair = 4 shorts (2 per endpoint), plus 2 terminator shorts
final short[] encoded = new short[pairCount * 4 + 2];
int out = 0;
for (int i = 0; i < pairCount; i++) {
final int lo = codepoints[i * 2];
final int hi = codepoints[i * 2 + 1];
encoded[out++] = (short) (lo & 0xFFFF);
encoded[out++] = (short) ((lo >> 16) & 0xFFFF);
encoded[out++] = (short) (hi & 0xFFFF);
encoded[out++] = (short) ((hi >> 16) & 0xFFFF);
}
// terminator already zero from array initialisation
setGlyphRanges(encoded);
}
private native void nSetGlyphRanges(short[] glyphRanges); /*
THIS->GlyphRanges = glyphRanges != NULL ? (ImWchar*)&glyphRanges[0] : NULL;
*/
@@ -10,12 +10,14 @@ import java.util.List;
* You can use the ImFontGlyphRangesBuilder helper to create glyph ranges based on text input. For example: for a game where your script is known,
* if you can feed your entire script to it and only build the characters the game needs.
* <p>
* Direct reimplementation of native ImFontGlyphRangesBuilder in java
* Direct reimplementation of native ImFontGlyphRangesBuilder in java.
* Built with IMGUI_USE_WCHAR32=1: supports full Unicode range U+0000..U+10FFFF.
* buildRanges() emits each range endpoint as two little-endian shorts (32-bit ImWchar layout).
*/
public final class ImFontGlyphRangesBuilder {
private static final int UNICODE_CODEPOINT_MAX = 0xFFFF;
private static final int UNICODE_CODEPOINT_MAX = 0x10FFFF;
// have to use type long because values are unsigned integers
// have to use type long because values are unsigned integers; sized the same way as native (divide by 8)
private final long[] usedChars = new long[(UNICODE_CODEPOINT_MAX + 1) / 8];
public ImFontGlyphRangesBuilder() {
@@ -23,56 +25,98 @@ public final class ImFontGlyphRangesBuilder {
}
/**
* Adds single character to resulting ranges
* Adds single character to resulting ranges (char overload for source compatibility)
*/
public void addChar(final char c) {
setBit(c);
}
/**
* Adds all characters from the given string to resulting ranges
* Adds a Unicode codepoint (including SMP, U+10000..U+10FFFF) to resulting ranges
*/
public void addText(final String text) {
for (int i = 0; i < text.length(); i++) {
addChar(text.charAt(i));
public void addChar(final int codepoint) {
if (codepoint >= 0 && codepoint <= UNICODE_CODEPOINT_MAX) {
setBit(codepoint);
}
}
/**
* Copies all given ranges to resulting ranges
* Adds all codepoints from the given string to resulting ranges.
* Handles supplementary characters (emoji, etc.) via codePointAt iteration.
*/
public void addText(final String text) {
int i = 0;
while (i < text.length()) {
final int cp = text.codePointAt(i);
addChar(cp);
i += Character.charCount(cp);
}
}
/**
* Copies all given ranges to resulting ranges.
* Expects the WCHAR32 short[] layout: each 32-bit codepoint encoded as two little-endian shorts,
* pairs of codepoints form a [lo, hi] range, terminated by two zero shorts.
* Format: [ lo_lo16, lo_hi16, hi_lo16, hi_hi16, ..., 0, 0 ]
*/
public void addRanges(final short[] ranges) {
for (int i = 0; i < ranges.length; i += 2) {
for (int i = 0; i + 3 < ranges.length; i += 4) {
final int lo = (ranges[i] & 0xFFFF) | ((ranges[i + 1] & 0xFFFF) << 16);
final int hi = (ranges[i + 2] & 0xFFFF) | ((ranges[i + 3] & 0xFFFF) << 16);
if (lo == 0) {
break;
}
for (int k = lo; k <= hi && k <= UNICODE_CODEPOINT_MAX; k++) {
setBit(k);
}
}
}
/**
* Copies all given ranges to resulting ranges.
* Expects int[] pairs: [ lo, hi, lo, hi, ..., 0 ] (zero-terminated).
*/
public void addRanges(final int[] ranges) {
for (int i = 0; i + 1 < ranges.length; i += 2) {
if (ranges[i] == 0) {
break;
}
for (int k = ranges[i]; k <= ranges[i + 1]; k++) {
addChar((char) k);
for (int k = ranges[i]; k <= ranges[i + 1] && k <= UNICODE_CODEPOINT_MAX; k++) {
setBit(k);
}
}
}
/**
* Builds the final result (ordered ranges with all the unique characters submitted)
* Result of this function can be directly passed to ImFontAtlas
* Builds the final result (ordered ranges with all the unique characters submitted).
* Result is in WCHAR32 short[] layout: each range endpoint is two little-endian shorts,
* terminated by two zero shorts.
* Format: [ lo_lo16, lo_hi16, hi_lo16, hi_hi16, ..., 0, 0 ]
*/
public short[] buildRanges() {
final List<Short> out = new ArrayList<>();
for (int n = 0; n <= UNICODE_CODEPOINT_MAX; n++) {
if (getBit(n)) {
out.add((short) n);
final int lo = n;
while (n < UNICODE_CODEPOINT_MAX && getBit(n + 1)) {
n++;
}
out.add((short) n);
final int hi = n;
// emit lo as two LE shorts
out.add((short) (lo & 0xFFFF));
out.add((short) ((lo >> 16) & 0xFFFF));
// emit hi as two LE shorts
out.add((short) (hi & 0xFFFF));
out.add((short) ((hi >> 16) & 0xFFFF));
}
}
final short[] result = new short[out.size() + 1];
// terminator: two zero shorts (= one 32-bit zero ImWchar)
final short[] result = new short[out.size() + 2];
for (int i = 0; i < out.size(); i++) {
result[i] = out.get(i);
}
result[result.length - 2] = 0;
result[result.length - 1] = 0;
return result;
}
@@ -322,7 +322,7 @@ public final class ImGuiIO extends ImGuiStruct {
const char* getClipboardTextStub(void* user_data) {
JNIEnv* env = Jni::GetEnv();
jstring jstr = Jni::CallImStrSupplier(env, _getClipboardTextCallback);
return env->GetStringUTFChars(jstr, 0);
return Jni::ToTrueUtf8(env, jstr);
}
*/
@@ -78,9 +78,9 @@ public final class TextEditor extends ImGuiStructDestroyable {
for (int i = 0; i < keysLen; i++) {
int key = keys[i];
jstring string = (jstring)env->GetObjectArrayElement(values, i);
const char* value = env->GetStringUTFChars(string, JNI_FALSE);
const char* value = Jni::ToTrueUtf8(env, string);
markers.emplace(std::pair<int, std::string>(key, std::string(value)));
env->ReleaseStringUTFChars(string, value);
Jni::FreeTrueUtf8(value);
}
THIS->SetErrorMarkers(markers);
*/
@@ -116,9 +116,9 @@ public final class TextEditor extends ImGuiStructDestroyable {
vec.reserve(length);
for (int i = 0; i < length; i++) {
jstring string = (jstring)env->GetObjectArrayElement(lines, i);
const char* raw = env->GetStringUTFChars(string, JNI_FALSE);
const char* raw = Jni::ToTrueUtf8(env, string);
vec.emplace_back(std::string(raw));
env->ReleaseStringUTFChars(string, raw);
Jni::FreeTrueUtf8(raw);
}
THIS->SetTextLines(vec);
*/
@@ -49,9 +49,9 @@ public final class TextEditorLanguageDefinition extends ImGuiStructDestroyable {
std::unordered_set<std::string> set;
for (int i = 0; i < length; i++) {
jstring string = (jstring)env->GetObjectArrayElement(keywords, i);
const char* raw = env->GetStringUTFChars(string, JNI_FALSE);
const char* raw = Jni::ToTrueUtf8(env, string);
set.emplace(std::string(raw));
env->ReleaseStringUTFChars(string, raw);
Jni::FreeTrueUtf8(raw);
}
THIS->mKeywords = set;
*/
@@ -67,13 +67,13 @@ public final class TextEditorLanguageDefinition extends ImGuiStructDestroyable {
for (int i = 0; i < keysLen; i++) {
jstring string1 = (jstring)env->GetObjectArrayElement(keys, i);
jstring string2 = (jstring)env->GetObjectArrayElement(decl, i);
const char* key = env->GetStringUTFChars(string1, JNI_FALSE);
const char* value = env->GetStringUTFChars(string2, JNI_FALSE);
const char* key = Jni::ToTrueUtf8(env, string1);
const char* value = Jni::ToTrueUtf8(env, string2);
TextEditor::Identifier id;
id.mDeclaration = std::string(value);
identifiers.insert(std::pair<std::string, TextEditor::Identifier>(std::string(key), id));
env->ReleaseStringUTFChars(string1, key);
env->ReleaseStringUTFChars(string2, value);
Jni::FreeTrueUtf8(key);
Jni::FreeTrueUtf8(value);
}
THIS->mIdentifiers = identifiers;
*/
@@ -89,13 +89,13 @@ public final class TextEditorLanguageDefinition extends ImGuiStructDestroyable {
for (int i = 0; i < keysLen; i++) {
jstring string1 = (jstring)env->GetObjectArrayElement(keys, i);
jstring string2 = (jstring)env->GetObjectArrayElement(decl, i);
const char* key = env->GetStringUTFChars(string1, JNI_FALSE);
const char* value = env->GetStringUTFChars(string2, JNI_FALSE);
const char* key = Jni::ToTrueUtf8(env, string1);
const char* value = Jni::ToTrueUtf8(env, string2);
TextEditor::Identifier id;
id.mDeclaration = std::string(value);
preprocIdentifiers.insert(std::pair<std::string, TextEditor::Identifier>(std::string(key), id));
env->ReleaseStringUTFChars(string1, key);
env->ReleaseStringUTFChars(string2, value);
Jni::FreeTrueUtf8(key);
Jni::FreeTrueUtf8(value);
}
THIS->mPreprocIdentifiers = preprocIdentifiers;
*/
@@ -131,7 +131,7 @@ public final class TextEditorLanguageDefinition extends ImGuiStructDestroyable {
std::vector<std::pair<std::string, TextEditor::PaletteIndex>> tokenRegexStrings;
for (int i = 0; i < keysLen; i++) {
jstring string = (jstring)env->GetObjectArrayElement(keys, i);
const char* key = env->GetStringUTFChars(string, JNI_FALSE);
const char* key = Jni::ToTrueUtf8(env, string);
int value = paletteIndexes[i];
tokenRegexStrings.emplace_back(
std::pair<std::string, TextEditor::PaletteIndex>(
@@ -139,7 +139,7 @@ public final class TextEditorLanguageDefinition extends ImGuiStructDestroyable {
static_cast<TextEditor::PaletteIndex>(value)
)
);
env->ReleaseStringUTFChars(string, key);
Jni::FreeTrueUtf8(key);
}
THIS->mTokenRegexStrings = tokenRegexStrings;
*/
+1 -1
View File
@@ -59,7 +59,7 @@
//#define IMGUI_USE_BGRA_PACKED_COLOR
//---- Use 32-bit for ImWchar (default is 16-bit) to support unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...)
//#define IMGUI_USE_WCHAR32
#define IMGUI_USE_WCHAR32
//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
// By default the embedded implementations are declared static and not available outside of Dear ImGui sources files.
@@ -119,4 +119,49 @@ namespace Jni
env->DeleteLocalRef(value);
}
}
char* ToTrueUtf8(JNIEnv* env, jstring s) {
if (s == nullptr) return nullptr;
const jchar* chars = env->GetStringChars(s, nullptr);
jsize len = env->GetStringLength(s);
// Worst case: one codepoint → 4 UTF-8 bytes, plus null terminator.
char* buf = (char*)malloc((size_t)len * 4 + 1);
if (buf == nullptr) {
env->ReleaseStringChars(s, chars);
return nullptr;
}
char* out = buf;
for (jsize i = 0; i < len; i++) {
uint32_t cp = (uint32_t)chars[i];
if (cp >= 0xD800 && cp <= 0xDBFF && i + 1 < len) {
uint32_t low = (uint32_t)chars[i + 1];
if (low >= 0xDC00 && low <= 0xDFFF) {
cp = 0x10000 + ((cp - 0xD800) << 10) + (low - 0xDC00);
i++;
}
}
if (cp < 0x80) {
*out++ = (char)cp;
} else if (cp < 0x800) {
*out++ = (char)(0xC0 | (cp >> 6));
*out++ = (char)(0x80 | (cp & 0x3F));
} else if (cp < 0x10000) {
*out++ = (char)(0xE0 | (cp >> 12));
*out++ = (char)(0x80 | ((cp >> 6) & 0x3F));
*out++ = (char)(0x80 | (cp & 0x3F));
} else {
*out++ = (char)(0xF0 | (cp >> 18));
*out++ = (char)(0x80 | ((cp >> 12) & 0x3F));
*out++ = (char)(0x80 | ((cp >> 6) & 0x3F));
*out++ = (char)(0x80 | (cp & 0x3F));
}
}
*out = 0;
env->ReleaseStringChars(s, chars);
return buf;
}
void FreeTrueUtf8(const char* p) {
if (p != nullptr) free((void*)p);
}
}
@@ -47,4 +47,12 @@ namespace Jni
jobjectArray NewImGuiKeyDataArray(JNIEnv* env, const ImGuiKeyData* src, int size);
void ImGuiKeyDataArrayCpy(JNIEnv* env, jobjectArray src, ImGuiKeyData* dst, int size);
// Converts a jstring to a freshly-malloc'd C string in real UTF-8 (not JNI's MUTF-8).
// JNI's GetStringUTFChars encodes codepoints above U+FFFF as a surrogate pair of two
// 3-byte sequences, which ImGui's UTF-8 decoder rejects — so SMP emoji never reach
// the glyph atlas even when the glyph is registered. Caller must release with
// FreeTrueUtf8(). Returns nullptr iff the input jstring is null.
char* ToTrueUtf8(JNIEnv* env, jstring s);
void FreeTrueUtf8(const char* p);
}
+5 -7
View File
@@ -12,19 +12,17 @@ ext.configurePublishing = { packageName, packageDesc, packageVersion ->
publishing {
repositories {
maven {
name = 'MavenCentral'
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
name = 'MrLokop'
url = 'https://mvn.mrlokop.dev/releases'
credentials {
username = System.getenv('NEXUS_UPD_ID')?.trim() ?: ''
password = System.getenv('NEXUS_UPD_PASS')?.trim() ?: ''
username = 'AutoRobot'
password = '8Mr3OAv4WcRNHZS3lAVDx32sWt71YS7GsBvN7TZhCGMmDeSz'
}
}
}
publications {
imgui(MavenPublication) {
groupId = 'io.github.spair'
groupId = 'org.nnstd.imgui'
artifactId = packageName
version = packageVersion
+1 -1
View File
@@ -1,5 +1,5 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version("0.10.0")
id("org.gradle.toolchains.foojay-resolver-convention") version("0.9.0")
}
rootProject.name = "imgui-java"