summaryrefslogtreecommitdiff
path: root/pdf/pdf_jsimp_v8.cpp
diff options
context:
space:
mode:
authorPaul Gardiner <paulg.artifex@glidos.net>2012-08-10 10:09:34 +0100
committerPaul Gardiner <paulg.artifex@glidos.net>2012-08-10 10:09:34 +0100
commit465ddf7b0e7e9ffb8345117dc19fbd9576ad73ff (patch)
treeb692d3e4632b5464d0a7b2b90f3444a968939eea /pdf/pdf_jsimp_v8.cpp
parent2fba705a0b45b1192578de71c969f056a77bd789 (diff)
downloadmupdf-465ddf7b0e7e9ffb8345117dc19fbd9576ad73ff.tar.xz
Forms: handle Keystroke and Validate actions
Diffstat (limited to 'pdf/pdf_jsimp_v8.cpp')
-rw-r--r--pdf/pdf_jsimp_v8.cpp11
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();