From a6df08bc596d57fdee2f464a4d2c8fe9aa11f665 Mon Sep 17 00:00:00 2001 From: Nate Summers Date: Fri, 15 Jul 2005 23:48:09 +0000 Subject: [PATCH] merged in all the changes in my current gimp-poppler tree that don't need * plug-ins/common/poppler.c: merged in all the changes in my current gimp-poppler tree that don't need c++ or cause regressions. Insignificant code cleanups. * plug-ins/common/poppler.c (load_dialog): display title of pdf at the top of the dialog, and show the page labels in the page selector. The loop for the page labels might be profitably moved into another thread, but I haven't actually timed how long it takes to be sure. --- plug-ins/common/poppler.c | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/plug-ins/common/poppler.c b/plug-ins/common/poppler.c index fc9f64a4a9..ed768775cf 100644 --- a/plug-ins/common/poppler.c +++ b/plug-ins/common/poppler.c @@ -231,7 +231,7 @@ run (const gchar *name, pages); if (doc) - g_object_unref (G_OBJECT (doc)); + g_object_unref (doc); if (image_ID != -1) { @@ -273,7 +273,7 @@ run (const gchar *name, { poppler_page_get_size (page, &width, &height); - g_object_unref (G_OBJECT (buf)); + g_object_unref (buf); } buf = get_thumbnail (doc, 0, param[1].data.d_int32); @@ -297,10 +297,10 @@ run (const gchar *name, height *= scale; if (doc) - g_object_unref (G_OBJECT (doc)); + g_object_unref (doc); if (buf) - g_object_unref (G_OBJECT (buf)); + g_object_unref (buf); if (image != -1) { @@ -502,7 +502,7 @@ load_image (PopplerDocument *doc, doc_progress = (double) (i + 1) / pages->n_pages; gimp_progress_update (doc_progress); - g_object_unref (G_OBJECT (buf)); + g_object_unref (buf); } return image; @@ -544,7 +544,7 @@ get_thumbnail (PopplerDocument *doc, 0, 0); } - g_object_unref (G_OBJECT (page)); + g_object_unref (page); return pixbuf; } @@ -611,6 +611,7 @@ load_dialog (PopplerDocument *doc, { GtkWidget *dialog; GtkWidget *vbox; + GtkWidget *title; GtkWidget *selector; GtkWidget *table; GtkWidget *spinbutton; @@ -619,6 +620,8 @@ load_dialog (PopplerDocument *doc, ThreadData thread_data; GThread *thread; + + int i; int n_pages; gboolean run; @@ -644,11 +647,32 @@ load_dialog (PopplerDocument *doc, gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox); gtk_widget_show (vbox); + /* Title */ + title = gimp_prop_label_new (G_OBJECT (doc), "title"); + gtk_box_pack_start (GTK_BOX (vbox), title, FALSE, FALSE, 0); + gtk_widget_show (title); + /* Page Selector */ selector = gimp_page_selector_new (); gtk_box_pack_start (GTK_BOX (vbox), selector, TRUE, TRUE, 0); n_pages = poppler_document_get_n_pages (doc); gimp_page_selector_set_n_pages (GIMP_PAGE_SELECTOR (selector), n_pages); + + for (i=0; i