Skip to content

Commit 29fcfa9

Browse files
committed
(#8) Renamed libnut.cc to main.cc
1 parent 106e42d commit 29fcfa9

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/libnut.cc renamed to src/main.cc

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
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.
1511
int mouseDelay = 10;
1612
int keyboardDelay = 10;
1713
static 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));

0 commit comments

Comments
 (0)