-
-
Notifications
You must be signed in to change notification settings - Fork 646
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(glfw) add experimental support for IME
Close #946
- Loading branch information
Showing
12 changed files
with
1,014 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
301 changes: 293 additions & 8 deletions
301
modules/lwjgl/glfw/src/generated/java/org/lwjgl/glfw/GLFW.java
Large diffs are not rendered by default.
Oops, something went wrong.
85 changes: 85 additions & 0 deletions
85
modules/lwjgl/glfw/src/generated/java/org/lwjgl/glfw/GLFWIMEStatusCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* Copyright LWJGL. All rights reserved. | ||
* License terms: https://www.lwjgl.org/license | ||
* MACHINE GENERATED FILE, DO NOT EDIT | ||
*/ | ||
package org.lwjgl.glfw; | ||
|
||
import javax.annotation.*; | ||
|
||
import org.lwjgl.system.*; | ||
|
||
import static org.lwjgl.system.MemoryUtil.*; | ||
|
||
import static org.lwjgl.glfw.GLFW.*; | ||
|
||
/** | ||
* Instances of this class may be passed to the {@link GLFW#glfwSetIMEStatusCallback SetIMEStatusCallback} method. | ||
* | ||
* <h3>Type</h3> | ||
* | ||
* <pre><code> | ||
* void (*{@link #invoke}) ( | ||
* GLFWwindow *window | ||
* )</code></pre> | ||
* | ||
* @since version 3.X | ||
*/ | ||
public abstract class GLFWIMEStatusCallback extends Callback implements GLFWIMEStatusCallbackI { | ||
|
||
/** | ||
* Creates a {@code GLFWIMEStatusCallback} instance from the specified function pointer. | ||
* | ||
* @return the new {@code GLFWIMEStatusCallback} | ||
*/ | ||
public static GLFWIMEStatusCallback create(long functionPointer) { | ||
GLFWIMEStatusCallbackI instance = Callback.get(functionPointer); | ||
return instance instanceof GLFWIMEStatusCallback | ||
? (GLFWIMEStatusCallback)instance | ||
: new Container(functionPointer, instance); | ||
} | ||
|
||
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ | ||
@Nullable | ||
public static GLFWIMEStatusCallback createSafe(long functionPointer) { | ||
return functionPointer == NULL ? null : create(functionPointer); | ||
} | ||
|
||
/** Creates a {@code GLFWIMEStatusCallback} instance that delegates to the specified {@code GLFWIMEStatusCallbackI} instance. */ | ||
public static GLFWIMEStatusCallback create(GLFWIMEStatusCallbackI instance) { | ||
return instance instanceof GLFWIMEStatusCallback | ||
? (GLFWIMEStatusCallback)instance | ||
: new Container(instance.address(), instance); | ||
} | ||
|
||
protected GLFWIMEStatusCallback() { | ||
super(CIF); | ||
} | ||
|
||
GLFWIMEStatusCallback(long functionPointer) { | ||
super(functionPointer); | ||
} | ||
|
||
/** See {@link GLFW#glfwSetIMEStatusCallback SetIMEStatusCallback}. */ | ||
public GLFWIMEStatusCallback set(long window) { | ||
glfwSetIMEStatusCallback(window, this); | ||
return this; | ||
} | ||
|
||
private static final class Container extends GLFWIMEStatusCallback { | ||
|
||
private final GLFWIMEStatusCallbackI delegate; | ||
|
||
Container(long functionPointer, GLFWIMEStatusCallbackI delegate) { | ||
super(functionPointer); | ||
this.delegate = delegate; | ||
} | ||
|
||
@Override | ||
public void invoke(long window) { | ||
delegate.invoke(window); | ||
} | ||
|
||
} | ||
|
||
} |
54 changes: 54 additions & 0 deletions
54
modules/lwjgl/glfw/src/generated/java/org/lwjgl/glfw/GLFWIMEStatusCallbackI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright LWJGL. All rights reserved. | ||
* License terms: https://www.lwjgl.org/license | ||
* MACHINE GENERATED FILE, DO NOT EDIT | ||
*/ | ||
package org.lwjgl.glfw; | ||
|
||
import org.lwjgl.system.*; | ||
import org.lwjgl.system.libffi.*; | ||
|
||
import static org.lwjgl.system.APIUtil.*; | ||
import static org.lwjgl.system.MemoryUtil.*; | ||
import static org.lwjgl.system.libffi.LibFFI.*; | ||
|
||
/** | ||
* Instances of this interface may be passed to the {@link GLFW#glfwSetIMEStatusCallback SetIMEStatusCallback} method. | ||
* | ||
* <h3>Type</h3> | ||
* | ||
* <pre><code> | ||
* void (*{@link #invoke}) ( | ||
* GLFWwindow *window | ||
* )</code></pre> | ||
* | ||
* @since version 3.X | ||
*/ | ||
@FunctionalInterface | ||
@NativeType("GLFWimestatusfun") | ||
public interface GLFWIMEStatusCallbackI extends CallbackI { | ||
|
||
FFICIF CIF = apiCreateCIF( | ||
FFI_DEFAULT_ABI, | ||
ffi_type_void, | ||
ffi_type_pointer | ||
); | ||
|
||
@Override | ||
default FFICIF getCallInterface() { return CIF; } | ||
|
||
@Override | ||
default void callback(long ret, long args) { | ||
invoke( | ||
memGetAddress(memGetAddress(args)) | ||
); | ||
} | ||
|
||
/** | ||
* The function pointer type for IME status change callbacks. | ||
* | ||
* @param window the window that received the event | ||
*/ | ||
void invoke(@NativeType("GLFWwindow *") long window); | ||
|
||
} |
91 changes: 91 additions & 0 deletions
91
modules/lwjgl/glfw/src/generated/java/org/lwjgl/glfw/GLFWPreeditCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* | ||
* Copyright LWJGL. All rights reserved. | ||
* License terms: https://www.lwjgl.org/license | ||
* MACHINE GENERATED FILE, DO NOT EDIT | ||
*/ | ||
package org.lwjgl.glfw; | ||
|
||
import javax.annotation.*; | ||
|
||
import org.lwjgl.system.*; | ||
|
||
import static org.lwjgl.system.MemoryUtil.*; | ||
|
||
import static org.lwjgl.glfw.GLFW.*; | ||
|
||
/** | ||
* Instances of this class may be passed to the {@link GLFW#glfwSetPreeditCallback SetPreeditCallback} method. | ||
* | ||
* <h3>Type</h3> | ||
* | ||
* <pre><code> | ||
* void (*{@link #invoke}) ( | ||
* GLFWwindow *window, | ||
* int preedit_count, | ||
* unsigned int *preedit_string, | ||
* int block_count, | ||
* int *block_sizes, | ||
* int focused_block, | ||
* int caret | ||
* )</code></pre> | ||
* | ||
* @since version 3.X | ||
*/ | ||
public abstract class GLFWPreeditCallback extends Callback implements GLFWPreeditCallbackI { | ||
|
||
/** | ||
* Creates a {@code GLFWPreeditCallback} instance from the specified function pointer. | ||
* | ||
* @return the new {@code GLFWPreeditCallback} | ||
*/ | ||
public static GLFWPreeditCallback create(long functionPointer) { | ||
GLFWPreeditCallbackI instance = Callback.get(functionPointer); | ||
return instance instanceof GLFWPreeditCallback | ||
? (GLFWPreeditCallback)instance | ||
: new Container(functionPointer, instance); | ||
} | ||
|
||
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ | ||
@Nullable | ||
public static GLFWPreeditCallback createSafe(long functionPointer) { | ||
return functionPointer == NULL ? null : create(functionPointer); | ||
} | ||
|
||
/** Creates a {@code GLFWPreeditCallback} instance that delegates to the specified {@code GLFWPreeditCallbackI} instance. */ | ||
public static GLFWPreeditCallback create(GLFWPreeditCallbackI instance) { | ||
return instance instanceof GLFWPreeditCallback | ||
? (GLFWPreeditCallback)instance | ||
: new Container(instance.address(), instance); | ||
} | ||
|
||
protected GLFWPreeditCallback() { | ||
super(CIF); | ||
} | ||
|
||
GLFWPreeditCallback(long functionPointer) { | ||
super(functionPointer); | ||
} | ||
|
||
/** See {@link GLFW#glfwSetPreeditCallback SetPreeditCallback}. */ | ||
public GLFWPreeditCallback set(long window) { | ||
glfwSetPreeditCallback(window, this); | ||
return this; | ||
} | ||
|
||
private static final class Container extends GLFWPreeditCallback { | ||
|
||
private final GLFWPreeditCallbackI delegate; | ||
|
||
Container(long functionPointer, GLFWPreeditCallbackI delegate) { | ||
super(functionPointer); | ||
this.delegate = delegate; | ||
} | ||
|
||
@Override | ||
public void invoke(long window, int preedit_count, long preedit_string, int block_count, long block_sizes, int focused_block, int caret) { | ||
delegate.invoke(window, preedit_count, preedit_string, block_count, block_sizes, focused_block, caret); | ||
} | ||
|
||
} | ||
|
||
} |
72 changes: 72 additions & 0 deletions
72
modules/lwjgl/glfw/src/generated/java/org/lwjgl/glfw/GLFWPreeditCallbackI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright LWJGL. All rights reserved. | ||
* License terms: https://www.lwjgl.org/license | ||
* MACHINE GENERATED FILE, DO NOT EDIT | ||
*/ | ||
package org.lwjgl.glfw; | ||
|
||
import org.lwjgl.system.*; | ||
import org.lwjgl.system.libffi.*; | ||
|
||
import static org.lwjgl.system.APIUtil.*; | ||
import static org.lwjgl.system.MemoryUtil.*; | ||
import static org.lwjgl.system.libffi.LibFFI.*; | ||
|
||
/** | ||
* Instances of this interface may be passed to the {@link GLFW#glfwSetPreeditCallback SetPreeditCallback} method. | ||
* | ||
* <h3>Type</h3> | ||
* | ||
* <pre><code> | ||
* void (*{@link #invoke}) ( | ||
* GLFWwindow *window, | ||
* int preedit_count, | ||
* unsigned int *preedit_string, | ||
* int block_count, | ||
* int *block_sizes, | ||
* int focused_block, | ||
* int caret | ||
* )</code></pre> | ||
* | ||
* @since version 3.X | ||
*/ | ||
@FunctionalInterface | ||
@NativeType("GLFWpreeditfun") | ||
public interface GLFWPreeditCallbackI extends CallbackI { | ||
|
||
FFICIF CIF = apiCreateCIF( | ||
FFI_DEFAULT_ABI, | ||
ffi_type_void, | ||
ffi_type_pointer, ffi_type_sint32, ffi_type_pointer, ffi_type_sint32, ffi_type_pointer, ffi_type_sint32, ffi_type_sint32 | ||
); | ||
|
||
@Override | ||
default FFICIF getCallInterface() { return CIF; } | ||
|
||
@Override | ||
default void callback(long ret, long args) { | ||
invoke( | ||
memGetAddress(memGetAddress(args)), | ||
memGetInt(memGetAddress(args + POINTER_SIZE)), | ||
memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)), | ||
memGetInt(memGetAddress(args + 3 * POINTER_SIZE)), | ||
memGetAddress(memGetAddress(args + 4 * POINTER_SIZE)), | ||
memGetInt(memGetAddress(args + 5 * POINTER_SIZE)), | ||
memGetInt(memGetAddress(args + 6 * POINTER_SIZE)) | ||
); | ||
} | ||
|
||
/** | ||
* The function pointer type for preedit callbacks. | ||
* | ||
* @param window the window that received the event | ||
* @param preedit_count preedit string count | ||
* @param preedit_string preedit string | ||
* @param block_count attributed block count | ||
* @param block_sizes list of attributed block size | ||
* @param focused_block Focused block index | ||
* @param caret Caret position | ||
*/ | ||
void invoke(@NativeType("GLFWwindow *") long window, int preedit_count, @NativeType("unsigned int *") long preedit_string, int block_count, @NativeType("int *") long block_sizes, int focused_block, int caret); | ||
|
||
} |
Oops, something went wrong.