Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@src.gnome.org>2005-07-30 23:11:25 (GMT)
committer Jonathan Blandford <jrb@src.gnome.org>2005-07-30 23:11:25 (GMT)
commit2f1494f465ee651cb78bdf8f365ad45f33957ba6 (patch)
tree2ec147ce256791a4bc6a1e2d258435d7089ff8fb /shell
parent9695105e94d879997669c2e3765ebbafce41f401 (diff)
at Jul 30 19:09:34 2005 Jonathan Blandford <jrb@redhat.com>
* shell/ev-pixbuf-cache.c: (ev_pixbuf_cache_clear): * shell/ev-pixbuf-cache.h: * shell/ev-sidebar-thumbnails.c: (ev_sidebar_thumbnails_get_property), (add_range), (adjustment_changed_cb): * shell/ev-view.c: (ev_view_set_rotation): Fix rotation and the pixbuf cache. Make thumbnailing work again. Also, fix bug where we were thumbnailing the entire docment on startup, slowing us down hugely.
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-pixbuf-cache.c18
-rw-r--r--shell/ev-pixbuf-cache.h2
-rw-r--r--shell/ev-sidebar-thumbnails.c12
-rw-r--r--shell/ev-view.c1
4 files changed, 28 insertions, 5 deletions
diff --git a/shell/ev-pixbuf-cache.c b/shell/ev-pixbuf-cache.c
index 7ada246..36eca68 100644
--- a/shell/ev-pixbuf-cache.c
+++ b/shell/ev-pixbuf-cache.c
@@ -700,6 +700,24 @@ ev_pixbuf_cache_get_text_mapping (EvPixbufCache *pixbuf_cache,
return job_info->text_mapping;
}
+/* Clears the cache of jobs and pixbufs.
+ */
+void
+ev_pixbuf_cache_clear (EvPixbufCache *pixbuf_cache)
+{
+ int i;
+
+ for (i = 0; i < pixbuf_cache->preload_cache_size; i++) {
+ dispose_cache_job_info (pixbuf_cache->prev_job + i, pixbuf_cache);
+ dispose_cache_job_info (pixbuf_cache->next_job + i, pixbuf_cache);
+ }
+
+ for (i = 0; i < PAGE_CACHE_LEN (pixbuf_cache); i++) {
+ dispose_cache_job_info (pixbuf_cache->job_list + i, pixbuf_cache);
+ }
+}
+
+
GdkPixbuf *
ev_pixbuf_cache_get_selection_pixbuf (EvPixbufCache *pixbuf_cache,
gint page,
diff --git a/shell/ev-pixbuf-cache.h b/shell/ev-pixbuf-cache.h
index 0021f62..443e94d 100644
--- a/shell/ev-pixbuf-cache.h
+++ b/shell/ev-pixbuf-cache.h
@@ -61,6 +61,8 @@ GList *ev_pixbuf_cache_get_link_mapping (EvPixbufCache *pixbuf_cache
gint page);
GdkRegion *ev_pixbuf_cache_get_text_mapping (EvPixbufCache *pixbuf_cache,
gint page);
+void ev_pixbuf_cache_clear (EvPixbufCache *pixbuf_cache);
+
/* Selection */
GdkPixbuf *ev_pixbuf_cache_get_selection_pixbuf (EvPixbufCache *pixbuf_cache,
gint page,
diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c
index 46dc9ce..362ef48 100644
--- a/shell/ev-sidebar-thumbnails.c
+++ b/shell/ev-sidebar-thumbnails.c
@@ -116,9 +116,9 @@ ev_sidebar_thumbnails_dispose (GObject *object)
static void
ev_sidebar_thumbnails_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
EvSidebarThumbnails *sidebar = EV_SIDEBAR_THUMBNAILS (object);
@@ -229,7 +229,8 @@ add_range (EvSidebarThumbnails *sidebar_thumbnails,
-1);
if (job == NULL && !thumbnail_set) {
- job = (EvJobThumbnail *)ev_job_thumbnail_new (priv->document, page, THUMBNAIL_WIDTH, 0);
+ /* FIXME: Need rotation */
+ job = (EvJobThumbnail *)ev_job_thumbnail_new (priv->document, page, 0, THUMBNAIL_WIDTH);
ev_job_queue_add_job (EV_JOB (job), EV_JOB_PRIORITY_HIGH);
g_object_set_data_full (G_OBJECT (job), "tree_iter",
gtk_tree_iter_copy (&iter),
@@ -307,7 +308,8 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails)
#ifdef HAVE_GTK_ICON_VIEW_GET_VISIBLE_RANGE
if (! GTK_WIDGET_REALIZED (priv->icon_view))
return;
- gtk_icon_view_get_visible_range (GTK_ICON_VIEW (priv->icon_view), &path, &path2);
+ if (! gtk_icon_view_get_visible_range (GTK_ICON_VIEW (priv->icon_view), &path, &path2))
+ return;
#else
g_assert_not_reached ();
#endif
diff --git a/shell/ev-view.c b/shell/ev-view.c
index 6bc088b..31705ab 100644
--- a/shell/ev-view.c
+++ b/shell/ev-view.c
@@ -2331,6 +2331,7 @@ ev_view_set_rotation (EvView *view, int rotation)
{
view->rotation = rotation;
+ ev_pixbuf_cache_clear (view->pixbuf_cache);
gtk_widget_queue_resize (GTK_WIDGET (view));
}