From 2b8e8c8f4d832a9065ac633dad54ba32c91af5a6 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Sun, 9 Feb 2014 18:31:22 +0200 Subject: [PATCH] glib: Add poppler_structure_element_is_grouping() Implement a method to check whether a structure element is a grouping element, wrapping the StructElement::isGrouping() method. --- glib/poppler-structure-element.cc | 20 ++++++++++++++++++++ glib/poppler-structure-element.h | 1 + 2 files changed, 21 insertions(+) diff --git a/glib/poppler-structure-element.cc b/glib/poppler-structure-element.cc index 72293d9..7053a88 100644 --- a/glib/poppler-structure-element.cc +++ b/glib/poppler-structure-element.cc @@ -813,6 +813,26 @@ poppler_structure_element_is_block (PopplerStructureElement *poppler_structure_e } /** + * poppler_structure_element_is_grouping: + * @poppler_structure_element: A #PopplerStructureElement + * + * Checks whether an element is a grouping element. + * + * Return value: %TRUE if the element is a grouping element, %FALSE + * otherwise. + * + * Since: 0.26 + */ +gboolean +poppler_structure_element_is_grouping (PopplerStructureElement *poppler_structure_element) +{ + g_return_val_if_fail (POPPLER_IS_STRUCTURE_ELEMENT (poppler_structure_element), FALSE); + g_return_val_if_fail (poppler_structure_element->elem != NULL, FALSE); + + return poppler_structure_element->elem->isGrouping (); +} + +/** * poppler_structure_element_get_id: * @poppler_structure_element: A #PopplerStructureElement * diff --git a/glib/poppler-structure-element.h b/glib/poppler-structure-element.h index eefc340..69db98e 100644 --- a/glib/poppler-structure-element.h +++ b/glib/poppler-structure-element.h @@ -300,6 +300,7 @@ gint poppler_structure_element_get_page gboolean poppler_structure_element_is_content (PopplerStructureElement *poppler_structure_element); gboolean poppler_structure_element_is_inline (PopplerStructureElement *poppler_structure_element); gboolean poppler_structure_element_is_block (PopplerStructureElement *poppler_structure_element); +gboolean poppler_structure_element_is_grouping (PopplerStructureElement *poppler_structure_element); gchar *poppler_structure_element_get_id (PopplerStructureElement *poppler_structure_element); gchar *poppler_structure_element_get_title (PopplerStructureElement *poppler_structure_element); gchar *poppler_structure_element_get_abbreviation (PopplerStructureElement *poppler_structure_element); -- 1.8.5.4