mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-12-25 11:48:21 +01:00
adding reomote desktop package
This commit is contained in:
parent
8cb0cf2e34
commit
ff8839f6e3
24
RemoteDesktop/README.md
Normal file
24
RemoteDesktop/README.md
Normal file
@ -0,0 +1,24 @@
|
||||
# RemoteDesktop
|
||||
This project is generated by AntOS Development Kit
|
||||
|
||||
## Howto
|
||||
|
||||
1. Open the project.apj file with AntOSDK (simply double Click on it)
|
||||
2. Modify the UI in *assets/scheme.html*
|
||||
3. Modify application code in *coffees/main.coffee*
|
||||
4. Modify CSS style in *css/main.css*
|
||||
5. Other files need to be copied: put in to assets
|
||||
|
||||
## Set up build target
|
||||
|
||||
Click **Menu> Build > Build Option** or simply hit **ALT-Y**
|
||||
|
||||
In the build options dialog, add or remove files that need to be
|
||||
included into the build
|
||||
|
||||
Click **Save**
|
||||
|
||||
## Build application
|
||||
* To build: **Menu > Build > Build** or **ALT-C**
|
||||
* To build and run: **Menu > Build > Build and Run** or **CTRL-R**
|
||||
* To release: **Menu > Build > Build release** or **ALT-P**
|
5
RemoteDesktop/assets/scheme.html
Normal file
5
RemoteDesktop/assets/scheme.html
Normal file
@ -0,0 +1,5 @@
|
||||
<afx-app-window apptitle="VNC Remote Desktop" width="720" height="576" data-id="RemoteDesktop">
|
||||
<afx-hbox >
|
||||
<canvas data-id="screen"></canvas>
|
||||
</afx-hbox>
|
||||
</afx-app-window>
|
24
RemoteDesktop/build/debug/README.md
Normal file
24
RemoteDesktop/build/debug/README.md
Normal file
@ -0,0 +1,24 @@
|
||||
# RemoteDesktop
|
||||
This project is generated by AntOS Development Kit
|
||||
|
||||
## Howto
|
||||
|
||||
1. Open the project.apj file with AntOSDK (simply double Click on it)
|
||||
2. Modify the UI in *assets/scheme.html*
|
||||
3. Modify application code in *coffees/main.coffee*
|
||||
4. Modify CSS style in *css/main.css*
|
||||
5. Other files need to be copied: put in to assets
|
||||
|
||||
## Set up build target
|
||||
|
||||
Click **Menu> Build > Build Option** or simply hit **ALT-Y**
|
||||
|
||||
In the build options dialog, add or remove files that need to be
|
||||
included into the build
|
||||
|
||||
Click **Save**
|
||||
|
||||
## Build application
|
||||
* To build: **Menu > Build > Build** or **ALT-C**
|
||||
* To build and run: **Menu > Build > Build and Run** or **CTRL-R**
|
||||
* To release: **Menu > Build > Build release** or **ALT-P**
|
1
RemoteDesktop/build/debug/decoder.js
Normal file
1
RemoteDesktop/build/debug/decoder.js
Normal file
@ -0,0 +1 @@
|
||||
var api,onmessage,resolution,wasm_update;importScripts("wvnc_asm.js"),api={},resolution=void 0,Module.onRuntimeInitialized=function(){return api={createBuffer:Module.cwrap("create_buffer","number",["number","number"]),destroyBuffer:Module.cwrap("destroy_buffer","",["number"]),updateBuffer:Module.cwrap("update","number",["number","number","number","number","number","number"]),decodeBuffer:Module.cwrap("decode","number",["number","number","number","number"])}},wasm_update=function(e){var r,u,n,t,a,o,d,f,i,s,m;if(s=(r=new Uint8Array(e))[1]|r[2]<<8,m=r[3]|r[4]<<8,i=r[5]|r[6]<<8,t=r[7]|r[8]<<8,n=r[9],a=api.createBuffer(r.length),Module.HEAP8.set(r,a),d=i*t*4,o=api.decodeBuffer(a,r.length,resolution.depth,d),u=new Uint8Array(Module.HEAP8.buffer,o,d),e={},(f=new Uint8Array(d)).set(u,0),e.pixels=f.buffer,e.x=s,e.y=m,e.w=i,e.h=t,postMessage(e,[e.pixels]),api.destroyBuffer(a),0!==n||32!==resolution.depth)return api.destroyBuffer(o)},onmessage=function(e){return e.data.depth?resolution=e.data:wasm_update(e.data)};
|
150
RemoteDesktop/build/debug/main.js
Normal file
150
RemoteDesktop/build/debug/main.js
Normal file
File diff suppressed because one or more lines are too long
13
RemoteDesktop/build/debug/package.json
Normal file
13
RemoteDesktop/build/debug/package.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"app":"RemoteDesktop",
|
||||
"name":"RemoteDesktop",
|
||||
"description":"",
|
||||
"info":{
|
||||
"author": "",
|
||||
"email": ""
|
||||
},
|
||||
"version":"0.0.1-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"]
|
||||
}
|
5
RemoteDesktop/build/debug/scheme.html
Normal file
5
RemoteDesktop/build/debug/scheme.html
Normal file
@ -0,0 +1,5 @@
|
||||
<afx-app-window apptitle="VNC Remote Desktop" width="720" height="576" data-id="RemoteDesktop">
|
||||
<afx-hbox >
|
||||
<canvas data-id="screen"></canvas>
|
||||
</afx-hbox>
|
||||
</afx-app-window>
|
5
RemoteDesktop/build/debug/wvnc_asm.js
Normal file
5
RemoteDesktop/build/debug/wvnc_asm.js
Normal file
File diff suppressed because one or more lines are too long
BIN
RemoteDesktop/build/debug/wvnc_asm.wasm
Normal file
BIN
RemoteDesktop/build/debug/wvnc_asm.wasm
Normal file
Binary file not shown.
70
RemoteDesktop/coffees/main.coffee
Normal file
70
RemoteDesktop/coffees/main.coffee
Normal file
@ -0,0 +1,70 @@
|
||||
class ConnectionDialog extends this.OS.GUI.BasicDialog
|
||||
constructor: () ->
|
||||
super "ConnectionDialog", {
|
||||
tags: [
|
||||
{ tag: "afx-label", att: 'text="__(VNC server)" data-height="23" class="header"' },
|
||||
{ tag: "input", att: 'data-height="30"' },
|
||||
{ tag: "afx-label", att: 'text="__(Bits per pixel)" data-height="23" class="header"' },
|
||||
{ tag: "afx-list-view", att: 'dropdown="true" data-height="30"' },
|
||||
{ tag: "afx-label", att: 'text="__(Compression)" data-height="23" class="header"' },
|
||||
{ tag: "afx-list-view", att: 'dropdown="true" data-height="30"' },
|
||||
{ tag: "afx-label", att: 'text="__(JPEG quality)" data-height="23" class="header"' },
|
||||
{ tag: "afx-slider", att: 'max="100" data-height="30"' },
|
||||
{ tag: "div", att: ' data-height="5"' }
|
||||
],
|
||||
width: 350,
|
||||
height: 280,
|
||||
resizable: false,
|
||||
buttons: [
|
||||
{
|
||||
label: "__(Connect)",
|
||||
onclick: (d) ->
|
||||
return unless d.handler
|
||||
data =
|
||||
server: (d.find "content1").value
|
||||
bbp: ((d.find "content3").get "selected").value,
|
||||
flag: ((d.find "content5").get "selected").value,
|
||||
quality:((d.find "content7").get "value")
|
||||
d.handler data
|
||||
d.quit()
|
||||
},
|
||||
{ label: "__(Cancel)", onclick: (d) -> d.quit() }
|
||||
],
|
||||
filldata: (d) ->
|
||||
(d.find "content1").value = "176.180.44.70:9999"
|
||||
(d.find "content3").set "items", [
|
||||
{ text: "16 bits", value: 16 },
|
||||
{ text: "32 bits", value: 32, selected:true}]
|
||||
(d.find "content5").set "items", [
|
||||
{text: "No compression", value:0},
|
||||
{text: "JPEG", value:1},
|
||||
{text: "zLib", value:2},
|
||||
{text: "JPEG & zLib", value:3, selected:true}
|
||||
]
|
||||
(d.find "content7").set "value", 40
|
||||
}
|
||||
|
||||
class RemoteDesktop extends this.OS.GUI.BaseApplication
|
||||
constructor: ( args ) ->
|
||||
super "RemoteDesktop", args
|
||||
|
||||
main: () ->
|
||||
me = @
|
||||
@canvas = @find "screen"
|
||||
@client = new WVNC {
|
||||
element: me.canvas,
|
||||
ws: 'wss://localhost:9192/wvnc',
|
||||
worker: "#{me._api.handler.get}/#{me.meta().path}/decoder.js"
|
||||
}
|
||||
@client.onpassword = ()->
|
||||
return new Promise (r,e)->
|
||||
r("demopass")
|
||||
@client.init().then () ->
|
||||
me.showConnectionDialog()
|
||||
|
||||
showConnectionDialog: () ->
|
||||
me = @
|
||||
@openDialog new ConnectionDialog, (d) ->
|
||||
me.client.connect d.server, d
|
||||
, __("Connection")
|
||||
this.OS.register "RemoteDesktop", RemoteDesktop
|
1
RemoteDesktop/javascripts/decoder.js
Normal file
1
RemoteDesktop/javascripts/decoder.js
Normal file
@ -0,0 +1 @@
|
||||
var api,onmessage,resolution,wasm_update;importScripts("wvnc_asm.js"),api={},resolution=void 0,Module.onRuntimeInitialized=function(){return api={createBuffer:Module.cwrap("create_buffer","number",["number","number"]),destroyBuffer:Module.cwrap("destroy_buffer","",["number"]),updateBuffer:Module.cwrap("update","number",["number","number","number","number","number","number"]),decodeBuffer:Module.cwrap("decode","number",["number","number","number","number"])}},wasm_update=function(e){var r,u,n,t,a,o,d,f,i,s,m;if(s=(r=new Uint8Array(e))[1]|r[2]<<8,m=r[3]|r[4]<<8,i=r[5]|r[6]<<8,t=r[7]|r[8]<<8,n=r[9],a=api.createBuffer(r.length),Module.HEAP8.set(r,a),d=i*t*4,o=api.decodeBuffer(a,r.length,resolution.depth,d),u=new Uint8Array(Module.HEAP8.buffer,o,d),e={},(f=new Uint8Array(d)).set(u,0),e.pixels=f.buffer,e.x=s,e.y=m,e.w=i,e.h=t,postMessage(e,[e.pixels]),api.destroyBuffer(a),0!==n||32!==resolution.depth)return api.destroyBuffer(o)},onmessage=function(e){return e.data.depth?resolution=e.data:wasm_update(e.data)};
|
1
RemoteDesktop/javascripts/wvnc.js
Normal file
1
RemoteDesktop/javascripts/wvnc.js
Normal file
File diff suppressed because one or more lines are too long
5
RemoteDesktop/javascripts/wvnc_asm.js
Normal file
5
RemoteDesktop/javascripts/wvnc_asm.js
Normal file
File diff suppressed because one or more lines are too long
BIN
RemoteDesktop/javascripts/wvnc_asm.wasm
Normal file
BIN
RemoteDesktop/javascripts/wvnc_asm.wasm
Normal file
Binary file not shown.
13
RemoteDesktop/package.json
Normal file
13
RemoteDesktop/package.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"app":"RemoteDesktop",
|
||||
"name":"RemoteDesktop",
|
||||
"description":"",
|
||||
"info":{
|
||||
"author": "",
|
||||
"email": ""
|
||||
},
|
||||
"version":"0.0.1-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"]
|
||||
}
|
1
RemoteDesktop/project.apj
Normal file
1
RemoteDesktop/project.apj
Normal file
@ -0,0 +1 @@
|
||||
{"name":"RemoteDesktop","root":"home://workspace/RemoteDesktop","css":[],"javascripts":["javascripts/wvnc.js"],"coffees":["coffees/main.coffee"],"copies":["assets/scheme.html","package.json","README.md","javascripts/decoder.js","javascripts/wvnc_asm.js"]}
|
Loading…
Reference in New Issue
Block a user