static VALUE rg_initialize(VALUE self, VALUE document) { PopplerIndexIter *iter; iter = poppler_index_iter_new(RVAL2POPPLERDOCUMENT(document)); G_INITIALIZE(self, iter); poppler_index_iter_free(iter); rb_ivar_set(self, id_valid, CBOOL2RVAL(iter)); return Qnil; }
GtkTreeModel * xv_doc_get_index_tree_model (struct xv_doc_t *doc) { PopplerIndexIter *index_iter; if (doc->model) { return doc->model; } index_iter = poppler_index_iter_new(doc->doc); if(index_iter) { doc->model = GTK_TREE_MODEL(gtk_tree_store_new(2, G_TYPE_STRING, G_TYPE_POINTER)); xv_doc_build_index(doc->model, NULL, index_iter); poppler_index_iter_free(index_iter); } else { printf ("This document does not contain any index"); } return doc->model; }
void test_action (void) { PopplerIndexIter *iter; document = load_document ("slide.pdf"); iter = poppler_index_iter_new (document); cut_assert_not_null (iter); collect_action (iter); poppler_index_iter_free (iter); #define APPEND(type) \ expected_action_types = \ g_list_append (expected_action_types, GINT_TO_POINTER (type)) APPEND(POPPLER_ACTION_GOTO_DEST); APPEND(POPPLER_ACTION_GOTO_DEST); #undef APPEND gcut_assert_equal_list_enum (POPPLER_TYPE_ACTION_TYPE, expected_action_types, actual_action_types); }
static void read_outline (PopplerDocument *document, TrackerResource *metadata) { PopplerIndexIter *index; GString *toc = NULL; index = poppler_index_iter_new (document); if (!index) { return; } read_toc (index, &toc); if (toc) { if (toc->len > 0) { tracker_resource_set_string (metadata, "nfo:tableOfContents", toc->str); } g_string_free (toc, TRUE); } }
static void read_outline (PopplerDocument *document, TrackerSparqlBuilder *metadata) { PopplerIndexIter *index; GString *toc = NULL; index = poppler_index_iter_new (document); if (!index) { return; } read_toc (index, &toc); if (toc) { if (toc->len > 0) { tracker_sparql_builder_predicate (metadata, "nfo:tableOfContents"); tracker_sparql_builder_object_unvalidated (metadata, toc->str); } g_string_free (toc, TRUE); } }