main-executable: handle drawable-based app icons by rendering them into SVG

This commit is contained in:
Mis012
2025-06-21 01:22:29 +02:00
parent 1c83948b15
commit 2a0c6cd455
6 changed files with 63 additions and 13 deletions

View File

@@ -35,6 +35,7 @@
#define _GET_FLOAT_FIELD(object, field) ((*env)->GetFloatField(env, object, _FIELD_ID(_CLASS(object), field, "F")))
#define _SET_FLOAT_FIELD(object, field, value) ((*env)->SetFloatField(env, object, _FIELD_ID(_CLASS(object), field, "F"), value))
#define _SET_STATIC_INT_FIELD(class, field, value) ((*env)->SetStaticIntField(env, class, _STATIC_FIELD_ID(class, field, "I"), value))
#define _SET_STATIC_BOOL_FIELD(class, field, value) ((*env)->SetStaticBooleanField(env, class, _STATIC_FIELD_ID(class, field, "Z"), value))
#define _SET_STATIC_OBJ_FIELD(class, field, type, value) ((*env)->SetStaticObjectField(env, class, _STATIC_FIELD_ID(class, field, type), value))
#define _GET_STATIC_OBJ_FIELD(class, field, type) ((*env)->GetStaticObjectField(env, class, _STATIC_FIELD_ID(class, field, type)))
#define _GET_BYTE_ARRAY_ELEMENTS(b_array) ((*env)->GetByteArrayElements(env, b_array, NULL))

View File

@@ -162,6 +162,7 @@ void set_up_handle_cache(JNIEnv *env)
handle_cache.application.class = _REF((*env)->FindClass(env, "android/app/Application"));
handle_cache.application.get_app_icon_path = _METHOD(handle_cache.application.class, "get_app_icon_path", "()Ljava/lang/String;");
handle_cache.application.get_app_icon_paintable = _METHOD(handle_cache.application.class, "get_app_icon_paintable", "()J");
handle_cache.looper.class = _REF((*env)->FindClass(env, "android/os/Looper"));
handle_cache.looper.loop = _STATIC_METHOD(handle_cache.looper.class, "loop", "()V");

View File

@@ -107,6 +107,7 @@ struct handle_cache {
struct {
jclass class;
jmethodID get_app_icon_path;
jmethodID get_app_icon_paintable;
} application;
struct {
jclass class;