blob: 6632db5bb1ff999028e1446a45219a9feba953b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#include "fitz-internal.h"
#include "mupdf-internal.h"
struct pdf_js_s
{
fz_context *ctx;
pdf_js_event event;
};
pdf_js *pdf_new_js(pdf_document *doc)
{
fz_context *ctx = doc->ctx;
pdf_js *js = fz_malloc_struct(ctx, pdf_js);
fz_try(ctx)
{
js->ctx = doc->ctx;
js->event.target = NULL;
js->event.value = fz_strdup(ctx, "");
js->event.rc = 1;
}
fz_catch(ctx)
{
pdf_drop_js(js);
}
return js;
}
void pdf_drop_js(pdf_js *js)
{
if (js)
{
fz_free(js->ctx, js->event.value);
fz_free(js->ctx, js);
}
}
void pdf_js_setup_event(pdf_js *js, pdf_js_event *e)
{
}
pdf_js_event *pdf_js_get_event(pdf_js *js)
{
return js ? &js->event : NULL;
}
void pdf_js_execute(pdf_js *js, char *code)
{
}
void pdf_js_execute_count(pdf_js *js, char *code, int count)
{
}
|