diff options
author | Paul Gardiner <paulg.artifex@glidos.net> | 2012-08-10 10:09:34 +0100 |
---|---|---|
committer | Paul Gardiner <paulg.artifex@glidos.net> | 2012-08-10 10:09:34 +0100 |
commit | 465ddf7b0e7e9ffb8345117dc19fbd9576ad73ff (patch) | |
tree | b692d3e4632b5464d0a7b2b90f3444a968939eea /pdf/pdf_jsimp_v8.cpp | |
parent | 2fba705a0b45b1192578de71c969f056a77bd789 (diff) | |
download | mupdf-465ddf7b0e7e9ffb8345117dc19fbd9576ad73ff.tar.xz |
Forms: handle Keystroke and Validate actions
Diffstat (limited to 'pdf/pdf_jsimp_v8.cpp')
-rw-r--r-- | pdf/pdf_jsimp_v8.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pdf/pdf_jsimp_v8.cpp b/pdf/pdf_jsimp_v8.cpp index 70234d0f..bc5d3b10 100644 --- a/pdf/pdf_jsimp_v8.cpp +++ b/pdf/pdf_jsimp_v8.cpp @@ -143,6 +143,11 @@ public: pobj = Persistent<Value>::New(String::New(str)); } + PDFJSImpObject(double num): utf8(NULL) + { + pobj = Persistent<Value>::New(Number::New(num)); + } + ~PDFJSImpObject() { delete utf8; @@ -372,6 +377,12 @@ extern "C" char *pdf_jsimp_toString_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, char return NULL; } +extern "C" char *pdf_jsimp_fromNumber_cpp(pdf_jsimp *imp, double num, pdf_jsimp_obj **obj) +{ + *obj = reinterpret_cast<pdf_jsimp_obj *>(new PDFJSImpObject(num)); + return NULL; +} + extern "C" char *pdf_jsimp_toNumber_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, double *num) { *num = reinterpret_cast<PDFJSImpObject *>(obj)->toNumber(); |