Commit 69a2ecfa authored by Pino Toscano's avatar Pino Toscano

Add the Stamp annotation type.

parent 97be4332
...@@ -3284,6 +3284,32 @@ void AnnotScreen::initialize(XRef *xrefA, Catalog *catalog, Dict* dict) { ...@@ -3284,6 +3284,32 @@ void AnnotScreen::initialize(XRef *xrefA, Catalog *catalog, Dict* dict) {
} }
//------------------------------------------------------------------------
// AnnotStamp
//------------------------------------------------------------------------
AnnotStamp::AnnotStamp(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj) :
AnnotMarkup(xrefA, dict, catalog, obj) {
type = typeStamp;
initialize(xrefA, catalog, dict);
}
AnnotStamp::~AnnotStamp() {
delete icon;
}
void AnnotStamp::initialize(XRef *xrefA, Catalog *catalog, Dict* dict) {
Object obj1;
if (dict->lookup("Name", &obj1)->isName()) {
icon = new GooString(obj1.getName());
} else {
icon = new GooString("Draft");
}
obj1.free();
}
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// Annots // Annots
//------------------------------------------------------------------------ //------------------------------------------------------------------------
...@@ -3355,7 +3381,7 @@ Annot *Annots::createAnnot(XRef *xref, Dict* dict, Catalog *catalog, Object *obj ...@@ -3355,7 +3381,7 @@ Annot *Annots::createAnnot(XRef *xref, Dict* dict, Catalog *catalog, Object *obj
} else if (!typeName->cmp("StrikeOut")) { } else if (!typeName->cmp("StrikeOut")) {
annot = new Annot(xref, dict, catalog, obj); annot = new Annot(xref, dict, catalog, obj);
} else if (!typeName->cmp("Stamp")) { } else if (!typeName->cmp("Stamp")) {
annot = new Annot(xref, dict, catalog, obj); annot = new AnnotStamp(xref, dict, catalog, obj);
} else if (!typeName->cmp("Caret")) { } else if (!typeName->cmp("Caret")) {
annot = new Annot(xref, dict, catalog, obj); annot = new Annot(xref, dict, catalog, obj);
} else if (!typeName->cmp("Ink")) { } else if (!typeName->cmp("Ink")) {
......
...@@ -907,6 +907,26 @@ protected: ...@@ -907,6 +907,26 @@ protected:
AnnotQuadrilaterals *quadrilaterals; // QuadPoints AnnotQuadrilaterals *quadrilaterals; // QuadPoints
}; };
//------------------------------------------------------------------------
// AnnotStamp
//------------------------------------------------------------------------
class AnnotStamp: public AnnotMarkup {
public:
AnnotStamp(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
~AnnotStamp();
// getters
GooString *getIcon() const { return icon; }
private:
void initialize(XRef *xrefA, Catalog *catalog, Dict *dict);
GooString *icon; // Name (Default Draft)
};
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// AnnotWidget // AnnotWidget
//------------------------------------------------------------------------ //------------------------------------------------------------------------
......
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