Permalink
Browse files

Merge pull request #40 from freebsd-electron/freebsd-support

Add FreeBSD support reusing the Linux code
  • Loading branch information...
daviwil committed Jul 3, 2018
2 parents 68ea2b2 + 4eff6f8 commit 2439cd2f5b75d856d3a2c30229ea67b786d8ad3f
Showing with 14 additions and 3 deletions.
  1. +11 −0 binding.gyp
  2. +3 −3 src/keyboard-layout-manager.h
View
@@ -49,6 +49,17 @@
]
}
}], # OS=="linux"
['OS=="freebsd"', {
"sources": [
"src/keyboard-layout-manager-linux.cc",
],
"include_dirs": [
"/usr/local/include", "/usr/local/include/X11",
],
"ldflags": [
"-lX11", "-lxkbfile", "-L/usr/local/lib",
],
}], # OS=="posix"
]
}
]
@@ -3,9 +3,9 @@
#include "nan.h"
#ifdef __linux__
#if defined(__linux__) || defined(__FreeBSD__)
#include <X11/Xlib.h>
#endif // __linux__
#endif // __linux__ || __FreeBSD__
class KeyboardLayoutManager : public Nan::ObjectWrap {
public:
@@ -21,7 +21,7 @@ class KeyboardLayoutManager : public Nan::ObjectWrap {
static NAN_METHOD(GetInstalledKeyboardLanguages);
static NAN_METHOD(GetCurrentKeymap);
#ifdef __linux__
#if defined(__linux__) || defined(__FreeBSD__)
Display *xDisplay;
XIC xInputContext;
XIM xInputMethod;

0 comments on commit 2439cd2

Please sign in to comment.