From 9e792dcef900de7039cd277459c0629abfab9f21 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 4 May 2010 06:35:37 +0200 Subject: NEWT Fixes: - Common native in NewtCommon.c/.h - Add simple NEWTEventFiFo, providing a pattern to spool events by an EventListener and to process them where it impacts (GLEventListener ..) - Window [X11|Windows]: setSize/setPosition: - always store the values, - only act if valid and !fullscreen - Window [X11]: - Add requestFocus - Add setTitle - Fix parent/child window creation - Fix parent/child window fullscreen (reparenting) - JUnit Test: ParentTest: - Shows parent and client window animation - Client window shall be able to go into fullscreen, ie disconnect/reconnect from its parent. Test: Focus-client + type-'f' - Both windows receive/dispatch events properly --- src/newt/native/NewtCommon.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/newt/native/NewtCommon.c (limited to 'src/newt/native/NewtCommon.c') diff --git a/src/newt/native/NewtCommon.c b/src/newt/native/NewtCommon.c new file mode 100644 index 000000000..8b64ec37f --- /dev/null +++ b/src/newt/native/NewtCommon.c @@ -0,0 +1,13 @@ + +#include "NewtCommon.h" + +jchar* NewtCommon_GetNullTerminatedStringChars(JNIEnv* env, jstring str) +{ + jchar* strChars = NULL; + strChars = calloc((*env)->GetStringLength(env, str) + 1, sizeof(jchar)); + if (strChars != NULL) { + (*env)->GetStringRegion(env, str, 0, (*env)->GetStringLength(env, str), strChars); + } + return strChars; +} + -- cgit v1.2.3