2015-10-04 01:35:00 +00:00
|
|
|
ipc = require 'ipc'
|
|
|
|
remote = require 'remote'
|
|
|
|
NativeImage = require 'native-image'
|
|
|
|
|
|
|
|
EventEmitter = require('events').EventEmitter
|
|
|
|
desktopCapturer = new EventEmitter
|
|
|
|
|
|
|
|
desktopCapturer.startUpdating = (args) ->
|
|
|
|
ipc.send 'ATOM_BROWSER_DESKTOP_CAPTURER_START_UPDATING', args
|
|
|
|
|
|
|
|
desktopCapturer.stopUpdating = () ->
|
|
|
|
ipc.send 'ATOM_BROWSER_DESKTOP_CAPTURER_STOP_UPDATING'
|
|
|
|
|
2015-10-05 03:32:12 +00:00
|
|
|
ipc.on 'ATOM_RENDERER_DESKTOP_CAPTURER', (event_name, id, name, thumbnail) ->
|
|
|
|
if not thumbnail
|
|
|
|
return desktopCapturer.emit event_name, id, name
|
|
|
|
desktopCapturer.emit event_name, id, name, NativeImage.createFromDataUrl thumbnail
|
2015-10-04 01:35:00 +00:00
|
|
|
|
|
|
|
module.exports = desktopCapturer
|