implement Window.setLayout()

This commit is contained in:
Julian Winkler
2024-12-10 23:47:52 +01:00
parent 1fd2638c57
commit 5150564a5b
3 changed files with 22 additions and 2 deletions

View File

@@ -46,3 +46,10 @@ JNIEXPORT void JNICALL Java_android_view_Window_take_1input_1queue(JNIEnv *env,
g_object_set_data(G_OBJECT(window), "input_queue_callback", (gpointer)_REF(callback));
g_object_set_data(G_OBJECT(window), "input_queue", (gpointer)_REF(queue));
}
JNIEXPORT void JNICALL Java_android_view_Window_set_1layout(JNIEnv *env, jobject this, jlong window, jint width, jint height)
{
GtkWindow *gtk_window = GTK_WINDOW(_PTR(window));
if (width > 0 && height > 0)
gtk_window_set_default_size(gtk_window, width, height);
}

View File

@@ -35,6 +35,14 @@ JNIEXPORT void JNICALL Java_android_view_Window_set_1title
JNIEXPORT void JNICALL Java_android_view_Window_take_1input_1queue
(JNIEnv *, jobject, jlong, jobject, jobject);
/*
* Class: android_view_Window
* Method: set_layout
* Signature: (JII)V
*/
JNIEXPORT void JNICALL Java_android_view_Window_set_1layout
(JNIEnv *, jobject, jlong, jint, jint);
#ifdef __cplusplus
}
#endif