From cc3d8d20e7ed6d2399627bba622af7ffd98afb20 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?I=C3=B1igo=20Mart=C3=ADnez?= Date: Mon, 10 Dec 2007 16:34:01 +0100 Subject: [PATCH] AnnotPopup support. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Signed-off-by: Iñigo Martínez --- poppler/Annot.cc | 34 ++++++++++++++++++++++++++++++++++ poppler/Annot.h | 21 +++++++++++++++++++++ 2 files changed, 55 insertions(+), 0 deletions(-) diff --git a/poppler/Annot.cc b/poppler/Annot.cc index 48f3248..7ba7510 100644 --- a/poppler/Annot.cc +++ b/poppler/Annot.cc @@ -1686,6 +1686,40 @@ void Annot::draw(Gfx *gfx, GBool printing) { obj.free(); } +//------------------------------------------------------------------------ +// AnnotPopup +//------------------------------------------------------------------------ + +AnnotPopup::AnnotPopup(XRef *xrefA, Dict *acroForm, Dict *dict, Catalog *catalog, Object *obj) : + Annot(xrefA, acroForm, dict, catalog, obj) { + type = typePopup; + initialize(xrefA, acroForm, dict, catalog); +} + +AnnotPopup::~AnnotPopup() { + /* + if (parent) + delete parent; + */ +} + +void AnnotPopup::initialize(XRef *xrefA, Dict *acroForm, Dict *dict, Catalog *catalog) { + Object obj1; + /* + if(dict->lookup("Parent", &obj1)->isDict()) { + parent = NULL; + } else { + parent = NULL; + } + obj1.free(); + */ + if(dict->lookup("Open", &obj1)->isBool()) { + open = obj1.getBool(); + } else { + open = gFalse; + } + obj1.free(); +} //------------------------------------------------------------------------ // Annots diff --git a/poppler/Annot.h b/poppler/Annot.h index bdd8839..26611d2 100644 --- a/poppler/Annot.h +++ b/poppler/Annot.h @@ -284,6 +284,27 @@ private: }; //------------------------------------------------------------------------ +// AnnotPopup +//------------------------------------------------------------------------ + +class AnnotPopup: public Annot { +public: + + AnnotPopup(XRef *xrefA, Dict *acroForm, Dict *dict, Catalog *catalog, Object *obj); + virtual ~AnnotPopup(); + + Dict *getParent() { return parent; } + bool getOpen() { return open; } + +protected: + + void initialize(XRef *xrefA, Dict *acroForm, Dict *dict, Catalog *catalog); + + Dict *parent; // Parent + bool open; // Open +}; + +//------------------------------------------------------------------------ // Annots //------------------------------------------------------------------------ -- 1.5.2.5