diff --git a/packages/celest_core/ffigen.glib.yaml b/packages/celest_core/ffigen.glib.yaml index 308d2f37..47e17e05 100644 --- a/packages/celest_core/ffigen.glib.yaml +++ b/packages/celest_core/ffigen.glib.yaml @@ -29,6 +29,8 @@ functions: - g_hash_table_new - g_hash_table_insert - g_hash_table_destroy + - g_application_get_default + - g_application_get_application_id structs: include: - _GError diff --git a/packages/celest_core/lib/src/native/linux/glib.ffi.dart b/packages/celest_core/lib/src/native/linux/glib.ffi.dart index f7a39af7..0033492c 100644 --- a/packages/celest_core/lib/src/native/linux/glib.ffi.dart +++ b/packages/celest_core/lib/src/native/linux/glib.ffi.dart @@ -93,6 +93,32 @@ class Glib { gpointer)>>('g_hash_table_insert'); late final _g_hash_table_insert = _g_hash_table_insertPtr .asFunction, gpointer, gpointer)>(); + + ffi.Pointer g_application_get_application_id( + ffi.Pointer<_GApplication> application, + ) { + return _g_application_get_application_id( + application, + ); + } + + late final _g_application_get_application_idPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_GApplication>)>>('g_application_get_application_id'); + late final _g_application_get_application_id = + _g_application_get_application_idPtr.asFunction< + ffi.Pointer Function(ffi.Pointer<_GApplication>)>(); + + ffi.Pointer<_GApplication> g_application_get_default() { + return _g_application_get_default(); + } + + late final _g_application_get_defaultPtr = + _lookup Function()>>( + 'g_application_get_default'); + late final _g_application_get_default = _g_application_get_defaultPtr + .asFunction Function()>(); } final class GError extends ffi.Struct { @@ -167,3 +193,12 @@ final class GCancellable extends ffi.Struct { } final class _GCancellablePrivate extends ffi.Opaque {} + +final class _GApplication extends ffi.Struct { + /// < private > + external GObject parent_instance; + + external ffi.Pointer<_GApplicationPrivate> priv; +} + +final class _GApplicationPrivate extends ffi.Opaque {}