api-impl: stubs and fixes for Shosetsu

This commit is contained in:
Julian Winkler
2025-10-04 13:57:53 +02:00
committed by Mis012
parent 8dcaf3e1ef
commit e58d8d2065
18 changed files with 77 additions and 22 deletions

View File

@@ -313,3 +313,10 @@ JNIEXPORT jboolean JNICALL Java_android_app_Activity_isInMultiWindowMode(JNIEnv
{
return !gtk_window_is_maximized(window);
}
JNIEXPORT jboolean JNICALL Java_android_app_Activity_isTaskRoot(JNIEnv *env, jobject this)
{
jobject root_activity = activity_backlog ? g_list_last(activity_backlog)->data : NULL;
// NULL means that we are currently creating the root activity, so no other activity can exist yet
return root_activity == NULL || (*env)->IsSameObject(env, this, root_activity);
}

View File

@@ -13,6 +13,14 @@ extern "C" {
#define android_app_Activity_RESULT_CANCELED 0L
#undef android_app_Activity_RESULT_OK
#define android_app_Activity_RESULT_OK -1L
/*
* Class: android_app_Activity
* Method: isTaskRoot
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_android_app_Activity_isTaskRoot
(JNIEnv *, jobject);
/*
* Class: android_app_Activity
* Method: nativeFinish

View File

@@ -9,14 +9,6 @@ extern "C" {
#endif
#undef android_graphics_Region_MAX_POOL_SIZE
#define android_graphics_Region_MAX_POOL_SIZE 10L
/*
* Class: android_graphics_Region
* Method: isEmpty
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_isEmpty
(JNIEnv *, jobject);
/*
* Class: android_graphics_Region
* Method: isRect

View File

@@ -250,6 +250,7 @@ void wrapper_widget_set_child(WrapperWidget *parent, GtkWidget *child) // TODO:
static guint queue_queue_redraw(GtkWidget *widget)
{
gtk_widget_queue_draw(widget);
g_object_unref(widget);
return G_SOURCE_REMOVE;
}
@@ -258,7 +259,7 @@ void wrapper_widget_queue_draw(WrapperWidget *wrapper)
if (wrapper->draw_method) {
/* schedule the call to gtk_widget_queue_draw for a future event loop pass in case we're currently inside the snapshot */
/* GTK+ uses G_PRIORITY_HIGH_IDLE + 10 for resizing operations, and G_PRIORITY_HIGH_IDLE + 20 for redrawing operations. */
g_idle_add_full(G_PRIORITY_HIGH_IDLE + 20, G_SOURCE_FUNC(queue_queue_redraw), &wrapper->parent_instance, NULL);
g_idle_add_full(G_PRIORITY_HIGH_IDLE + 20, G_SOURCE_FUNC(queue_queue_redraw), g_object_ref(wrapper), NULL);
}
if(wrapper->child)

View File

@@ -74,5 +74,5 @@ JNIEXPORT void JNICALL Java_android_webkit_WebView_native_1loadDataWithBaseURL(J
jsize data_jlen = (*env)->GetStringLength(env, data_jstr);
char *data = malloc(data_len + 1); // + 1 for NUL
(*env)->GetStringUTFRegion(env, data_jstr, 0, data_jlen, data);
webkit_web_view_load_bytes(webview, g_bytes_new(data, data_len), mime_type ? _CSTRING(mime_type) : "text/html", _CSTRING(encoding), _CSTRING(base_url));
webkit_web_view_load_bytes(webview, g_bytes_new(data, data_len), mime_type ? _CSTRING(mime_type) : "text/html", encoding ? _CSTRING(encoding) : NULL, base_url ? _CSTRING(base_url) : NULL);
}