{
static GtkIconFactory *icon_factory = NULL;
GtkIconSet *icon_set;
-
+
if (!icon_factory)
{
icon_factory = gtk_icon_factory_new();
gtk_icon_factory_add_default(icon_factory);
}
-
+
icon_set = gtk_icon_set_new_from_pixbuf(pixbuf);
gtk_icon_factory_add(icon_factory, key, icon_set);
}
GError *error = NULL;
icon_theme = gtk_icon_theme_get_default();
-
+
if (gtk_icon_theme_has_icon(icon_theme, key)) return FALSE;
pixbuf = gtk_icon_theme_load_icon(icon_theme,
64, /* size */
0, /* flags */
&error);
- if (!pixbuf)
+ if (!pixbuf)
{
if (error)
{
g_error_free(error);
error = NULL;
}
-
+
if (strchr(icon, '.'))
{
/* try again without extension */
}
if (!pixbuf) return FALSE;
-
+
register_stock_icon(key, pixbuf);
return TRUE;
}
GdkPixbuf *pixbuf_fallback(FileData *fd, gint requested_width, gint requested_height)
{
GdkPixbuf *pixbuf = pixbuf_inline(PIXBUF_INLINE_BROKEN); /* FIXME use different images according to FORMAT_CLASS */
-
+
if (requested_width && requested_height)
{
gint w = gdk_pixbuf_get_width(pixbuf);
gint dw, dh, drs;
guchar *s_pix;
guchar *d_pix;
-#if 0
- guchar *sp;
- guchar *dp;
-#endif
gint i, j;
gint a;
GdkPixbuf *buffer;
{
GdkPixbuf *dest;
GdkPixbuf *tmp = NULL;
-
+
switch (orientation)
{
case EXIF_ORIENTATION_TOP_LEFT:
{
GdkPixbuf *buffer;
gint w, h;
- GdkGC *gc;
gint sx, sy;
gint dw, dh;
cairo_surface_t *source;
if (y1 < clip_y || y2 > clip_y + clip_h) return FALSE;
}
-#if 0
- if (x1 >= clip_x && x2 <= clip_x + clip_w)
- {
- if (y1 < y2)
- {
- if (y1 >= clip_y && y2 <= clip_y + clip_h) return TRUE;
- }
- else
- {
- if (y2 >= clip_y && y1 <= clip_y + clip_h) return TRUE;
- }
- }
-#endif
-
d = x2 - x1;
if (d > 0.0)
{