]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-job-queue.c
Minor issue in NEWS
[evince.git] / shell / ev-job-queue.c
index c8c51d8cc15f1cf0fb0304ffa79bd364042d934e..d2733d6f28575051856ccad08db634470c67d592 100644 (file)
@@ -12,8 +12,9 @@ static GQueue *render_queue_high = NULL;
 static GQueue *render_queue_low = NULL;
 static GQueue *thumbnail_queue_high = NULL;
 static GQueue *thumbnail_queue_low = NULL;
 static GQueue *render_queue_low = NULL;
 static GQueue *thumbnail_queue_high = NULL;
 static GQueue *thumbnail_queue_low = NULL;
-static GQueue *xfer_queue = NULL;
+static GQueue *load_queue = NULL;
 static GQueue *fonts_queue = NULL;
 static GQueue *fonts_queue = NULL;
+static GQueue *print_queue = NULL;
 
 /* Queues used for backends supporting EvAsyncRender interface,
    they are executed on the main thread */
 
 /* Queues used for backends supporting EvAsyncRender interface,
    they are executed on the main thread */
@@ -95,12 +96,14 @@ handle_job (EvJob *job)
                ev_job_thumbnail_run (EV_JOB_THUMBNAIL (job));
        else if (EV_IS_JOB_LINKS (job))
                ev_job_links_run (EV_JOB_LINKS (job));
                ev_job_thumbnail_run (EV_JOB_THUMBNAIL (job));
        else if (EV_IS_JOB_LINKS (job))
                ev_job_links_run (EV_JOB_LINKS (job));
-       else if (EV_IS_JOB_XFER (job))
-               ev_job_xfer_run (EV_JOB_XFER (job));
+       else if (EV_IS_JOB_LOAD (job))
+               ev_job_load_run (EV_JOB_LOAD (job));
        else if (EV_IS_JOB_RENDER (job))
                ev_job_render_run (EV_JOB_RENDER (job));
        else if (EV_IS_JOB_FONTS (job))
                ev_job_fonts_run (EV_JOB_FONTS (job));
        else if (EV_IS_JOB_RENDER (job))
                ev_job_render_run (EV_JOB_RENDER (job));
        else if (EV_IS_JOB_FONTS (job))
                ev_job_fonts_run (EV_JOB_FONTS (job));
+       else if (EV_IS_JOB_PRINT (job))
+               ev_job_print_run (EV_JOB_PRINT (job));
 
        if (!EV_JOB (job)->async) {
                /* We let the idle own a ref, as we (the queue) are done with the job. */
 
        if (!EV_JOB (job)->async) {
                /* We let the idle own a ref, as we (the queue) are done with the job. */
@@ -132,7 +135,7 @@ search_for_jobs_unlocked (void)
        if (job)
                return job;
 
        if (job)
                return job;
 
-       job = (EvJob *) g_queue_pop_head (xfer_queue);
+       job = (EvJob *) g_queue_pop_head (load_queue);
        if (job)
                return job;
 
        if (job)
                return job;
 
@@ -144,6 +147,10 @@ search_for_jobs_unlocked (void)
        if (job)
                return job;
 
        if (job)
                return job;
 
+       job = (EvJob *) g_queue_pop_head (print_queue);
+       if (job)
+               return job;
+
        return NULL;
 }
 
        return NULL;
 }
 
@@ -153,10 +160,11 @@ no_jobs_available_unlocked (void)
        return g_queue_is_empty (render_queue_high)
                && g_queue_is_empty (render_queue_low)
                && g_queue_is_empty (links_queue)
        return g_queue_is_empty (render_queue_high)
                && g_queue_is_empty (render_queue_low)
                && g_queue_is_empty (links_queue)
-               && g_queue_is_empty (xfer_queue)
+               && g_queue_is_empty (load_queue)
                && g_queue_is_empty (thumbnail_queue_high)
                && g_queue_is_empty (thumbnail_queue_low)
                && g_queue_is_empty (thumbnail_queue_high)
                && g_queue_is_empty (thumbnail_queue_low)
-               && g_queue_is_empty (fonts_queue);
+               && g_queue_is_empty (fonts_queue)
+               && g_queue_is_empty (print_queue);
 }
 
 /* the thread mainloop function */
 }
 
 /* the thread mainloop function */
@@ -212,7 +220,7 @@ ev_job_queue_init (void)
        ev_queue_mutex = g_mutex_new ();
 
        links_queue = g_queue_new ();
        ev_queue_mutex = g_mutex_new ();
 
        links_queue = g_queue_new ();
-       xfer_queue = g_queue_new ();
+       load_queue = g_queue_new ();
        render_queue_high = g_queue_new ();
        render_queue_low = g_queue_new ();
        async_render_queue_high = g_queue_new ();
        render_queue_high = g_queue_new ();
        render_queue_low = g_queue_new ();
        async_render_queue_high = g_queue_new ();
@@ -220,6 +228,7 @@ ev_job_queue_init (void)
        thumbnail_queue_high = g_queue_new ();
        thumbnail_queue_low = g_queue_new ();
        fonts_queue = g_queue_new ();
        thumbnail_queue_high = g_queue_new ();
        thumbnail_queue_low = g_queue_new ();
        fonts_queue = g_queue_new ();
+       print_queue = g_queue_new ();
 
        g_thread_create (ev_render_thread, NULL, FALSE, NULL);
 
 
        g_thread_create (ev_render_thread, NULL, FALSE, NULL);
 
@@ -247,15 +256,18 @@ find_queue (EvJob         *job,
                                return thumbnail_queue_high;
                        else
                                return thumbnail_queue_low;
                                return thumbnail_queue_high;
                        else
                                return thumbnail_queue_low;
-               } else if (EV_IS_JOB_XFER (job)) {
-                       /* the priority doesn't effect xfer */
-                       return xfer_queue;
+               } else if (EV_IS_JOB_LOAD (job)) {
+                       /* the priority doesn't effect load */
+                       return load_queue;
                } else if (EV_IS_JOB_LINKS (job)) {
                        /* the priority doesn't effect links */
                        return links_queue;
                } else if (EV_IS_JOB_FONTS (job)) {
                        /* the priority doesn't effect fonts */
                        return fonts_queue;
                } else if (EV_IS_JOB_LINKS (job)) {
                        /* the priority doesn't effect links */
                        return links_queue;
                } else if (EV_IS_JOB_FONTS (job)) {
                        /* the priority doesn't effect fonts */
                        return fonts_queue;
+               } else if (EV_IS_JOB_PRINT (job)) {
+                       /* the priority doesn't effect print */
+                       return print_queue;
                }
        }
 
                }
        }
 
@@ -391,10 +403,12 @@ ev_job_queue_remove_job (EvJob *job)
                        retval = retval || remove_job_from_queue_locked (render_queue_low, job);
                } else if (EV_IS_JOB_LINKS (job)) {
                        retval = remove_job_from_queue_locked (links_queue, job);
                        retval = retval || remove_job_from_queue_locked (render_queue_low, job);
                } else if (EV_IS_JOB_LINKS (job)) {
                        retval = remove_job_from_queue_locked (links_queue, job);
-               } else if (EV_IS_JOB_XFER (job)) {
-                       retval = remove_job_from_queue_locked (xfer_queue, job);
+               } else if (EV_IS_JOB_LOAD (job)) {
+                       retval = remove_job_from_queue_locked (load_queue, job);
                } else if (EV_IS_JOB_FONTS (job)) {
                        retval = remove_job_from_queue_locked (fonts_queue, job);
                } else if (EV_IS_JOB_FONTS (job)) {
                        retval = remove_job_from_queue_locked (fonts_queue, job);
+               } else if (EV_IS_JOB_PRINT (job)) {
+                       retval = remove_job_from_queue_locked (print_queue, job);
                } else {
                        g_assert_not_reached ();
                }
                } else {
                        g_assert_not_reached ();
                }