[poppler] glib/poppler-annot.cc glib/poppler-annot.h glib/reference

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sat Apr 18 03:21:54 PDT 2015


 glib/poppler-annot.cc               |   31 +++++++++++++++++++++++++++++++
 glib/poppler-annot.h                |    2 ++
 glib/reference/poppler-sections.txt |    1 +
 3 files changed, 34 insertions(+)

New commits:
commit 056ee89122385bc2df7cb2c05e1cb1770af8ecce
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sat Apr 18 12:16:56 2015 +0200

    glib: Add poppler_annot_markup_set_popup_rectangle()
    
    It updates the popup rectangle of a markup annotation that already has a
    popup associated.

diff --git a/glib/poppler-annot.cc b/glib/poppler-annot.cc
index e87bce3..15d48c5 100644
--- a/glib/poppler-annot.cc
+++ b/glib/poppler-annot.cc
@@ -1251,6 +1251,37 @@ poppler_annot_markup_get_popup_rectangle (PopplerAnnotMarkup *poppler_annot,
 }
 
 /**
+ * poppler_annot_markup_set_popup_rectangle:
+ * @poppler_annot: a #PopplerAnnotMarkup
+ * @poppler_rect: a #PopplerRectangle to set
+ *
+ * Sets the rectangle of the popup window related to @poppler_annot.
+ * This doesn't have any effect if @poppler_annot doesn't have a
+ * popup associated, use poppler_annot_markup_set_popup() to associate
+ * a popup window to a #PopplerAnnotMarkup.
+ *
+ * Since: 0.33
+ */
+void
+poppler_annot_markup_set_popup_rectangle (PopplerAnnotMarkup *poppler_annot,
+                                          PopplerRectangle   *poppler_rect)
+{
+        AnnotMarkup *annot;
+        Annot *annot_popup;
+
+        g_return_if_fail (POPPLER_IS_ANNOT_MARKUP (poppler_annot));
+        g_return_if_fail (poppler_rect != NULL);
+
+        annot = static_cast<AnnotMarkup *>(POPPLER_ANNOT (poppler_annot)->annot);
+        annot_popup = annot->getPopup ();
+        if (!annot_popup)
+                return;
+
+        annot_popup->setRect (poppler_rect->x1, poppler_rect->y1,
+                              poppler_rect->x2, poppler_rect->y2);
+}
+
+/**
  * poppler_annot_markup_get_opacity:
  * @poppler_annot: a #PopplerAnnotMarkup
  *
diff --git a/glib/poppler-annot.h b/glib/poppler-annot.h
index 441563e..44ab5e3 100644
--- a/glib/poppler-annot.h
+++ b/glib/poppler-annot.h
@@ -202,6 +202,8 @@ void                          poppler_annot_markup_set_popup_is_open           (
 										gboolean            is_open);
 gboolean                      poppler_annot_markup_get_popup_rectangle         (PopplerAnnotMarkup *poppler_annot,
 										PopplerRectangle   *poppler_rect);
+void                          poppler_annot_markup_set_popup_rectangle         (PopplerAnnotMarkup *poppler_annot,
+                                                                                PopplerRectangle   *poppler_rect);
 gdouble                       poppler_annot_markup_get_opacity                 (PopplerAnnotMarkup *poppler_annot);
 void                          poppler_annot_markup_set_opacity                 (PopplerAnnotMarkup *poppler_annot,
 										gdouble             opacity);
diff --git a/glib/reference/poppler-sections.txt b/glib/reference/poppler-sections.txt
index 04ecb7e..bbac42d 100644
--- a/glib/reference/poppler-sections.txt
+++ b/glib/reference/poppler-sections.txt
@@ -401,6 +401,7 @@ poppler_annot_markup_set_popup
 poppler_annot_markup_get_popup_is_open
 poppler_annot_markup_set_popup_is_open
 poppler_annot_markup_get_popup_rectangle
+poppler_annot_markup_set_popup_rectangle
 poppler_annot_markup_get_date
 poppler_annot_markup_get_external_data
 poppler_annot_markup_get_reply_to


More information about the poppler mailing list