Remove _for_theme() variant of st_texture_cache_load_icon_name()

Now that we're using St.Icon in the Javascript, there is no reason
to have separate st_texture_cache_load_icon_name() and
st_texture_cache_load_icon_name_for_theme(), instead just add
the StThemeNode argument to st_texture_cache_load_icon_name().

https://bugzilla.gnome.org/show_bug.cgi?id=633866
This commit is contained in:
Owen W. Taylor 2010-11-12 17:07:05 -05:00
parent 0e3431ac47
commit dc1e23501c
3 changed files with 17 additions and 45 deletions

View File

@ -324,11 +324,11 @@ st_icon_update (StIcon *icon)
if (theme_node)
{
StTextureCache *cache = st_texture_cache_get_default ();
priv->icon_texture = st_texture_cache_load_icon_name_for_theme (cache,
theme_node,
priv->icon_name,
priv->icon_type,
priv->icon_size);
priv->icon_texture = st_texture_cache_load_icon_name (cache,
theme_node,
priv->icon_name,
priv->icon_type,
priv->icon_size);
if (priv->icon_texture)
clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (icon));

View File

@ -1235,9 +1235,9 @@ st_texture_cache_load_sliced_image (StTextureCache *cache,
*/
/**
* st_texture_cache_load_icon_name_for_theme:
* st_texture_cache_load_icon_name:
* @cache: The texture cache instance
* @theme_node: a #StThemeNode
* @theme_node: (allow-none): a #StThemeNode
* @name: Name of a themed icon
* @icon_type: the type of icon to load
* @size: Size of themed
@ -1249,16 +1249,18 @@ st_texture_cache_load_sliced_image (StTextureCache *cache,
* Return Value: (transfer none): A new #ClutterTexture for the icon
*/
ClutterActor *
st_texture_cache_load_icon_name_for_theme (StTextureCache *cache,
StThemeNode *theme_node,
const char *name,
StIconType icon_type,
gint size)
st_texture_cache_load_icon_name (StTextureCache *cache,
StThemeNode *theme_node,
const char *name,
StIconType icon_type,
gint size)
{
ClutterActor *texture;
GIcon *themed;
char *symbolic;
g_return_val_if_fail (!(icon_type == ST_ICON_SYMBOLIC && theme_node == NULL), NULL);
switch (icon_type)
{
case ST_ICON_APPLICATION:
@ -1273,12 +1275,8 @@ st_texture_cache_load_icon_name_for_theme (StTextureCache *cache,
symbolic = g_strconcat (name, "-symbolic", NULL);
themed = g_themed_icon_new_with_default_fallbacks ((const gchar*)symbolic);
g_free (symbolic);
if (theme_node)
texture = load_gicon_with_colors (cache, themed, size,
st_theme_node_get_icon_colors (theme_node));
else
texture = st_texture_cache_load_gicon (cache, themed, size);
texture = load_gicon_with_colors (cache, themed, size,
st_theme_node_get_icon_colors (theme_node));
g_object_unref (themed);
return CLUTTER_ACTOR (texture);
@ -1294,27 +1292,6 @@ st_texture_cache_load_icon_name_for_theme (StTextureCache *cache,
}
}
/**
* st_texture_cache_load_icon_name:
* @cache: The texture cache instance
* @name: Name of a themed icon
* @icon_type: the type of icon to load
* @size: Size of themed
*
* Load a themed icon into a texture. See the #StIconType documentation
* for an explanation of how @icon_type affects the returned icon.
*
* Return Value: (transfer none): A new #ClutterTexture for the icon
*/
ClutterActor *
st_texture_cache_load_icon_name (StTextureCache *cache,
const char *name,
StIconType icon_type,
gint size)
{
return st_texture_cache_load_icon_name_for_theme (cache, NULL, name, icon_type, size);
}
/**
* st_texture_cache_load_uri_async:
*

View File

@ -79,16 +79,11 @@ ClutterActor *st_texture_cache_bind_pixbuf_property (StTextureCache *cache,
const char *property_name);
ClutterActor *st_texture_cache_load_icon_name (StTextureCache *cache,
StThemeNode *theme_node,
const char *name,
StIconType icon_type,
gint size);
ClutterActor *st_texture_cache_load_icon_name_for_theme (StTextureCache *cache,
StThemeNode *theme_node,
const char *name,
StIconType icon_type,
gint size);
ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache,
GIcon *icon,
gint size);