Author: hqm
Date: 2008-03-07 08:10:56 -0800 (Fri, 07 Mar 2008)
New Revision: 8206
Removed:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzDefs.js
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/Library.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzDefs.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/events/LaszloEvents.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/events/Library.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/glue/LaszloInitiator.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzIdle.js
Log:
Change 20080306-hqm-k by [EMAIL PROTECTED] on 2008-03-06 23:42:09 EST
in /Users/hqm/openlaszlo/devildog
for http://svn.openlaszlo.org/openlaszlo/branches/devildog
Summary: merge swf9 and 'trunk' LaszloEvents.lzs files
New Features:
Bugs Fixed:
Technical Reviewer: philr
QA Reviewer: ptw
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
merged together the swf9 and 'trunk' versions of LaszloEvents.lzs , to make
a unified file
Tests:
smokecheck
test/lfc/data
test/lztest/lztest-events.lzx
calendar
examples/components
ant lztest
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/Library.lzs
2008-03-07 04:43:07 UTC (rev 8205)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/Library.lzs
2008-03-07 16:10:56 UTC (rev 8206)
@@ -1,22 +1,19 @@
/**
* Library.lzs
*
- * @copyright Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @access private
*/
#include "core/LzConstants.lzs"
+#include "core/LzDefs.lzs"
+
if ($swf9) {
- // TODO [hqm 2007] temporarily exclude userclass from swf9 build right now
#include "core/dummyclasses.js"
- #include "core/LzDefs.js"
#include "core/LzNode.js"
-
-
} else {
- #include "core/LzDefs.lzs"
#include "core/LzNode.lzs"
#include "core/UserClass.lzs"
}
Deleted: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzDefs.js
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzDefs.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzDefs.lzs
2008-03-07 04:43:07 UTC (rev 8205)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzDefs.lzs
2008-03-07 16:10:56 UTC (rev 8206)
@@ -13,42 +13,64 @@
/** Sentinel value for events
* @access private
*/
-class LzDeclaredEventClass /* implements LzEvent */ {
- /**
- * @access private
- */
- /* const */ var ready = false;
+public class LzEventInterface {
- /**
- * @access private
- */
- function sendEvent() {};
+ public function LzEventInterface ( ) {
+ }
- /**
- * @access private
- */
- function clearDelegates() {};
+/**
+ * @access private
+ */
+ public function sendEvent (sd = null ){};
- /**
- * @access private
- */
- function removeDelegate() {};
+/**
+ * @access private
+ */
+function clearDelegates ( ){ };
- /**
- * @access private
- */
- function getDelegateCount () {return 0};
+/**
+ * @access private
+ */
+ function removeDelegate (d = null){ };
- /**
- * @access private
- */
- function toString() {
+/**
+ * @access private
+ */
+function getDelegateCount ( ){return 0};
+
+/**
+ * @access private
+ */
+function toString ( ){
return "LzDeclaredEvent";
+}
+
+/**
+ * @access private
+ */
+ var ready:Boolean = false;
+
+}
+
+public class LzNullEvent extends LzEventInterface {
+ public function LzNullEvent () {
+ }
+
+ public override function sendEvent (sd = null) {
+ // TODO [hqm 2008-03] This would be useful debugging info to see
+ // when apps call sendEvent on null events.
+ /*
+ if ($debug) {
+ Debug.debug('Inefficient call to %s', arguments.callee);
+ }
+ */
}
}
- var LzDeclaredEvent = new LzDeclaredEventClass;
+var LzDeclaredEvent:LzNullEvent = new LzNullEvent();
+
+
/**
* Private class used to distinguish an init expression from an
* initial value in node attributes. All forms of 'constraints' are a
@@ -143,6 +165,23 @@
* overhead of a slower implementation, use LzDictionary).
* @access private
*/
+if ($swf9) {
+dynamic class LzInheritedHash extends Dictionary {
+ #passthrough (toplevel:true) {
+import flash.utils.Dictionary;
+}#
+
+ function LzInheritedHash (sup:Object) {
+ if(sup) {
+ for (var k in sup) {
+ this[k] = sup[k];
+ }
+ }
+ }
+}
+
+} else {
+
function LzInheritedHash (parent) {
if (parent) {
// NOTE: [2007-08-31 ptw] AS2 does not allow returning an
@@ -163,6 +202,7 @@
}
}
+}
/** A map of element names, to functions that create instances of the
* appropriate type.
* Each built-in class that defines the implementation of a tag adds
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js
2008-03-07 04:43:07 UTC (rev 8205)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js
2008-03-07 16:10:56 UTC (rev 8206)
@@ -119,3 +119,18 @@
}
var lzOptions = {};
+
+
+class lzcoreutils {
+ /// TODO [hqm 2008-01] just for debugging until we get debugger up
+ #passthrough {
+ public static function objAsString(obj:*):String {
+ var s:* = "";
+ for (var k:* in obj) {
+ s+= k +": "+obj[k];
+ s+=", ";
+ }
+ return s;
+ }
+ }#
+}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/events/LaszloEvents.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/events/LaszloEvents.lzs
2008-03-07 04:43:07 UTC (rev 8205)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/events/LaszloEvents.lzs
2008-03-07 16:10:56 UTC (rev 8206)
@@ -21,8 +21,10 @@
* @shortdesc The receiver in Laszlo's point-to-point event system.
* @see LzEvent
*/
-class LzDelegate {
+dynamic class LzDelegate {
+ var __delegateID:int = 0;
+
/**
*
* @param Object context: reference to object which will be called
@@ -32,12 +34,11 @@
* @param String eventName: Optional, but required if eventSender is used;
The name
* of the event to register the new delegate for.
*/
-function LzDelegate (context, functionName, eventSender, eventName) {
- super();
- // too expensive to leave on all the time
-// if ($debug) {
-// this._dbg_created = Debug.backtrace();
-// }
+ function LzDelegate (context, functionName, eventSender:* = null,
eventName:* = null) {
+ // too expensive to leave on all the time
+ // if ($debug) {
+ // this._dbg_created = Debug.backtrace();
+ // }
this.c = context;
if ( $debug ){
if (typeof(functionName) != "string")
@@ -57,7 +58,7 @@
}
/** @access private */
-static var __nextID = 1;
+ static var __nextID:int = 1;
/** The context in which to call the method
* @type Object
@@ -87,7 +88,6 @@
// 'resurrect' the deleted view, causing a memory leak
// Usually this is because a deleted view has idle or timer events
// still registered.
- // inlined in LzDelegate.sendEvent(), __LZdrainDelegatesQueue(), and
LzTimer.addTimer();
var context = this.c;
if (this.enabled && context) {
if (context['__LZdeleted']) {
@@ -204,7 +204,7 @@
* @access private
*/
static function __LZdrainDelegatesQueue (pos) {
- var evq = this.__LZdelegatesQueue;
+ var evq = LzDelegate.__LZdelegatesQueue;
var n = evq.length;
var i = pos;
if (i < n) {
@@ -349,15 +349,16 @@
* @see LzDelegate
*/
-class LzEvent {
+public class LzEvent extends LzEventInterface {
+ var delegateList:Array = null;
+
/**
* @param Object eventSender: The owner of this event
* @param String eventName: The name of this event.
*/
-function LzEvent ( eventSender , eventName , d ){
- super();
-
+ function LzEvent ( eventSender:* , eventName:* , d:* = null){
+ super();
var _evs = eventSender._events;
if (_evs == null ){
eventSender._events = [ this ];
@@ -388,12 +389,8 @@
/** True when event is being sent.
* @type Boolean
*/
-var locked = false;
+ var locked:Boolean = false;
-/** True when event is ready to be sent.
- *
- */
-var ready = false;
/**
* Adds the given delegate to the event's delegate list. Although this listed
@@ -415,7 +412,7 @@
*
* @param sd: The data to send with the event.
*/
-function sendEvent ( sd ){
+public override function sendEvent ( sd = null ){
if ( this.locked ) { return; } //don't allow for multiple calls
var dll = this.delegateList.length;
@@ -479,7 +476,8 @@
*
* @param LzDelegate d: The delegate to remove from the delegateList.
*/
-function removeDelegate ( d ){
+override function removeDelegate ( d = null ){
+
var dll = this.delegateList.length;
for (var i = 0; i < dll; i++){
if (this.delegateList[i] == d){
@@ -495,7 +493,7 @@
/**
* Removes all delegates from call list
*/
-function clearDelegates (){
+override function clearDelegates (){
while (this.delegateList.length ){
this.delegateList[ 0 ].unregisterFrom( this );
}
@@ -507,11 +505,11 @@
* Returns the number of delegates registered for the event
* @return Number: The number of delegates registered for the event.
*/
-function getDelegateCount ( ){
+override function getDelegateCount ( ){
return this.delegateList.length;
}
-function toString (){
+override function toString (){
return ( "LzEvent");
}
@@ -520,7 +518,7 @@
* If debugging, add an informative name
* @access private
*/
-function _dbg_name (){
+override function _dbg_name (){
return Debug.formatToString("%0.48w.%s", this._dbg_eventSender,
this._dbg_eventName);
}
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/events/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/events/Library.lzs
2008-03-07 04:43:07 UTC (rev 8205)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/events/Library.lzs
2008-03-07 16:10:56 UTC (rev 8206)
@@ -1,14 +1,11 @@
/**
* Library.lzs
*
- * @copyright Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @access private
*/
-if ($swf9) {
- #include "events/LaszloEvents.js"
- } else {
- #include "events/LaszloEvents.lzs"
-}
+#include "events/LaszloEvents.lzs"
+
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/glue/LaszloInitiator.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/glue/LaszloInitiator.lzs
2008-03-07 04:43:07 UTC (rev 8205)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/glue/LaszloInitiator.lzs
2008-03-07 16:10:56 UTC (rev 8206)
@@ -56,7 +56,7 @@
* org.openlaszlo.ic.CompilationEnvironment.VIEW_INSTANTIATION_FNAME.
*/
-function LzInstantiateView(e, tn)
+function LzInstantiateView(e, tn = null)
{
//LzInstantiateSubviews(canvas, e);
@@ -72,7 +72,7 @@
return;
}
- if ( typeof(tn) == "undefined" ){
+ if (tn == null ){
tn = 1;
}
canvas.initiatorAddNode( e , tn );
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzIdle.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzIdle.js
2008-03-07 04:43:07 UTC (rev 8205)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzIdle.js
2008-03-07 16:10:56 UTC (rev 8206)
@@ -34,7 +34,7 @@
*/
public class LzIdleClass {
-
+ public var __LZdeleted:Boolean = false;
public var __LZdeferDelegates:Boolean = false;
var coi;
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins