From 66ccd744ba783e912484c50ff7963518d6536551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Poo-Caama=C3=B1o?= Date: Thu, 31 Jan 2013 14:08:55 -0800 Subject: [PATCH 7/8] glib: Add PopplerAnnotTextStrikeOut 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 | 1 + glib/poppler.h | 1 + 5 files changed, 50 insertions(+), 1 deletion(-) diff --git a/glib/poppler-annot.cc b/glib/poppler-annot.cc index 72cec14..a2c016a 100644 --- a/glib/poppler-annot.cc +++ b/glib/poppler-annot.cc @@ -36,6 +36,7 @@ typedef struct _PopplerAnnotTextMarkupClass PopplerAnnotTextMarkupClass; typedef struct _PopplerAnnotTextHighlightClass PopplerAnnotTextHighlightClass; typedef struct _PopplerAnnotTextUnderlineClass PopplerAnnotTextUnderlineClass; typedef struct _PopplerAnnotTextSquigglyClass PopplerAnnotTextSquigglyClass; +typedef struct _PopplerAnnotTextStrikeOutClass PopplerAnnotTextStrikeOutClass; typedef struct _PopplerAnnotFileAttachmentClass PopplerAnnotFileAttachmentClass; typedef struct _PopplerAnnotMovieClass PopplerAnnotMovieClass; typedef struct _PopplerAnnotScreenClass PopplerAnnotScreenClass; @@ -105,6 +106,16 @@ struct _PopplerAnnotTextSquigglyClass PopplerAnnotMarkupClass parent_class; }; +struct _PopplerAnnotTextStrikeOut +{ + PopplerAnnotMarkup parent_instance; +}; + +struct _PopplerAnnotTextStrikeOutClass +{ + PopplerAnnotMarkupClass parent_class; +}; + struct _PopplerAnnotFreeText { PopplerAnnotMarkup parent_instance; @@ -156,6 +167,7 @@ G_DEFINE_TYPE (PopplerAnnotTextMarkup, poppler_annot_text_markup, POPPLER_TYPE_A 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 (PopplerAnnotTextSquiggly, poppler_annot_text_squiggly, POPPLER_TYPE_ANNOT_TEXT_MARKUP) +G_DEFINE_TYPE (PopplerAnnotTextStrikeOut, poppler_annot_text_strike_out, 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) @@ -400,6 +412,31 @@ poppler_annot_text_squiggly_class_init (PopplerAnnotTextSquigglyClass *klass) { } +/** + * poppler_annot_text_strike_out_new: + * + * Creates a new empty #PopplerAnnotTextStrikeOut. + * + * Return value: a newly #PopplerAnnotTextStrikeOut annotation + * + * Since: 0.24 + **/ +PopplerAnnot * +_poppler_annot_text_strike_out_new (Annot *annot) +{ + return _poppler_create_annot (POPPLER_TYPE_ANNOT_TEXT_STRIKE_OUT, annot); +} + +static void +poppler_annot_text_strike_out_init (PopplerAnnotTextStrikeOut *poppler_annot) +{ +} + +static void +poppler_annot_text_strike_out_class_init (PopplerAnnotTextStrikeOutClass *klass) +{ +} + static void poppler_annot_free_text_init (PopplerAnnotFreeText *poppler_annot) { diff --git a/glib/poppler-annot.h b/glib/poppler-annot.h index 868c9d6..675b39c 100644 --- a/glib/poppler-annot.h +++ b/glib/poppler-annot.h @@ -54,6 +54,10 @@ G_BEGIN_DECLS #define POPPLER_ANNOT_TEXT_SQUIGGLY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ANNOT_TEXT_SQUIGGLY, PopplerAnnotTextSquiggly)) #define POPPLER_IS_ANNOT_TEXT_SQUIGGLY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_ANNOT_TEXT_SQUIGGLY)) +#define POPPLER_TYPE_ANNOT_TEXT_STRIKE_OUT (poppler_annot_text_strike_out_get_type ()) +#define POPPLER_ANNOT_TEXT_STRIKE_OUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ANNOT_TEXT_STRIKE_OUT, PopplerAnnotTextSrikeOut)) +#define POPPLER_IS_ANNOT_TEXT_STRIKE_OUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_ANNOT_TEXT_STRIKE_OUT)) + #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)) @@ -286,6 +290,12 @@ PopplerAnnot *poppler_annot_text_squiggly_new ( PopplerAnnotQuadrilateral *quads, gint *length_quads); +/* PopplerAnnotTextStrikeOut */ +GType poppler_annot_text_strike_out_get_type (void) G_GNUC_CONST; +PopplerAnnot *poppler_annot_text_strike_out_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 80980b4..7667336 100644 --- a/glib/poppler-page.cc +++ b/glib/poppler-page.cc @@ -1382,7 +1382,7 @@ poppler_page_get_annot_mapping (PopplerPage *page) mapping->annot = _poppler_annot_text_squiggly_new (annot); break; case Annot::typeStrikeOut: - mapping->annot = _poppler_annot_text_markup_new (annot); + mapping->annot = _poppler_annot_text_strike_out_new (annot); break; default: mapping->annot = _poppler_annot_new (annot); diff --git a/glib/poppler-private.h b/glib/poppler-private.h index a7ac6e8..ee80425 100644 --- a/glib/poppler-private.h +++ b/glib/poppler-private.h @@ -121,6 +121,7 @@ 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_text_strike_out_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 7bccd1f..a428410 100644 --- a/glib/poppler.h +++ b/glib/poppler.h @@ -201,6 +201,7 @@ typedef struct _PopplerAnnotTextMarkup PopplerAnnotTextMarkup; typedef struct _PopplerAnnotTextHighlight PopplerAnnotTextHighlight; typedef struct _PopplerAnnotTextUnderline PopplerAnnotTextUnderline; typedef struct _PopplerAnnotTextSquiggly PopplerAnnotTextSquiggly; +typedef struct _PopplerAnnotTextStrikeOut PopplerAnnotTextStrikeOut; typedef struct _PopplerAnnotFreeText PopplerAnnotFreeText; typedef struct _PopplerAnnotFileAttachment PopplerAnnotFileAttachment; typedef struct _PopplerAnnotMovie PopplerAnnotMovie; -- 1.7.9.5