├── .gitattributes ├── .github └── workflows │ └── CI.yml ├── .gitignore ├── 1.7.10 ├── build.gradle.kts └── src │ └── main │ ├── java │ └── city │ │ └── windmill │ │ └── ingameime │ │ ├── ClientProxy.java │ │ ├── CommonProxy.java │ │ ├── Config.java │ │ ├── IMEventHandler.java │ │ ├── IMStates.java │ │ ├── IngameIME_Forge.java │ │ ├── Internal.java │ │ ├── gui │ │ ├── OverlayScreen.java │ │ ├── Widget.java │ │ ├── WidgetCandidateList.java │ │ ├── WidgetInputMode.java │ │ └── WidgetPreEdit.java │ │ └── mixins │ │ ├── MixinGuiScreen.java │ │ ├── MixinGuiTextField.java │ │ └── MixinMinecraft.java │ └── resources │ ├── LICENSE │ ├── assets │ └── ingameime │ │ └── lang │ │ ├── en_US.lang │ │ └── zh_CN.lang │ ├── icon.png │ ├── mcmod.info │ └── mixins.ingameime.json ├── CurseForgeLatest.json ├── IngameIME-Icon.png ├── IngameIME-Icon.psd ├── IngameIME-Logo-Mini.png ├── IngameIME-Logo.png ├── IngameIME-Native ├── build.gradle.kts └── src │ └── main │ ├── java │ └── ingameime │ │ ├── API.java │ │ ├── CandidateListCallback.java │ │ ├── CandidateListCallbackImpl.java │ │ ├── CandidateListContext.java │ │ ├── CandidateListState.java │ │ ├── CommitCallback.java │ │ ├── CommitCallbackImpl.java │ │ ├── CompositionState.java │ │ ├── IngameIME.java │ │ ├── IngameIMEJNI.java │ │ ├── InputContext.java │ │ ├── InputMode.java │ │ ├── InputModeCallback.java │ │ ├── InputModeCallbackImpl.java │ │ ├── PreEditCallback.java │ │ ├── PreEditCallbackImpl.java │ │ ├── PreEditContext.java │ │ ├── PreEditRect.java │ │ └── string_list.java │ └── resources │ ├── IngameIME_Java-arm64.dll │ ├── IngameIME_Java-x64.dll │ └── IngameIME_Java-x86.dll ├── LICENSE ├── README.md ├── docs ├── FullScreenInput.gif └── WindowInput.gif ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle.kts /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | 3 | *.[jJ][aA][rR] binary 4 | 5 | *.[pP][nN][gG] binary 6 | *.[jJ][pP][gG] binary 7 | *.[jJ][pP][eE][gG] binary 8 | *.[gG][iI][fF] binary 9 | *.[tT][iI][fF] binary 10 | *.[tT][iI][fF][fF] binary 11 | *.[iI][cC][oO] binary 12 | *.[sS][vV][gG] text 13 | *.[eE][pP][sS] binary 14 | *.[xX][cC][fF] binary 15 | 16 | *.[kK][aA][rR] binary 17 | *.[mM]4[aA] binary 18 | *.[mM][iI][dD] binary 19 | *.[mM][iI][dD][iI] binary 20 | *.[mM][pP]3 binary 21 | *.[oO][gG][gG] binary 22 | *.[rR][aA] binary 23 | 24 | *.7[zZ] binary 25 | *.[gG][zZ] binary 26 | *.[tT][aA][rR] binary 27 | *.[tT][gG][zZ] binary 28 | *.[zZ][iI][pP] binary 29 | 30 | *.[tT][cC][nN] binary 31 | *.[sS][oO] binary 32 | *.[dD][lL][lL] binary 33 | *.[dD][yY][lL][iI][bB] binary 34 | *.[pP][sS][dD] binary 35 | *.[tT][tT][fF] binary 36 | *.[oO][tT][fF] binary 37 | 38 | *.[pP][aA][tT][cC][hH] -text 39 | 40 | *.[bB][aA][tT] text eol=crlf 41 | *.[cC][mM][dD] text eol=crlf 42 | *.[pP][sS]1 text eol=crlf 43 | 44 | *[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary 45 | -------------------------------------------------------------------------------- /.github/workflows/CI.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - docs/** 7 | - cmake/** 8 | - .vscode/** 9 | - README.md 10 | 11 | jobs: 12 | CI: 13 | runs-on: ubuntu-latest 14 | env: 15 | CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }} 16 | strategy: 17 | matrix: 18 | java: [8] 19 | 20 | steps: 21 | - name: Checkout Repo 22 | uses: actions/checkout@v4 23 | with: 24 | submodules: true 25 | # Make git describe work correctly 26 | fetch-depth: 0 27 | fetch-tags: true 28 | ref: mixed 29 | 30 | - name: Setup Java 31 | uses: actions/setup-java@v1 32 | with: 33 | java-version: ${{ matrix.java }} 34 | 35 | - name: Cache Gradle packages 36 | uses: actions/cache@v2 37 | with: 38 | path: | 39 | ~/.gradle/caches 40 | ${GITHUB_WORKSPACE}/.gradle 41 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} 42 | restore-keys: ${{ runner.os }}-gradle 43 | 44 | - name: Build 45 | run: gradle build 46 | 47 | - name: Upload to CurseForge 48 | if: startsWith(github.ref, 'refs/tags/') 49 | run: gradle curseforge 50 | 51 | - name: Commit 'CurseForgeLatest.json' 52 | if: always() 53 | uses: EndBug/add-and-commit@v9.1.3 54 | with: 55 | add: "CurseForgeLatest.json" 56 | message: " Updated CurseForge Version File" 57 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | .settings 3 | /.idea/ 4 | /.vscode/ 5 | /run/ 6 | /build/ 7 | /eclipse/ 8 | .classpath 9 | .project 10 | /bin/ 11 | /config/ 12 | /crash-reports/ 13 | /logs/ 14 | options.txt 15 | /saves/ 16 | usernamecache.json 17 | banned-ips.json 18 | banned-players.json 19 | eula.txt 20 | ops.json 21 | server.properties 22 | servers.dat 23 | usercache.json 24 | whitelist.json 25 | /out/ 26 | *.iml 27 | *.ipr 28 | *.iws 29 | src/main/resources/mixins.*([!.]).json 30 | *.bat 31 | *.DS_Store 32 | !gradlew.bat 33 | .factorypath 34 | addon.local.gradle 35 | addon.local.gradle.kts 36 | addon.late.local.gradle 37 | addon.late.local.gradle.kts 38 | layout.json 39 | /1.7.10/run/ 40 | /1.7.10/build/ 41 | /IngameIME-Native/build 42 | -------------------------------------------------------------------------------- /1.7.10/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask 2 | import com.gtnewhorizons.retrofuturagradle.shadow.de.undercouch.gradle.tasks.download.Download 3 | import java.util.* 4 | import com.gtnewhorizons.retrofuturagradle.util.Distribution as DistributionGTNH 5 | 6 | buildscript { 7 | repositories { 8 | gradlePluginPortal() 9 | mavenCentral() 10 | mavenLocal() 11 | maven { 12 | // GTNH RetroFuturaGradle and ASM Fork 13 | name = "GTNH Maven" 14 | url = uri("http://jenkins.usrv.eu:8081/nexus/content/groups/public/") 15 | isAllowInsecureProtocol = true 16 | } 17 | } 18 | } 19 | 20 | plugins { 21 | id("java-library") 22 | id("com.github.johnrengelman.shadow") version "8.1.1" 23 | id("com.palantir.git-version") version "3.0.0" 24 | // Publish 25 | id("com.modrinth.minotaur") version "2.+" 26 | id("com.matthewprenger.cursegradle") version "1.4.0" 27 | // ForgeGradle 28 | id("com.gtnewhorizons.retrofuturagradle") version "1.3.26" 29 | } 30 | 31 | val modId = "ingameime" 32 | val modName = "IngameIME" 33 | val modGroup = "city.windmill.ingameime" 34 | val modType = "forge" 35 | 36 | val mcVersion = minecraft.mcVersion.get() 37 | val gitVersion: groovy.lang.Closure by extra 38 | val modVersion = gitVersion() 39 | 40 | repositories { 41 | maven { 42 | name = "Overmind forge repo mirror" 43 | url = uri("https://gregtech.overminddl1.com/") 44 | } 45 | maven { 46 | name = "GTNH Maven" 47 | url = uri("http://jenkins.usrv.eu:8081/nexus/content/groups/public/") 48 | isAllowInsecureProtocol = true 49 | } 50 | maven { 51 | name = "sonatype" 52 | url = uri("https://oss.sonatype.org/content/repositories/snapshots/") 53 | content { 54 | includeGroup("org.lwjgl") 55 | } 56 | } 57 | exclusiveContent { 58 | forRepository { 59 | maven { 60 | name = "CurseMaven" 61 | url = uri("https://cursemaven.com") 62 | } 63 | } 64 | filter { 65 | includeGroup("curse.maven") 66 | } 67 | } 68 | } 69 | 70 | val shadowCompileOnly: Configuration by configurations.creating { 71 | configurations.compileOnly.get().extendsFrom(this) 72 | } 73 | 74 | val mixinSpec by extra { "io.github.legacymoddingmc:unimixins:0.1.13:dev" } 75 | dependencies { 76 | shadowCompileOnly(project(":IngameIME-Native")) 77 | 78 | annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3") 79 | annotationProcessor("com.google.guava:guava:24.1.1-jre") 80 | annotationProcessor("com.google.code.gson:gson:2.8.6") 81 | annotationProcessor(mixinSpec) 82 | implementation( 83 | modUtils.enableMixins( 84 | mixinSpec, 85 | "mixins.ingameime.refmap.json" 86 | ) 87 | ) 88 | compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.5.3-GTNH:dev") 89 | } 90 | 91 | tasks { 92 | build { 93 | doFirst { 94 | println("modVersion: $modVersion") 95 | } 96 | } 97 | injectTags { 98 | outputClassName = "$modGroup.Tags" 99 | } 100 | } 101 | 102 | minecraft { 103 | // Tags 104 | injectedTags.put("MODID", modId) 105 | injectedTags.put("MODNAME", modName) 106 | injectedTags.put("MODGROUP", modGroup) 107 | injectedTags.put("VERSION", modVersion) 108 | 109 | //LWJGL 110 | lwjgl3Version = "3.3.2" 111 | // Enable assertions in the current mod 112 | extraRunJvmArguments.add("-ea:${modGroup}") 113 | // Debug Mixin 114 | extraRunJvmArguments.addAll( 115 | listOf( 116 | "-Dmixin.debug.countInjections=true", 117 | "-Dmixin.debug.verbose=true", 118 | "-Dmixin.debug.export=true" 119 | ) 120 | ) 121 | } 122 | 123 | fun getManifestAttributes(): MutableMap { 124 | val manifestAttributes = mutableMapOf() 125 | manifestAttributes["TweakClass"] = "org.spongepowered.asm.launch.MixinTweaker" 126 | manifestAttributes["MixinConfigs"] = "mixins.ingameime.json" 127 | manifestAttributes["ForceLoadAsMod"] = "true" 128 | manifestAttributes["FMLCorePluginContainsFMLMod"] = "true" 129 | return manifestAttributes 130 | } 131 | 132 | tasks { 133 | compileJava { 134 | options.encoding = "UTF-8" 135 | } 136 | compileTestJava { 137 | options.encoding = "UTF-8" 138 | } 139 | jar { 140 | archiveBaseName = "$modName-$mcVersion-$modVersion" 141 | // Replaced by shadowJar 142 | enabled = false 143 | } 144 | processResources { 145 | filesMatching("mcmod.info") { 146 | expand("modVersion" to modVersion) 147 | } 148 | duplicatesStrategy = DuplicatesStrategy.INCLUDE 149 | } 150 | shadowJar { 151 | archiveBaseName = "$modName-$mcVersion-$modVersion" 152 | archiveClassifier = "dev" 153 | manifest { 154 | attributes(getManifestAttributes()) 155 | } 156 | configurations = listOf(shadowCompileOnly) 157 | minimize() 158 | } 159 | reobfJar { 160 | inputJar.set(shadowJar.flatMap { it.archiveFile }) 161 | } 162 | } 163 | 164 | /** 165 | * Upload Tasks 166 | */ 167 | class Version(version: String) : Comparable { 168 | @Suppress("PropertyName") 169 | val VERSION_REGEX: Regex = Regex("""(\d+)(?:.(\d+)(?:.(\d+))?)?""") 170 | var major: Int = 0 171 | var minor: Int = 0 172 | var revision: Int = 0 173 | 174 | init { 175 | VERSION_REGEX.matchEntire(version)?.apply { 176 | major = this.groupValues[1].toInt() 177 | minor = this.groupValues[2].toIntOrNull() ?: 0 178 | revision = this.groupValues[3].toIntOrNull() ?: 0 179 | } ?: throw IllegalArgumentException("Invalid version string:$version") 180 | } 181 | 182 | override fun compareTo(other: Version): Int { 183 | if (this == other) return 0 184 | if (this.major > other.major) return 1 185 | if (this.major == other.major) { 186 | if (this.minor > other.minor) return 1 187 | if (this.minor == other.minor && this.revision > other.revision) return 1 188 | } 189 | return -1 190 | } 191 | 192 | override fun equals(other: Any?): Boolean { 193 | if (this === other) return true 194 | if (javaClass != other?.javaClass) return false 195 | 196 | other as Version 197 | 198 | if (major != other.major) return false 199 | if (minor != other.minor) return false 200 | if (revision != other.revision) return false 201 | 202 | return true 203 | } 204 | 205 | override fun hashCode(): Int { 206 | var result = major 207 | result = 31 * result + minor 208 | result = 31 * result + revision 209 | return result 210 | } 211 | 212 | override fun toString(): String { 213 | return "$major.$minor.$revision" 214 | } 215 | } 216 | 217 | val curseApiKey: String 218 | get() { 219 | with(file("../local.properties")) { 220 | if (exists()) { 221 | val props = Properties() 222 | props.load(inputStream()) 223 | return (props["curse_api_key"]!!) as String 224 | } 225 | } 226 | return System.getenv("CURSE_API_KEY") ?: "" 227 | } 228 | 229 | afterEvaluate { 230 | tasks { 231 | withType { 232 | onlyIf { 233 | val curseforgeFile = file("../CurseForgeLatest.json") 234 | @Suppress("UNCHECKED_CAST") val versionInfo = 235 | (groovy.json.JsonSlurper().parse(curseforgeFile) as Map).toMutableMap() 236 | val uploadedVersion = Version(versionInfo["$modType-$mcVersion"] ?: "0.0.0") 237 | val currentVersion = Version(modVersion) 238 | println("Uploaded:$uploadedVersion") 239 | println("Current:$currentVersion") 240 | return@onlyIf uploadedVersion < currentVersion 241 | } 242 | doLast { 243 | val curseforgeFile = file("../CurseForgeLatest.json") 244 | @Suppress("UNCHECKED_CAST") val versionInfo = 245 | (groovy.json.JsonSlurper().parse(curseforgeFile) as Map).toMutableMap() 246 | //Uploaded, update json file 247 | versionInfo["$modType-$mcVersion"] = modVersion 248 | groovy.json.JsonOutput.toJson(versionInfo).let { 249 | curseforgeFile 250 | .outputStream() 251 | .bufferedWriter().apply { 252 | write(groovy.json.JsonOutput.prettyPrint(it)) 253 | flush() 254 | close() 255 | } 256 | } 257 | } 258 | } 259 | } 260 | } 261 | 262 | curseforge { 263 | apiKey = curseApiKey 264 | project(closureOf { 265 | id = "440032" 266 | releaseType = "release" 267 | mainArtifact(tasks["reobfJar"]) 268 | addArtifact(tasks["shadowJar"]) 269 | addGameVersion("Forge") 270 | addGameVersion("Java 8") 271 | addGameVersion("1.7.10") 272 | relations(closureOf { 273 | requiredDependency("unimixins") 274 | }) 275 | }) 276 | options(closureOf { 277 | forgeGradleIntegration = false 278 | }) 279 | } 280 | 281 | /** 282 | * Java 17 Tasks 283 | */ 284 | val java17Dependencies by extra { 285 | configurations.create("java17Dependencies") { 286 | extendsFrom(configurations.getByName("runtimeClasspath")) // Ensure consistent transitive dependency resolution 287 | isCanBeConsumed = false 288 | } 289 | } 290 | val java17PatchDependencies by extra { 291 | configurations.create("java17PatchDependencies") { 292 | isCanBeConsumed = false 293 | } 294 | } 295 | val java17Toolchain by extra { 296 | Action { -> 297 | this.languageVersion.set(JavaLanguageVersion.of(17)) 298 | this.vendor.set(JvmVendorSpec.matching("jetbrains")) 299 | } 300 | } 301 | 302 | dependencies { 303 | val lwjgl3ifyVersion = "1.5.7" 304 | java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") 305 | java17Dependencies("com.github.GTNewHorizons:Hodgepodge:2.3.35") 306 | java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") { 307 | isTransitive = false 308 | } 309 | } 310 | 311 | val setupHotswapAgentTask = tasks.register("setupHotswapAgent") { 312 | group = "GTNH Buildscript" 313 | description = "Installs a recent version of HotSwapAgent into the Java 17 JetBrains runtime directory" 314 | val hsaUrl = 315 | "https://github.com/HotswapProjects/HotswapAgent/releases/download/1.4.2-SNAPSHOT/hotswap-agent-1.4.2-SNAPSHOT.jar" 316 | val targetFolderProvider = 317 | javaToolchains.launcherFor(java17Toolchain) 318 | .map { it.metadata.installationPath.dir("lib/hotswap") } 319 | val targetFilename = "hotswap-agent.jar" 320 | onlyIf { 321 | !targetFolderProvider.get().file(targetFilename).asFile.exists() 322 | } 323 | doLast { 324 | val targetFolder = targetFolderProvider.get() 325 | targetFolder.asFile.mkdirs() 326 | task("download") { 327 | src(hsaUrl) 328 | dest(targetFolder.file(targetFilename).asFile) 329 | overwrite(false) 330 | tempAndMove(true) 331 | } 332 | } 333 | } 334 | 335 | abstract class RunHotSwappableMinecraftTask @Inject constructor( 336 | side: DistributionGTNH, 337 | superTask: String, 338 | gradle: Gradle 339 | ) : RunMinecraftTask(side, gradle) { 340 | private val java17JvmArgs = listOf( 341 | // Java 9+ support 342 | "--illegal-access=warn", 343 | "-Djava.security.manager=allow", 344 | "-Dfile.encoding=UTF-8", 345 | "--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED", 346 | "--add-opens", "java.base/java.net=ALL-UNNAMED", 347 | "--add-opens", "java.base/java.nio=ALL-UNNAMED", 348 | "--add-opens", "java.base/java.io=ALL-UNNAMED", 349 | "--add-opens", "java.base/java.lang=ALL-UNNAMED", 350 | "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", 351 | "--add-opens", "java.base/java.text=ALL-UNNAMED", 352 | "--add-opens", "java.base/java.util=ALL-UNNAMED", 353 | "--add-opens", "java.base/jdk.internal.reflect=ALL-UNNAMED", 354 | "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", 355 | "--add-opens", "jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED,java.naming", 356 | "--add-opens", "java.desktop/sun.awt.image=ALL-UNNAMED", 357 | "--add-modules", "jdk.dynalink", 358 | "--add-opens", "jdk.dynalink/jdk.dynalink.beans=ALL-UNNAMED", 359 | "--add-modules", "java.sql.rowset", 360 | "--add-opens", "java.sql.rowset/javax.sql.rowset.serial=ALL-UNNAMED" 361 | ) 362 | private val hotswapJvmArgs = listOf( 363 | // DCEVM advanced hot reload 364 | "-XX:+AllowEnhancedClassRedefinition", 365 | "-XX:HotswapAgent=fatjar" 366 | ) 367 | 368 | // IntelliJ doesn't seem to allow commandline arguments, so we also support an env variable 369 | private var enableHotswap = System.getenv("HOTSWAP").toBoolean() 370 | 371 | private val java17Toolchain: Action by project.extra 372 | private val java17Dependencies: Configuration by project.extra 373 | private val java17PatchDependencies: Configuration by project.extra 374 | private val mixinSpec: String by project.extra 375 | 376 | @Input 377 | fun getEnableHotswap(): Boolean { 378 | return enableHotswap 379 | } 380 | 381 | @Option(option = "hotswap", description = "Enables HotSwapAgent for enhanced class reloading under a debugger") 382 | fun setEnableHotswap(enable: Boolean) { 383 | enableHotswap = enable 384 | } 385 | 386 | init { 387 | lwjglVersion = 3 388 | javaLauncher = project.javaToolchains.launcherFor(java17Toolchain) 389 | // JVM Args 390 | extraJvmArgs.addAll(java17JvmArgs) 391 | if (enableHotswap) 392 | extraJvmArgs.addAll(hotswapJvmArgs) 393 | 394 | // ClassPaths 395 | this.classpath(java17PatchDependencies) 396 | if (side == DistributionGTNH.CLIENT) 397 | this.classpath(project.minecraftTasks.lwjgl3Configuration) 398 | this.classpath(project.provider { 399 | project.tasks.named(superTask).get().classpath 400 | }) 401 | this.classpath.filter { 402 | !it.path.contains("2.9.4-nightly-20150209") 403 | } 404 | this.classpath(java17Dependencies) 405 | } 406 | 407 | override fun setup(project: Project) { 408 | super.setup(project) 409 | if (enableHotswap) { 410 | val mixinCfg = project.configurations.detachedConfiguration(project.dependencies.create(mixinSpec)) 411 | mixinCfg.isTransitive = false 412 | mixinCfg.isCanBeConsumed = false 413 | extraJvmArgs.addAll("-javaagent:${mixinCfg.singleFile.absolutePath}") 414 | } 415 | } 416 | } 417 | 418 | val runClient17 = tasks.register( 419 | "runClient17", 420 | RunHotSwappableMinecraftTask::class.java, 421 | DistributionGTNH.CLIENT, 422 | "runClient", 423 | gradle 424 | ) 425 | runClient17.configure { 426 | setup(project) 427 | group = "Modded Minecraft" 428 | description = "Runs the modded client using Java 17, lwjgl3ify and Hodgepodge" 429 | dependsOn( 430 | setupHotswapAgentTask, 431 | mcpTasks.launcherSources.classesTaskName, 432 | minecraftTasks.taskDownloadVanillaAssets, 433 | mcpTasks.taskPackagePatchedMc, 434 | tasks.shadowJar 435 | ) 436 | mainClass = "GradleStart" 437 | username = minecraft.username 438 | userUUID = minecraft.userUUID 439 | } 440 | 441 | val runServer17 = tasks.register( 442 | "runServer17", 443 | RunHotSwappableMinecraftTask::class.java, 444 | DistributionGTNH.DEDICATED_SERVER, 445 | "runServer", 446 | gradle 447 | ) 448 | runServer17.configure { 449 | setup(project) 450 | group = "Modded Minecraft" 451 | description = "Runs the modded server using Java 17, lwjgl3ify and Hodgepodge" 452 | dependsOn( 453 | setupHotswapAgentTask, 454 | mcpTasks.launcherSources.classesTaskName, 455 | minecraftTasks.taskDownloadVanillaAssets, 456 | mcpTasks.taskPackagePatchedMc, 457 | tasks.shadowJar 458 | ) 459 | mainClass = "GradleStartServer" 460 | extraArgs.add("nogui") 461 | } 462 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/ClientProxy.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime; 2 | 3 | import city.windmill.ingameime.gui.OverlayScreen; 4 | import cpw.mods.fml.client.registry.ClientRegistry; 5 | import cpw.mods.fml.common.event.FMLPreInitializationEvent; 6 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 7 | import net.minecraft.client.settings.KeyBinding; 8 | import net.minecraftforge.client.event.GuiScreenEvent; 9 | import net.minecraftforge.common.MinecraftForge; 10 | import org.lwjgl.input.Keyboard; 11 | import org.lwjgl.input.Mouse; 12 | 13 | import javax.annotation.Nonnull; 14 | 15 | import static city.windmill.ingameime.IngameIME_Forge.LOG; 16 | import static org.lwjgl.input.Keyboard.KEY_HOME; 17 | 18 | public class ClientProxy extends CommonProxy implements IMEventHandler { 19 | public static ClientProxy INSTANCE = null; 20 | public static OverlayScreen Screen = new OverlayScreen(); 21 | public static KeyBinding KeyBind = new KeyBinding("ingameime.key.desc", KEY_HOME, "IngameIME"); 22 | public static city.windmill.ingameime.IMEventHandler IMEventHandler = IMStates.Disabled; 23 | private static boolean IsKeyDown = false; 24 | 25 | @SubscribeEvent 26 | public void onRenderScreen(GuiScreenEvent.DrawScreenEvent.Post event) { 27 | ClientProxy.Screen.draw(); 28 | 29 | if (Keyboard.isKeyDown(ClientProxy.KeyBind.getKeyCode())) { 30 | IsKeyDown = true; 31 | } else if (IsKeyDown) { 32 | IsKeyDown = false; 33 | onToggleKey(); 34 | } 35 | 36 | if (Config.TurnOffOnMouseMove.getBoolean()) 37 | if (IMEventHandler == IMStates.OpenedManual && (Mouse.getDX() > 0 || Mouse.getDY() > 0)) { 38 | onMouseMove(); 39 | } 40 | } 41 | 42 | public void preInit(FMLPreInitializationEvent event) { 43 | INSTANCE = this; 44 | Config.synchronizeConfiguration(event.getSuggestedConfigurationFile()); 45 | ClientRegistry.registerKeyBinding(KeyBind); 46 | Internal.loadLibrary(); 47 | Internal.createInputCtx(); 48 | MinecraftForge.EVENT_BUS.register(this); 49 | } 50 | 51 | @Override 52 | public IMStates onScreenClose() { 53 | IMEventHandler = IMEventHandler.onScreenClose(); 54 | return null; 55 | } 56 | 57 | @Override 58 | public IMStates onControlFocus(@Nonnull Object control, boolean focused) { 59 | IMEventHandler = IMEventHandler.onControlFocus(control, focused); 60 | return null; 61 | } 62 | 63 | @Override 64 | public IMStates onScreenOpen(Object screen) { 65 | IMEventHandler = IMEventHandler.onScreenOpen(screen); 66 | return null; 67 | } 68 | 69 | @Override 70 | public IMStates onToggleKey() { 71 | IMEventHandler = IMEventHandler.onToggleKey(); 72 | return null; 73 | } 74 | 75 | @Override 76 | public IMStates onMouseMove() { 77 | IMEventHandler = IMEventHandler.onMouseMove(); 78 | return null; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/CommonProxy.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime; 2 | 3 | import cpw.mods.fml.common.event.FMLPreInitializationEvent; 4 | 5 | public class CommonProxy { 6 | public void preInit(FMLPreInitializationEvent event) { 7 | IngameIME_Forge.LOG.info("This mod is a Client side only mod, skip loading..."); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/Config.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime; 2 | 3 | import net.minecraftforge.common.config.Configuration; 4 | import net.minecraftforge.common.config.Property; 5 | 6 | import java.io.File; 7 | import java.util.Arrays; 8 | 9 | public class Config { 10 | // API 11 | public static Property API_Windows = null; 12 | public static Property UiLess_Windows = null; 13 | // General 14 | public static Property TurnOffOnMouseMove = null; 15 | // Mode Text 16 | public static Property AlphaModeText = null; 17 | public static Property NativeModeText = null; 18 | 19 | public static void synchronizeConfiguration(File configFile) { 20 | Configuration configuration = new Configuration(configFile); 21 | 22 | API_Windows = configuration.get("API", 23 | "Windows", 24 | "TextServiceFramework", 25 | "Config the API to use in Windows platform (TextServiceFramework, Imm32)" 26 | ); 27 | API_Windows.setValidValues(new String[]{"TextServiceFramework", "Imm32"}); 28 | if (Arrays.stream(API_Windows.getValidValues()).noneMatch(it -> it.equals(API_Windows.getString()))) 29 | API_Windows.set(API_Windows.getDefault()); 30 | API_Windows.setRequiresMcRestart(true); 31 | 32 | UiLess_Windows = configuration.get("UiLess", 33 | "Windows", 34 | true, 35 | "Config if render CandidateList in game"); 36 | UiLess_Windows.setRequiresMcRestart(true); 37 | 38 | TurnOffOnMouseMove = configuration.get("General", 39 | "TurnOffOnMouseMove", 40 | true, 41 | "Turn off InputMethod on mouse move"); 42 | 43 | AlphaModeText = configuration.get("ModeText", 44 | "AlphaMode", 45 | "Alpha", 46 | "Text to display when in Alpha mode"); 47 | 48 | NativeModeText = configuration.get("ModeText", 49 | "NativeMode", 50 | "Native", 51 | "Text to display when in Native mode"); 52 | 53 | if (configuration.hasChanged()) { 54 | configuration.save(); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/IMEventHandler.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime; 2 | 3 | import javax.annotation.Nonnull; 4 | import javax.annotation.Nullable; 5 | 6 | public interface IMEventHandler { 7 | IMStates onScreenClose(); 8 | 9 | IMStates onControlFocus(@Nonnull Object control, boolean focused); 10 | 11 | IMStates onScreenOpen(@Nullable Object screen); 12 | 13 | IMStates onToggleKey(); 14 | 15 | IMStates onMouseMove(); 16 | } 17 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/IMStates.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime; 2 | 3 | import javax.annotation.Nonnull; 4 | import javax.annotation.Nullable; 5 | 6 | public enum IMStates implements IMEventHandler { 7 | Disabled { 8 | @Override 9 | public IMStates onControlFocus(@Nonnull Object control, boolean focused) { 10 | if (focused) { 11 | ActiveControl = control; 12 | IngameIME_Forge.LOG.info("Opened by control focus: {}", ActiveControl.getClass()); 13 | Internal.setActivated(true); 14 | return OpenedAuto; 15 | } else { 16 | return this; 17 | } 18 | } 19 | 20 | @Override 21 | public IMStates onToggleKey() { 22 | IngameIME_Forge.LOG.info("Turned on by toggle key"); 23 | Internal.setActivated(true); 24 | return OpenedManual; 25 | } 26 | 27 | }, OpenedManual { 28 | @Override 29 | public IMStates onControlFocus(@Nonnull Object control, boolean focused) { 30 | // Ignore all focus event 31 | return this; 32 | } 33 | 34 | @Override 35 | public IMStates onMouseMove() { 36 | if (!Config.TurnOffOnMouseMove.getBoolean()) return this; 37 | IngameIME_Forge.LOG.info("Turned off by mouse move"); 38 | Internal.setActivated(false); 39 | return Disabled; 40 | } 41 | }, OpenedAuto { 42 | @Override 43 | public IMStates onControlFocus(@Nonnull Object control, boolean focused) { 44 | // Ignore not active focus one 45 | if (!focused && control != ActiveControl) return this; 46 | 47 | if (!focused) { 48 | IngameIME_Forge.LOG.info("Turned off by losing control focus: {}", ActiveControl.getClass()); 49 | Internal.setActivated(false); 50 | return Disabled; 51 | } 52 | 53 | // Update active focused control 54 | if (ActiveControl != control) { 55 | ActiveControl = control; 56 | IngameIME_Forge.LOG.info("Opened by control focus: {}", ActiveControl.getClass()); 57 | Internal.setActivated(true); 58 | ClientProxy.Screen.WInputMode.setActive(true); 59 | } 60 | return this; 61 | } 62 | }; 63 | 64 | @Nullable 65 | public static Object ActiveScreen = null; 66 | @Nullable 67 | public static Object ActiveControl = null; 68 | 69 | @Override 70 | public IMStates onScreenClose() { 71 | if (ActiveScreen != null) IngameIME_Forge.LOG.info("Screen closed: {}", ActiveScreen.getClass()); 72 | Internal.setActivated(false); 73 | ActiveScreen = null; 74 | return Disabled; 75 | } 76 | 77 | @Override 78 | public IMStates onScreenOpen(Object screen) { 79 | if (ActiveScreen == screen) return this; 80 | ActiveScreen = screen; 81 | if (ActiveScreen != null) IngameIME_Forge.LOG.info("Screen Opened: {}", ActiveScreen.getClass()); 82 | return this; 83 | } 84 | 85 | @Override 86 | public IMStates onMouseMove() { 87 | return this; 88 | } 89 | 90 | @Override 91 | public IMStates onToggleKey() { 92 | IngameIME_Forge.LOG.info("Turned off by toggle key"); 93 | Internal.setActivated(false); 94 | return Disabled; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/IngameIME_Forge.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime; 2 | 3 | import cpw.mods.fml.common.Mod; 4 | import cpw.mods.fml.common.SidedProxy; 5 | import cpw.mods.fml.common.event.FMLPreInitializationEvent; 6 | import org.apache.logging.log4j.LogManager; 7 | import org.apache.logging.log4j.Logger; 8 | 9 | @Mod( 10 | modid = Tags.MODID, 11 | version = Tags.VERSION, 12 | name = Tags.MODNAME, 13 | acceptedMinecraftVersions = "[1.7.10]", 14 | acceptableRemoteVersions = "*", 15 | dependencies = "required-after:unimixins;after:NotEnoughItems" 16 | ) 17 | public class IngameIME_Forge { 18 | public static final Logger LOG = LogManager.getLogger(Tags.MODNAME); 19 | @SidedProxy(clientSide = "city.windmill.ingameime.ClientProxy", serverSide = "city.windmill.ingameime.CommonProxy") 20 | public static CommonProxy proxy; 21 | 22 | @Mod.EventHandler 23 | public void preInit(FMLPreInitializationEvent event) { 24 | proxy.preInit(event); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/Internal.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime; 2 | 3 | import city.windmill.ingameime.mixins.MixinGuiScreen; 4 | import codechicken.nei.guihook.GuiContainerManager; 5 | import cpw.mods.fml.common.Loader; 6 | import ingameime.*; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraft.client.gui.GuiScreen; 9 | import org.lwjgl.LWJGLUtil; 10 | import org.lwjgl.input.Keyboard; 11 | import org.lwjgl.opengl.Display; 12 | 13 | import java.io.InputStream; 14 | import java.lang.reflect.Method; 15 | import java.nio.file.Files; 16 | import java.nio.file.Path; 17 | import java.nio.file.StandardCopyOption; 18 | import java.util.ArrayList; 19 | 20 | import static city.windmill.ingameime.IngameIME_Forge.LOG; 21 | 22 | public class Internal { 23 | public static boolean LIBRARY_LOADED = false; 24 | public static InputContext InputCtx = null; 25 | static PreEditCallbackImpl preEditCallbackProxy = null; 26 | static CommitCallbackImpl commitCallbackProxy = null; 27 | static CandidateListCallbackImpl candidateListCallbackProxy = null; 28 | static InputModeCallbackImpl inputModeCallbackProxy = null; 29 | static PreEditCallback preEditCallback = null; 30 | static CommitCallback commitCallback = null; 31 | static CandidateListCallback candidateListCallback = null; 32 | static InputModeCallback inputModeCallback = null; 33 | 34 | private static void tryLoadLibrary(String libName) { 35 | if (!LIBRARY_LOADED) try { 36 | InputStream lib = IngameIME.class.getClassLoader().getResourceAsStream(libName); 37 | if (lib == null) throw new RuntimeException("Required library resource not exist!"); 38 | Path path = Files.createTempFile("IngameIME-Native", null); 39 | Files.copy(lib, path, StandardCopyOption.REPLACE_EXISTING); 40 | System.load(path.toString()); 41 | LIBRARY_LOADED = true; 42 | LOG.info("Library [{}] has loaded!", libName); 43 | } catch (Throwable e) { 44 | LOG.warn("Try to load library [{}] but failed: {}", libName, e.getClass().getSimpleName()); 45 | } 46 | else LOG.info("Library has loaded, skip loading of [{}]", libName); 47 | } 48 | 49 | private static long getWindowHandle_LWJGL3() { 50 | try { 51 | Method getWindow = Display.class.getMethod("getWindow"); 52 | Class NativeWin32 = Class.forName("org.lwjgl.glfw.GLFWNativeWin32"); 53 | long glfwWindow = (long) getWindow.invoke(null); 54 | Method glfwGetWin32Window = NativeWin32.getMethod("glfwGetWin32Window", long.class); 55 | return (long) glfwGetWin32Window.invoke(null, glfwWindow); 56 | } catch (Throwable e) { 57 | LOG.error("Failed to get window handle", e); 58 | return 0; 59 | } 60 | } 61 | 62 | private static long getWindowHandle_LWJGL2() { 63 | try { 64 | Method getImplementation = Display.class.getDeclaredMethod("getImplementation"); 65 | getImplementation.setAccessible(true); 66 | Object impl = getImplementation.invoke(null); 67 | Class clsWindowsDisplay = Class.forName("org.lwjgl.opengl.WindowsDisplay"); 68 | Method getHwnd = clsWindowsDisplay.getDeclaredMethod("getHwnd"); 69 | getHwnd.setAccessible(true); 70 | return (Long) getHwnd.invoke(impl); 71 | } catch (Throwable e) { 72 | LOG.error("Failed to get window handle", e); 73 | return 0; 74 | } 75 | } 76 | 77 | public static void destroyInputCtx() { 78 | if (InputCtx != null) { 79 | InputCtx.delete(); 80 | InputCtx = null; 81 | LOG.info("InputContext has destroyed!"); 82 | } 83 | } 84 | 85 | public static void createInputCtx() { 86 | if (!LIBRARY_LOADED) return; 87 | 88 | LOG.info("Using IngameIME-Native: {}", InputContext.getVersion()); 89 | 90 | long hWnd = Loader.isModLoaded("lwjgl3ify") ? getWindowHandle_LWJGL3() : getWindowHandle_LWJGL2(); 91 | if (hWnd != 0) { 92 | // Once switched to the full screen, we can't back to not UiLess mode, unless restart the game 93 | if (Minecraft.getMinecraft().isFullScreen()) Config.UiLess_Windows.set(true); 94 | API api = Config.API_Windows.getString().equals("TextServiceFramework") ? API.TextServiceFramework : API.Imm32; 95 | LOG.info("Using API: {}, UiLess: {}", api, Config.UiLess_Windows.getBoolean()); 96 | InputCtx = IngameIME.CreateInputContextWin32(hWnd, api, Config.UiLess_Windows.getBoolean()); 97 | LOG.info("InputContext has created!"); 98 | } else { 99 | LOG.error("InputContext could not init as the hWnd is NULL!"); 100 | return; 101 | } 102 | 103 | preEditCallbackProxy = new PreEditCallbackImpl() { 104 | @Override 105 | protected void call(CompositionState arg0, PreEditContext arg1) { 106 | try { 107 | LOG.info("PreEdit State: {}", arg0); 108 | 109 | //Hide Indicator when PreEdit start 110 | if (arg0 == CompositionState.Begin) ClientProxy.Screen.WInputMode.setActive(false); 111 | 112 | if (arg1 != null) ClientProxy.Screen.PreEdit.setContent(arg1.getContent(), arg1.getSelStart()); 113 | else ClientProxy.Screen.PreEdit.setContent(null, -1); 114 | } catch (Throwable e) { 115 | LOG.error("Exception thrown during callback handling", e); 116 | } 117 | } 118 | }; 119 | preEditCallback = new PreEditCallback(preEditCallbackProxy); 120 | commitCallbackProxy = new CommitCallbackImpl() { 121 | @Override 122 | protected void call(String arg0) { 123 | try { 124 | LOG.info("Commit: {}", arg0); 125 | GuiScreen screen = Minecraft.getMinecraft().currentScreen; 126 | if (screen != null) { 127 | // NEI Integration 128 | if (Loader.isModLoaded("NotEnoughItems") && GuiContainerManager.getManager() != null) { 129 | for (char c : arg0.toCharArray()) { 130 | GuiContainerManager.getManager().keyTyped(c, Keyboard.KEY_NONE); 131 | } 132 | return; 133 | } 134 | 135 | // Normal Minecraft Guis 136 | for (char c : arg0.toCharArray()) { 137 | ((MixinGuiScreen) screen).callKeyTyped(c, Keyboard.KEY_NONE); 138 | } 139 | } 140 | } catch (Throwable e) { 141 | LOG.error("Exception thrown during callback handling", e); 142 | } 143 | } 144 | }; 145 | commitCallback = new CommitCallback(commitCallbackProxy); 146 | candidateListCallbackProxy = new CandidateListCallbackImpl() { 147 | @Override 148 | protected void call(CandidateListState arg0, CandidateListContext arg1) { 149 | try { 150 | if (arg1 != null) 151 | ClientProxy.Screen.CandidateList.setContent(new ArrayList<>(arg1.getCandidates()), arg1.getSelection()); 152 | else ClientProxy.Screen.CandidateList.setContent(null, -1); 153 | } catch (Throwable e) { 154 | LOG.error("Exception thrown during callback handling", e); 155 | } 156 | } 157 | }; 158 | candidateListCallback = new CandidateListCallback(candidateListCallbackProxy); 159 | inputModeCallbackProxy = new InputModeCallbackImpl() { 160 | @Override 161 | protected void call(InputMode arg0) { 162 | try { 163 | ClientProxy.Screen.WInputMode.setMode(arg0); 164 | } catch (Throwable e) { 165 | LOG.error("Exception thrown during callback handling", e); 166 | } 167 | } 168 | }; 169 | inputModeCallback = new InputModeCallback(inputModeCallbackProxy); 170 | 171 | InputCtx.setCallback(preEditCallback); 172 | InputCtx.setCallback(commitCallback); 173 | InputCtx.setCallback(candidateListCallback); 174 | InputCtx.setCallback(inputModeCallback); 175 | 176 | // Free unused native object 177 | System.gc(); 178 | } 179 | 180 | static void loadLibrary() { 181 | boolean isWindows = LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_WINDOWS; 182 | 183 | if (!isWindows) { 184 | LOG.info("Unsupported platform: {}", LWJGLUtil.getPlatformName()); 185 | return; 186 | } 187 | 188 | tryLoadLibrary("IngameIME_Java-arm64.dll"); 189 | tryLoadLibrary("IngameIME_Java-x64.dll"); 190 | tryLoadLibrary("IngameIME_Java-x86.dll"); 191 | 192 | if (!LIBRARY_LOADED) { 193 | LOG.error("Unsupported arch: {}", System.getProperty("os.arch")); 194 | } 195 | } 196 | 197 | public static boolean getActivated() { 198 | if (InputCtx != null) return InputCtx.getActivated(); 199 | else return false; 200 | } 201 | 202 | public static void setActivated(boolean activated) { 203 | if (InputCtx != null && getActivated() != activated) { 204 | InputCtx.setActivated(activated); 205 | LOG.info("IM active state: {}", activated); 206 | } 207 | } 208 | } 209 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/gui/OverlayScreen.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime.gui; 2 | 3 | import city.windmill.ingameime.Internal; 4 | import ingameime.InputContext; 5 | import org.lwjgl.opengl.GL11; 6 | 7 | public class OverlayScreen extends Widget { 8 | public WidgetPreEdit PreEdit = new WidgetPreEdit(); 9 | public WidgetCandidateList CandidateList = new WidgetCandidateList(); 10 | public WidgetInputMode WInputMode = new WidgetInputMode(); 11 | 12 | @Override 13 | public boolean isActive() { 14 | InputContext inputCtx = Internal.InputCtx; 15 | return inputCtx != null && inputCtx.getActivated(); 16 | } 17 | 18 | @Override 19 | public void layout() { 20 | } 21 | 22 | @Override 23 | public void draw() { 24 | if (!isActive()) return; 25 | GL11.glDisable(GL11.GL_DEPTH_TEST); 26 | PreEdit.draw(); 27 | CandidateList.draw(); 28 | WInputMode.draw(); 29 | GL11.glEnable(GL11.GL_DEPTH_TEST); 30 | } 31 | 32 | public void setCaretPos(int x, int y) { 33 | PreEdit.setPos(x, y); 34 | WInputMode.setPos(x, y); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/gui/Widget.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime.gui; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.Gui; 5 | import net.minecraft.client.gui.ScaledResolution; 6 | 7 | public class Widget extends Gui { 8 | public int offsetX, offsetY; 9 | public int TextColor = 0xFF_00_00_00; 10 | public int Background = 0xEB_EB_EB_EB; 11 | public int Padding = 1; 12 | public int X, Y; 13 | public int Width, Height; 14 | public boolean DrawInline = true; 15 | protected boolean isDirty = true; 16 | 17 | public boolean isActive() { 18 | return false; 19 | } 20 | 21 | public void layout() { 22 | // Update Width & Height before positioning 23 | Width += 2 * Padding; 24 | Height += 2 * Padding; 25 | 26 | X = offsetX; 27 | Y = offsetY + (DrawInline ? 0 : Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT); 28 | 29 | // Check if exceed screen 30 | ScaledResolution scaledresolution = new ScaledResolution( 31 | Minecraft.getMinecraft(), 32 | Minecraft.getMinecraft().displayWidth, 33 | Minecraft.getMinecraft().displayHeight); 34 | int displayHeight = scaledresolution.getScaledHeight(); 35 | int displayWidth = scaledresolution.getScaledWidth(); 36 | if (X + Width > displayWidth) X = Math.max(0, displayWidth - Width); 37 | if (Y + Height > displayHeight) Y = (DrawInline ? displayHeight : offsetY) - Height; 38 | 39 | isDirty = false; 40 | } 41 | 42 | public void draw() { 43 | drawRect(X, Y, X + Width, Y + Height, Background); 44 | } 45 | 46 | public void setPos(int x, int y) { 47 | if (offsetX == x && offsetY == y) return; 48 | offsetX = x; 49 | offsetY = y; 50 | isDirty = true; 51 | layout(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/gui/WidgetCandidateList.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime.gui; 2 | 3 | import net.minecraft.client.Minecraft; 4 | 5 | import java.util.List; 6 | 7 | public class WidgetCandidateList extends Widget { 8 | private List Candidates = null; 9 | private int Selected = -1; 10 | 11 | WidgetCandidateList() { 12 | Padding = 3; 13 | } 14 | 15 | public void setContent(List candidates, int selected) { 16 | Candidates = candidates; 17 | Selected = selected; 18 | isDirty = true; 19 | layout(); 20 | } 21 | 22 | @Override 23 | public boolean isActive() { 24 | return Candidates != null; 25 | } 26 | 27 | @Override 28 | public void layout() { 29 | if (!isDirty) return; 30 | Height = Width = 0; 31 | if (!isActive()) return; 32 | 33 | Height = Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT; 34 | 35 | int i = 1; 36 | for (String candidate : Candidates) { 37 | Width += Padding * 2; 38 | String formatted = String.format("%d. %s", i++, candidate); 39 | Width += Minecraft.getMinecraft().fontRenderer.getStringWidth(formatted); 40 | } 41 | super.layout(); 42 | } 43 | 44 | @Override 45 | public void draw() { 46 | if (!isActive()) return; 47 | super.draw(); 48 | 49 | int x = X + Padding; 50 | int i = 1; 51 | for (String candidate : Candidates) { 52 | x += Padding; 53 | String formatted = String.format("%d. %s", i, candidate); 54 | if (Selected != i++ - 1) 55 | Minecraft.getMinecraft().fontRenderer.drawString( 56 | formatted, 57 | x, 58 | Y + Padding, 59 | TextColor 60 | ); 61 | else { 62 | // Different background for selected one 63 | int xLen = Minecraft.getMinecraft().fontRenderer.getStringWidth(formatted); 64 | int fontH = Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT; 65 | drawRect(x - 1, Y + Padding - 1, x + xLen, Y + Padding + fontH, 0xEB_B2DAE0); 66 | Minecraft.getMinecraft().fontRenderer.drawString( 67 | formatted, 68 | x, 69 | Y + Padding, 70 | TextColor 71 | ); 72 | } 73 | x += Minecraft.getMinecraft().fontRenderer.getStringWidth(formatted); 74 | x += Padding; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/gui/WidgetInputMode.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime.gui; 2 | 3 | import ingameime.InputMode; 4 | import net.minecraft.client.Minecraft; 5 | 6 | import static city.windmill.ingameime.Config.AlphaModeText; 7 | import static city.windmill.ingameime.Config.NativeModeText; 8 | 9 | public class WidgetInputMode extends Widget { 10 | public final long ActiveTime = 3000; 11 | private long LastActive = 0; 12 | private InputMode Mode = InputMode.AlphaNumeric; 13 | 14 | public WidgetInputMode() { 15 | Padding = 5; 16 | DrawInline = false; 17 | } 18 | 19 | @Override 20 | public boolean isActive() { 21 | return System.currentTimeMillis() - LastActive <= ActiveTime; 22 | } 23 | 24 | public void setActive(boolean active) { 25 | if (active) LastActive = System.currentTimeMillis(); 26 | else LastActive = 0; 27 | } 28 | 29 | public void setMode(InputMode mode) { 30 | Mode = mode; 31 | setActive(true); 32 | isDirty = true; 33 | layout(); 34 | } 35 | 36 | @Override 37 | public void layout() { 38 | if (!isDirty) return; 39 | 40 | Height = Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT; 41 | 42 | if (Mode == InputMode.AlphaNumeric) 43 | Width = Minecraft.getMinecraft().fontRenderer.getStringWidth(AlphaModeText.getString()); 44 | else 45 | Width = Minecraft.getMinecraft().fontRenderer.getStringWidth(NativeModeText.getString()); 46 | 47 | super.layout(); 48 | } 49 | 50 | @Override 51 | public void draw() { 52 | if (!isActive()) return; 53 | super.draw(); 54 | 55 | if (Mode == InputMode.AlphaNumeric) 56 | Minecraft.getMinecraft().fontRenderer.drawString(AlphaModeText.getString(), X + Padding, Y + Padding, TextColor); 57 | else 58 | Minecraft.getMinecraft().fontRenderer.drawString(NativeModeText.getString(), X + Padding, Y + Padding, TextColor); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/gui/WidgetPreEdit.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime.gui; 2 | 3 | import city.windmill.ingameime.ClientProxy; 4 | import city.windmill.ingameime.Internal; 5 | import ingameime.PreEditRect; 6 | import net.minecraft.client.Minecraft; 7 | 8 | public class WidgetPreEdit extends Widget { 9 | private final int CursorWidth = 3; 10 | private String Content = null; 11 | private int Cursor = -1; 12 | 13 | public void setContent(String content, int cursor) { 14 | Cursor = cursor; 15 | Content = content; 16 | isDirty = true; 17 | layout(); 18 | } 19 | 20 | @Override 21 | public void layout() { 22 | if (!isDirty) return; 23 | if (isActive()) { 24 | Width = Minecraft.getMinecraft().fontRenderer.getStringWidth(Content) + CursorWidth; 25 | Height = Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT; 26 | } else { 27 | Width = Height = 0; 28 | } 29 | super.layout(); 30 | 31 | WidgetCandidateList list = ClientProxy.Screen.CandidateList; 32 | list.setPos(X, Y + Height); 33 | // Check if overlap 34 | if (list.Y < Y + Height) { 35 | list.setPos(X, Y - list.Height); 36 | } 37 | 38 | // Update Rect 39 | if (!Internal.LIBRARY_LOADED || Internal.InputCtx == null) return; 40 | PreEditRect rect = new PreEditRect(); 41 | rect.setX(X); 42 | rect.setY(Y); 43 | rect.setHeight(Height); 44 | rect.setWidth(Width); 45 | Internal.InputCtx.setPreEditRect(rect); 46 | } 47 | 48 | @Override 49 | public boolean isActive() { 50 | return Content != null && !Content.isEmpty(); 51 | } 52 | 53 | @Override 54 | public void draw() { 55 | if (!isActive()) return; 56 | super.draw(); 57 | String beforeCursor = Content.substring(0, Cursor); 58 | String afterCursor = Content.substring(Cursor); 59 | int x = Minecraft.getMinecraft().fontRenderer.drawString(beforeCursor, X + Padding, Y + Padding, TextColor); 60 | // Cursor 61 | drawRect(x + 1, Y + Padding, x + 2, Y + Padding + Height, TextColor); 62 | Minecraft.getMinecraft().fontRenderer.drawString(afterCursor, x + CursorWidth, Y + Padding, TextColor); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/mixins/MixinGuiScreen.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime.mixins; 2 | 3 | import net.minecraft.client.gui.GuiScreen; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Invoker; 6 | 7 | @Mixin(GuiScreen.class) 8 | public interface MixinGuiScreen { 9 | @Invoker() 10 | void callKeyTyped(char typedChar, int keyCode); 11 | } 12 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/mixins/MixinGuiTextField.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime.mixins; 2 | 3 | import city.windmill.ingameime.ClientProxy; 4 | import city.windmill.ingameime.IMStates; 5 | import net.minecraft.client.gui.GuiTextField; 6 | import org.spongepowered.asm.lib.Opcodes; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | import org.spongepowered.asm.mixin.injection.callback.LocalCapture; 12 | 13 | @Mixin(GuiTextField.class) 14 | public class MixinGuiTextField { 15 | @SuppressWarnings("InvalidInjectorMethodSignature") 16 | @Inject( 17 | method = "drawTextBox", 18 | at = @At(value = "JUMP", opcode = Opcodes.IF_ICMPEQ, ordinal = 0), 19 | locals = LocalCapture.CAPTURE_FAILSOFT 20 | ) 21 | void onDrawCaret(CallbackInfo ci, int var1, int var2, int var3, String var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11) { 22 | if (IMStates.ActiveControl == this) 23 | ClientProxy.Screen.setCaretPos(var11, var8); 24 | } 25 | 26 | @Inject(method = "setFocused", at = @At(value = "HEAD")) 27 | void onSetFocus(boolean focused, CallbackInfo ci) { 28 | ClientProxy.INSTANCE.onControlFocus(this, focused); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /1.7.10/src/main/java/city/windmill/ingameime/mixins/MixinMinecraft.java: -------------------------------------------------------------------------------- 1 | package city.windmill.ingameime.mixins; 2 | 3 | import city.windmill.ingameime.ClientProxy; 4 | import city.windmill.ingameime.Internal; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.gui.GuiScreen; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(Minecraft.class) 13 | public class MixinMinecraft { 14 | @Inject(method = "toggleFullscreen", at = @At(value = "HEAD")) 15 | void preToggleFullscreen(CallbackInfo ci) { 16 | Internal.destroyInputCtx(); 17 | } 18 | 19 | @Inject(method = "toggleFullscreen", at = @At(value = "RETURN")) 20 | void postToggleFullscreen(CallbackInfo ci) { 21 | Internal.createInputCtx(); 22 | } 23 | 24 | @Inject(method = "displayGuiScreen", at = @At(value = "RETURN")) 25 | void postDisplayScreen(GuiScreen guiScreenIn, CallbackInfo ci) { 26 | // Reset pos when screen changes 27 | ClientProxy.Screen.setCaretPos(0, 0); 28 | // Disable input method when not screen 29 | GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen; 30 | if (currentScreen == null) 31 | ClientProxy.INSTANCE.onScreenClose(); 32 | else 33 | ClientProxy.INSTANCE.onScreenOpen(currentScreen); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /1.7.10/src/main/resources/LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 489 | USA 490 | 491 | Also add information on how to contact you by electronic and paper mail. 492 | 493 | You should also get your employer (if you work as a programmer) or your 494 | school, if any, to sign a "copyright disclaimer" for the library, if 495 | necessary. Here is a sample; alter the names: 496 | 497 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 498 | library `Frob' (a library for tweaking knobs) written by James Random 499 | Hacker. 500 | 501 | , 1 April 1990 502 | Ty Coon, President of Vice 503 | 504 | That's all there is to it! 505 | -------------------------------------------------------------------------------- /1.7.10/src/main/resources/assets/ingameime/lang/en_US.lang: -------------------------------------------------------------------------------- 1 | ingameime.key.desc=Toggle Input Method -------------------------------------------------------------------------------- /1.7.10/src/main/resources/assets/ingameime/lang/zh_CN.lang: -------------------------------------------------------------------------------- 1 | ingameime.key.desc=开关输入法 2 | -------------------------------------------------------------------------------- /1.7.10/src/main/resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Windmill-City/IngameIME-Minecraft/e4594b05c6ff7d4f85d95d0d158f40054acab2c7/1.7.10/src/main/resources/icon.png -------------------------------------------------------------------------------- /1.7.10/src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | { 2 | "modListVersion": 2, 3 | "modList": [ 4 | { 5 | "modid": "ingameime", 6 | "name": "IngameIME", 7 | "description": "Use InputMethod in full screen minecraft", 8 | "version": "${modVersion}", 9 | "mcversion": "1.7.10", 10 | "url": "https://github.com/Windmill-City/IngameIME-Minecraft", 11 | "updateUrl": "", 12 | "authorList": [ 13 | "Windmill_City" 14 | ], 15 | "credits": "", 16 | "logoFile": "Icon.png", 17 | "screenshots": [], 18 | "parent": "", 19 | "requiredMods": [], 20 | "dependencies": [], 21 | "dependants": [], 22 | "useDependencyInformation": true 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /1.7.10/src/main/resources/mixins.ingameime.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "minVersion": "0.8", 4 | "package": "city.windmill.ingameime.mixins", 5 | "compatibilityLevel": "JAVA_8", 6 | "refmap": "mixins.ingameime.refmap.json", 7 | "mixins": [ 8 | ], 9 | "client": [ 10 | "MixinGuiScreen", 11 | "MixinGuiTextField", 12 | "MixinMinecraft" 13 | ], 14 | "injectors": { 15 | "defaultRequire": 0 16 | } 17 | } -------------------------------------------------------------------------------- /CurseForgeLatest.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge-1.7.10": "2.0.10" 3 | } -------------------------------------------------------------------------------- /IngameIME-Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Windmill-City/IngameIME-Minecraft/e4594b05c6ff7d4f85d95d0d158f40054acab2c7/IngameIME-Icon.png -------------------------------------------------------------------------------- /IngameIME-Icon.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Windmill-City/IngameIME-Minecraft/e4594b05c6ff7d4f85d95d0d158f40054acab2c7/IngameIME-Icon.psd -------------------------------------------------------------------------------- /IngameIME-Logo-Mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Windmill-City/IngameIME-Minecraft/e4594b05c6ff7d4f85d95d0d158f40054acab2c7/IngameIME-Logo-Mini.png -------------------------------------------------------------------------------- /IngameIME-Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Windmill-City/IngameIME-Minecraft/e4594b05c6ff7d4f85d95d0d158f40054acab2c7/IngameIME-Logo.png -------------------------------------------------------------------------------- /IngameIME-Native/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.gtnewhorizons.retrofuturagradle.modutils.ModUtils 2 | 3 | buildscript { 4 | repositories { 5 | gradlePluginPortal() 6 | mavenCentral() 7 | mavenLocal() 8 | maven { 9 | // GTNH RetroFuturaGradle and ASM Fork 10 | name = "GTNH Maven" 11 | url = uri("http://jenkins.usrv.eu:8081/nexus/content/groups/public/") 12 | isAllowInsecureProtocol = true 13 | } 14 | } 15 | } 16 | 17 | plugins { 18 | id("java-library") 19 | // ForgeGradle 20 | id("com.gtnewhorizons.retrofuturagradle") version "1.3.26" apply false 21 | } 22 | 23 | tasks.compileJava { 24 | options.encoding = "UTF-8" 25 | sourceCompatibility = "1.8" 26 | } 27 | 28 | tasks.compileTestJava { 29 | options.encoding = "UTF-8" 30 | sourceCompatibility = "1.8" 31 | } 32 | 33 | configurations.all { 34 | afterEvaluate { 35 | attributes { 36 | attribute(ModUtils.DEOBFUSCATOR_TRANSFORMED, true) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/API.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public final class API { 12 | public final static API TextServiceFramework = new API("TextServiceFramework"); 13 | public final static API Imm32 = new API("Imm32"); 14 | 15 | public final int swigValue() { 16 | return swigValue; 17 | } 18 | 19 | public String toString() { 20 | return swigName; 21 | } 22 | 23 | public static API swigToEnum(int swigValue) { 24 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 25 | return swigValues[swigValue]; 26 | for (int i = 0; i < swigValues.length; i++) 27 | if (swigValues[i].swigValue == swigValue) 28 | return swigValues[i]; 29 | throw new IllegalArgumentException("No enum " + API.class + " with value " + swigValue); 30 | } 31 | 32 | private API(String swigName) { 33 | this.swigName = swigName; 34 | this.swigValue = swigNext++; 35 | } 36 | 37 | private API(String swigName, int swigValue) { 38 | this.swigName = swigName; 39 | this.swigValue = swigValue; 40 | swigNext = swigValue+1; 41 | } 42 | 43 | private API(String swigName, API swigEnum) { 44 | this.swigName = swigName; 45 | this.swigValue = swigEnum.swigValue; 46 | swigNext = this.swigValue+1; 47 | } 48 | 49 | private static API[] swigValues = { TextServiceFramework, Imm32 }; 50 | private static int swigNext = 0; 51 | private final int swigValue; 52 | private final String swigName; 53 | } 54 | 55 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/CandidateListCallback.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class CandidateListCallback { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected CandidateListCallback(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(CandidateListCallback obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(CandidateListCallback obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_CandidateListCallback(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | public void call(CandidateListState arg0, CandidateListContext arg1) { 52 | IngameIMEJNI.CandidateListCallback_call(swigCPtr, this, arg0.swigValue(), CandidateListContext.getCPtr(arg1), arg1); 53 | } 54 | 55 | public CandidateListCallback(CandidateListCallbackImpl in) { 56 | this(IngameIMEJNI.new_CandidateListCallback(CandidateListCallbackImpl.getCPtr(in), in), true); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/CandidateListCallbackImpl.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class CandidateListCallbackImpl { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected CandidateListCallbackImpl(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(CandidateListCallbackImpl obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(CandidateListCallbackImpl obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_CandidateListCallbackImpl(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | protected void swigDirectorDisconnect() { 52 | swigCMemOwn = false; 53 | delete(); 54 | } 55 | 56 | public void swigReleaseOwnership() { 57 | swigCMemOwn = false; 58 | IngameIMEJNI.CandidateListCallbackImpl_change_ownership(this, swigCPtr, false); 59 | } 60 | 61 | public void swigTakeOwnership() { 62 | swigCMemOwn = true; 63 | IngameIMEJNI.CandidateListCallbackImpl_change_ownership(this, swigCPtr, true); 64 | } 65 | 66 | protected void call(CandidateListState arg0, CandidateListContext arg1) { 67 | IngameIMEJNI.CandidateListCallbackImpl_call(swigCPtr, this, arg0.swigValue(), CandidateListContext.getCPtr(arg1), arg1); 68 | } 69 | 70 | public CandidateListCallbackImpl() { 71 | this(IngameIMEJNI.new_CandidateListCallbackImpl(), true); 72 | IngameIMEJNI.CandidateListCallbackImpl_director_connect(this, swigCPtr, true, true); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/CandidateListContext.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class CandidateListContext { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected CandidateListContext(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(CandidateListContext obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(CandidateListContext obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_CandidateListContext(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | public int getSelection() { 52 | return IngameIMEJNI.CandidateListContext_selection_get(swigCPtr, this); 53 | } 54 | 55 | public string_list getCandidates() { 56 | long cPtr = IngameIMEJNI.CandidateListContext_candidates_get(swigCPtr, this); 57 | return (cPtr == 0) ? null : new string_list(cPtr, false); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/CandidateListState.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public final class CandidateListState { 12 | public final static CandidateListState Begin = new CandidateListState("Begin"); 13 | public final static CandidateListState Update = new CandidateListState("Update"); 14 | public final static CandidateListState End = new CandidateListState("End"); 15 | 16 | public final int swigValue() { 17 | return swigValue; 18 | } 19 | 20 | public String toString() { 21 | return swigName; 22 | } 23 | 24 | public static CandidateListState swigToEnum(int swigValue) { 25 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 26 | return swigValues[swigValue]; 27 | for (int i = 0; i < swigValues.length; i++) 28 | if (swigValues[i].swigValue == swigValue) 29 | return swigValues[i]; 30 | throw new IllegalArgumentException("No enum " + CandidateListState.class + " with value " + swigValue); 31 | } 32 | 33 | private CandidateListState(String swigName) { 34 | this.swigName = swigName; 35 | this.swigValue = swigNext++; 36 | } 37 | 38 | private CandidateListState(String swigName, int swigValue) { 39 | this.swigName = swigName; 40 | this.swigValue = swigValue; 41 | swigNext = swigValue+1; 42 | } 43 | 44 | private CandidateListState(String swigName, CandidateListState swigEnum) { 45 | this.swigName = swigName; 46 | this.swigValue = swigEnum.swigValue; 47 | swigNext = this.swigValue+1; 48 | } 49 | 50 | private static CandidateListState[] swigValues = { Begin, Update, End }; 51 | private static int swigNext = 0; 52 | private final int swigValue; 53 | private final String swigName; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/CommitCallback.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class CommitCallback { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected CommitCallback(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(CommitCallback obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(CommitCallback obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_CommitCallback(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | public void call(String arg0) { 52 | IngameIMEJNI.CommitCallback_call(swigCPtr, this, arg0); 53 | } 54 | 55 | public CommitCallback(CommitCallbackImpl in) { 56 | this(IngameIMEJNI.new_CommitCallback(CommitCallbackImpl.getCPtr(in), in), true); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/CommitCallbackImpl.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class CommitCallbackImpl { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected CommitCallbackImpl(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(CommitCallbackImpl obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(CommitCallbackImpl obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_CommitCallbackImpl(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | protected void swigDirectorDisconnect() { 52 | swigCMemOwn = false; 53 | delete(); 54 | } 55 | 56 | public void swigReleaseOwnership() { 57 | swigCMemOwn = false; 58 | IngameIMEJNI.CommitCallbackImpl_change_ownership(this, swigCPtr, false); 59 | } 60 | 61 | public void swigTakeOwnership() { 62 | swigCMemOwn = true; 63 | IngameIMEJNI.CommitCallbackImpl_change_ownership(this, swigCPtr, true); 64 | } 65 | 66 | protected void call(String arg0) { 67 | IngameIMEJNI.CommitCallbackImpl_call(swigCPtr, this, arg0); 68 | } 69 | 70 | public CommitCallbackImpl() { 71 | this(IngameIMEJNI.new_CommitCallbackImpl(), true); 72 | IngameIMEJNI.CommitCallbackImpl_director_connect(this, swigCPtr, true, true); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/CompositionState.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public final class CompositionState { 12 | public final static CompositionState Begin = new CompositionState("Begin"); 13 | public final static CompositionState Update = new CompositionState("Update"); 14 | public final static CompositionState End = new CompositionState("End"); 15 | 16 | public final int swigValue() { 17 | return swigValue; 18 | } 19 | 20 | public String toString() { 21 | return swigName; 22 | } 23 | 24 | public static CompositionState swigToEnum(int swigValue) { 25 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 26 | return swigValues[swigValue]; 27 | for (int i = 0; i < swigValues.length; i++) 28 | if (swigValues[i].swigValue == swigValue) 29 | return swigValues[i]; 30 | throw new IllegalArgumentException("No enum " + CompositionState.class + " with value " + swigValue); 31 | } 32 | 33 | private CompositionState(String swigName) { 34 | this.swigName = swigName; 35 | this.swigValue = swigNext++; 36 | } 37 | 38 | private CompositionState(String swigName, int swigValue) { 39 | this.swigName = swigName; 40 | this.swigValue = swigValue; 41 | swigNext = swigValue+1; 42 | } 43 | 44 | private CompositionState(String swigName, CompositionState swigEnum) { 45 | this.swigName = swigName; 46 | this.swigValue = swigEnum.swigValue; 47 | swigNext = this.swigValue+1; 48 | } 49 | 50 | private static CompositionState[] swigValues = { Begin, Update, End }; 51 | private static int swigNext = 0; 52 | private final int swigValue; 53 | private final String swigName; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/IngameIME.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class IngameIME { 12 | public static InputContext CreateInputContextWin32(long hWnd, API api, boolean uiLess) { 13 | long cPtr = IngameIMEJNI.CreateInputContextWin32__SWIG_0(hWnd, api.swigValue(), uiLess); 14 | return (cPtr == 0) ? null : new InputContext(cPtr, true); 15 | } 16 | 17 | public static InputContext CreateInputContextWin32(long hWnd, API api) { 18 | long cPtr = IngameIMEJNI.CreateInputContextWin32__SWIG_1(hWnd, api.swigValue()); 19 | return (cPtr == 0) ? null : new InputContext(cPtr, true); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/IngameIMEJNI.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class IngameIMEJNI { 12 | public final static native void delete_PreEditCallbackImpl(long jarg1); 13 | public final static native void PreEditCallbackImpl_call(long jarg1, PreEditCallbackImpl jarg1_, int jarg2, long jarg3, PreEditContext jarg3_); 14 | public final static native long new_PreEditCallbackImpl(); 15 | public final static native void PreEditCallbackImpl_director_connect(PreEditCallbackImpl obj, long cptr, boolean mem_own, boolean weak_global); 16 | public final static native void PreEditCallbackImpl_change_ownership(PreEditCallbackImpl obj, long cptr, boolean take_or_release); 17 | public final static native void PreEditCallback_call(long jarg1, PreEditCallback jarg1_, int jarg2, long jarg3, PreEditContext jarg3_); 18 | public final static native long new_PreEditCallback(long jarg1, PreEditCallbackImpl jarg1_); 19 | public final static native void delete_PreEditCallback(long jarg1); 20 | public final static native void delete_CommitCallbackImpl(long jarg1); 21 | public final static native void CommitCallbackImpl_call(long jarg1, CommitCallbackImpl jarg1_, String jarg2); 22 | public final static native long new_CommitCallbackImpl(); 23 | public final static native void CommitCallbackImpl_director_connect(CommitCallbackImpl obj, long cptr, boolean mem_own, boolean weak_global); 24 | public final static native void CommitCallbackImpl_change_ownership(CommitCallbackImpl obj, long cptr, boolean take_or_release); 25 | public final static native void CommitCallback_call(long jarg1, CommitCallback jarg1_, String jarg2); 26 | public final static native long new_CommitCallback(long jarg1, CommitCallbackImpl jarg1_); 27 | public final static native void delete_CommitCallback(long jarg1); 28 | public final static native void delete_CandidateListCallbackImpl(long jarg1); 29 | public final static native void CandidateListCallbackImpl_call(long jarg1, CandidateListCallbackImpl jarg1_, int jarg2, long jarg3, CandidateListContext jarg3_); 30 | public final static native long new_CandidateListCallbackImpl(); 31 | public final static native void CandidateListCallbackImpl_director_connect(CandidateListCallbackImpl obj, long cptr, boolean mem_own, boolean weak_global); 32 | public final static native void CandidateListCallbackImpl_change_ownership(CandidateListCallbackImpl obj, long cptr, boolean take_or_release); 33 | public final static native void CandidateListCallback_call(long jarg1, CandidateListCallback jarg1_, int jarg2, long jarg3, CandidateListContext jarg3_); 34 | public final static native long new_CandidateListCallback(long jarg1, CandidateListCallbackImpl jarg1_); 35 | public final static native void delete_CandidateListCallback(long jarg1); 36 | public final static native void delete_InputModeCallbackImpl(long jarg1); 37 | public final static native void InputModeCallbackImpl_call(long jarg1, InputModeCallbackImpl jarg1_, int jarg2); 38 | public final static native long new_InputModeCallbackImpl(); 39 | public final static native void InputModeCallbackImpl_director_connect(InputModeCallbackImpl obj, long cptr, boolean mem_own, boolean weak_global); 40 | public final static native void InputModeCallbackImpl_change_ownership(InputModeCallbackImpl obj, long cptr, boolean take_or_release); 41 | public final static native void InputModeCallback_call(long jarg1, InputModeCallback jarg1_, int jarg2); 42 | public final static native long new_InputModeCallback(long jarg1, InputModeCallbackImpl jarg1_); 43 | public final static native void delete_InputModeCallback(long jarg1); 44 | public final static native void string_list_Iterator_set_unchecked(long jarg1, string_list.Iterator jarg1_, String jarg2); 45 | public final static native long string_list_Iterator_next_unchecked(long jarg1, string_list.Iterator jarg1_); 46 | public final static native long string_list_Iterator_previous_unchecked(long jarg1, string_list.Iterator jarg1_); 47 | public final static native String string_list_Iterator_deref_unchecked(long jarg1, string_list.Iterator jarg1_); 48 | public final static native long string_list_Iterator_advance_unchecked(long jarg1, string_list.Iterator jarg1_, long jarg2); 49 | public final static native void delete_string_list_Iterator(long jarg1); 50 | public final static native long new_string_list__SWIG_0(); 51 | public final static native long new_string_list__SWIG_1(long jarg1, string_list jarg1_); 52 | public final static native boolean string_list_isEmpty(long jarg1, string_list jarg1_); 53 | public final static native void string_list_clear(long jarg1, string_list jarg1_); 54 | public final static native long string_list_remove(long jarg1, string_list jarg1_, long jarg2, string_list.Iterator jarg2_); 55 | public final static native void string_list_removeLast(long jarg1, string_list jarg1_); 56 | public final static native void string_list_removeFirst(long jarg1, string_list jarg1_); 57 | public final static native void string_list_addLast(long jarg1, string_list jarg1_, String jarg2); 58 | public final static native void string_list_addFirst(long jarg1, string_list jarg1_, String jarg2); 59 | public final static native long string_list_begin(long jarg1, string_list jarg1_); 60 | public final static native long string_list_end(long jarg1, string_list jarg1_); 61 | public final static native long string_list_insert(long jarg1, string_list jarg1_, long jarg2, string_list.Iterator jarg2_, String jarg3); 62 | public final static native long new_string_list__SWIG_2(int jarg1, String jarg2); 63 | public final static native int string_list_doSize(long jarg1, string_list jarg1_); 64 | public final static native int string_list_doPreviousIndex(long jarg1, string_list jarg1_, long jarg2, string_list.Iterator jarg2_); 65 | public final static native int string_list_doNextIndex(long jarg1, string_list jarg1_, long jarg2, string_list.Iterator jarg2_); 66 | public final static native boolean string_list_doHasNext(long jarg1, string_list jarg1_, long jarg2, string_list.Iterator jarg2_); 67 | public final static native void delete_string_list(long jarg1); 68 | public final static native int CandidateListContext_selection_get(long jarg1, CandidateListContext jarg1_); 69 | public final static native long CandidateListContext_candidates_get(long jarg1, CandidateListContext jarg1_); 70 | public final static native void delete_CandidateListContext(long jarg1); 71 | public final static native void PreEditRect_x_set(long jarg1, PreEditRect jarg1_, int jarg2); 72 | public final static native int PreEditRect_x_get(long jarg1, PreEditRect jarg1_); 73 | public final static native void PreEditRect_y_set(long jarg1, PreEditRect jarg1_, int jarg2); 74 | public final static native int PreEditRect_y_get(long jarg1, PreEditRect jarg1_); 75 | public final static native void PreEditRect_width_set(long jarg1, PreEditRect jarg1_, int jarg2); 76 | public final static native int PreEditRect_width_get(long jarg1, PreEditRect jarg1_); 77 | public final static native void PreEditRect_height_set(long jarg1, PreEditRect jarg1_, int jarg2); 78 | public final static native int PreEditRect_height_get(long jarg1, PreEditRect jarg1_); 79 | public final static native long new_PreEditRect(); 80 | public final static native void delete_PreEditRect(long jarg1); 81 | public final static native int PreEditContext_selStart_get(long jarg1, PreEditContext jarg1_); 82 | public final static native int PreEditContext_selEnd_get(long jarg1, PreEditContext jarg1_); 83 | public final static native String PreEditContext_content_get(long jarg1, PreEditContext jarg1_); 84 | public final static native void delete_PreEditContext(long jarg1); 85 | public final static native String InputContext_Version_get(); 86 | public final static native void delete_InputContext(long jarg1); 87 | public final static native int InputContext_getInputMode(long jarg1, InputContext jarg1_); 88 | public final static native void InputContext_setPreEditRect(long jarg1, InputContext jarg1_, long jarg2, PreEditRect jarg2_); 89 | public final static native long InputContext_getPreEditRect(long jarg1, InputContext jarg1_); 90 | public final static native void InputContext_setActivated(long jarg1, InputContext jarg1_, boolean jarg2); 91 | public final static native boolean InputContext_getActivated(long jarg1, InputContext jarg1_); 92 | public final static native long InputContext_setCallback__SWIG_0(long jarg1, InputContext jarg1_, long jarg2, PreEditCallback jarg2_); 93 | public final static native long InputContext_setCallback__SWIG_1(long jarg1, InputContext jarg1_, long jarg2, CommitCallback jarg2_); 94 | public final static native long InputContext_setCallback__SWIG_2(long jarg1, InputContext jarg1_, long jarg2, CandidateListCallback jarg2_); 95 | public final static native long InputContext_setCallback__SWIG_3(long jarg1, InputContext jarg1_, long jarg2, InputModeCallback jarg2_); 96 | public final static native long CreateInputContextWin32__SWIG_0(long jarg1, int jarg2, boolean jarg3); 97 | public final static native long CreateInputContextWin32__SWIG_1(long jarg1, int jarg2); 98 | 99 | public static void SwigDirector_PreEditCallbackImpl_call(PreEditCallbackImpl jself, int arg0, long arg1) { 100 | jself.call(CompositionState.swigToEnum(arg0), (arg1 == 0) ? null : new PreEditContext(arg1, false)); 101 | } 102 | public static void SwigDirector_CommitCallbackImpl_call(CommitCallbackImpl jself, String arg0) { 103 | jself.call(arg0); 104 | } 105 | public static void SwigDirector_CandidateListCallbackImpl_call(CandidateListCallbackImpl jself, int arg0, long arg1) { 106 | jself.call(CandidateListState.swigToEnum(arg0), (arg1 == 0) ? null : new CandidateListContext(arg1, false)); 107 | } 108 | public static void SwigDirector_InputModeCallbackImpl_call(InputModeCallbackImpl jself, int arg0) { 109 | jself.call(InputMode.swigToEnum(arg0)); 110 | } 111 | 112 | private final static native void swig_module_init(); 113 | static { 114 | swig_module_init(); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/InputContext.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class InputContext { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected InputContext(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(InputContext obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(InputContext obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_InputContext(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | public static String getVersion() { 52 | return IngameIMEJNI.InputContext_Version_get(); 53 | } 54 | 55 | public InputMode getInputMode() { 56 | return InputMode.swigToEnum(IngameIMEJNI.InputContext_getInputMode(swigCPtr, this)); 57 | } 58 | 59 | public void setPreEditRect(PreEditRect rect) { 60 | IngameIMEJNI.InputContext_setPreEditRect(swigCPtr, this, PreEditRect.getCPtr(rect), rect); 61 | } 62 | 63 | public PreEditRect getPreEditRect() { 64 | return new PreEditRect(IngameIMEJNI.InputContext_getPreEditRect(swigCPtr, this), true); 65 | } 66 | 67 | public void setActivated(boolean activated) { 68 | IngameIMEJNI.InputContext_setActivated(swigCPtr, this, activated); 69 | } 70 | 71 | public boolean getActivated() { 72 | return IngameIMEJNI.InputContext_getActivated(swigCPtr, this); 73 | } 74 | 75 | public PreEditCallback setCallback(PreEditCallback callback) { 76 | return new PreEditCallback(IngameIMEJNI.InputContext_setCallback__SWIG_0(swigCPtr, this, PreEditCallback.getCPtr(callback), callback), true); 77 | } 78 | 79 | public CommitCallback setCallback(CommitCallback callback) { 80 | return new CommitCallback(IngameIMEJNI.InputContext_setCallback__SWIG_1(swigCPtr, this, CommitCallback.getCPtr(callback), callback), true); 81 | } 82 | 83 | public CandidateListCallback setCallback(CandidateListCallback callback) { 84 | return new CandidateListCallback(IngameIMEJNI.InputContext_setCallback__SWIG_2(swigCPtr, this, CandidateListCallback.getCPtr(callback), callback), true); 85 | } 86 | 87 | public InputModeCallback setCallback(InputModeCallback callback) { 88 | return new InputModeCallback(IngameIMEJNI.InputContext_setCallback__SWIG_3(swigCPtr, this, InputModeCallback.getCPtr(callback), callback), true); 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/InputMode.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public final class InputMode { 12 | public final static InputMode AlphaNumeric = new InputMode("AlphaNumeric"); 13 | public final static InputMode Native = new InputMode("Native"); 14 | 15 | public final int swigValue() { 16 | return swigValue; 17 | } 18 | 19 | public String toString() { 20 | return swigName; 21 | } 22 | 23 | public static InputMode swigToEnum(int swigValue) { 24 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 25 | return swigValues[swigValue]; 26 | for (int i = 0; i < swigValues.length; i++) 27 | if (swigValues[i].swigValue == swigValue) 28 | return swigValues[i]; 29 | throw new IllegalArgumentException("No enum " + InputMode.class + " with value " + swigValue); 30 | } 31 | 32 | private InputMode(String swigName) { 33 | this.swigName = swigName; 34 | this.swigValue = swigNext++; 35 | } 36 | 37 | private InputMode(String swigName, int swigValue) { 38 | this.swigName = swigName; 39 | this.swigValue = swigValue; 40 | swigNext = swigValue+1; 41 | } 42 | 43 | private InputMode(String swigName, InputMode swigEnum) { 44 | this.swigName = swigName; 45 | this.swigValue = swigEnum.swigValue; 46 | swigNext = this.swigValue+1; 47 | } 48 | 49 | private static InputMode[] swigValues = { AlphaNumeric, Native }; 50 | private static int swigNext = 0; 51 | private final int swigValue; 52 | private final String swigName; 53 | } 54 | 55 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/InputModeCallback.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class InputModeCallback { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected InputModeCallback(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(InputModeCallback obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(InputModeCallback obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_InputModeCallback(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | public void call(InputMode arg0) { 52 | IngameIMEJNI.InputModeCallback_call(swigCPtr, this, arg0.swigValue()); 53 | } 54 | 55 | public InputModeCallback(InputModeCallbackImpl in) { 56 | this(IngameIMEJNI.new_InputModeCallback(InputModeCallbackImpl.getCPtr(in), in), true); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/InputModeCallbackImpl.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class InputModeCallbackImpl { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected InputModeCallbackImpl(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(InputModeCallbackImpl obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(InputModeCallbackImpl obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_InputModeCallbackImpl(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | protected void swigDirectorDisconnect() { 52 | swigCMemOwn = false; 53 | delete(); 54 | } 55 | 56 | public void swigReleaseOwnership() { 57 | swigCMemOwn = false; 58 | IngameIMEJNI.InputModeCallbackImpl_change_ownership(this, swigCPtr, false); 59 | } 60 | 61 | public void swigTakeOwnership() { 62 | swigCMemOwn = true; 63 | IngameIMEJNI.InputModeCallbackImpl_change_ownership(this, swigCPtr, true); 64 | } 65 | 66 | protected void call(InputMode arg0) { 67 | IngameIMEJNI.InputModeCallbackImpl_call(swigCPtr, this, arg0.swigValue()); 68 | } 69 | 70 | public InputModeCallbackImpl() { 71 | this(IngameIMEJNI.new_InputModeCallbackImpl(), true); 72 | IngameIMEJNI.InputModeCallbackImpl_director_connect(this, swigCPtr, true, true); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/PreEditCallback.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class PreEditCallback { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected PreEditCallback(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(PreEditCallback obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(PreEditCallback obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_PreEditCallback(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | public void call(CompositionState arg0, PreEditContext arg1) { 52 | IngameIMEJNI.PreEditCallback_call(swigCPtr, this, arg0.swigValue(), PreEditContext.getCPtr(arg1), arg1); 53 | } 54 | 55 | public PreEditCallback(PreEditCallbackImpl in) { 56 | this(IngameIMEJNI.new_PreEditCallback(PreEditCallbackImpl.getCPtr(in), in), true); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/PreEditCallbackImpl.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class PreEditCallbackImpl { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected PreEditCallbackImpl(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(PreEditCallbackImpl obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(PreEditCallbackImpl obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_PreEditCallbackImpl(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | protected void swigDirectorDisconnect() { 52 | swigCMemOwn = false; 53 | delete(); 54 | } 55 | 56 | public void swigReleaseOwnership() { 57 | swigCMemOwn = false; 58 | IngameIMEJNI.PreEditCallbackImpl_change_ownership(this, swigCPtr, false); 59 | } 60 | 61 | public void swigTakeOwnership() { 62 | swigCMemOwn = true; 63 | IngameIMEJNI.PreEditCallbackImpl_change_ownership(this, swigCPtr, true); 64 | } 65 | 66 | protected void call(CompositionState arg0, PreEditContext arg1) { 67 | IngameIMEJNI.PreEditCallbackImpl_call(swigCPtr, this, arg0.swigValue(), PreEditContext.getCPtr(arg1), arg1); 68 | } 69 | 70 | public PreEditCallbackImpl() { 71 | this(IngameIMEJNI.new_PreEditCallbackImpl(), true); 72 | IngameIMEJNI.PreEditCallbackImpl_director_connect(this, swigCPtr, true, true); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/PreEditContext.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class PreEditContext { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected PreEditContext(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(PreEditContext obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(PreEditContext obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_PreEditContext(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | public int getSelStart() { 52 | return IngameIMEJNI.PreEditContext_selStart_get(swigCPtr, this); 53 | } 54 | 55 | public int getSelEnd() { 56 | return IngameIMEJNI.PreEditContext_selEnd_get(swigCPtr, this); 57 | } 58 | 59 | public String getContent() { 60 | return IngameIMEJNI.PreEditContext_content_get(swigCPtr, this); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/PreEditRect.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class PreEditRect { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected PreEditRect(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(PreEditRect obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(PreEditRect obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_PreEditRect(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | public void setX(int value) { 52 | IngameIMEJNI.PreEditRect_x_set(swigCPtr, this, value); 53 | } 54 | 55 | public int getX() { 56 | return IngameIMEJNI.PreEditRect_x_get(swigCPtr, this); 57 | } 58 | 59 | public void setY(int value) { 60 | IngameIMEJNI.PreEditRect_y_set(swigCPtr, this, value); 61 | } 62 | 63 | public int getY() { 64 | return IngameIMEJNI.PreEditRect_y_get(swigCPtr, this); 65 | } 66 | 67 | public void setWidth(int value) { 68 | IngameIMEJNI.PreEditRect_width_set(swigCPtr, this, value); 69 | } 70 | 71 | public int getWidth() { 72 | return IngameIMEJNI.PreEditRect_width_get(swigCPtr, this); 73 | } 74 | 75 | public void setHeight(int value) { 76 | IngameIMEJNI.PreEditRect_height_set(swigCPtr, this, value); 77 | } 78 | 79 | public int getHeight() { 80 | return IngameIMEJNI.PreEditRect_height_get(swigCPtr, this); 81 | } 82 | 83 | public PreEditRect() { 84 | this(IngameIMEJNI.new_PreEditRect(), true); 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/java/ingameime/string_list.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (https://www.swig.org). 3 | * Version 4.1.1 4 | * 5 | * Do not make changes to this file unless you know what you are doing - modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package ingameime; 10 | 11 | public class string_list extends java.util.AbstractSequentialList { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected string_list(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(string_list obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected static long swigRelease(string_list obj) { 25 | long ptr = 0; 26 | if (obj != null) { 27 | if (!obj.swigCMemOwn) 28 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 29 | ptr = obj.swigCPtr; 30 | obj.swigCMemOwn = false; 31 | obj.delete(); 32 | } 33 | return ptr; 34 | } 35 | 36 | @SuppressWarnings("deprecation") 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | IngameIMEJNI.delete_string_list(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | public string_list(java.util.Collection c) { 52 | this(); 53 | java.util.ListIterator it = listIterator(0); 54 | // Special case the "copy constructor" here to avoid lots of cross-language calls 55 | for (java.lang.Object o : c) { 56 | it.add((String)o); 57 | } 58 | } 59 | 60 | public int size() { 61 | return doSize(); 62 | } 63 | 64 | public boolean add(String value) { 65 | addLast(value); 66 | return true; 67 | } 68 | 69 | public java.util.ListIterator listIterator(int index) { 70 | return new java.util.ListIterator() { 71 | private Iterator pos; 72 | private Iterator last; 73 | 74 | private java.util.ListIterator init(int index) { 75 | if (index < 0 || index > string_list.this.size()) 76 | throw new IndexOutOfBoundsException("Index: " + index); 77 | pos = string_list.this.begin(); 78 | pos = pos.advance_unchecked(index); 79 | return this; 80 | } 81 | 82 | public void add(String v) { 83 | // Technically we can invalidate last here, but this makes more sense 84 | last = string_list.this.insert(pos, v); 85 | } 86 | 87 | public void set(String v) { 88 | if (null == last) { 89 | throw new IllegalStateException(); 90 | } 91 | last.set_unchecked(v); 92 | } 93 | 94 | public void remove() { 95 | if (null == last) { 96 | throw new IllegalStateException(); 97 | } 98 | string_list.this.remove(last); 99 | last = null; 100 | } 101 | 102 | public int previousIndex() { 103 | return string_list.this.doPreviousIndex(pos); 104 | } 105 | 106 | public int nextIndex() { 107 | return string_list.this.doNextIndex(pos); 108 | } 109 | 110 | public String previous() { 111 | if (previousIndex() < 0) { 112 | throw new java.util.NoSuchElementException(); 113 | } 114 | last = pos; 115 | pos = pos.previous_unchecked(); 116 | return last.deref_unchecked(); 117 | } 118 | 119 | public String next() { 120 | if (!hasNext()) { 121 | throw new java.util.NoSuchElementException(); 122 | } 123 | last = pos; 124 | pos = pos.next_unchecked(); 125 | return last.deref_unchecked(); 126 | } 127 | 128 | public boolean hasPrevious() { 129 | // This call to previousIndex() will be much slower than the hasNext() implementation, but it's simpler like this with C++ forward iterators 130 | return previousIndex() != -1; 131 | } 132 | 133 | public boolean hasNext() { 134 | return string_list.this.doHasNext(pos); 135 | } 136 | }.init(index); 137 | } 138 | 139 | static public class Iterator { 140 | private transient long swigCPtr; 141 | protected transient boolean swigCMemOwn; 142 | 143 | protected Iterator(long cPtr, boolean cMemoryOwn) { 144 | swigCMemOwn = cMemoryOwn; 145 | swigCPtr = cPtr; 146 | } 147 | 148 | protected static long getCPtr(Iterator obj) { 149 | return (obj == null) ? 0 : obj.swigCPtr; 150 | } 151 | 152 | protected static long swigRelease(Iterator obj) { 153 | long ptr = 0; 154 | if (obj != null) { 155 | if (!obj.swigCMemOwn) 156 | throw new RuntimeException("Cannot release ownership as memory is not owned"); 157 | ptr = obj.swigCPtr; 158 | obj.swigCMemOwn = false; 159 | obj.delete(); 160 | } 161 | return ptr; 162 | } 163 | 164 | @SuppressWarnings("deprecation") 165 | protected void finalize() { 166 | delete(); 167 | } 168 | 169 | public synchronized void delete() { 170 | if (swigCPtr != 0) { 171 | if (swigCMemOwn) { 172 | swigCMemOwn = false; 173 | IngameIMEJNI.delete_string_list_Iterator(swigCPtr); 174 | } 175 | swigCPtr = 0; 176 | } 177 | } 178 | 179 | public void set_unchecked(String v) { 180 | IngameIMEJNI.string_list_Iterator_set_unchecked(swigCPtr, this, v); 181 | } 182 | 183 | public string_list.Iterator next_unchecked() { 184 | return new string_list.Iterator(IngameIMEJNI.string_list_Iterator_next_unchecked(swigCPtr, this), true); 185 | } 186 | 187 | public string_list.Iterator previous_unchecked() { 188 | return new string_list.Iterator(IngameIMEJNI.string_list_Iterator_previous_unchecked(swigCPtr, this), true); 189 | } 190 | 191 | public String deref_unchecked() { 192 | return IngameIMEJNI.string_list_Iterator_deref_unchecked(swigCPtr, this); 193 | } 194 | 195 | public string_list.Iterator advance_unchecked(long index) { 196 | return new string_list.Iterator(IngameIMEJNI.string_list_Iterator_advance_unchecked(swigCPtr, this, index), true); 197 | } 198 | 199 | } 200 | 201 | public string_list() { 202 | this(IngameIMEJNI.new_string_list__SWIG_0(), true); 203 | } 204 | 205 | public string_list(string_list other) { 206 | this(IngameIMEJNI.new_string_list__SWIG_1(string_list.getCPtr(other), other), true); 207 | } 208 | 209 | public boolean isEmpty() { 210 | return IngameIMEJNI.string_list_isEmpty(swigCPtr, this); 211 | } 212 | 213 | public void clear() { 214 | IngameIMEJNI.string_list_clear(swigCPtr, this); 215 | } 216 | 217 | public string_list.Iterator remove(string_list.Iterator pos) { 218 | return new string_list.Iterator(IngameIMEJNI.string_list_remove(swigCPtr, this, string_list.Iterator.getCPtr(pos), pos), true); 219 | } 220 | 221 | public void removeLast() { 222 | IngameIMEJNI.string_list_removeLast(swigCPtr, this); 223 | } 224 | 225 | public void removeFirst() { 226 | IngameIMEJNI.string_list_removeFirst(swigCPtr, this); 227 | } 228 | 229 | public void addLast(String value) { 230 | IngameIMEJNI.string_list_addLast(swigCPtr, this, value); 231 | } 232 | 233 | public void addFirst(String value) { 234 | IngameIMEJNI.string_list_addFirst(swigCPtr, this, value); 235 | } 236 | 237 | private string_list.Iterator begin() { 238 | return new string_list.Iterator(IngameIMEJNI.string_list_begin(swigCPtr, this), true); 239 | } 240 | 241 | public string_list.Iterator end() { 242 | return new string_list.Iterator(IngameIMEJNI.string_list_end(swigCPtr, this), true); 243 | } 244 | 245 | private string_list.Iterator insert(string_list.Iterator pos, String value) { 246 | return new string_list.Iterator(IngameIMEJNI.string_list_insert(swigCPtr, this, string_list.Iterator.getCPtr(pos), pos, value), true); 247 | } 248 | 249 | public string_list(int count, String value) { 250 | this(IngameIMEJNI.new_string_list__SWIG_2(count, value), true); 251 | } 252 | 253 | private int doSize() { 254 | return IngameIMEJNI.string_list_doSize(swigCPtr, this); 255 | } 256 | 257 | private int doPreviousIndex(string_list.Iterator pos) { 258 | return IngameIMEJNI.string_list_doPreviousIndex(swigCPtr, this, string_list.Iterator.getCPtr(pos), pos); 259 | } 260 | 261 | private int doNextIndex(string_list.Iterator pos) { 262 | return IngameIMEJNI.string_list_doNextIndex(swigCPtr, this, string_list.Iterator.getCPtr(pos), pos); 263 | } 264 | 265 | private boolean doHasNext(string_list.Iterator pos) { 266 | return IngameIMEJNI.string_list_doHasNext(swigCPtr, this, string_list.Iterator.getCPtr(pos), pos); 267 | } 268 | 269 | } 270 | -------------------------------------------------------------------------------- /IngameIME-Native/src/main/resources/IngameIME_Java-arm64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Windmill-City/IngameIME-Minecraft/e4594b05c6ff7d4f85d95d0d158f40054acab2c7/IngameIME-Native/src/main/resources/IngameIME_Java-arm64.dll -------------------------------------------------------------------------------- /IngameIME-Native/src/main/resources/IngameIME_Java-x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Windmill-City/IngameIME-Minecraft/e4594b05c6ff7d4f85d95d0d158f40054acab2c7/IngameIME-Native/src/main/resources/IngameIME_Java-x64.dll -------------------------------------------------------------------------------- /IngameIME-Native/src/main/resources/IngameIME_Java-x86.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Windmill-City/IngameIME-Minecraft/e4594b05c6ff7d4f85d95d0d158f40054acab2c7/IngameIME-Native/src/main/resources/IngameIME_Java-x86.dll -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 489 | USA 490 | 491 | Also add information on how to contact you by electronic and paper mail. 492 | 493 | You should also get your employer (if you work as a programmer) or your 494 | school, if any, to sign a "copyright disclaimer" for the library, if 495 | necessary. Here is a sample; alter the names: 496 | 497 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 498 | library `Frob' (a library for tweaking knobs) written by James Random 499 | Hacker. 500 | 501 | , 1 April 1990 502 | Ty Coon, President of Vice 503 | 504 | That's all there is to it! 505 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IngameIME-Minecraft 2 | 3 | ![Icon](IngameIME-Icon.png) 4 | 5 | Use `InputMethod` in **Full screen** Minecraft! 6 | 7 | ![CurseForge Bandage Downloads](http://cf.way2muchnoise.eu/full_440032_downloads.svg) 8 | ![CurseForge Bandage Versions](http://cf.way2muchnoise.eu/versions/440032.svg) 9 | 10 | ## Preview 11 | 12 | ### Window Mode 13 | 14 | ![Window Mode](docs/WindowInput.gif) 15 | 16 | ### Full screen Mode 17 | 18 | ![Full screen Mode](docs/FullScreenInput.gif) 19 | 20 | ## Supported Platforms 21 | 22 | | Platform | Supported | 23 | |----------|-----------| 24 | | Windows | √ | 25 | | Linux | × | 26 | | MacOS | × | 27 | -------------------------------------------------------------------------------- /docs/FullScreenInput.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Windmill-City/IngameIME-Minecraft/e4594b05c6ff7d4f85d95d0d158f40054acab2c7/docs/FullScreenInput.gif -------------------------------------------------------------------------------- /docs/WindowInput.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Windmill-City/IngameIME-Minecraft/e4594b05c6ff7d4f85d95d0d158f40054acab2c7/docs/WindowInput.gif -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Windmill-City/IngameIME-Minecraft/e4594b05c6ff7d4f85d95d0d158f40054acab2c7/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | mavenCentral() 5 | mavenLocal() 6 | maven { 7 | // RetroFuturaGradle 8 | name = "GTNH Maven" 9 | url = uri("http://jenkins.usrv.eu:8081/nexus/content/groups/public/") 10 | isAllowInsecureProtocol = true 11 | mavenContent { 12 | includeGroup("com.gtnewhorizons.retrofuturagradle") 13 | } 14 | } 15 | } 16 | } 17 | 18 | rootProject.name = "IngameIME-Minecraft" 19 | include(":IngameIME-Native", ":1.7.10") 20 | --------------------------------------------------------------------------------