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 1
1
#include < napi.h>
2
- # include " mouse.h "
2
+
3
3
#include " buffer_finalizer.h"
4
- #include " deadbeef_rand.h"
5
4
#include " keypress.h"
5
+ #include " microsleep.h"
6
+ #include " MMBitmap.h"
7
+ #include " mouse.h"
6
8
#include " screen.h"
7
9
#include " screengrab.h"
8
- #include " MMBitmap.h"
9
- #include " microsleep.h"
10
- #if defined(USE_X11)
11
- #include " xdisplay.h"
12
- #endif
13
10
14
- // Global delays.
15
11
int mouseDelay = 10 ;
16
12
int keyboardDelay = 10 ;
17
13
static BufferFinalizer<char > finalizer;
@@ -246,6 +242,12 @@ Napi::Number _scrollMouse(const Napi::CallbackInfo &info)
246
242
return Napi::Number::New (env, 1 );
247
243
}
248
244
245
+ Napi::Number _theAnswer (const Napi::CallbackInfo &info) {
246
+ Napi::Env env = info.Env ();
247
+
248
+ return Napi::Number::New (env, 42 );
249
+ }
250
+
249
251
/*
250
252
_ __ _ _
251
253
| |/ /___ _ _| |__ ___ __ _ _ __ __| |
@@ -728,8 +730,9 @@ Napi::Object _captureScreen(const Napi::CallbackInfo &info)
728
730
return obj;
729
731
}
730
732
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
+
733
736
exports.Set (Napi::String::New (env, " dragMouse" ), Napi::Function::New (env, _dragMouse));
734
737
exports.Set (Napi::String::New (env, " moveMouse" ), Napi::Function::New (env, _moveMouse));
735
738
exports.Set (Napi::String::New (env, " getMousePos" ), Napi::Function::New (env, _getMousePos));
You can’t perform that action at this time.
0 commit comments