Move all sources under atom/.
This commit is contained in:
parent
26ddbbb0ee
commit
516d46444d
217 changed files with 519 additions and 519 deletions
25
atom/common/api/lib/callbacks-registry.coffee
Normal file
25
atom/common/api/lib/callbacks-registry.coffee
Normal file
|
@ -0,0 +1,25 @@
|
|||
module.exports =
|
||||
class CallbacksRegistry
|
||||
constructor: ->
|
||||
@emptyFunc = -> throw new Error "Browser trying to call a non-exist callback
|
||||
in renderer, this usually happens when renderer code forgot to release
|
||||
a callback installed on objects in browser when renderer was going to be
|
||||
unloaded or released."
|
||||
@callbacks = {}
|
||||
|
||||
add: (callback) ->
|
||||
id = Math.random().toString()
|
||||
@callbacks[id] = callback
|
||||
id
|
||||
|
||||
get: (id) ->
|
||||
@callbacks[id] ? ->
|
||||
|
||||
call: (id, args...) ->
|
||||
@get(id).call global, args...
|
||||
|
||||
apply: (id, args...) ->
|
||||
@get(id).apply global, args...
|
||||
|
||||
remove: (id) ->
|
||||
delete @callbacks[id]
|
1
atom/common/api/lib/clipboard.coffee
Normal file
1
atom/common/api/lib/clipboard.coffee
Normal file
|
@ -0,0 +1 @@
|
|||
module.exports = process.atomBinding 'clipboard'
|
38
atom/common/api/lib/crash-reporter.coffee
Normal file
38
atom/common/api/lib/crash-reporter.coffee
Normal file
|
@ -0,0 +1,38 @@
|
|||
{spawn} = require 'child_process'
|
||||
binding = process.atomBinding 'crash_reporter'
|
||||
|
||||
class CrashReporter
|
||||
start: (options={}) ->
|
||||
{productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra} = options
|
||||
|
||||
productName ?= 'Atom-Shell'
|
||||
companyName ?= 'GitHub, Inc'
|
||||
submitUrl ?= 'http://54.249.141.255:1127/post'
|
||||
autoSubmit ?= true
|
||||
ignoreSystemCrashHandler ?= false
|
||||
extra ?= {}
|
||||
|
||||
extra._productName ?= productName
|
||||
extra._companyName ?= companyName
|
||||
extra._version ?=
|
||||
if process.__atom_type is 'browser'
|
||||
require('app').getVersion()
|
||||
else
|
||||
require('remote').require('app').getVersion()
|
||||
|
||||
start = -> binding.start productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra
|
||||
|
||||
if process.platform is 'win32'
|
||||
args = [
|
||||
"--reporter-url=#{submitUrl}"
|
||||
"--application-name=#{productName}"
|
||||
"--v=1"
|
||||
]
|
||||
env = ATOM_SHELL_INTERNAL_CRASH_SERVICE: 1
|
||||
|
||||
spawn process.execPath, args, {env, detached: true}
|
||||
start()
|
||||
else
|
||||
start()
|
||||
|
||||
module.exports = new CrashReporter
|
3
atom/common/api/lib/id-weak-map.coffee
Normal file
3
atom/common/api/lib/id-weak-map.coffee
Normal file
|
@ -0,0 +1,3 @@
|
|||
IDWeakMap = process.atomBinding('id_weak_map').IDWeakMap
|
||||
|
||||
module.exports = IDWeakMap
|
3
atom/common/api/lib/screen.coffee
Normal file
3
atom/common/api/lib/screen.coffee
Normal file
|
@ -0,0 +1,3 @@
|
|||
{Screen} = process.atomBinding 'screen'
|
||||
|
||||
module.exports = new Screen
|
1
atom/common/api/lib/shell.coffee
Normal file
1
atom/common/api/lib/shell.coffee
Normal file
|
@ -0,0 +1 @@
|
|||
module.exports = process.atomBinding 'shell'
|
Loading…
Add table
Add a link
Reference in a new issue