2013-05-17 07:39:44 +00:00
|
|
|
bindings = process.atomBinding 'app'
|
2013-10-05 05:13:04 +00:00
|
|
|
objectsRegistry = require '../../atom/objects-registry.js'
|
2013-05-02 16:05:09 +00:00
|
|
|
EventEmitter = require('events').EventEmitter
|
|
|
|
|
2013-05-17 07:39:44 +00:00
|
|
|
Application = bindings.Application
|
|
|
|
Application::__proto__ = EventEmitter.prototype
|
|
|
|
|
|
|
|
app = new Application
|
|
|
|
|
2013-06-19 05:49:58 +00:00
|
|
|
app.getHomeDir = ->
|
|
|
|
process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME']
|
|
|
|
|
2013-10-05 05:13:04 +00:00
|
|
|
app.getBrowserWindows = ->
|
|
|
|
objectsRegistry.getAllWindows()
|
|
|
|
|
2013-10-05 05:46:48 +00:00
|
|
|
app.setApplicationMenu = (menu) ->
|
|
|
|
require('menu').setApplicationMenu menu
|
|
|
|
|
2013-05-17 07:39:44 +00:00
|
|
|
app.commandLine =
|
|
|
|
appendSwitch: bindings.appendSwitch,
|
|
|
|
appendArgument: bindings.appendArgument
|
2013-05-02 16:05:09 +00:00
|
|
|
|
2013-08-06 08:19:56 +00:00
|
|
|
if process.platform is 'darwin'
|
|
|
|
app.dock =
|
|
|
|
bounce: (type = 'informational') -> bindings.dockBounce type
|
|
|
|
cancelBounce: bindings.dockCancelBounce
|
|
|
|
setBadge: bindings.dockSetBadgeText
|
2013-08-06 08:39:31 +00:00
|
|
|
getBadge: bindings.dockGetBadgeText
|
2013-08-06 08:19:56 +00:00
|
|
|
|
2013-05-03 02:53:54 +00:00
|
|
|
# Only one App object pemitted.
|
2013-05-17 07:39:44 +00:00
|
|
|
module.exports = app
|