2 * Copyright (C) 2007 Benjamin Otte <otte@gnome.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301 USA
22 ASSetNative
= ASnative
(4, 0);
23 ASSetNativeAccessor
= ASnative
(4, 1);
25 /*** ASBROADCASTER ***/
27 function AsBroadcaster
() { };
29 AsBroadcaster
.broadcastMessage
= ASnative
(101, 12);
31 AsBroadcaster
.addListener
= function (x
) {
32 this.removeListener
(x
);
33 this._listeners
.push
(x
);
37 AsBroadcaster
.removeListener
= function (x
) {
38 var l
= this._listeners
;
41 for (var i
= 0; i
< l
.length
; i
++) {
50 AsBroadcaster
.initialize
= function (o
) {
51 o
.broadcastMessage
= ASnative
(101, 12);
52 o
.addListener
= AsBroadcaster
.addListener
;
53 o
.removeListener
= AsBroadcaster
.removeListener
;
54 o
._listeners
= new Array ();
55 ASSetPropFlags
(o
, "broadcastMessage,addListener,removeListener,_listeners", 131);
57 ASSetPropFlags
(AsBroadcaster
, null, 131);
59 Key
= { ALT
: 18, BACKSPACE
: 8, CAPSLOCK
: 20, CONTROL
: 17, DELETEKEY
: 46,
60 DOWN
: 40, END
: 35, ENTER
: 13, ESCAPE
: 27, HOME
: 36, INSERT
: 45, LEFT
: 37,
61 PGDN
: 34, PGUP
: 33, RIGHT
: 39, SHIFT
: 16, SPACE
: 32, TAB
: 9, UP
: 38 };
62 ASSetNative
(Key
, 800, "getAscii,getCode,isDown");
63 AsBroadcaster
.initialize
(Key
);
64 ASSetPropFlags
(Key
, null, 7);
68 Mouse = new Object ();
69 Mouse.show
= ASnative
(5, 0);
70 Mouse.hide
= ASnative
(5, 1);
71 AsBroadcaster
.initialize
(Mouse);
75 Stage = new Object ();
76 AsBroadcaster
.initialize
(Stage);
77 ASSetNativeAccessor
(Stage, 666, "scaleMode,align,width,height", 1);
81 function LoadVars
() { };
83 LoadVars
.prototype
.contentType
= "application/x-www-form-urlencoded";
85 LoadVars
.prototype
.load
= ASnative
(301, 0);
86 //LoadVars.prototype.send = ASnative (301, 1);
87 //LoadVars.prototype.sendAndLoad = ASnative (301, 2);
88 LoadVars
.prototype
.decode
= ASnative
(301, 3);
90 LoadVars
.prototype
.onLoad
= function () {
93 LoadVars
.prototype
.onData
= function (src
) {
103 LoadVars
.prototype
.toString
= function () {
105 for (var x
in this) {
107 str
= escape
(x
) + "=" + escape
(this[x
]);
109 str
+= "&" + escape
(x
) + "=" + escape
(this[x
]);
115 LoadVars
.prototype
.getBytesLoaded
= function () {
116 return this._bytesLoaded
;
119 LoadVars
.prototype
.getBytesTotal
= function () {
120 return this._bytesTotal
;
123 ASSetPropFlags
(LoadVars
.prototype
, null, 129);