summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-02-14 14:14:13 +0100
committerTor Andersson <tor.andersson@artifex.com>2014-02-14 14:14:39 +0100
commit520dbcb30f9f303fa13f4f2dbd5e7589dd5d7ca6 (patch)
tree61990a1b6f01d6a1530b5366cd0694008f86eff8 /source
parent460c7c54f83c19ac84f54b8d79f71fcfa0b73d91 (diff)
downloadmupdf-520dbcb30f9f303fa13f4f2dbd5e7589dd5d7ca6.tar.xz
pdf-js: Pass a name string to type constructor.
Diffstat (limited to 'source')
-rw-r--r--source/pdf/js/pdf-js.c8
-rw-r--r--source/pdf/js/pdf-jsimp-cpp.c2
-rw-r--r--source/pdf/js/pdf-jsimp-jscore.c3
3 files changed, 6 insertions, 7 deletions
diff --git a/source/pdf/js/pdf-js.c b/source/pdf/js/pdf-js.c
index ee7f979b..b6129bfa 100644
--- a/source/pdf/js/pdf-js.c
+++ b/source/pdf/js/pdf-js.c
@@ -711,7 +711,7 @@ static void declare_dom(pdf_js *js)
pdf_jsimp *imp = js->imp;
/* Create the document type */
- js->doctype = pdf_jsimp_new_type(imp, NULL);
+ js->doctype = pdf_jsimp_new_type(imp, NULL, "Document");
pdf_jsimp_addmethod(imp, js->doctype, "getField", doc_getField);
pdf_jsimp_addmethod(imp, js->doctype, "resetForm", doc_resetForm);
pdf_jsimp_addmethod(imp, js->doctype, "print", doc_print);
@@ -720,14 +720,14 @@ static void declare_dom(pdf_js *js)
pdf_jsimp_addproperty(imp, js->doctype, "app", doc_getApp, doc_setApp);
/* Create the event type */
- js->eventtype = pdf_jsimp_new_type(imp, NULL);
+ js->eventtype = pdf_jsimp_new_type(imp, NULL, "Event");
pdf_jsimp_addproperty(imp, js->eventtype, "target", event_getTarget, event_setTarget);
pdf_jsimp_addproperty(imp, js->eventtype, "value", event_getValue, event_setValue);
pdf_jsimp_addproperty(imp, js->eventtype, "willCommit", event_getWillCommit, event_setWillCommit);
pdf_jsimp_addproperty(imp, js->eventtype, "rc", event_getRC, event_setRC);
/* Create the field type */
- js->fieldtype = pdf_jsimp_new_type(imp, NULL);
+ js->fieldtype = pdf_jsimp_new_type(imp, NULL, "Field");
pdf_jsimp_addproperty(imp, js->fieldtype, "value", field_getValue, field_setValue);
pdf_jsimp_addproperty(imp, js->fieldtype, "borderStyle", field_getBorderStyle, field_setBorderStyle);
pdf_jsimp_addproperty(imp, js->fieldtype, "textColor", field_getTextColor, field_setTextColor);
@@ -737,7 +737,7 @@ static void declare_dom(pdf_js *js)
pdf_jsimp_addmethod(imp, js->fieldtype, "buttonSetCaption", field_buttonSetCaption);
/* Create the app type */
- js->apptype = pdf_jsimp_new_type(imp, NULL);
+ js->apptype = pdf_jsimp_new_type(imp, NULL, "Application");
pdf_jsimp_addmethod(imp, js->apptype, "alert", app_alert);
pdf_jsimp_addmethod(imp, js->apptype, "execDialog", app_execDialog);
pdf_jsimp_addmethod(imp, js->apptype, "execMenuItem", app_execMenuItem);
diff --git a/source/pdf/js/pdf-jsimp-cpp.c b/source/pdf/js/pdf-jsimp-cpp.c
index 7e8031a6..a23c15f6 100644
--- a/source/pdf/js/pdf-jsimp-cpp.c
+++ b/source/pdf/js/pdf-jsimp-cpp.c
@@ -26,7 +26,7 @@ void pdf_drop_jsimp(pdf_jsimp *imp)
}
}
-pdf_jsimp_type *pdf_jsimp_new_type(pdf_jsimp *imp, pdf_jsimp_dtr *dtr)
+pdf_jsimp_type *pdf_jsimp_new_type(pdf_jsimp *imp, pdf_jsimp_dtr *dtr, char *name)
{
pdf_jsimp_type *type = NULL;
const char *err = pdf_jsimp_new_type_cpp(imp, dtr, &type);
diff --git a/source/pdf/js/pdf-jsimp-jscore.c b/source/pdf/js/pdf-jsimp-jscore.c
index 55808b4c..364b08b5 100644
--- a/source/pdf/js/pdf-jsimp-jscore.c
+++ b/source/pdf/js/pdf-jsimp-jscore.c
@@ -293,12 +293,11 @@ void pdf_drop_jsimp(pdf_jsimp *imp)
}
}
-pdf_jsimp_type *pdf_jsimp_new_type(pdf_jsimp *imp, pdf_jsimp_dtr *dtr)
+pdf_jsimp_type *pdf_jsimp_new_type(pdf_jsimp *imp, pdf_jsimp_dtr *dtr, char *name)
{
pdf_jsimp_type *type = fz_malloc_struct(imp->ctx, pdf_jsimp_type);
type->imp = imp;
type->dtr = dtr;
-
return type;
}