[poppler] 2 commits - glib/demo glib/poppler-annot.cc glib/poppler-annot.h
Carlos Garcia Campos
carlosgc at kemper.freedesktop.org
Mon Jun 1 06:25:04 PDT 2009
glib/demo/annots.c | 7 ++++---
glib/poppler-annot.cc | 20 ++++++++++++++++++++
glib/poppler-annot.h | 1 +
3 files changed, 25 insertions(+), 3 deletions(-)
New commits:
commit 41775d8c0b44bf591d8ff5ede7fad276e8fa9eef
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date: Mon Jun 1 15:24:24 2009 +0200
[glib-demo] Use poppler_annot_markup_has_popup()
diff --git a/glib/demo/annots.c b/glib/demo/annots.c
index b8744a7..7865f1d 100644
--- a/glib/demo/annots.c
+++ b/glib/demo/annots.c
@@ -309,10 +309,11 @@ pgd_annot_view_set_annot_markup (GtkWidget *table,
pgd_table_add_property (GTK_TABLE (table), "<b>Label:</b>", text, row);
g_free (text);
- pgd_table_add_property (GTK_TABLE (table), "<b>Popup is open:</b>",
- poppler_annot_markup_get_popup_is_open (markup) ? "Yes" : "No", row);
+ if (poppler_annot_markup_has_popup (markup)) {
+ pgd_table_add_property (GTK_TABLE (table), "<b>Popup is open:</b>",
+ poppler_annot_markup_get_popup_is_open (markup) ? "Yes" : "No", row);
- if (poppler_annot_markup_get_popup_rectangle (markup, &rect)) {
+ poppler_annot_markup_get_popup_rectangle (markup, &rect);
text = g_strdup_printf ("X1: %.2f, Y1: %.2f, X2: %.2f, Y2: %.2f",
rect.x1, rect.y1, rect.x2, rect.y2);
pgd_table_add_property (GTK_TABLE (table), "<b>Popup Rectangle:</b>", text, row);
commit f542c5294394e837298cb7e7d1d94bb336bfd09d
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date: Mon Jun 1 15:24:04 2009 +0200
[glib] Add poppler_annot_markup_has_popup()
diff --git a/glib/poppler-annot.cc b/glib/poppler-annot.cc
index b433bcf..d1bfbac 100644
--- a/glib/poppler-annot.cc
+++ b/glib/poppler-annot.cc
@@ -413,6 +413,26 @@ poppler_annot_markup_get_label (PopplerAnnotMarkup *poppler_annot)
}
/**
+ * poppler_annot_markup_has_popup:
+ * @poppler_annot: a #PopplerAnnotMarkup
+ *
+ * Return %TRUE if the markup annotation has a popup window associated
+ *
+ * Return value: %TRUE, if @poppler_annot has popup, %FALSE otherwise
+ **/
+gboolean
+poppler_annot_markup_has_popup (PopplerAnnotMarkup *poppler_annot)
+{
+ AnnotMarkup *annot;
+
+ g_return_val_if_fail (POPPLER_IS_ANNOT_MARKUP (poppler_annot), FALSE);
+
+ annot = static_cast<AnnotMarkup *>(POPPLER_ANNOT (poppler_annot)->annot);
+
+ return annot->getPopup () != NULL;
+}
+
+/**
* poppler_annot_markup_get_popup_is_open:
* @poppler_annot: a #PopplerAnnotMarkup
*
diff --git a/glib/poppler-annot.h b/glib/poppler-annot.h
index 9689e82..4648027 100644
--- a/glib/poppler-annot.h
+++ b/glib/poppler-annot.h
@@ -144,6 +144,7 @@ PopplerColor *poppler_annot_get_color (
/* PopplerAnnotMarkup */
GType poppler_annot_markup_get_type (void) G_GNUC_CONST;
gchar *poppler_annot_markup_get_label (PopplerAnnotMarkup *poppler_annot);
+gboolean poppler_annot_markup_has_popup (PopplerAnnotMarkup *poppler_annot);
gboolean poppler_annot_markup_get_popup_is_open (PopplerAnnotMarkup *poppler_annot);
gboolean poppler_annot_markup_get_popup_rectangle (PopplerAnnotMarkup *poppler_annot,
PopplerRectangle *poppler_rect);
More information about the poppler
mailing list