#include "ui_menu.h"
#include "ui_misc.h"
#include "window.h"
+#include "image-load.h"
enum {
FULLSCREEN_CURSOR_HIDDEN = 1 << 0,
FullScreenData *fs = data;
if (fs->imd->il &&
- fs->imd->il->pixbuf != image_get_pixbuf(fs->imd))
+ image_loader_get_pixbuf(fs->imd->il) != image_get_pixbuf(fs->imd))
{
fullscreen_mouse_set_busy_idle(fs);
}
return il->done;
}
+FileData *image_loader_get_fd(ImageLoader *il)
+{
+ if (!il) return NULL;
+
+ return il->fd;
+
+}
+
+gint image_loader_get_shrunk(ImageLoader *il)
+{
+ if (!il) return FALSE;
+
+ return il->shrunk;
+
+}
+
+
gint image_load_dimensions(FileData *fd, gint *width, gint *height)
{
ImageLoader *il;
gchar *image_loader_get_format(ImageLoader *il);
gdouble image_loader_get_percent(ImageLoader *il);
gint image_loader_get_is_done(ImageLoader *il);
+FileData *image_loader_get_fd(ImageLoader *il);
+gint image_loader_get_shrunk(ImageLoader *il);
gint image_load_dimensions(FileData *fd, gint *width, gint *height);
#include "pixbuf-renderer.h"
#include "pixbuf_util.h"
#include "ui_fileops.h"
+#include "image-load.h"
/*
*----------------------------------------------------------------------------
if (!imd->unknown)
{
gint w, h;
+ GdkPixbuf *load_pixbuf = image_loader_get_pixbuf(imd->il);
if (imd->delay_flip &&
- imd->il && imd->il->pixbuf &&
- image_get_pixbuf(imd) != imd->il->pixbuf)
+ imd->il && load_pixbuf &&
+ image_get_pixbuf(imd) != load_pixbuf)
{
- w = gdk_pixbuf_get_width(imd->il->pixbuf);
- h = gdk_pixbuf_get_height(imd->il->pixbuf);
- imgpixbuf = imd->il->pixbuf;
+ w = gdk_pixbuf_get_width(load_pixbuf);
+ h = gdk_pixbuf_get_height(load_pixbuf);
+ imgpixbuf = load_pixbuf;
}
else
{
text = g_markup_escape_text(_("Untitled"), -1);
}
- with_hist = (imgpixbuf && (osd->show & OSD_SHOW_HISTOGRAM) && osd->histogram && (!imd->il || imd->il->done));
+ with_hist = (imgpixbuf && (osd->show & OSD_SHOW_HISTOGRAM) && osd->histogram && (!imd->il || image_loader_get_is_done(imd->il)));
{
gint active_marks = 0;
image_osd_icons_hide(osd);
}
- if (osd->imd->il && osd->imd->il->done)
+ if (osd->imd->il && image_loader_get_is_done(osd->imd->il))
osd->changed_states = IMAGE_STATE_NONE;
osd->idle_id = -1;
return FALSE;
if (pw->text_fields == 0) return TRUE;
string = g_string_new("");
- path = pw->job_loader->fd->path;
+ path = image_loader_get_fd(pw->job_loader)->path;
if (pw->text_fields & TEXT_INFO_FILENAME)
{
{
if (newline) g_string_append(string, "\n");
if (space) g_string_append(string, " - ");
- g_string_append(string, text_from_time(filetime(pw->job_loader->fd->path)));
+ g_string_append(string, text_from_time(filetime(image_loader_get_fd(pw->job_loader)->path)));
newline = proof;
space = !proof;
}
if (newline) g_string_append(string, "\n");
if (space) g_string_append(string, " - ");
- size = text_from_size_abrev(filesize(pw->job_loader->fd->path));
+ size = text_from_size_abrev(filesize(image_loader_get_fd(pw->job_loader)->path));
g_string_append(string, size);
g_free(size);
}
y = y + h + PRINT_TEXT_PADDING;
success = (success &&
- print_job_text_image(pw, pw->job_loader->fd->path, x, y, dw, sw, sh, FALSE));
+ print_job_text_image(pw, image_loader_get_fd(pw->job_loader)->path, x, y, dw, sw, sh, FALSE));
}
image_loader_free(pw->job_loader);
y = y + icon_h + (pw->proof_height - icon_h) / 2 + PRINT_TEXT_PADDING;
success = (success &&
- print_job_text_image(pw, pw->job_loader->fd->path, x, y, icon_w + PRINT_PROOF_MARGIN * 2, w, h, TRUE));
+ print_job_text_image(pw, image_loader_get_fd(pw->job_loader)->path, x, y, icon_w + PRINT_PROOF_MARGIN * 2, w, h, TRUE));
if (!success)
{
}
if (options->thumbnails.enable_caching &&
- sd->img_loader && sd->img_loader->fd)
+ sd->img_loader && image_loader_get_fd(sd->img_loader))
{
gchar *base;
const gchar *path;
mode_t mode = 0755;
- path = sd->img_loader->fd->path;
+ path = image_loader_get_fd(sd->img_loader)->path;
base = cache_get_location(CACHE_TYPE_SIM, path, FALSE, &mode);
if (cache_ensure_dir_exists(base, mode))
{
cd->path = cache_get_location(CACHE_TYPE_SIM, path, TRUE, NULL);
if (cache_sim_data_save(cd))
{
- filetime_set(cd->path, filetime(sd->img_loader->fd->path));
+ filetime_set(cd->path, filetime(image_loader_get_fd(sd->img_loader)->path));
}
}
g_free(base);
tl->fd->thumb_pixbuf = pixbuf;
gdk_pixbuf_ref(tl->fd->thumb_pixbuf);
}
- save = il->shrunk;
+ save = image_loader_get_shrunk(il);
}
if (rotated) gdk_pixbuf_unref(rotated);
GdkPixbuf *pixbuf;
DEBUG_1("thumb image done: %s", tl->fd ? tl->fd->path : "???");
- DEBUG_1(" from: %s", tl->il->path);
+ DEBUG_1(" from: %s", image_loader_get_fd(tl->il)->path);
pixbuf = image_loader_get_pixbuf(tl->il);
if (!pixbuf)
if (tl->fd)
{
if (tl->fd->thumb_pixbuf) g_object_unref(tl->fd->thumb_pixbuf);
- tl->fd->thumb_pixbuf = thumb_loader_std_finish(tl, pixbuf, il->shrunk);
+ tl->fd->thumb_pixbuf = thumb_loader_std_finish(tl, pixbuf, image_loader_get_shrunk(il));
}
if (tl->func_done) tl->func_done(tl, tl->data);
}
DEBUG_1("thumb image error: %s", tl->fd->path);
- DEBUG_1(" from: %s", tl->il->fd->path);
+ DEBUG_1(" from: %s", image_loader_get_fd(tl->il)->path);
if (thumb_loader_std_next_source(tl, TRUE)) return;