Commit 1f8c1fe3 authored by Inigo Martínez's avatar Inigo Martínez Committed by Albert Astals Cid

AnnotPopup support.

Signed-off-by: Inigo Martínez's avatarIñigo Martínez <inigomartinez@gmail.com>
parent 6c83e06f
......@@ -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
......
......@@ -283,6 +283,27 @@ private:
bool hasRef;
};
//------------------------------------------------------------------------
// 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
//------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment