2015-10-04 09:35:00 +08:00
|
|
|
ipc = require 'ipc'
|
|
|
|
NativeImage = require 'native-image'
|
|
|
|
|
2015-10-06 14:34:54 +08:00
|
|
|
getSources = (options, callback) ->
|
|
|
|
ipc.send 'ATOM_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', options
|
2015-10-17 19:28:14 +08:00
|
|
|
ipc.once 'ATOM_RENDERER_DESKTOP_CAPTURER_RESULT', (sources) ->
|
2015-10-06 14:34:54 +08:00
|
|
|
callback ({id: source.id, name: source.name, thumbnail: NativeImage.createFromDataUrl source.thumbnail} for source in sources)
|
2015-10-04 09:35:00 +08:00
|
|
|
|
2015-10-06 14:34:54 +08:00
|
|
|
module.exports =
|
|
|
|
getSources: getSources
|