Skip to content

Commit

Permalink
add pocoPackage (#24)
Browse files Browse the repository at this point in the history
* upgrade that you can ignore those gray area

* add package

* new readme.md

* update readme

* useless log has been deleted
pic path in readme change into relative path
  • Loading branch information
szzg authored and adolli committed Jul 30, 2018
1 parent 17bc55e commit 94f6627
Show file tree
Hide file tree
Showing 11 changed files with 669 additions and 7 deletions.
Binary file added Egret/doc/1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Egret/doc/2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Egret/doc/3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Egret/doc/4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Egret/poco/EgretDumper.js
Expand Up @@ -11,7 +11,7 @@ var Dumper = function (root) {

Dumper.prototype = Object.create(AbstractDumper.prototype)

Dumper.prototype.getRoot = function () {
Dumper.prototype.getRoot = function () {
return new Node(this.root, this.root.width, this.root.height)
}

Expand Down
3 changes: 3 additions & 0 deletions Egret/poco/Poco.d.ts
@@ -0,0 +1,3 @@
declare class PocoManager {
constructor(stage:any,port ?:number);
}
10 changes: 4 additions & 6 deletions Egret/poco/Poco.js
Expand Up @@ -17,17 +17,15 @@ function PocoManager(stage, port) {
this.port = port || PORT
this.poco = new Dumper(stage);
this.screen = new Screen(stage);

// this.poco.dumpHierarchy();
// console.log(this.poco)
this.rpc_dispacher = {
"GetSDKVersion": function () { return POCO_SDK_VERSION },
"Dump": this.poco.dumpHierarchy.bind(this.poco),
"GetSDKVersion": function () { return POCO_SDK_VERSION },
"Dump": this.poco.dumpHierarchy.bind(this.poco),
"Screenshot": this.screen.getScreen.bind(this.screen),
"GetScreenSize": this.screen.getPortSize.bind(this.screen),
"test": function () { return "test" },
}
console.log('registered rpc methods.', this.rpc_dispacher)

this.init_server();
}

Expand All @@ -43,7 +41,7 @@ PocoManager.prototype.init_server = function () {
this.server.onmessage = function (evt) {
console.log('Network onMessage...');
var fr = new FileReader();
fr.onloadend = function(e) {
fr.onloadend = function (e) {
var text = e.srcElement.result;
console.log(text);

Expand Down
3 changes: 3 additions & 0 deletions Egret/pocoPackage/poco.d.ts
@@ -0,0 +1,3 @@
declare class PocoManager {
constructor(stage:any,port ?:number);
}

0 comments on commit 94f6627

Please sign in to comment.