Skip to content

Commit 2876f15

Browse files
committed
Enable creating NativeImage with native-image module
1 parent 85f5ef2 commit 2876f15

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

atom.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
'atom/common/api/lib/clipboard.coffee',
3939
'atom/common/api/lib/crash-reporter.coffee',
4040
'atom/common/api/lib/id-weak-map.coffee',
41+
'atom/common/api/lib/native-image.coffee',
4142
'atom/common/api/lib/original-fs.coffee',
4243
'atom/common/api/lib/shell.coffee',
4344
'atom/common/lib/init.coffee',

atom/common/api/atom_api_native_image.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ namespace {
9898

9999
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
100100
v8::Handle<v8::Context> context, void* priv) {
101+
mate::Dictionary dict(context->GetIsolate(), exports);
102+
dict.SetMethod("createFromPng", &atom::api::NativeImage::CreateFromPNG);
103+
dict.SetMethod("createFromJpeg", &atom::api::NativeImage::CreateFromJPEG);
101104
}
102105

103106
} // namespace
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = process.atomBinding 'native_image'

0 commit comments

Comments
 (0)