]> www.fi.muni.cz Git - evince.git/blobdiff - libview/ev-jobs.c
[totem-screensaver] Adapt to GDBus API change
[evince.git] / libview / ev-jobs.c
index d13c06b27abb828268d22082e34b7405a8df1fae..140c51ad9a9e67b936fbe31cb9941cf516f44bab 100644 (file)
@@ -15,7 +15,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -448,12 +448,8 @@ ev_job_render_dispose (GObject *object)
 
        job = EV_JOB_RENDER (object);
 
 
        job = EV_JOB_RENDER (object);
 
-       if (job->ev_page) {
-               ev_debug_message (DEBUG_JOBS, "page: %d (%p)", job->ev_page->index, job);
-               g_object_unref (job->ev_page);
-               job->ev_page = NULL;
-       }
-       
+       ev_debug_message (DEBUG_JOBS, "page: %d (%p)", job->page, job);
+
        if (job->surface) {
                cairo_surface_destroy (job->surface);
                job->surface = NULL;
        if (job->surface) {
                cairo_surface_destroy (job->surface);
                job->surface = NULL;
@@ -476,6 +472,7 @@ static gboolean
 ev_job_render_run (EvJob *job)
 {
        EvJobRender     *job_render = EV_JOB_RENDER (job);
 ev_job_render_run (EvJob *job)
 {
        EvJobRender     *job_render = EV_JOB_RENDER (job);
+       EvPage          *ev_page;
        EvRenderContext *rc;
 
        ev_debug_message (DEBUG_JOBS, "page: %d (%p)", job_render->page, job);
        EvRenderContext *rc;
 
        ev_debug_message (DEBUG_JOBS, "page: %d (%p)", job_render->page, job);
@@ -487,9 +484,10 @@ ev_job_render_run (EvJob *job)
                
        ev_document_fc_mutex_lock ();
 
                
        ev_document_fc_mutex_lock ();
 
-       job_render->ev_page = ev_document_get_page (job->document, job_render->page);
-       rc = ev_render_context_new (job_render->ev_page, job_render->rotation, job_render->scale);
-               
+       ev_page = ev_document_get_page (job->document, job_render->page);
+       rc = ev_render_context_new (ev_page, job_render->rotation, job_render->scale);
+       g_object_unref (ev_page);
+
        job_render->surface = ev_document_render (job->document, rc);
        /* If job was cancelled during the page rendering,
         * we return now, so that the thread is finished ASAP
        job_render->surface = ev_document_render (job->document, rc);
        /* If job was cancelled during the page rendering,
         * we return now, so that the thread is finished ASAP
@@ -600,7 +598,7 @@ ev_job_page_data_run (EvJob *job)
                        ev_selection_get_selection_map (EV_SELECTION (job->document), ev_page);
        if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_LINKS) && EV_IS_DOCUMENT_LINKS (job->document))
                job_pd->link_mapping =
                        ev_selection_get_selection_map (EV_SELECTION (job->document), ev_page);
        if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_LINKS) && EV_IS_DOCUMENT_LINKS (job->document))
                job_pd->link_mapping =
-                       ev_document_links_get_links (EV_DOCUMENT_LINKS (job->document), job_pd->page);
+                       ev_document_links_get_links (EV_DOCUMENT_LINKS (job->document), ev_page);
        if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_FORMS) && EV_IS_DOCUMENT_FORMS (job->document))
                job_pd->form_field_mapping =
                        ev_document_forms_get_form_fields (EV_DOCUMENT_FORMS (job->document),
        if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_FORMS) && EV_IS_DOCUMENT_FORMS (job->document))
                job_pd->form_field_mapping =
                        ev_document_forms_get_form_fields (EV_DOCUMENT_FORMS (job->document),
@@ -608,7 +606,7 @@ ev_job_page_data_run (EvJob *job)
        if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_IMAGES) && EV_IS_DOCUMENT_IMAGES (job->document))
                job_pd->image_mapping =
                        ev_document_images_get_image_mapping (EV_DOCUMENT_IMAGES (job->document),
        if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_IMAGES) && EV_IS_DOCUMENT_IMAGES (job->document))
                job_pd->image_mapping =
                        ev_document_images_get_image_mapping (EV_DOCUMENT_IMAGES (job->document),
-                                                             job_pd->page);
+                                                             ev_page);
        if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_ANNOTS) && EV_IS_DOCUMENT_ANNOTATIONS (job->document))
                job_pd->annot_mapping =
                        ev_document_annotations_get_annotations (EV_DOCUMENT_ANNOTATIONS (job->document),
        if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_ANNOTS) && EV_IS_DOCUMENT_ANNOTATIONS (job->document))
                job_pd->annot_mapping =
                        ev_document_annotations_get_annotations (EV_DOCUMENT_ANNOTATIONS (job->document),
@@ -842,6 +840,8 @@ ev_job_load_run (EvJob *job)
           because, e.g., a password is required - if so, just reload rather than
           creating a new instance */
        if (job->document) {
           because, e.g., a password is required - if so, just reload rather than
           creating a new instance */
        if (job->document) {
+               const gchar *uncompressed_uri;
+
                if (job_load->password) {
                        ev_document_security_set_password (EV_DOCUMENT_SECURITY (job->document),
                                                           job_load->password);
                if (job_load->password) {
                        ev_document_security_set_password (EV_DOCUMENT_SECURITY (job->document),
                                                           job_load->password);
@@ -850,9 +850,11 @@ ev_job_load_run (EvJob *job)
                job->failed = FALSE;
                job->finished = FALSE;
                g_clear_error (&job->error);
                job->failed = FALSE;
                job->finished = FALSE;
                g_clear_error (&job->error);
-               
+
+               uncompressed_uri = g_object_get_data (G_OBJECT (job->document),
+                                                     "uri-uncompressed");
                ev_document_load (job->document,
                ev_document_load (job->document,
-                                 job_load->uri,
+                                 uncompressed_uri ? uncompressed_uri : job_load->uri,
                                  &error);
        } else {
                job->document = ev_document_factory_get_document (job_load->uri,
                                  &error);
        } else {
                job->document = ev_document_factory_get_document (job_load->uri,
@@ -1085,7 +1087,7 @@ ev_job_find_dispose (GObject *object)
                gint i;
 
                for (i = 0; i < job->n_pages; i++) {
                gint i;
 
                for (i = 0; i < job->n_pages; i++) {
-                       g_list_foreach (job->pages[i], (GFunc)g_free, NULL);
+                       g_list_foreach (job->pages[i], (GFunc)ev_rectangle_free, NULL);
                        g_list_free (job->pages[i]);
                }
 
                        g_list_free (job->pages[i]);
                }