Top | ![]() |
![]() |
![]() |
![]() |
XDG Icon and Sound themeXDG Icon and Sound theme — implementation of lookup algorithm for icon and sound themes |
NkXdgThemeContext * | nk_xdg_theme_context_new () |
void | nk_xdg_theme_context_free () |
void | nk_xdg_theme_preload_themes_icon () |
void | nk_xdg_theme_preload_themes_sound () |
gchar * | nk_xdg_theme_get_icon () |
gchar * | nk_xdg_theme_get_sound () |
NkXdgThemeContext * nk_xdg_theme_context_new (const gchar * const *icon_fallback_themes
,const gchar * const *sound_fallback_themes
);
Creates a new NkXdgThemeContext.
Both icon_fallback_themes
and sound_fallback_themes
must exists until the NkXdgThemeContext is freed.
It is recommended to use static const lists.
In addition to the application fallback themes in arguments, the Desktop Environment and GTK themes will be used.
Here is the full lookup list:
Themes passed to nk_xdg_theme_get_icon()
or nk_xdg_theme_get_sound()
Desktop Environment theme if found
GTK theme if found
Application fallback themes
Specification fallback theme ("hicolor" for icons and "freedesktop" for sounds)
void
nk_xdg_theme_context_free (NkXdgThemeContext *context
);
Frees context
.
void nk_xdg_theme_preload_themes_icon (NkXdgThemeContext *context
,const gchar * const *themes
);
Preloads icon themes metedata.
The preloaded themes will be the one from themes
and the one from context
(see nk_xdg_theme_context_new()
).
void nk_xdg_theme_preload_themes_sound (NkXdgThemeContext *context
,const gchar * const *themes
);
Preloads sound themes metedata.
The preloaded themes will be the one from themes
and the one from context
(see nk_xdg_theme_context_new()
).
gchar * nk_xdg_theme_get_icon (NkXdgThemeContext *context
,const gchar * const *themes
,const gchar *context_name
,const gchar *name
,gint size
,gint scale
,gboolean svg
);
Searches name
in themes
and context
themes (see nk_xdg_theme_context_new()
).
size
is directly linked to your usage of the icon.
(E.g. 32 for a small toolbar or 256 for an application grid.)
If your output is an HiDPI monitor, *do not* increase the size
manually, and instead use a higher scale
.
scale
refers to the pixel density of your display.
If your rendering engine support SVG, you can pass TRUE
to svg
.
See the Icon theme specification for the full algorithm.
gchar * nk_xdg_theme_get_sound (NkXdgThemeContext *context
,const gchar * const *themes
,const gchar *name
,const gchar *profile
,const gchar *locale
);
Searches name
in themes
and context
themes (see nk_xdg_theme_context_new()
).
profile
may be "stereo" or "5.1" or any profile the themes are expected to support.
Some sounds may be to be localized, and you may use locale
for that.
If locale
is NULL
, the current locale will be used.
If localized sound is not found, fallbacks to "C".
See the Sound theme specification for the full algorithm.