dango_generator 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +16 -0
- data/README.txt +41 -0
- data/dango_generator.rb +99 -0
- data/templates/as3/as3corelib-license.txt +33 -0
- data/templates/as3/as3corelib-readme.txt +5 -0
- data/templates/as3/com/adobe/crypto/MD5.as +256 -0
- data/templates/as3/com/adobe/crypto/SHA1.as +268 -0
- data/templates/as3/com/adobe/crypto/SHA224.as +255 -0
- data/templates/as3/com/adobe/crypto/SHA256.as +260 -0
- data/templates/as3/com/adobe/crypto/WSSEUsernameToken.as +117 -0
- data/templates/as3/com/adobe/errors/IllegalStateError.as +66 -0
- data/templates/as3/com/adobe/images/BitString.as +42 -0
- data/templates/as3/com/adobe/images/JPGEncoder.as +651 -0
- data/templates/as3/com/adobe/images/PNGEncoder.as +144 -0
- data/templates/as3/com/adobe/net/DynamicURLLoader.as +58 -0
- data/templates/as3/com/adobe/net/IURIResolver.as +79 -0
- data/templates/as3/com/adobe/net/URI.as +2469 -0
- data/templates/as3/com/adobe/net/URIEncodingBitmap.as +142 -0
- data/templates/as3/com/adobe/net/proxies/RFC2817Socket.as +204 -0
- data/templates/as3/com/adobe/serialization/json/JSON.as +88 -0
- data/templates/as3/com/adobe/serialization/json/JSONDecoder.as +218 -0
- data/templates/as3/com/adobe/serialization/json/JSONEncoder.as +302 -0
- data/templates/as3/com/adobe/serialization/json/JSONParseError.as +90 -0
- data/templates/as3/com/adobe/serialization/json/JSONToken.as +107 -0
- data/templates/as3/com/adobe/serialization/json/JSONTokenType.as +70 -0
- data/templates/as3/com/adobe/serialization/json/JSONTokenizer.as +550 -0
- data/templates/as3/com/adobe/utils/ArrayUtil.as +190 -0
- data/templates/as3/com/adobe/utils/DateUtil.as +666 -0
- data/templates/as3/com/adobe/utils/DictionaryUtil.as +90 -0
- data/templates/as3/com/adobe/utils/IntUtil.as +69 -0
- data/templates/as3/com/adobe/utils/NumberFormatter.as +77 -0
- data/templates/as3/com/adobe/utils/StringUtil.as +257 -0
- data/templates/as3/com/adobe/utils/XMLUtil.as +171 -0
- data/templates/as3/com/adobe/webapis/ServiceBase.as +51 -0
- data/templates/as3/com/adobe/webapis/URLLoaderBase.as +111 -0
- data/templates/as3/com/adobe/webapis/events/ServiceEvent.as +78 -0
- data/templates/as3/org/rubyforge/dango/DangoClientFramework.as +426 -0
- data/templates/as3/org/rubyforge/dango/DangoError.as +11 -0
- data/templates/as3/org/rubyforge/dango/DangoErrorCode.as +7 -0
- data/templates/as3/org/rubyforge/dango/DangoErrorEvent.as +23 -0
- data/templates/as3/org/rubyforge/dango/DangoReceiveEvent.as +21 -0
- data/templates/as3/org/rubyforge/dango/DangoURLLoader.as +127 -0
- data/templates/as3/org/rubyforge/dango/DangoURLLoaderEvent.as +29 -0
- data/templates/as3/org/rubyforge/dango/DangoUtil.as +84 -0
- data/templates/dango/config/development.yml +28 -0
- data/templates/dango/config/production.yml +3 -0
- data/templates/dango/config/system_message.yml +5 -0
- data/templates/dango/config/test.yml +3 -0
- data/templates/dango/server/99_dango_server.rb +22 -0
- data/templates/lib/dango_monitor_client.rb +1 -0
- data/templates/lib/dango_tester_client.rb +1 -0
- data/templates/script/dango_server +36 -0
- data/templates/tasks/dango.rake +2 -0
- metadata +108 -0
@@ -0,0 +1,144 @@
|
|
1
|
+
/*
|
2
|
+
Adobe Systems Incorporated(r) Source Code License Agreement
|
3
|
+
Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved.
|
4
|
+
|
5
|
+
Please read this Source Code License Agreement carefully before using
|
6
|
+
the source code.
|
7
|
+
|
8
|
+
Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
|
9
|
+
no-charge, royalty-free, irrevocable copyright license, to reproduce,
|
10
|
+
prepare derivative works of, publicly display, publicly perform, and
|
11
|
+
distribute this source code and such derivative works in source or
|
12
|
+
object code form without any attribution requirements.
|
13
|
+
|
14
|
+
The name "Adobe Systems Incorporated" must not be used to endorse or promote products
|
15
|
+
derived from the source code without prior written permission.
|
16
|
+
|
17
|
+
You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
|
18
|
+
against any loss, damage, claims or lawsuits, including attorney's
|
19
|
+
fees that arise or result from your use or distribution of the source
|
20
|
+
code.
|
21
|
+
|
22
|
+
THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
|
23
|
+
ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
|
24
|
+
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
25
|
+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
|
26
|
+
NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
|
27
|
+
OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
28
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
29
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
30
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
31
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
32
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
|
33
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
*/
|
35
|
+
package com.adobe.images
|
36
|
+
{
|
37
|
+
import flash.geom.*;
|
38
|
+
import flash.display.Bitmap;
|
39
|
+
import flash.display.BitmapData;
|
40
|
+
import flash.utils.ByteArray;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Class that converts BitmapData into a valid PNG
|
44
|
+
*/
|
45
|
+
public class PNGEncoder
|
46
|
+
{
|
47
|
+
/**
|
48
|
+
* Created a PNG image from the specified BitmapData
|
49
|
+
*
|
50
|
+
* @param image The BitmapData that will be converted into the PNG format.
|
51
|
+
* @return a ByteArray representing the PNG encoded image data.
|
52
|
+
* @langversion ActionScript 3.0
|
53
|
+
* @playerversion Flash 9.0
|
54
|
+
* @tiptext
|
55
|
+
*/
|
56
|
+
public static function encode(img:BitmapData):ByteArray {
|
57
|
+
// Create output byte array
|
58
|
+
var png:ByteArray = new ByteArray();
|
59
|
+
// Write PNG signature
|
60
|
+
png.writeUnsignedInt(0x89504e47);
|
61
|
+
png.writeUnsignedInt(0x0D0A1A0A);
|
62
|
+
// Build IHDR chunk
|
63
|
+
var IHDR:ByteArray = new ByteArray();
|
64
|
+
IHDR.writeInt(img.width);
|
65
|
+
IHDR.writeInt(img.height);
|
66
|
+
IHDR.writeUnsignedInt(0x08060000); // 32bit RGBA
|
67
|
+
IHDR.writeByte(0);
|
68
|
+
writeChunk(png,0x49484452,IHDR);
|
69
|
+
// Build IDAT chunk
|
70
|
+
var IDAT:ByteArray= new ByteArray();
|
71
|
+
for(var i:int=0;i < img.height;i++) {
|
72
|
+
// no filter
|
73
|
+
IDAT.writeByte(0);
|
74
|
+
var p:uint;
|
75
|
+
var j:int;
|
76
|
+
if ( !img.transparent ) {
|
77
|
+
for(j=0;j < img.width;j++) {
|
78
|
+
p = img.getPixel(j,i);
|
79
|
+
IDAT.writeUnsignedInt(
|
80
|
+
uint(((p&0xFFFFFF) << 8)|0xFF));
|
81
|
+
}
|
82
|
+
} else {
|
83
|
+
for(j=0;j < img.width;j++) {
|
84
|
+
p = img.getPixel32(j,i);
|
85
|
+
IDAT.writeUnsignedInt(
|
86
|
+
uint(((p&0xFFFFFF) << 8)|
|
87
|
+
(p>>>24)));
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
IDAT.compress();
|
92
|
+
writeChunk(png,0x49444154,IDAT);
|
93
|
+
// Build IEND chunk
|
94
|
+
writeChunk(png,0x49454E44,null);
|
95
|
+
// return PNG
|
96
|
+
return png;
|
97
|
+
}
|
98
|
+
|
99
|
+
private static var crcTable:Array;
|
100
|
+
private static var crcTableComputed:Boolean = false;
|
101
|
+
|
102
|
+
private static function writeChunk(png:ByteArray,
|
103
|
+
type:uint, data:ByteArray):void {
|
104
|
+
if (!crcTableComputed) {
|
105
|
+
crcTableComputed = true;
|
106
|
+
crcTable = [];
|
107
|
+
var c:uint;
|
108
|
+
for (var n:uint = 0; n < 256; n++) {
|
109
|
+
c = n;
|
110
|
+
for (var k:uint = 0; k < 8; k++) {
|
111
|
+
if (c & 1) {
|
112
|
+
c = uint(uint(0xedb88320) ^
|
113
|
+
uint(c >>> 1));
|
114
|
+
} else {
|
115
|
+
c = uint(c >>> 1);
|
116
|
+
}
|
117
|
+
}
|
118
|
+
crcTable[n] = c;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
var len:uint = 0;
|
122
|
+
if (data != null) {
|
123
|
+
len = data.length;
|
124
|
+
}
|
125
|
+
png.writeUnsignedInt(len);
|
126
|
+
var p:uint = png.position;
|
127
|
+
png.writeUnsignedInt(type);
|
128
|
+
if ( data != null ) {
|
129
|
+
png.writeBytes(data);
|
130
|
+
}
|
131
|
+
var e:uint = png.position;
|
132
|
+
png.position = p;
|
133
|
+
c = 0xffffffff;
|
134
|
+
for (var i:int = 0; i < (e-p); i++) {
|
135
|
+
c = uint(crcTable[
|
136
|
+
(c ^ png.readUnsignedByte()) &
|
137
|
+
uint(0xff)] ^ uint(c >>> 8));
|
138
|
+
}
|
139
|
+
c = uint(c^uint(0xffffffff));
|
140
|
+
png.position = e;
|
141
|
+
png.writeUnsignedInt(c);
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
/*
|
2
|
+
Adobe Systems Incorporated(r) Source Code License Agreement
|
3
|
+
Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved.
|
4
|
+
|
5
|
+
Please read this Source Code License Agreement carefully before using
|
6
|
+
the source code.
|
7
|
+
|
8
|
+
Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
|
9
|
+
no-charge, royalty-free, irrevocable copyright license, to reproduce,
|
10
|
+
prepare derivative works of, publicly display, publicly perform, and
|
11
|
+
distribute this source code and such derivative works in source or
|
12
|
+
object code form without any attribution requirements.
|
13
|
+
|
14
|
+
The name "Adobe Systems Incorporated" must not be used to endorse or promote products
|
15
|
+
derived from the source code without prior written permission.
|
16
|
+
|
17
|
+
You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
|
18
|
+
against any loss, damage, claims or lawsuits, including attorney's
|
19
|
+
fees that arise or result from your use or distribution of the source
|
20
|
+
code.
|
21
|
+
|
22
|
+
THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
|
23
|
+
ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
|
24
|
+
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
25
|
+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
|
26
|
+
NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
|
27
|
+
OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
28
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
29
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
30
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
31
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
32
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
|
33
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
*/
|
35
|
+
|
36
|
+
package com.adobe.net
|
37
|
+
{
|
38
|
+
import flash.net.URLLoader;
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Class that provides a dynamic implimentation of the URLLoader class.
|
42
|
+
*
|
43
|
+
* This class provides no API implimentations. However, since the class is
|
44
|
+
* declared as dynamic, it can be used in place of URLLoader, and allow
|
45
|
+
* you to dynamically attach properties to it (which URLLoader does not allow).
|
46
|
+
*
|
47
|
+
* @langversion ActionScript 3.0
|
48
|
+
* @playerversion Flash 9.0
|
49
|
+
* @tiptext
|
50
|
+
*/
|
51
|
+
public dynamic class DynamicURLLoader extends URLLoader
|
52
|
+
{
|
53
|
+
public function DynamicURLLoader()
|
54
|
+
{
|
55
|
+
super();
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
/*
|
2
|
+
Adobe Systems Incorporated(r) Source Code License Agreement
|
3
|
+
Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved.
|
4
|
+
|
5
|
+
Please read this Source Code License Agreement carefully before using
|
6
|
+
the source code.
|
7
|
+
|
8
|
+
Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
|
9
|
+
no-charge, royalty-free, irrevocable copyright license, to reproduce,
|
10
|
+
prepare derivative works of, publicly display, publicly perform, and
|
11
|
+
distribute this source code and such derivative works in source or
|
12
|
+
object code form without any attribution requirements.
|
13
|
+
|
14
|
+
The name "Adobe Systems Incorporated" must not be used to endorse or promote products
|
15
|
+
derived from the source code without prior written permission.
|
16
|
+
|
17
|
+
You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
|
18
|
+
against any loss, damage, claims or lawsuits, including attorney's
|
19
|
+
fees that arise or result from your use or distribution of the source
|
20
|
+
code.
|
21
|
+
|
22
|
+
THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
|
23
|
+
ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
|
24
|
+
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
25
|
+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
|
26
|
+
NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
|
27
|
+
OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
28
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
29
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
30
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
31
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
32
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
|
33
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
*/
|
35
|
+
|
36
|
+
package com.adobe.net
|
37
|
+
{
|
38
|
+
/**
|
39
|
+
* The URI class cannot know about DNS aliases, virtual hosts, or
|
40
|
+
* symbolic links that may be involved. The application can provide
|
41
|
+
* an implementation of this interface to resolve the URI before the
|
42
|
+
* URI class makes any comparisons. For example, a web host has
|
43
|
+
* two aliases:
|
44
|
+
*
|
45
|
+
* <p><code>
|
46
|
+
* http://www.site.com/
|
47
|
+
* http://www.site.net/
|
48
|
+
* </code></p>
|
49
|
+
*
|
50
|
+
* <p>The application can provide an implementation that automatically
|
51
|
+
* resolves site.net to site.com before URI compares two URI objects.
|
52
|
+
* Only the application can know and understand the context in which
|
53
|
+
* the URI's are being used.</p>
|
54
|
+
*
|
55
|
+
* <p>Use the URI.resolver accessor to assign a custom resolver to
|
56
|
+
* the URI class. Any resolver specified is global to all instances
|
57
|
+
* of URI.</p>
|
58
|
+
*
|
59
|
+
* <p>URI will call this before performing URI comparisons in the
|
60
|
+
* URI.getRelation() and URI.getCommonParent() functions.
|
61
|
+
*
|
62
|
+
* @see URI.getRelation
|
63
|
+
* @see URI.getCommonParent
|
64
|
+
*
|
65
|
+
* @langversion ActionScript 3.0
|
66
|
+
* @playerversion Flash 9.0
|
67
|
+
*/
|
68
|
+
public interface IURIResolver
|
69
|
+
{
|
70
|
+
/**
|
71
|
+
* Implement this method to provide custom URI resolution for
|
72
|
+
* your application.
|
73
|
+
*
|
74
|
+
* @langversion ActionScript 3.0
|
75
|
+
* @playerversion Flash 9.0
|
76
|
+
*/
|
77
|
+
function resolve(uri:URI) : URI;
|
78
|
+
}
|
79
|
+
}
|