File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 11#include < napi.h>
2- # include " mouse.h "
2+
33#include " buffer_finalizer.h"
4- #include " deadbeef_rand.h"
54#include " keypress.h"
5+ #include " microsleep.h"
6+ #include " MMBitmap.h"
7+ #include " mouse.h"
68#include " screen.h"
79#include " screengrab.h"
8- #include " MMBitmap.h"
9- #include " microsleep.h"
10- #if defined(USE_X11)
11- #include " xdisplay.h"
12- #endif
1310
14- // Global delays.
1511int mouseDelay = 10 ;
1612int keyboardDelay = 10 ;
1713static BufferFinalizer<char > finalizer;
@@ -246,6 +242,12 @@ Napi::Number _scrollMouse(const Napi::CallbackInfo &info)
246242 return Napi::Number::New (env, 1 );
247243}
248244
245+ Napi::Number _theAnswer (const Napi::CallbackInfo &info) {
246+ Napi::Env env = info.Env ();
247+
248+ return Napi::Number::New (env, 42 );
249+ }
250+
249251/*
250252 _ __ _ _
251253| |/ /___ _ _| |__ ___ __ _ _ __ __| |
@@ -728,8 +730,9 @@ Napi::Object _captureScreen(const Napi::CallbackInfo &info)
728730 return obj;
729731}
730732
731- Napi::Object Init (Napi::Env env, Napi::Object exports)
732- {
733+ Napi::Object Init (Napi::Env env, Napi::Object exports) {
734+ exports.Set (Napi::String::New (env, " theAnswer" ), Napi::Function::New (env, _theAnswer));
735+
733736 exports.Set (Napi::String::New (env, " dragMouse" ), Napi::Function::New (env, _dragMouse));
734737 exports.Set (Napi::String::New (env, " moveMouse" ), Napi::Function::New (env, _moveMouse));
735738 exports.Set (Napi::String::New (env, " getMousePos" ), Napi::Function::New (env, _getMousePos));
You can’t perform that action at this time.
0 commit comments