X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=backend%2Fpdf%2Fev-poppler.cc;h=8c5b203ccb476eb9b6fe06ae835c88a216e68c3f;hb=d9458f7a82b916efcc7bebf576388ef9bf2e8e45;hp=0c5c8982270a0954b99d0f1277bf88b9ec521a65;hpb=08993c59369086fa8916236f580438d656ccb8f7;p=evince.git diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc index 0c5c8982..8c5b203c 100644 --- a/backend/pdf/ev-poppler.cc +++ b/backend/pdf/ev-poppler.cc @@ -722,6 +722,9 @@ pdf_document_get_info (EvDocument *document) PopplerPermissions permissions; EvPage *page; char *metadata; +#ifdef HAVE_POPPLER_DOCUMENT_IS_LINEARIZED + gboolean linearized; +#endif info = g_new0 (EvDocumentInfo, 1); @@ -758,7 +761,11 @@ pdf_document_get_info (EvDocument *document) "producer", &(info->producer), "creation-date", &(info->creation_date), "mod-date", &(info->modified_date), +#ifdef HAVE_POPPLER_DOCUMENT_IS_LINEARIZED + "linearized", &linearized, +#else "linearized", &(info->linearized), +#endif "metadata", &metadata, NULL); @@ -864,6 +871,10 @@ pdf_document_get_info (EvDocument *document) info->security = g_strdup (_("No")); } +#ifdef HAVE_POPPLER_DOCUMENT_IS_LINEARIZED + info->linearized = linearized ? g_strdup (_("Yes")) : g_strdup (_("No")); +#endif + return info; } @@ -1212,8 +1223,47 @@ ev_link_from_action (PdfDocument *pdf_document, case POPPLER_ACTION_RENDITION: unimplemented_action = "POPPLER_ACTION_RENDITION"; break; - case POPPLER_ACTION_OCG_STATE: - unimplemented_action = "POPPLER_ACTION_OCG_STATE"; + case POPPLER_ACTION_OCG_STATE: { + GList *on_list = NULL; + GList *off_list = NULL; + GList *toggle_list = NULL; + GList *l, *m; + + for (l = action->ocg_state.state_list; l; l = g_list_next (l)) { + PopplerActionLayer *action_layer = (PopplerActionLayer *)l->data; + + for (m = action_layer->layers; m; m = g_list_next (m)) { + PopplerLayer *layer = (PopplerLayer *)m->data; + EvLayer *ev_layer; + + ev_layer = ev_layer_new (poppler_layer_is_parent (layer), + poppler_layer_get_radio_button_group_id (layer)); + g_object_set_data_full (G_OBJECT (ev_layer), + "poppler-layer", + g_object_ref (layer), + (GDestroyNotify)g_object_unref); + + switch (action_layer->action) { + case POPPLER_ACTION_LAYER_ON: + on_list = g_list_prepend (on_list, ev_layer); + break; + case POPPLER_ACTION_LAYER_OFF: + off_list = g_list_prepend (off_list, ev_layer); + break; + case POPPLER_ACTION_LAYER_TOGGLE: + toggle_list = g_list_prepend (toggle_list, ev_layer); + break; + } + } + } + + /* The action takes the ownership of the lists */ + ev_action = ev_link_action_new_layers_state (g_list_reverse (on_list), + g_list_reverse (off_list), + g_list_reverse (toggle_list)); + + + } break; #endif case POPPLER_ACTION_UNKNOWN: @@ -2021,7 +2071,7 @@ pdf_document_text_get_text_layout (EvDocumentText *selection, { PopplerPage *poppler_page; - g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), NULL); + g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), FALSE); poppler_page = POPPLER_PAGE (page->backend_page);