From 9405aa7ed83fcbda8c39acee8680ae68505c8ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Aliste?= Date: Sat, 8 Dec 2012 10:33:04 -0300 Subject: [PATCH 1/2] glib: Add poppler_annot_set_flags --- glib/poppler-annot.cc | 22 ++++++++++++++++++++++ glib/poppler-annot.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/glib/poppler-annot.cc b/glib/poppler-annot.cc index 1627d25..a2cf203 100644 --- a/glib/poppler-annot.cc +++ b/glib/poppler-annot.cc @@ -508,6 +508,28 @@ poppler_annot_get_flags (PopplerAnnot *poppler_annot) } /** + * poppler_annot_set_flags: + * @poppler_annot: a #PopplerAnnot + * @flags: a #PopplerAnnotFlag + * + * Sets the flag field specifying various characteristics of the + * @poppler_annot. + * + * Since: 0.22 + **/ +void +poppler_annot_set_flags (PopplerAnnot *poppler_annot, PopplerAnnotFlag flags) +{ + g_return_if_fail (POPPLER_IS_ANNOT (poppler_annot)); + + if (poppler_annot_get_flags (poppler_annot) == flags) + return; + + poppler_annot->annot->setFlags ((guint) flags); +} + + +/** * poppler_annot_get_color: * @poppler_annot: a #PopplerAnnot * diff --git a/glib/poppler-annot.h b/glib/poppler-annot.h index 17440fb..88f4e46 100644 --- a/glib/poppler-annot.h +++ b/glib/poppler-annot.h @@ -162,6 +162,8 @@ void poppler_annot_set_contents ( gchar *poppler_annot_get_name (PopplerAnnot *poppler_annot); gchar *poppler_annot_get_modified (PopplerAnnot *poppler_annot); PopplerAnnotFlag poppler_annot_get_flags (PopplerAnnot *poppler_annot); +void poppler_annot_set_flags (PopplerAnnot *poppler_annot, + PopplerAnnotFlag flags); PopplerColor *poppler_annot_get_color (PopplerAnnot *poppler_annot); void poppler_annot_set_color (PopplerAnnot *poppler_annot, PopplerColor *poppler_color); -- 1.8.0.1