macOS native:

- removed `FlatNativeMacLibrary.getWindowPtr()` because it is too dangerous to use `windowPtr` (which is `NSWindow*`) in Java (using invalid window pointer would crash app)
- made `getNSWindow()` 20x faster
- catch exceptions in `getNSWindow()`
- digitally signed dylibs
This commit is contained in:
Karl Tauber
2023-12-14 14:39:26 +01:00
parent 9bf4da7acf
commit 46de81c1c9
9 changed files with 108 additions and 74 deletions

View File

@@ -23,9 +23,9 @@
*/
// from JNFJNI.h
// from jlong_md.h
#ifndef jlong_to_ptr
#define jlong_to_ptr(a) ((void *)(uintptr_t)(a))
#define jlong_to_ptr(a) ((void*)(a))
#endif
@@ -39,3 +39,6 @@
[ex name], [ex reason], [ex userInfo], [ex callStackSymbols] ); \
} \
}
jfieldID getFieldID( JNIEnv *env, const char* className, const char* fieldName, const char* fieldSignature );

View File

@@ -7,21 +7,13 @@
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_formdev_flatlaf_ui_FlatNativeMacLibrary
* Method: getWindowPtr
* Signature: (Ljava/awt/Window;)J
*/
JNIEXPORT jlong JNICALL Java_com_formdev_flatlaf_ui_FlatNativeMacLibrary_getWindowPtr
(JNIEnv *, jclass, jobject);
/*
* Class: com_formdev_flatlaf_ui_FlatNativeMacLibrary
* Method: setWindowRoundedBorder
* Signature: (JFFI)V
* Signature: (Ljava/awt/Window;FFI)Z
*/
JNIEXPORT void JNICALL Java_com_formdev_flatlaf_ui_FlatNativeMacLibrary_setWindowRoundedBorder
(JNIEnv *, jclass, jlong, jfloat, jfloat, jint);
JNIEXPORT jboolean JNICALL Java_com_formdev_flatlaf_ui_FlatNativeMacLibrary_setWindowRoundedBorder
(JNIEnv *, jclass, jobject, jfloat, jfloat, jint);
#ifdef __cplusplus
}