From b03eb1295ceeee90b402652f40dc2257a3014f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Poo-Caama=C3=B1o?= Date: Thu, 31 Jan 2013 16:57:12 -0800 Subject: [PATCH 5/8] glib: Add PopplerAnnotTextUnderline object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Germán Poo-Caamaño --- glib/poppler-annot.cc | 37 +++++++++++++++++++++++++++++++++++++ glib/poppler-annot.h | 10 ++++++++++ glib/poppler-page.cc | 2 ++ glib/poppler-private.h | 2 ++ glib/poppler.h | 1 + 5 files changed, 52 insertions(+) diff --git a/glib/poppler-annot.cc b/glib/poppler-annot.cc index 86108c2..c738a14 100644 --- a/glib/poppler-annot.cc +++ b/glib/poppler-annot.cc @@ -34,6 +34,7 @@ typedef struct _PopplerAnnotFreeTextClass PopplerAnnotFreeTextClass; typedef struct _PopplerAnnotTextClass PopplerAnnotTextClass; typedef struct _PopplerAnnotTextMarkupClass PopplerAnnotTextMarkupClass; typedef struct _PopplerAnnotTextHighlightClass PopplerAnnotTextHighlightClass; +typedef struct _PopplerAnnotTextUnderlineClass PopplerAnnotTextUnderlineClass; typedef struct _PopplerAnnotFileAttachmentClass PopplerAnnotFileAttachmentClass; typedef struct _PopplerAnnotMovieClass PopplerAnnotMovieClass; typedef struct _PopplerAnnotScreenClass PopplerAnnotScreenClass; @@ -83,6 +84,16 @@ struct _PopplerAnnotTextHighlightClass PopplerAnnotMarkupClass parent_class; }; +struct _PopplerAnnotTextUnderline +{ + PopplerAnnotMarkup parent_instance; +}; + +struct _PopplerAnnotTextUnderlineClass +{ + PopplerAnnotMarkupClass parent_class; +}; + struct _PopplerAnnotFreeText { PopplerAnnotMarkup parent_instance; @@ -132,6 +143,7 @@ G_DEFINE_TYPE (PopplerAnnot, poppler_annot, G_TYPE_OBJECT) G_DEFINE_TYPE (PopplerAnnotMarkup, poppler_annot_markup, POPPLER_TYPE_ANNOT) G_DEFINE_TYPE (PopplerAnnotTextMarkup, poppler_annot_text_markup, POPPLER_TYPE_ANNOT_MARKUP) G_DEFINE_TYPE (PopplerAnnotTextHighlight, poppler_annot_text_highlight, POPPLER_TYPE_ANNOT_TEXT_MARKUP) +G_DEFINE_TYPE (PopplerAnnotTextUnderline, poppler_annot_text_underline, POPPLER_TYPE_ANNOT_TEXT_MARKUP) G_DEFINE_TYPE (PopplerAnnotText, poppler_annot_text, POPPLER_TYPE_ANNOT_MARKUP) G_DEFINE_TYPE (PopplerAnnotFreeText, poppler_annot_free_text, POPPLER_TYPE_ANNOT_MARKUP) G_DEFINE_TYPE (PopplerAnnotFileAttachment, poppler_annot_file_attachment, POPPLER_TYPE_ANNOT_MARKUP) @@ -326,6 +338,31 @@ poppler_annot_text_highlight_class_init (PopplerAnnotTextHighlightClass *klass) { } +/** + * poppler_annot_text_underline_new: + * + * Creates a new empty #PopplerAnnotTextUnderline. + * + * Return value: a newly #PopplerAnnotTextUnderline annotation + * + * Since: 0.24 + **/ +PopplerAnnot * +_poppler_annot_text_underline_new (Annot *annot) +{ + return _poppler_create_annot (POPPLER_TYPE_ANNOT_TEXT_UNDERLINE, annot); +} + +static void +poppler_annot_text_underline_init (PopplerAnnotTextUnderline *poppler_annot) +{ +} + +static void +poppler_annot_text_underline_class_init (PopplerAnnotTextUnderlineClass *klass) +{ +} + static void poppler_annot_free_text_init (PopplerAnnotFreeText *poppler_annot) { diff --git a/glib/poppler-annot.h b/glib/poppler-annot.h index 9597596..08b4851 100644 --- a/glib/poppler-annot.h +++ b/glib/poppler-annot.h @@ -46,6 +46,10 @@ G_BEGIN_DECLS #define POPPLER_ANNOT_TEXT_HIGHLIGHT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ANNOT_TEXT_HIGHLIGHT, PopplerAnnotTextHighlight)) #define POPPLER_IS_ANNOT_TEXT_HIGHLIGHT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_ANNOT_TEXT_HIGHLIGHT)) +#define POPPLER_TYPE_ANNOT_TEXT_UNDERLINE (poppler_annot_text_underline_get_type ()) +#define POPPLER_ANNOT_TEXT_UNDERLINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ANNOT_TEXT_UNDERLINE, PopplerAnnotTextUnderline)) +#define POPPLER_IS_ANNOT_TEXT_UNDERLINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_ANNOT_TEXT_UNDERLINE)) + #define POPPLER_TYPE_ANNOT_FREE_TEXT (poppler_annot_free_text_get_type ()) #define POPPLER_ANNOT_FREE_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ANNOT_FREE_TEXT, PopplerAnnotFreeText)) #define POPPLER_IS_ANNOT_FREE_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_ANNOT_FREE_TEXT)) @@ -266,6 +270,12 @@ PopplerAnnot *poppler_annot_text_highlight_new ( PopplerAnnotQuadrilateral *quads, gint *length_quads); +/* PopplerAnnotTextUnderline */ +GType poppler_annot_text_underline_get_type (void) G_GNUC_CONST; +PopplerAnnot *poppler_annot_text_underline_new (PopplerDocument *doc, + PopplerAnnotQuadrilateral *quads, + gint *length_quads); + /* PopplerAnnotFreeText */ GType poppler_annot_free_text_get_type (void) G_GNUC_CONST; PopplerAnnotFreeTextQuadding poppler_annot_free_text_get_quadding (PopplerAnnotFreeText *poppler_annot); diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc index c5a3468..265cf57 100644 --- a/glib/poppler-page.cc +++ b/glib/poppler-page.cc @@ -1376,6 +1376,8 @@ poppler_page_get_annot_mapping (PopplerPage *page) mapping->annot = _poppler_annot_text_highlight_new (annot); break; case Annot::typeUnderline: + mapping->annot = _poppler_annot_text_underline_new (annot); + break; case Annot::typeSquiggly: case Annot::typeStrikeOut: mapping->annot = _poppler_annot_text_markup_new (annot); diff --git a/glib/poppler-private.h b/glib/poppler-private.h index c742e14..a7ac6e8 100644 --- a/glib/poppler-private.h +++ b/glib/poppler-private.h @@ -119,6 +119,8 @@ PopplerAnnot *_poppler_annot_text_new (Annot *annot); PopplerAnnot *_poppler_annot_free_text_new (Annot *annot); PopplerAnnot *_poppler_annot_text_markup_new (Annot *annot); PopplerAnnot *_poppler_annot_text_highlight_new (Annot *annot); +PopplerAnnot *_poppler_annot_text_underline_new (Annot *annot); +PopplerAnnot *_poppler_annot_text_squiggly_new (Annot *annot); PopplerAnnot *_poppler_annot_file_attachment_new (Annot *annot); PopplerAnnot *_poppler_annot_movie_new (Annot *annot); PopplerAnnot *_poppler_annot_screen_new (Annot *annot); diff --git a/glib/poppler.h b/glib/poppler.h index 751e429..49e8d29 100644 --- a/glib/poppler.h +++ b/glib/poppler.h @@ -199,6 +199,7 @@ typedef struct _PopplerAnnotMarkup PopplerAnnotMarkup; typedef struct _PopplerAnnotText PopplerAnnotText; typedef struct _PopplerAnnotTextMarkup PopplerAnnotTextMarkup; typedef struct _PopplerAnnotTextHighlight PopplerAnnotTextHighlight; +typedef struct _PopplerAnnotTextUnderline PopplerAnnotTextUnderline; typedef struct _PopplerAnnotFreeText PopplerAnnotFreeText; typedef struct _PopplerAnnotFileAttachment PopplerAnnotFileAttachment; typedef struct _PopplerAnnotMovie PopplerAnnotMovie; -- 1.7.9.5