@esslassi/electron-printer 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +318 -318
- package/binding.gyp +57 -57
- package/lib/electronPrinter.js +2 -2
- package/package.json +1 -1
- package/src/linux_printer.cpp +370 -370
- package/src/linux_printer.h +30 -30
- package/src/mac_printer.cpp +372 -372
- package/src/mac_printer.h +30 -30
- package/src/main.cpp +50 -50
- package/src/print.cpp +352 -352
- package/src/printer_factory.cpp +19 -19
- package/src/printer_factory.h +12 -12
- package/src/printer_interface.h +66 -66
- package/src/windows_printer.cpp +346 -346
- package/src/windows_printer.h +63 -63
- package/test.js +119 -119
package/binding.gyp
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"targets": [
|
|
3
|
-
{
|
|
4
|
-
"target_name": "electron_printer",
|
|
5
|
-
"sources": [
|
|
6
|
-
"src/main.cpp",
|
|
7
|
-
"src/print.cpp",
|
|
8
|
-
"src/printer_factory.cpp"
|
|
9
|
-
],
|
|
10
|
-
"include_dirs": [
|
|
11
|
-
"<!@(node -p \"require('node-addon-api').include\")"
|
|
12
|
-
],
|
|
13
|
-
"dependencies": [
|
|
14
|
-
"<!(node -p \"require('node-addon-api').gyp\")"
|
|
15
|
-
],
|
|
16
|
-
"defines": [ "NAPI_CPP_EXCEPTIONS" ],
|
|
17
|
-
"conditions": [
|
|
18
|
-
['OS=="win"', {
|
|
19
|
-
"sources": ["src/windows_printer.cpp"],
|
|
20
|
-
"libraries": ["winspool.lib"],
|
|
21
|
-
"msvs_settings": {
|
|
22
|
-
"VCCLCompilerTool": {
|
|
23
|
-
"ExceptionHandling": 1
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}],
|
|
27
|
-
['OS=="mac"', {
|
|
28
|
-
"sources": ["src/mac_printer.cpp"],
|
|
29
|
-
"libraries": ["-lcups"],
|
|
30
|
-
"include_dirs": [
|
|
31
|
-
"/usr/include/cups"
|
|
32
|
-
],
|
|
33
|
-
"xcode_settings": {
|
|
34
|
-
"OTHER_CFLAGS": ["-Wall"],
|
|
35
|
-
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
|
|
36
|
-
"CLANG_CXX_LIBRARY": "libc++",
|
|
37
|
-
"MACOSX_DEPLOYMENT_TARGET": "10.7"
|
|
38
|
-
}
|
|
39
|
-
}],
|
|
40
|
-
['OS=="linux"', {
|
|
41
|
-
"sources": ["src/linux_printer.cpp"],
|
|
42
|
-
"libraries": ["-lcups"],
|
|
43
|
-
"include_dirs": [
|
|
44
|
-
"/usr/include/cups"
|
|
45
|
-
],
|
|
46
|
-
"cflags": [
|
|
47
|
-
"-Wall",
|
|
48
|
-
"-fexceptions"
|
|
49
|
-
],
|
|
50
|
-
"cflags_cc": [
|
|
51
|
-
"-fexceptions"
|
|
52
|
-
]
|
|
53
|
-
}]
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"targets": [
|
|
3
|
+
{
|
|
4
|
+
"target_name": "electron_printer",
|
|
5
|
+
"sources": [
|
|
6
|
+
"src/main.cpp",
|
|
7
|
+
"src/print.cpp",
|
|
8
|
+
"src/printer_factory.cpp"
|
|
9
|
+
],
|
|
10
|
+
"include_dirs": [
|
|
11
|
+
"<!@(node -p \"require('node-addon-api').include\")"
|
|
12
|
+
],
|
|
13
|
+
"dependencies": [
|
|
14
|
+
"<!(node -p \"require('node-addon-api').gyp\")"
|
|
15
|
+
],
|
|
16
|
+
"defines": [ "NAPI_CPP_EXCEPTIONS" ],
|
|
17
|
+
"conditions": [
|
|
18
|
+
['OS=="win"', {
|
|
19
|
+
"sources": ["src/windows_printer.cpp"],
|
|
20
|
+
"libraries": ["winspool.lib"],
|
|
21
|
+
"msvs_settings": {
|
|
22
|
+
"VCCLCompilerTool": {
|
|
23
|
+
"ExceptionHandling": 1
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}],
|
|
27
|
+
['OS=="mac"', {
|
|
28
|
+
"sources": ["src/mac_printer.cpp"],
|
|
29
|
+
"libraries": ["-lcups"],
|
|
30
|
+
"include_dirs": [
|
|
31
|
+
"/usr/include/cups"
|
|
32
|
+
],
|
|
33
|
+
"xcode_settings": {
|
|
34
|
+
"OTHER_CFLAGS": ["-Wall"],
|
|
35
|
+
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
|
|
36
|
+
"CLANG_CXX_LIBRARY": "libc++",
|
|
37
|
+
"MACOSX_DEPLOYMENT_TARGET": "10.7"
|
|
38
|
+
}
|
|
39
|
+
}],
|
|
40
|
+
['OS=="linux"', {
|
|
41
|
+
"sources": ["src/linux_printer.cpp"],
|
|
42
|
+
"libraries": ["-lcups"],
|
|
43
|
+
"include_dirs": [
|
|
44
|
+
"/usr/include/cups"
|
|
45
|
+
],
|
|
46
|
+
"cflags": [
|
|
47
|
+
"-Wall",
|
|
48
|
+
"-fexceptions"
|
|
49
|
+
],
|
|
50
|
+
"cflags_cc": [
|
|
51
|
+
"-fexceptions"
|
|
52
|
+
]
|
|
53
|
+
}]
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
package/lib/electronPrinter.js
CHANGED
|
@@ -19,8 +19,8 @@ exports.printFileAsync = printFileAsync;
|
|
|
19
19
|
exports.getJobAsync = getJobAsync;
|
|
20
20
|
exports.getPrintersAsync = getPrintersAsync;
|
|
21
21
|
exports.getPrinterAsync = getPrinterAsync;
|
|
22
|
-
const
|
|
23
|
-
const native = (
|
|
22
|
+
const path_1 = __importDefault(require("path"));
|
|
23
|
+
const native = require(path_1.default.join(__dirname, '../build/Release/electron_printer.node'));
|
|
24
24
|
/* ===========================
|
|
25
25
|
DIRECT NATIVE EXPORTS
|
|
26
26
|
=========================== */
|