diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-07-23 00:43:28 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-08-02 02:20:45 +0800 |
commit | 7111d62585a9264c92962584f234b1fcdd1445f9 (patch) | |
tree | ba927604ba0145257fe060bbb5c81797daa4a101 /source/tools/murun.c | |
parent | 147ce438ceb89649028e953bd7456c1fdfd79de2 (diff) | |
download | mupdf-7111d62585a9264c92962584f234b1fcdd1445f9.tar.xz |
JS: Add Pixmap.getX() and .getY() similar to JNI.
Diffstat (limited to 'source/tools/murun.c')
-rw-r--r-- | source/tools/murun.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/tools/murun.c b/source/tools/murun.c index e46033d9..80703931 100644 --- a/source/tools/murun.c +++ b/source/tools/murun.c @@ -1874,6 +1874,18 @@ static void ffi_Pixmap_clear(js_State *J) } } +static void ffi_Pixmap_getX(js_State *J) +{ + fz_pixmap *pixmap = js_touserdata(J, 0, "fz_pixmap"); + js_pushnumber(J, pixmap->x); +} + +static void ffi_Pixmap_getY(js_State *J) +{ + fz_pixmap *pixmap = js_touserdata(J, 0, "fz_pixmap"); + js_pushnumber(J, pixmap->y); +} + static void ffi_Pixmap_getWidth(js_State *J) { fz_pixmap *pixmap = js_touserdata(J, 0, "fz_pixmap"); @@ -3602,6 +3614,8 @@ int murun_main(int argc, char **argv) jsB_propfun(J, "Pixmap.bound", ffi_Pixmap_bound, 0); jsB_propfun(J, "Pixmap.clear", ffi_Pixmap_clear, 1); + jsB_propfun(J, "Pixmap.getX", ffi_Pixmap_getX, 0); + jsB_propfun(J, "Pixmap.getY", ffi_Pixmap_getY, 0); jsB_propfun(J, "Pixmap.getWidth", ffi_Pixmap_getWidth, 0); jsB_propfun(J, "Pixmap.getHeight", ffi_Pixmap_getHeight, 0); jsB_propfun(J, "Pixmap.getNumberOfComponents", ffi_Pixmap_getNumberOfComponents, 0); |