#include "config.h"
-#ifdef HAVE_POPPLER_FORM_FIELD_BUTTON_GET_BUTTON_TYPE
-#define HAVE_FORMS
-#endif
-
#include <math.h>
#include <string.h>
#include <gtk/gtk.h>
static void pdf_document_search_free (PdfDocumentSearch *search);
static void pdf_print_context_free (PdfPrintContext *ctx);
-#ifdef HAVE_FORMS
G_DEFINE_TYPE_WITH_CODE (PdfDocument, pdf_document, G_TYPE_OBJECT,
{
G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT,
G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_TRANSITION,
pdf_document_page_transition_iface_init);
});
-#else /* !HAVE_FORMS */
-G_DEFINE_TYPE_WITH_CODE (PdfDocument, pdf_document, G_TYPE_OBJECT,
- {
- G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT,
- pdf_document_document_iface_init);
- G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_SECURITY,
- pdf_document_security_iface_init);
- G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
- pdf_document_document_thumbnails_iface_init);
- G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_LINKS,
- pdf_document_document_links_iface_init);
- G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_IMAGES,
- pdf_document_document_images_iface_init);
- G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FONTS,
- pdf_document_document_fonts_iface_init);
- G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FIND,
- pdf_document_find_iface_init);
- G_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER,
- pdf_document_file_exporter_iface_init);
- G_IMPLEMENT_INTERFACE (EV_TYPE_SELECTION,
- pdf_selection_iface_init);
- G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_TRANSITION,
- pdf_document_page_transition_iface_init);
- });
-#endif /* HAVE_FORMS */
static void
set_rc_data (PdfDocument *pdf_document,
r.y2 = height - points->y1;
retval = poppler_page_get_text (poppler_page,
-#if 0
(PopplerSelectionStyle)style,
-#endif
&r);
g_object_unref (poppler_page);
retval = poppler_page_get_selection_region ((PopplerPage *)rc->data,
rc->scale,
-#if 0
(PopplerSelectionStyle)style,
-#endif
(PopplerRectangle *) points);
return retval;
}
points.y1 = 0.0;
poppler_page_get_size (poppler_page, &(points.x2), &(points.y2));
retval = poppler_page_get_selection_region (poppler_page, 1.0,
-#if 0
POPPLER_SELECTION_GLYPH,
-#endif
&points);
g_object_unref (poppler_page);
rect->y2 = poppler_rect.y2;
}
-#ifdef HAVE_FORMS
static EvFormField *
ev_form_field_from_poppler_field (PopplerFormField *poppler_field)
{
field_text->do_scroll = poppler_form_field_text_do_scroll (poppler_field);
field_text->is_rich_text = poppler_form_field_text_is_rich_text (poppler_field);
field_text->is_password = poppler_form_field_text_is_password (poppler_field);
-
-#ifdef HAVE_POPPLER_FORM_FIELD_TEXT_GET_MAX_LEN
field_text->max_len = poppler_form_field_text_get_max_len (poppler_field);
-#endif
field_text->text = poppler_form_field_text_get_text (poppler_field);
}
iface->form_field_choice_set_text = pdf_document_forms_form_field_choice_set_text;
iface->form_field_choice_get_text = pdf_document_forms_form_field_choice_get_text;
}
-#endif /* HAVE_FORMS */
+