Top | ![]() |
![]() |
![]() |
![]() |
void (*AscCheckMetadataEarlyFn) (AscResult *cres
,const AscUnit *unit
,gpointer user_data
);
Function which is called after all metainfo and related data (e.g. desktop-entry files) has been loaded, but *before* any expensive operations such as screenshot downloads or font searches are performed.
This function can be useful to filter out unwanted components early in the process and avoid unneeded downloads and other data processing. By the time this function is called, the component's global ID should be finalized and should not change any longer.
Please note that this function may be called from any thread, and thread safety needs to be taked care off by the callee.
cres |
A pointer to generated AscResult. |
[not nullable] |
unit |
The unit we are currently processing. |
[not nullable] |
user_data |
Additional data. |
GPtrArray * (*AscTranslateDesktopTextFn) (const GKeyFile *de
,const gchar *text
,gpointer user_data
);
Function which is called while parsing a desktop-entry file to allow external translations of string values. This is used in e.g. the Ubuntu distribution.
The return value must contain a list of strings with the locale name in even indices, and the text translated to the preceding locale in the following odd indices.
void
asc_compose_reset (AscCompose *compose
);
Reset the results, units and run-specific settings so the instance can be reused for another metadata generation run.
void asc_compose_add_unit (AscCompose *compose
,AscUnit *unit
);
Add an AscUnit as data source for metadata processing.
void asc_compose_add_allowed_cid (AscCompose *compose
,const gchar *component_id
);
Adds a component ID to the allowlist. If the list is not empty, only components in the list will be added to the metadata output.
const gchar *
asc_compose_get_prefix (AscCompose *compose
);
Get the directory prefix used for processing.
void asc_compose_set_prefix (AscCompose *compose
,const gchar *prefix
);
Set the directory prefix the to-be-processed units are using.
const gchar *
asc_compose_get_origin (AscCompose *compose
);
Get the metadata origin field.
void asc_compose_set_origin (AscCompose *compose
,const gchar *origin
);
Set the metadata origin field (e.g. "debian" or "flathub")
AsFormatKind
asc_compose_get_format (AscCompose *compose
);
get the format type we are generating.
void asc_compose_set_format (AscCompose *compose
,AsFormatKind kind
);
Set the format kind of the catalog metadata that we should generate.
const gchar *
asc_compose_get_media_baseurl (AscCompose *compose
);
Get the media base URL to be used for the generated data,
or NULL
if this feature is not used.
void asc_compose_set_media_baseurl (AscCompose *compose
,const gchar *url
);
Set the media base URL for the generated metadata. Can be NULL
.
AscComposeFlags
asc_compose_get_flags (AscCompose *compose
);
Get the flags controlling compose behavior.
void asc_compose_set_flags (AscCompose *compose
,AscComposeFlags flags
);
Set compose flags bitfield that controls the enabled features for this AscCompose.
void asc_compose_add_flags (AscCompose *compose
,AscComposeFlags flags
);
Add compose flags.
void asc_compose_remove_flags (AscCompose *compose
,AscComposeFlags flags
);
Remove compose flags.
AscIconPolicy *
asc_compose_get_icon_policy (AscCompose *compose
);
Get the policy for how icons should be distributed to any AppStream clients.
void asc_compose_set_icon_policy (AscCompose *compose
,AscIconPolicy *policy
);
Set an icon policy object, overriding the existing one.
const gchar *
asc_compose_get_cainfo (AscCompose *compose
);
Get the CA file used to verify peers with, or NULL
for default.
void asc_compose_set_cainfo (AscCompose *compose
,const gchar *cainfo
);
Set a CA file holding one or more certificates to verify peers with for download operations performed by this AscCompose.
const gchar *
asc_compose_get_data_result_dir (AscCompose *compose
);
Get the data result directory.
void asc_compose_set_data_result_dir (AscCompose *compose
,const gchar *dir
);
Set an output location where generated metadata should be saved.
If this is set to NULL
, no metadata will be saved.
const gchar *
asc_compose_get_icons_result_dir (AscCompose *compose
);
Get the icon result directory.
void asc_compose_set_icons_result_dir (AscCompose *compose
,const gchar *dir
);
Set an output location where plain icons for the processed metadata are stored.
const gchar *
asc_compose_get_media_result_dir (AscCompose *compose
);
Get the media result directory, that can be served on a webserver.
void asc_compose_set_media_result_dir (AscCompose *compose
,const gchar *dir
);
Set an output location to store media (screenshots, icons, ...) that will be served on a webserver via the URL set as media baseurl.
const gchar *
asc_compose_get_hints_result_dir (AscCompose *compose
);
Get hints report output directory.
void asc_compose_set_hints_result_dir (AscCompose *compose
,const gchar *dir
);
Set an output location for HTML reports of issues generated during a compose run.
void asc_compose_remove_custom_allowed (AscCompose *compose
,const gchar *key_id
);
Remove a key from the allowlist used to filter the <custom/>
tag entries.
void asc_compose_add_custom_allowed (AscCompose *compose
,const gchar *key_id
);
Add a key to the allowlist that is used to filter custom tag values.
gssize
asc_compose_get_max_screenshot_size (AscCompose *compose
);
Get the maximum size a screenshot video or image can have. A size < 0 may be returned for no limit, setting a limit of 0 will disable screenshots.
void asc_compose_set_max_screenshot_size (AscCompose *compose
,gssize size_bytes
);
Set the maximum size a screenshot video or image can have. A size < 0 may be set to allow unlimited sizes, setting a limit of 0 will disable screenshot caching entirely.
compose |
an AscCompose instance. |
|
size_bytes |
maximum size of a screenshot image or video in bytes |
void asc_compose_set_check_metadata_early_func (AscCompose *compose
,AscCheckMetadataEarlyFn func
,gpointer user_data
);
Set an custom callback to be run when most of the metadata has been loaded, but no expensive operations (like downloads or icon rendering) have been done yet. This can be used to ignore unwanted components early on.
The callback function may be called from any thread, so it needs to ensure thread safety on its own.
compose |
an AscCompose instance. |
|
func |
the AscCheckMetainfoLoadResultFn function to be called. |
[scope notified] |
user_data |
user data for |
void asc_compose_set_desktop_entry_l10n_func (AscCompose *compose
,AscTranslateDesktopTextFn func
,gpointer user_data
);
Set a custom desktop-entry field localization functions to be run for specialized desktop-entry localization schemes such as used in Ubuntu.
The callback function may be called from any thread, so it needs to ensure thread safety on its own.
compose |
an AscCompose instance. |
|
func |
the AscTranslateDesktopTextFn function to be called. |
[scope notified] |
user_data |
user data for |
AscUnit *
asc_compose_get_locale_unit (AscCompose *compose
);
Get the unit we use for locale processing
Return: (transfer none) (nullable): The unit used for locale processing, or NULL
for default.
void asc_compose_set_locale_unit (AscCompose *compose
,AscUnit *locale_unit
);
Set a specific unit that is used for fetching locale information. This may be useful in case a special language pack layout is used, but is generally not necessary to be set explicitly, as locale will be found in the unit where the metadata is by default.
GPtrArray *
asc_compose_get_results (AscCompose *compose
);
Get the results of the last processing run.
GPtrArray *
asc_compose_fetch_components (AscCompose *compose
);
Get the results components extracted in the last data processing run.
gboolean
asc_compose_has_errors (AscCompose *compose
);
Check if the last run generated any errors (which will cause metadata to be ignored).
GPtrArray * asc_compose_run (AscCompose *compose
,GCancellable *cancellable
,GError **error
);
Process the registered units and generate catalog metadata from found components.
void
asc_compose_finalize_results (AscCompose *compose
);
Perform final validation of generated data.
Calling this function is not necessary, unless the final check was explicitly
disabled using the ASC_COMPOSE_FLAG_NO_FINAL_CHECK
flag.
void asc_compose_finalize_result (AscCompose *compose
,AscResult *result
);
Perform final validation of generated data for the specified result container.