forked from AuroraMiddleware/gtk
iconcache: Remove unused function
This commit is contained in:
parent
371f501632
commit
d3bf602c60
@ -541,85 +541,3 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
GtkIconData *
|
||||
_gtk_icon_cache_get_icon_data (GtkIconCache *cache,
|
||||
const gchar *icon_name,
|
||||
gint directory_index)
|
||||
{
|
||||
guint32 offset, image_data_offset, meta_data_offset;
|
||||
GtkIconData *data;
|
||||
int i;
|
||||
|
||||
offset = find_image_offset (cache, icon_name, directory_index);
|
||||
if (!offset)
|
||||
return NULL;
|
||||
|
||||
image_data_offset = GET_UINT32 (cache->buffer, offset + 4);
|
||||
if (!image_data_offset)
|
||||
return NULL;
|
||||
|
||||
meta_data_offset = GET_UINT32 (cache->buffer, image_data_offset + 4);
|
||||
|
||||
if (!meta_data_offset)
|
||||
return NULL;
|
||||
|
||||
data = g_slice_new0 (GtkIconData);
|
||||
data->ref = 1;
|
||||
|
||||
offset = GET_UINT32 (cache->buffer, meta_data_offset);
|
||||
if (offset)
|
||||
{
|
||||
data->has_embedded_rect = TRUE;
|
||||
data->x0 = GET_UINT16 (cache->buffer, offset);
|
||||
data->y0 = GET_UINT16 (cache->buffer, offset + 2);
|
||||
data->x1 = GET_UINT16 (cache->buffer, offset + 4);
|
||||
data->y1 = GET_UINT16 (cache->buffer, offset + 6);
|
||||
}
|
||||
|
||||
offset = GET_UINT32 (cache->buffer, meta_data_offset + 4);
|
||||
if (offset)
|
||||
{
|
||||
data->n_attach_points = GET_UINT32 (cache->buffer, offset);
|
||||
data->attach_points = g_new (GdkPoint, data->n_attach_points);
|
||||
for (i = 0; i < data->n_attach_points; i++)
|
||||
{
|
||||
data->attach_points[i].x = GET_UINT16 (cache->buffer, offset + 4 + 4 * i);
|
||||
data->attach_points[i].y = GET_UINT16 (cache->buffer, offset + 4 + 4 * i + 2);
|
||||
}
|
||||
}
|
||||
|
||||
offset = GET_UINT32 (cache->buffer, meta_data_offset + 8);
|
||||
if (offset)
|
||||
{
|
||||
gint n_names;
|
||||
gchar *lang, *name;
|
||||
gchar **langs;
|
||||
GHashTable *table = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
|
||||
n_names = GET_UINT32 (cache->buffer, offset);
|
||||
|
||||
for (i = 0; i < n_names; i++)
|
||||
{
|
||||
lang = cache->buffer + GET_UINT32 (cache->buffer, offset + 4 + 8 * i);
|
||||
name = cache->buffer + GET_UINT32 (cache->buffer, offset + 4 + 8 * i + 4);
|
||||
|
||||
g_hash_table_insert (table, lang, name);
|
||||
}
|
||||
|
||||
langs = (gchar **)g_get_language_names ();
|
||||
for (i = 0; langs[i]; i++)
|
||||
{
|
||||
name = g_hash_table_lookup (table, langs[i]);
|
||||
if (name)
|
||||
{
|
||||
data->display_name = g_strdup (name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_hash_table_destroy (table);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -21,19 +21,6 @@
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
typedef struct _GtkIconCache GtkIconCache;
|
||||
typedef struct _GtkIconData GtkIconData;
|
||||
|
||||
struct _GtkIconData
|
||||
{
|
||||
gint ref;
|
||||
gboolean has_embedded_rect;
|
||||
gint x0, y0, x1, y1;
|
||||
|
||||
GdkPoint *attach_points;
|
||||
gint n_attach_points;
|
||||
|
||||
gchar *display_name;
|
||||
};
|
||||
|
||||
GtkIconCache *_gtk_icon_cache_new (const gchar *data);
|
||||
GtkIconCache *_gtk_icon_cache_new_for_path (const gchar *path);
|
||||
@ -56,9 +43,6 @@ gint _gtk_icon_cache_get_icon_flags (GtkIconCache *cache,
|
||||
GdkPixbuf *_gtk_icon_cache_get_icon (GtkIconCache *cache,
|
||||
const gchar *icon_name,
|
||||
gint directory_index);
|
||||
GtkIconData *_gtk_icon_cache_get_icon_data (GtkIconCache *cache,
|
||||
const gchar *icon_name,
|
||||
gint directory_index);
|
||||
|
||||
GtkIconCache *_gtk_icon_cache_ref (GtkIconCache *cache);
|
||||
void _gtk_icon_cache_unref (GtkIconCache *cache);
|
||||
|
Loading…
Reference in New Issue
Block a user