mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-14 07:02:30 +02:00
Send update dispatcher though FFI
This commit is contained in:
@ -23,12 +23,16 @@ struct wbcffi_config_entry {
|
||||
/// MANDATORY CFFI function
|
||||
///
|
||||
/// @param root_widget Root GTK widget instantiated by Waybar
|
||||
/// @param trigger_update Call this function with trigger_update_arg as argument to trigger
|
||||
/// wbcffi_update() on the next GTK main event loop iteration
|
||||
/// @param trigger_update_arg Argument for trigger_update call
|
||||
/// @param config_entries Flat representation of the module JSON config. The data only available
|
||||
/// during wbcffi_init call.
|
||||
/// @param config_entries_len Number of entries in `config_entries`
|
||||
///
|
||||
/// @return A untyped pointer to module data, NULL if the module failed to load.
|
||||
void* wbcffi_init(GtkContainer* root_widget, const struct wbcffi_config_entry* config_entries,
|
||||
void* wbcffi_init(GtkContainer* root_widget, const void (*trigger_update)(void*),
|
||||
void* trigger_update_arg, const struct wbcffi_config_entry* config_entries,
|
||||
size_t config_entries_len);
|
||||
|
||||
/// Module deinit/delete function, called when Waybar is closed or when the module is removed
|
||||
@ -38,8 +42,15 @@ void* wbcffi_init(GtkContainer* root_widget, const struct wbcffi_config_entry* c
|
||||
/// @param instance Module instance data (as returned by `wbcffi_init`)
|
||||
void wbcffi_deinit(void* instance);
|
||||
|
||||
/// When Waybar receives a POSIX signal, it forwards the signal to each module, calling this
|
||||
/// function
|
||||
/// Called from the GTK main event loop, to update the UI
|
||||
///
|
||||
/// Optional CFFI function
|
||||
///
|
||||
/// @param instance Module instance data (as returned by `wbcffi_init`)
|
||||
/// @param action_name Action name
|
||||
void wbcffi_update(void* instance);
|
||||
|
||||
/// Called when Waybar receives a POSIX signal and forwards it to each module
|
||||
///
|
||||
/// Optional CFFI function
|
||||
///
|
||||
@ -47,12 +58,14 @@ void wbcffi_deinit(void* instance);
|
||||
/// @param signal Signal ID
|
||||
void wbcffi_refresh(void* instance, int signal);
|
||||
|
||||
/// Called on module action (see
|
||||
/// https://github.com/Alexays/Waybar/wiki/Configuration#module-actions-config)
|
||||
///
|
||||
/// Optional CFFI function
|
||||
///
|
||||
/// @param instance Module instance data (as returned by `wbcffi_init`)
|
||||
/// @param name Action name
|
||||
void wbcffi_doaction(void* instance, const char* name);
|
||||
/// @param action_name Action name
|
||||
void wbcffi_doaction(void* instance, const char* action_name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user