summaryrefslogtreecommitdiff
path: root/backend/dvi
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-05-17 05:15:56 +0200
committerinfirit <[email protected]>2014-09-23 13:31:02 +0200
commit94dcb761b95ee54ef1f1512d59721932d75ffb7f (patch)
tree60f89e8174ffc3133c0f1758e2f43408b510c02b /backend/dvi
parent53bb92a83092a70170f85d75491c5b0b881455bc (diff)
downloadatril-94dcb761b95ee54ef1f1512d59721932d75ffb7f.tar.bz2
atril-94dcb761b95ee54ef1f1512d59721932d75ffb7f.tar.xz
Fix glib deprecations
Based on evince commit by Carlos Garcia Campos <[email protected]> Url: https://git.gnome.org/browse/evince/commit/?id=bf90f90e0af99bbfdd20e6d21fd228c05cffae51 Url: https://git.gnome.org/browse/evince/commit/?id=76151be92239ed5f491cb26c87a2328b670e9f64
Diffstat (limited to 'backend/dvi')
-rw-r--r--backend/dvi/dvi-document.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/backend/dvi/dvi-document.c b/backend/dvi/dvi-document.c
index c34de6e1..77065361 100644
--- a/backend/dvi/dvi-document.c
+++ b/backend/dvi/dvi-document.c
@@ -41,7 +41,7 @@
#endif
#include <stdlib.h>
-GMutex *dvi_context_mutex = NULL;
+GMutex dvi_context_mutex;
enum {
PROP_0,
@@ -98,12 +98,12 @@ dvi_document_load (EvDocument *document,
if (!filename)
return FALSE;
- g_mutex_lock (dvi_context_mutex);
+ g_mutex_lock (&dvi_context_mutex);
if (dvi_document->context)
mdvi_destroy_context (dvi_document->context);
dvi_document->context = mdvi_init_context(dvi_document->params, dvi_document->spec, filename);
- g_mutex_unlock (dvi_context_mutex);
+ g_mutex_unlock (&dvi_context_mutex);
g_free (filename);
if (!dvi_document->context) {
@@ -175,9 +175,9 @@ dvi_document_render (EvDocument *document,
* thread safe. The work to the future -
* let context render page independently
*/
- g_mutex_lock (dvi_context_mutex);
+ g_mutex_lock (&dvi_context_mutex);
- mdvi_setpage (dvi_document->context, rc->page->index);
+ mdvi_setpage (&dvi_document->context, rc->page->index);
mdvi_set_shrink (dvi_document->context,
(int)((dvi_document->params->hshrink - 1) / rc->scale) + 1,
@@ -198,7 +198,7 @@ dvi_document_render (EvDocument *document,
mdvi_cairo_device_render (dvi_document->context);
surface = mdvi_cairo_device_get_surface (&dvi_document->context->device);
- g_mutex_unlock (dvi_context_mutex);
+ g_mutex_unlock (&dvi_context_mutex);
rotated_surface = ev_document_misc_surface_rotate_and_scale (surface,
required_width,
@@ -214,12 +214,12 @@ dvi_document_finalize (GObject *object)
{
DviDocument *dvi_document = DVI_DOCUMENT(object);
- g_mutex_lock (dvi_context_mutex);
+ g_mutex_lock (&dvi_context_mutex);
if (dvi_document->context) {
mdvi_cairo_device_free (&dvi_document->context->device);
mdvi_destroy_context (dvi_document->context);
}
- g_mutex_unlock (dvi_context_mutex);
+ g_mutex_unlock (&dvi_context_mutex);
if (dvi_document->params)
g_free (dvi_document->params);
@@ -257,8 +257,6 @@ dvi_document_class_init (DviDocumentClass *klass)
mdvi_register_special ("Color", "color", NULL, dvi_document_do_color_special, 1);
mdvi_register_fonts ();
- dvi_context_mutex = g_mutex_new ();
-
ev_document_class->load = dvi_document_load;
ev_document_class->save = dvi_document_save;
ev_document_class->get_n_pages = dvi_document_get_n_pages;
@@ -301,7 +299,7 @@ dvi_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document,
thumb_width = (gint) (dvi_document->base_width * rc->scale);
thumb_height = (gint) (dvi_document->base_height * rc->scale);
- g_mutex_lock (dvi_context_mutex);
+ g_mutex_lock (&dvi_context_mutex);
mdvi_setpage (dvi_document->context, rc->page->index);
@@ -325,7 +323,7 @@ dvi_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document,
mdvi_cairo_device_set_scale (&dvi_document->context->device, rc->scale);
mdvi_cairo_device_render (dvi_document->context);
surface = mdvi_cairo_device_get_surface (&dvi_document->context->device);
- g_mutex_unlock (dvi_context_mutex);
+ g_mutex_unlock (&dvi_context_mutex);
pixbuf = ev_document_misc_pixbuf_from_surface (surface);
cairo_surface_destroy (surface);