Top | ![]() |
![]() |
![]() |
![]() |
gs-plugin-helpersgs-plugin-helpers — Helpers for storing call closures for GsPlugin vfuncs |
The helpers in this file each create a context structure to store the arguments passed to a standard GsPlugin vfunc.
These are intended to be used by plugin implementations to easily create GTasks for handling GsPlugin vfunc calls, without all having to write the same code to create a structure to wrap the vfunc arguments.
GsPluginRefineData * gs_plugin_refine_data_new (GsAppList *list
,GsPluginRefineFlags flags
);
Context data for a call to GsPluginClass.refine_async.
Since: 42
GTask * gs_plugin_refine_data_new_task (gpointer source_object
,GsAppList *list
,GsPluginRefineFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Create a GTask for a refine operation with the given arguments. The task data will be set to a GsPluginRefineData containing the given context.
This is essentially a combination of gs_plugin_refine_data_new()
,
g_task_new()
and g_task_set_task_data()
.
Since: 42
void
gs_plugin_refine_data_free (GsPluginRefineData *data
);
Free the given data
.
Since: 42
GsPluginRefreshMetadataData * gs_plugin_refresh_metadata_data_new (guint64 cache_age_secs
,GsPluginRefreshMetadataFlags flags
);
Context data for a call to GsPluginClass.refresh_metadata_async.
cache_age_secs |
maximum allowed age of the cache in order for it to remain valid, in seconds |
|
flags |
refresh metadata flags |
Since: 42
void
gs_plugin_refresh_metadata_data_free (GsPluginRefreshMetadataData *data
);
Free the given data
.
Since: 42
GsPluginListAppsData * gs_plugin_list_apps_data_new (GsAppQuery *query
,GsPluginListAppsFlags flags
);
Context data for a call to GsPluginClass.list_apps_async.
query |
a query to filter apps, or |
[nullable][transfer none] |
flags |
list apps flags |
Since: 43
GTask * gs_plugin_list_apps_data_new_task (gpointer source_object
,GsAppQuery *query
,GsPluginListAppsFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Create a GTask for a list apps operation with the given arguments. The task data will be set to a GsPluginListAppsData containing the given context.
This is essentially a combination of gs_plugin_list_apps_data_new()
,
g_task_new()
and g_task_set_task_data()
.
source_object |
task source object |
|
query |
a query to filter apps, or |
[nullable][transfer none] |
flags |
list apps flags |
|
cancellable |
a GCancellable, or |
[nullable] |
callback |
function to call once asynchronous operation is finished |
|
user_data |
data to pass to |
Since: 43
void
gs_plugin_list_apps_data_free (GsPluginListAppsData *data
);
Free the given data
.
Since: 43
GsPluginManageRepositoryData * gs_plugin_manage_repository_data_new (GsApp *repository
,GsPluginManageRepositoryFlags flags
);
Common context data for a call to GsPluginClass.install_repository_async, GsPluginClass.remove_repository_async, GsPluginClass.enable_repository_async and GsPluginClass.disable_repository_async.
repository |
a repository to manage. |
[not-nullable][transfer none] |
flags |
manage repository flags |
Since: 43
GTask * gs_plugin_manage_repository_data_new_task (gpointer source_object
,GsApp *repository
,GsPluginManageRepositoryFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Create a GTask for a manage repository operation with the given arguments. The task data will be set to a GsPluginManageRepositoryData containing the given context.
This is essentially a combination of gs_plugin_manage_repository_data_new()
,
g_task_new()
and g_task_set_task_data()
.
source_object |
task source object |
|
repository |
a repository to manage. |
[not-nullable][transfer none] |
flags |
manage repository flags |
|
cancellable |
a GCancellable, or |
[nullable] |
callback |
function to call once asynchronous operation is finished |
|
user_data |
data to pass to |
Since: 43
void
gs_plugin_manage_repository_data_free (GsPluginManageRepositoryData *data
);
Free the given data
.
Since: 43
GsPluginRefineCategoriesData * gs_plugin_refine_categories_data_new (GPtrArray *list
,GsPluginRefineCategoriesFlags flags
);
Context data for a call to GsPluginClass.refine_categories_async.
Since: 43
GTask * gs_plugin_refine_categories_data_new_task (gpointer source_object
,GPtrArray *list
,GsPluginRefineCategoriesFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Create a GTask for a refine categories operation with the given arguments. The task data will be set to a GsPluginRefineCategoriesData containing the given context.
This is essentially a combination of gs_plugin_refine_categories_data_new()
,
g_task_new()
and g_task_set_task_data()
.
source_object |
task source object |
|
list |
list of GsCategory objects to refine. |
[element-type GsCategory] |
flags |
refine flags |
|
cancellable |
a GCancellable, or |
[nullable] |
callback |
function to call once asynchronous operation is finished |
|
user_data |
data to pass to |
Since: 43
void
gs_plugin_refine_categories_data_free (GsPluginRefineCategoriesData *data
);
Free the given data
.
Since: 43
GsPluginUpdateAppsData * gs_plugin_update_apps_data_new (GsAppList *apps
,GsPluginUpdateAppsFlags flags
,GsPluginProgressCallback progress_callback
,gpointer progress_user_data
,GsPluginAppNeedsUserActionCallback app_needs_user_action_callback
,gpointer app_needs_user_action_data
);
Context data for a call to GsPluginClass.update_apps_async.
Since: 44
GTask * gs_plugin_update_apps_data_new_task (gpointer source_object
,GsAppList *apps
,GsPluginUpdateAppsFlags flags
,GsPluginProgressCallback progress_callback
,gpointer progress_user_data
,GsPluginAppNeedsUserActionCallback app_needs_user_action_callback
,gpointer app_needs_user_action_data
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Create a GTask for an update apps operation with the given arguments. The task data will be set to a GsPluginUpdateAppsData containing the given context.
This is essentially a combination of gs_plugin_update_apps_data_new()
,
g_task_new()
and g_task_set_task_data()
.
source_object |
task source object |
|
apps |
list of apps to update |
|
flags |
update flags |
|
progress_callback |
function to call to notify of progress. |
[nullable] |
progress_user_data |
data to pass to |
|
app_needs_user_action_callback |
function to call to ask the user for a decision. |
[nullable] |
app_needs_user_action_data |
data to pass to |
|
cancellable |
a GCancellable, or |
[nullable] |
callback |
function to call once asynchronous operation is finished |
|
user_data |
data to pass to |
Since: 44
void
gs_plugin_update_apps_data_free (GsPluginUpdateAppsData *data
);
Free the given data
.
Since: 44
typedef struct { GsAppList *list; /* (owned) (not nullable) */ GsPluginRefineFlags flags; } GsPluginRefineData;
typedef struct { guint64 cache_age_secs; GsPluginRefreshMetadataFlags flags; } GsPluginRefreshMetadataData;
typedef struct { GsAppQuery *query; /* (owned) (nullable) */ GsPluginListAppsFlags flags; } GsPluginListAppsData;
typedef struct { GsApp *repository; /* (owned) (nullable) */ GsPluginManageRepositoryFlags flags; } GsPluginManageRepositoryData;
typedef struct { GPtrArray *list; /* (element-type GsCategory) (owned) (not nullable) */ GsPluginRefineCategoriesFlags flags; } GsPluginRefineCategoriesData;
typedef struct { GsAppList *apps; /* (owned) (not nullable) */ GsPluginUpdateAppsFlags flags; GsPluginProgressCallback progress_callback; gpointer progress_user_data; GsPluginAppNeedsUserActionCallback app_needs_user_action_callback; gpointer app_needs_user_action_data; } GsPluginUpdateAppsData;