[poppler] glib/poppler-form-field.cc glib/poppler-form-field.h glib/reference
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Apr 9 12:41:30 UTC 2020
glib/poppler-form-field.cc | 24 ++++++++++++++++++++++++
glib/poppler-form-field.h | 2 ++
glib/reference/poppler-docs.sgml | 5 +++++
glib/reference/poppler-sections.txt | 1 +
4 files changed, 32 insertions(+)
New commits:
commit 17b01bd15db544dbca989938cbf870f6376a8b18
Author: Nelson Benítez León <nbenitezl at gmail.com>
Date: Sat Mar 28 16:36:32 2020 -0400
PopplerFormField: add getter for alternative ui name
There are pdf files which carry a tooltip string
in this field, so applications need this getter
to show it. API added is:
gchar*
poppler_form_field_get_alternate_ui_name (PopplerFormField *field)
Related Poppler issue #34
Related Evince issue:
https://gitlab.gnome.org/GNOME/evince/issues/842
diff --git a/glib/poppler-form-field.cc b/glib/poppler-form-field.cc
index b7d51e56..a2e735fa 100644
--- a/glib/poppler-form-field.cc
+++ b/glib/poppler-form-field.cc
@@ -384,6 +384,30 @@ poppler_form_field_get_name (PopplerFormField *field)
return tmp ? _poppler_goo_string_to_utf8 (tmp) : nullptr;
}
+/**
+ * poppler_form_field_get_alternate_ui_name:
+ * @field: a #PopplerFormField
+ *
+ * Gets the alternate ui name of @field. This name is also commonly
+ * used by pdf producers/readers to show it as a tooltip when @field area
+ * is hovered by a pointing device (eg. mouse).
+ *
+ * Return value: a new allocated string. It must be freed with g_free() when done.
+ *
+ * Since: 0.88
+ **/
+gchar*
+poppler_form_field_get_alternate_ui_name (PopplerFormField *field)
+{
+ const GooString *tmp;
+
+ g_return_val_if_fail (POPPLER_IS_FORM_FIELD (field), NULL);
+
+ tmp = field->widget->getAlternateUiName();
+
+ return tmp ? _poppler_goo_string_to_utf8 (tmp) : nullptr;
+}
+
/* Text Field */
/**
* poppler_form_field_text_get_text_type:
diff --git a/glib/poppler-form-field.h b/glib/poppler-form-field.h
index 541bc44d..c04334f6 100644
--- a/glib/poppler-form-field.h
+++ b/glib/poppler-form-field.h
@@ -101,6 +101,8 @@ PopplerAction *poppler_form_field_get_action (PopplerFormFie
POPPLER_PUBLIC
PopplerAction *poppler_form_field_get_additional_action (PopplerFormField *field,
PopplerAdditionalActionType type);
+POPPLER_PUBLIC
+gchar *poppler_form_field_get_alternate_ui_name (PopplerFormField *field);
/* Button Field */
POPPLER_PUBLIC
diff --git a/glib/reference/poppler-docs.sgml b/glib/reference/poppler-docs.sgml
index f734ab76..8960aeb8 100644
--- a/glib/reference/poppler-docs.sgml
+++ b/glib/reference/poppler-docs.sgml
@@ -93,6 +93,11 @@
<title>Index of new symbols in 0.78</title>
<xi:include href="xml/api-index-0.78.xml"><xi:fallback /></xi:include>
</index>
+ <index id="api-index-0-88">
+ <title>Index of new symbols in 0.88</title>
+ <xi:include href="xml/api-index-0.88.xml"><xi:fallback /></xi:include>
+ </index>
+
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</book>
diff --git a/glib/reference/poppler-sections.txt b/glib/reference/poppler-sections.txt
index e13b3c1c..596a872c 100644
--- a/glib/reference/poppler-sections.txt
+++ b/glib/reference/poppler-sections.txt
@@ -363,6 +363,7 @@ poppler_form_field_choice_toggle_item
poppler_form_field_choice_unselect_all
poppler_form_field_get_action
poppler_form_field_get_additional_action
+poppler_form_field_get_alternate_ui_name
poppler_form_field_get_field_type
poppler_form_field_get_font_size
poppler_form_field_get_id
More information about the poppler
mailing list