]> www.fi.muni.cz Git - evince.git/blobdiff - pdf/ev-poppler.cc
Use an specific lock for FontConfig. Hopefully it fixes some crashes
[evince.git] / pdf / ev-poppler.cc
index a90c52413a1c769d0c516460fe8e4d6e6abc8c08..d4372ad6be7cbb1ffa66488676efc127697c6d52 100644 (file)
@@ -503,8 +503,8 @@ pdf_document_get_info (EvDocument *document)
                            EV_DOCUMENT_INFO_MOD_DATE |
                            EV_DOCUMENT_INFO_LINEARIZED |
                            EV_DOCUMENT_INFO_N_PAGES |
-                           EV_DOCUMENT_INFO_SECURITY;
-
+                           EV_DOCUMENT_INFO_SECURITY | 
+                           EV_DOCUMENT_INFO_PAPER_SIZE;
 
        g_object_get (PDF_DOCUMENT (document)->document,
                      "title", &(info->title),
@@ -523,6 +523,14 @@ pdf_document_get_info (EvDocument *document)
                      "linearized", &(info->linearized),
                      NULL);
 
+       pdf_document_get_page_size(document, 0,
+                                  &(info->paper_width),
+                                  &(info->paper_height));
+
+       // Convert to mm.
+       info->paper_width = info->paper_width / 72.0f * 25.4f;
+       info->paper_height = info->paper_height / 72.0f * 25.4f;
+
        switch (layout) {
                case POPPLER_PAGE_LAYOUT_SINGLE_PAGE:
                        info->layout = EV_DOCUMENT_LAYOUT_SINGLE_PAGE;
@@ -1139,9 +1147,11 @@ make_thumbnail_for_size (PdfDocument   *pdf_document,
                                 width, height);
        gdk_pixbuf_fill (pixbuf, 0xffffffff);
 
+       ev_document_fc_mutex_lock ();
        poppler_page_render_to_pixbuf (poppler_page, 0, 0,
                                       width, height,
                                       scale, rotation, pixbuf);
+       ev_document_fc_mutex_unlock ();
        
 
        g_object_unref (poppler_page);
@@ -1315,7 +1325,7 @@ pdf_document_find_begin (EvDocumentFind   *document,
                                                        search_string);
 }
 
-int
+static int
 pdf_document_find_get_n_results (EvDocumentFind *document_find, int page)
 {
        PdfDocumentSearch *search = PDF_DOCUMENT (document_find)->search;
@@ -1327,7 +1337,7 @@ pdf_document_find_get_n_results (EvDocumentFind *document_find, int page)
        }
 }
 
-gboolean
+static gboolean
 pdf_document_find_get_result (EvDocumentFind *document_find,
                              int             page,
                              int             n_result,
@@ -1358,7 +1368,7 @@ pdf_document_find_get_result (EvDocumentFind *document_find,
        return TRUE;
 }
 
-int
+static int
 pdf_document_find_page_has_results (EvDocumentFind *document_find,
                                    int             page)
 {
@@ -1367,7 +1377,7 @@ pdf_document_find_page_has_results (EvDocumentFind *document_find,
        return search && search->pages[page] != NULL;
 }
 
-double
+static double
 pdf_document_find_get_progress (EvDocumentFind *document_find)
 {
        PdfDocumentSearch *search;
@@ -1535,7 +1545,7 @@ pdf_document_file_exporter_iface_init (EvFileExporterIface *iface)
         iface->end = pdf_document_file_exporter_end;
 }
 
-void
+static void
 pdf_selection_render_selection (EvSelection      *selection,
                                EvRenderContext  *rc,
                                GdkPixbuf       **pixbuf,
@@ -1570,7 +1580,7 @@ pdf_selection_render_selection (EvSelection      *selection,
 }
 
 
-GdkRegion *
+static GdkRegion *
 pdf_selection_get_selection_region (EvSelection     *selection,
                                    EvRenderContext *rc,
                                    EvRectangle     *points)
@@ -1587,7 +1597,7 @@ pdf_selection_get_selection_region (EvSelection     *selection,
        return retval;
 }
 
-GdkRegion *
+static GdkRegion *
 pdf_selection_get_selection_map (EvSelection     *selection,
                                 EvRenderContext *rc)
 {