Author: hqm
Date: 2008-01-08 20:44:25 -0800 (Tue, 08 Jan 2008)
New Revision: 7778

Added:
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzIdle.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
Modified:
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/LaszloLibrary.lzs
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/Library.lzs
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzDefs.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzApplication.as
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzIdleKernel.as
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/Library.lzs
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzInstantiator.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs
Log:
checkpoint swf9 lfc with idle kernel and animators

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/LaszloLibrary.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/LaszloLibrary.lzs      
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/LaszloLibrary.lzs      
2008-01-09 04:44:25 UTC (rev 7778)
@@ -22,7 +22,7 @@
 
 #include "kernel/Library.lzs"
 #include "views/Library.lzs"
-  //#include "controllers/Library.lzs"
+#include "controllers/Library.lzs"
 
   //#include "helpers/Library.lzs"
   //  #include "data/Library.lzs"

Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.js 
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.js 
2008-01-09 04:44:25 UTC (rev 7778)
@@ -1,19 +1,442 @@
-/*
- * @copyright Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.
+/**
+  * LaszloAnimations.as 
+  *
+  * @copyright Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
+  * @affects animation lzanimator
+  * @access public
+  * @topic LFC
+  * @subtopic Controllers
   */
-public class LzAnimatorGroup extends LzNode {
-    public function LzAnimatorGroup(...rest) {
-        super(rest[0],rest[1]);
+
+/**
+  * LzAnimator
+  * <p>Animators change the value of an object's attribute over a
+  * specified duration in milliseconds. For example, the following program
+  * defines an animator for a window that moves it to a position of x=100
+  * over 1 second (1000 milliseconds).</p>
+  * 
+  * <example><programlisting class="code" extract="false">
+  * &lt;canvas>
+  *   &lt;window>
+  *     &lt;animator attribute="x" to="100" duration="1000"/>
+  *   &lt;/window>
+  * &lt;/canvas>
+  * </programlisting></example>
+  * 
+  * <p>See the <a href="${dguide}animation.html">Guide</a> for a complete 
discussion of
+  * animators and animation in Laszlo applications.</p>
+  *
+  * @lzxname animator
+  * @shortdesc Changes the value of another object's attribute over time.
+  * @see animatorgroup
+  */
+dynamic class LzAnimator extends LzAnimatorGroup {
+
+/** @access private
+  * @modifiers override 
+  */
+  static var tagname = 'animator';
+  ConstructorMap[tagname] = LzAnimator;
+
+    static var getters = new LzInheritedHash(LzAnimatorGroup.getters);
+    getters = LzAnimator.getters;
+
+    static var defaultattrs = new 
LzInheritedHash(LzAnimatorGroup.defaultattrs);
+    defaultattrs = LzAnimator.defaultattrs;
+
+    static var options = new LzInheritedHash(LzAnimatorGroup.options);
+    options = LzAnimator.options;
+
+    static var setters = new LzInheritedHash(LzAnimatorGroup.setters);
+    setters = LzAnimator.setters;
+
+
+    function LzAnimator ( parent:* , attrs:* , children:* = null, instcall:*  
= null) {
+        super(parent,attrs,children,instcall);
+        this.calcMethod = this.calcNextValue;
     }
 
+    var calcMethod:Function;
+
+    var lastIterationTime;
+var currentValue;
+var beginPole;
+var endPole;
+
+    var doBegin;
+
+var beginPoleDelta = .25;
+var endPoleDelta = .25;
+
+    var primary_K;
+    var origto;
+    
+//setters.from = "defaultSet";
+//setters.to = "defaultSet";
+//setters.duration = "defaultSet";
+//setters.attribute = "defaultSet";
+//setters.relative = "defaultSet";
+
+/**
+  * The style of motion to use for the animator. This
+  * is one of "linear", "easin" , "easeout" , and "easeboth". The default
+  * is "easeboth"
+  *
+  * @type String
+  */
+setters.motion = "setMotion";
+
+/**
+  * The destination value for the animator.
+  *
+  * @type Number
+  */
+setters.to = "setTo";
+
+
+/**
+  * @access private
+  */
+override function construct ( parent , args ){
+    super.construct.apply(this, arguments);
+    this.primary_K          = 1.0;
 }
 
-public class LzAnimator extends LzAnimatorGroup {
-    public function LzAnimator(...rest) {
-        super(rest[0],rest[1]);
+/**
+  * Sets the motion style for the animator.
+  * @param String eparam: One of "easein", "easeout" , "linear" or "easeboth"
+  * to describe how the animator accelerates and decelerates. The default is
+  * "easeboth".
+  */
+    function setMotion ( eparam, ignoreme=null ){
+    //easin, easeout , linear , easeboth (default)
+    if ( eparam == "linear" ){
+        this.calcMethod = this.calcNextValueLinear;
+    } else {
+        this.calcMethod = this.calcNextValue;
+        if ( eparam == "easeout" ){
+            this.beginPoleDelta = 100;
+        } else if ( eparam == "easein" ){
+            this.endPoleDelta = 15;
+        }
     }
+}
 
+/**
+  * Sets the destination value for the animator
+  * @param Number eparam: The destination value for the animator.
+  */
+    function setTo ( eparam, ignoreme=null ){
+    this.origto = Number(eparam);
 }
 
 
+/**
+  * Calculate the control values  fro the animation. These will not change even
+  * if the animation is repeated.
+  *
+  * @access private
+  */
+function calcControlValues ( cval  = null){
+    // reset currentValue
+    this.currentValue = cval || 0;
+
+    // create direction multiplier
+    var dir = this.indirect ? -1 : 1;
+
+    // set beginPole and endPole values
+    if ( this.currentValue < this.to ) {
+        this.beginPole = this.currentValue - dir*this.beginPoleDelta;
+        this.endPole = this.to + dir*this.endPoleDelta;
+    }else{
+        this.beginPole = this.currentValue + dir*this.beginPoleDelta;
+        this.endPole = this.to - dir*this.endPoleDelta;
+    }
+
+    // calculate value for primary_K
+    // a default value of 1.0 means the attribute will be static, i.e.
+    // the animation will still be calculated but the result will
+    // always be the same.
+    this.primary_K = 1.0;
+
+    var kN = 1.0*(this.beginPole - this.to )*
+                 (this.currentValue - this.endPole);
+
+    var kD = 1.0*(this.beginPole - this.currentValue)*
+                 (this.to - this.endPole);
+
+    // NOTE: in future this should probaly check for really small amounts not
+    // just zero
+    if (kD != 0) this.primary_K = Math.abs(kN/kD);
+
+}
+
+
+/**
+  * this is called once to set any starting values that will only need to be
+  * calculated once even if the animator repeats
+  *
+  * BRET'S NOTE:  this.target.setAttribute( this.attribute , this.from ); not 
true if relative
+  * if doStart is called while animator is active, just return
+  * else if a "from" value has been specified then this
+  * Here is where the expected value for a view should be updated
+  *
+  * @access private
+  */
+override function doStart (){
+    if ( this.isactive ) return;
+    this.isactive = true;
+
+    this.prepareStart();
+
+    // give this animator processing time by registering it with LzIdle service
+    this.updateDel.register( LzIdle , "onidle" );
+}
+
+
+/**
+  * @access private
+  */
+override function prepareStart ( ){
+    // create a "repeat" counter to be decremented each time after the
+    // animator finishes a cycle.
+    this.crepeat = this.repeat;
+
+
+    // Set the attribute of the view to its "from" value but make sure
+    // expectedAttribute is updated.
+    if ( this.from != null ){
+        this.target.setAttribute( this.attribute , Number( this.from ) );
+    }
+
+    if ( this.relative ) {
+        this.to = this.origto;
+    }else{
+        this.to = this.origto - 
this.target.getExpectedAttribute(this.attribute);
+
+        // "to" has changed so calc new poles and K value
+        //this.calcControlValues();
+    }
+
+    // update the expected attribute for this view so that animators attached
+    // after this one will can execute appropriately.
+    this.target.addToExpectedAttribute( this.attribute,this.to );
+
+    // everytime an animator is started, a counter associated with that 
property
+    // is incremented. When this counter is decremented and reaches zero then
+    // the final expected value will be assigned to that attribute
+    this.target.__LZincrementCounter(this.attribute);
+
+
+    // set current to zero since all animators are now relative
+    this.currentValue = 0;
+
+    //we already did this if !this.relative -- conditionalize?
+    this.calcControlValues();
+
+    this.doBegin = true;
+
+}
+
+/**
+  * reset the time variables and currentValue
+  * @access private
+  */
+override function resetAnimator() {
+    // Set the attribute of the view to its "from" value but make sure
+    // expectedAttribute is updated.
+    if ( this.from != null ){
+        this.target.setAttribute( this.attribute , this.from );
+        var d = this.from - this.target.getExpectedAttribute( this.attribute );
+        this.target.addToExpectedAttribute(this.attribute,d);
+    }
+
+    if (!this.relative) {
+        this.to = this.origto - this.target.getExpectedAttribute( 
this.attribute );
+        // "to" has changed so calc new poles and K value
+        this.calcControlValues();
+    }
+
+    // update the expected attribute for this view so that animators attached
+    // after this one will can execute appropriately.
+    this.target.addToExpectedAttribute(this.attribute,this.to);
+    this.target.__LZincrementCounter(this.attribute);
+
+    // set current to zero since all animators are now relative
+    this.currentValue = 0;
+
+    this.doBegin = true;
+}
+
+
+/**
+  * beginAnimator is called on the first iteration of the animator.
+  *
+  * @access private
+  *
+  * @param Number time: the time in milliseconds that this animator will
+  * be assigned as its beginning time.
+  */
+function beginAnimator( time ) {
+
+    // set initial time parameters
+    this.startTime = time;
+    this.lastIterationTime = time;
+
+    if (this.onstart.ready) this.onstart.sendEvent( time );
+
+    //Set to false so next update does not call this function
+    this.doBegin = false;
+
+
+}
+
+/**
+  * @access private
+  */
+override function stop( ) {
+    if ( !this.isactive ) return;
+
+    var e_prop = "e_" +  this.attribute;
+    if (!this.target[e_prop].c) { this.target[e_prop].c = 0; }
+    this.target[e_prop].c--; //decrement animation counter for prop
+    if ( this.target[e_prop].c <= 0 ){
+        this.target[e_prop].c = 0;
+        this.target[e_prop].v = null;
+    } else {
+        this.target[e_prop].v -= this.to - this.currentValue;
+    }
+
+    this.__LZhalt();
+}
+
+/**
+  * @access private
+  */
+override function __LZfinalizeAnim( ) {
+    var e_prop = "e_" +  this.attribute;
+    if (!this.target[e_prop].c) { this.target[e_prop].c = 0; }
+    this.target[e_prop].c -= 1; //decrement animation counter for prop
+
+    if ( this.target[e_prop].c <= 0 ){
+        this.target[e_prop].c = 0;
+        this.target.setAttribute( this.attribute,this.target[e_prop].v);
+        this.target[e_prop].v = null;
+    }
+
+    this.__LZhalt();
+}
+
+/**
+  * This method calculates the next value of the parameter being animated. This
+  * method can be used by any Animator object that inherits from LzAnimator, as
+  * long as the parameter is a scalar value (i.e. a number instead of a point).
+  *
+  * @access private
+  *
+  * @param timeDifference: the time difference in milliseconds from the start
+  * of the animation.
+  * @return nextValue: the next value in the animations iteration sequence
+  */
+function calcNextValue( timeDifference ) {
+    // return the currentValue by default
+    var nextValue  = this.currentValue;
+
+    // create local references
+    var aEndPole   = this.endPole;
+    var aBeginPole = this.beginPole;
+
+    // calculate new "K" value based on time difference
+    var K = Math.exp((timeDifference*1.0/this.duration)*
+                      Math.log(this.primary_K));
+
+    // calculate nextValue using the pole and new K value
+    if( K != 1.0 ) {
+       var aNumerator   = aBeginPole*aEndPole*(1 - K);
+       var aDenominator = aEndPole - K*aBeginPole;
+       if( aDenominator != 0.0 ) nextValue = aNumerator/aDenominator;
+    }
+    return nextValue;
+}
+
+
+
+/**
+  * This method replaces the nonlinear calcNextValue when motion is set to 
linear
+  *
+  * @access private
+  */
+function calcNextValueLinear( timeDifference ) {
+    var elapsed = timeDifference/this.duration;
+    return elapsed*this.to;
+}
+
+/**
+  * This is one of the core methods of an LzAnimator object. This method gets
+  * called to iterate the animation only once and then sets the property of the
+  * associated view.
+  *
+  * @access private
+  *
+  * @param time: the time assigned to this iteration of the animator. this time
+  * value ( in milliseconds) is set by the animation queue and then passed
+  * onto to every animator to ensure that all animators are synched to the same
+  * value.
+  * @return animatorIsDone: a boolean indicating if the animation is complete
+  */
+override function update( time ) {
+    var animatorIsDone = false;
+
+    // If this is its first iteration then calc the necessary paramters.
+    // Calling this function here allows animators to be added to a queue at
+    // different times and then "synced" at start of execution, i.e. next 
onIdle
+    // event.
+    if ( this.doBegin ) {
+        this.beginAnimator( time );
+    } else {
+        if ( !this.paused ) {
+            var aTotalTimeDifference = time - this.startTime;
+            if ( aTotalTimeDifference < this.duration ) {
+                this.setValue( this.calcMethod( aTotalTimeDifference ));
+                this.lastIterationTime = time;
+            } else {
+                this.setValue( this.to );
+                return this.checkRepeat();
+            }
+         }
+    }
+}
+
+/**
+  * sets the property specified in the binding to the <b>value</b>
+  *
+  * @access private
+  *
+  * @param value: to the value to be assigned
+  */
+    function setValue( value , ignoreme=null) {
+    // All animators are now relative at the core so add the difference
+    // of this value - the current value to the view's attribute.
+    var aDiff = value - this.currentValue;
+    if (this.target.setAttribute) {
+        //Debug.info('setValue', value, this.target);
+        this.target.setAttribute( this.attribute, this.target[this.attribute] 
+ aDiff );
+    }
+    this.currentValue = value;
+}
+
+
+/**
+  * @access private
+  */
+override function toString(){
+    return "Animator for " + this.target + " attribute:" + this.attribute + " 
to:" + this.to;
+}
+
+} // End of LzAnimator
+
+
+
+
+    

Added: openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.js


Property changes on: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.js
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/Library.lzs        
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/Library.lzs        
2008-01-09 04:44:25 UTC (rev 7778)
@@ -1,14 +1,16 @@
 /**
   * 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 "controllers/LzAnimatorGroup.js"
     #include "controllers/LaszloAnimation.js"
+    #include "controllers/LaszloLayout.js"
 } else {
     #include "controllers/LzAnimatorGroup.lzs"
     #include "controllers/LaszloAnimation.lzs"

Added: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.js


Property changes on: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.js
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzDefs.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzDefs.js 2008-01-09 
03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzDefs.js 2008-01-09 
04:44:25 UTC (rev 7778)
@@ -1,7 +1,7 @@
 /**
   * LzDefs.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.
   * @todo 2006-04-07 hqm This machinery could be removed if all
   * callers to sendEvent can be guaranteed to check if the event slot
@@ -99,3 +99,17 @@
         }
     }
 }
+
+class lzutils {
+    /// 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/core/LzNode.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js 2008-01-09 
03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js 2008-01-09 
04:44:25 UTC (rev 7778)
@@ -38,21 +38,16 @@
     var _instanceChildren:* = null;
     var __LZisnew:* = null;
     var __LZstyleConstraints:* = null;
-    var constructWithArgs:* = null;
     var  syncNew:* = null;
     var __LZdeferredcarr:* = null;
     var _events:* = null;
     var data:* = null;
 
     ///////////////////////////////////////////////////////////////////
-    // temporary definition
+    // TODO [hqm 2008-01]  Do we need to do anything more complex
+    // to deal with methods that reference superclass methods?
     function addProperty(key:*,val:*):void {
-        #passthrough {
-        if (val is Function)  {
-            trace('called addProperty with a function as val ' + key+" = " 
+val);
-        }
         this[key] = val;
-        }#
     }
 
     //////////////////
@@ -73,15 +68,6 @@
   * @access private
   */
     function LzNode ( parent:* , attrs:* , children:* = null, instcall:*  = 
null){
-        //function LzNode (...rest) {
-    // TODO [hqm 2007-12] replace this with optional args declaration when the 
compiler accepts this
-        ////////////////////////////////////////////////////////////////
-        //    var parent:* = rest[0];
-        //    var attrs:* = rest[1];
-        //    var children:*  = rest[2];
-        //    var  instcall:* = rest[3];
-        ////////////////////////////////////////////////////////////////
-
         this.setters = this.constructor.setters;
         this.getters = this.constructor.getters;
         this.defaultattrs = this.constructor.defaultattrs;
@@ -230,7 +216,7 @@
           * @todo 2006-05-24 ptw Adam says this is a hack that we should get
           * rid of.
           */
-        if (this.constructWithArgs) this.constructWithArgs( maskedargs );
+        this.constructWithArgs( maskedargs );
 
         this.__LZdeferDelegates = false;
 
@@ -263,6 +249,10 @@
         }
 }
 
+    function constructWithArgs(args:*) {
+
+    }
+
 /**
   * Link up the getter/setter/defaultattr inheritance
   * @access private
@@ -366,6 +356,8 @@
 static var defaultattrs:* = new LzInheritedHash({ $hasdefaultattrs : true });
 var defaultattrs:*;
 
+var $hasdefaultattrs:*;
+
 /**
  * Indicates that a <varname>node</varname>'s <method>init</method> method has 
been
  * called.  The execution of the <method>init</method> method is under
@@ -1836,7 +1828,7 @@
   * Deletes the node and all the subnodes.
   * @param Boolean recursiveCall: internal use only
   */
-function destroy( recursiveCall ){
+    function destroy( recursiveCall = null){
     if (this.__LZdeleted == true) {
         return;
     }
@@ -1974,7 +1966,7 @@
   * @return LzAnimator: a reference to the animator that was added
   */
 
-function animate( prop, to, duration, isRelative, moreargs ) {
+function animate( prop, to, duration, isRelative = null, moreargs = null ) {
 
     if ( duration == 0 ){
         var val = isRelative ? this[ prop ] + to : to;

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js   
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js   
2008-01-09 04:44:25 UTC (rev 7778)
@@ -41,10 +41,6 @@
     public function LzDatapath (...rest) { }
 }
 
-public class LzIdle  {
-    trace('dummy LzIdle declared in core/dummyclasses.js');
-}
-
 public class LzCSSStyle {
 
     public static  function  getPropertyValueFor(a:*, b:*):* { return null;}
@@ -52,11 +48,6 @@
 
 
 
-public class LzAnimator {
-    public function LzAnimator(...rest){}
-    trace('dummy LzAnimator declared in core/dummyclasses.js');
-}
-
 public class LzBrowser {
     public static var defaultPortNums = { http: 80, https: 443 };
 

Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzApplication.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzApplication.as   
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzApplication.as   
2008-01-09 04:44:25 UTC (rev 7778)
@@ -9,11 +9,43 @@
   * @author Henry Minsky &lt;[EMAIL PROTECTED]&gt;
   */
 
-public class LzApplication {
+public class LzApplication extends Sprite {
 
     // This serves as the superclass of DefaultApplication, currently that is 
where
     // the compiler puts top level code to run.
 
+    #passthrough (toplevel:true) {  
+    import flash.display.*;
+    import flash.events.*;
+    import flash.utils.*;
+    }#
+
+
+    public function LzApplication () {
+
+        // Start up idle service timer. LzIdle is a global
+        LzIdle = new LzIdleClass ();
+        
+        LzIdleKernel.addCallback( this, '__idleupdate' );
+
+        var idleTimerPeriod = 33; // msecs
+        LzIdleKernel.startTimer( idleTimerPeriod );
+    }
+
+    
+        /**
+         * __idleupdate is a callback function from LzIdleKernel.
+         * Treat it as a static function (ie. Don't reference 'this')
+         * @access private
+         */
+    public function __idleupdate (etime) {
+        var oi = LzIdle.onidle;
+        if (oi.ready) {
+            oi.sendEvent( etime );
+        }
+    }
+
+
 }
 
 

Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzIdleKernel.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzIdleKernel.as    
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzIdleKernel.as    
2008-01-09 04:44:25 UTC (rev 7778)
@@ -34,12 +34,19 @@
         }
 
         public static function __update  ():void{
-            trace ('__update ' );
             for (var i:int = __callbacks.length - 1; i >= 0; i--) {
-                var s:Function = (__callbacks[i])[0];
+                var s = (__callbacks[i])[0];
                 s[__callbacks[i][1]]( getTimer() );
             }
         }
 
+        public static function startTimer(msecs:uint):void {
+            setInterval( LzIdleKernel.__update, msecs );
+        }
+
     }#
 }
+
+
+
+

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as        
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as        
2008-01-09 04:44:25 UTC (rev 7778)
@@ -496,6 +496,11 @@
           event.target.startDrag();
       }
 
+      public function getMCRef () {
+          trace("LzSprite.getMCRef not implemented in this runtime");
+      }
+
+
   }#
   }
 

Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as    
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as    
2008-01-09 04:44:25 UTC (rev 7778)
@@ -85,6 +85,7 @@
         }
 
         public function __initTextProperties (args:Object):void {
+            trace("__initTextProperties ", lzutils.objAsString(args));
             this.password = args.password  ? true : false;
             var textclip:TextField = this.textfield;
             textclip.displayAsPassword = this.password;
@@ -324,6 +325,76 @@
         public function getTextHeight ( ):Number {
             return this.textfield.textHeight;
         }
+
+
+
+        function getTextfieldHeight ( ) {
+        }
+
+
+
+function setHScroll (s){}
+
+function setAntiAliasType( aliasType ){}
+
+function getAntiAliasType() {}
+
+
+function setGridFit( gridFit ){}
+
+function getGridFit() {}
+
+function setSharpness( sharpness ){}
+
+function getSharpness() { }
+
+function setThickness( thickness ){}
+
+function getThickness() {}
+
+function setMaxLength ( val ){}
+function setPattern ( val ){}
+
+function setSelection ( start , end ){ }
+
+function setResize ( val ){
+    this.resize = val;
+}
+
+function setScroll ( h ){
+    trace("LzTextSprite.setScroll not yet implemeneted");
+}
+function getScroll (  ){
+    trace("LzTextSprite.getScroll not yet implemeneted");
+}
+
+function getMaxScroll (  ){
+    trace("LzTextSprite.getMaxScroll not yet implemeneted");
+}
+
+function getBottomScroll (  ){
+    trace("LzTextSprite.getBottomScroll not yet implemeneted");
+}
+
+function setXScroll ( n ){
+    trace("LzTextSprite.setXScroll not yet implemeneted");
+}
+
+function setYScroll ( n ){
+    trace("LzTextSprite.setYScroll not yet implemeneted");
+}
+
+function setWordWrap ( wrap ){
+    trace("LzTextSprite.setWordWrap not yet implemeneted");
+}
+
+function getSelectionPosition ( ){
+    trace("LzTextSprite.getSelectionPosition not yet implemeneted");
+}    
+function getSelectionSize ( ){
+    trace("LzTextSprite.getSelectionSize not yet implemeneted");
+}    
+
     }#
 }
 

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/Library.lzs   
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/Library.lzs   
2008-01-09 04:44:25 UTC (rev 7778)
@@ -38,6 +38,7 @@
 }
 
 if ($swf9) {
+#include "services/LzIdle.js"
 } else {
 #include "services/LzCSSStyle.js"
 #include "services/LzStyleSheet.js"

Added: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzIdle.js


Property changes on: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzIdle.js
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzInstantiator.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzInstantiator.js     
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzInstantiator.js     
2008-01-09 04:44:25 UTC (rev 7778)
@@ -17,7 +17,7 @@
   * @shortdesc Handles application instantiation.
   */
 
-public class LzInstantiatorClass {
+dynamic public class LzInstantiatorClass {
 
 var checkQDel = null;
 function LzInstantiatorClass () {
@@ -123,8 +123,10 @@
 
 /**
   * @access private
+  *
+  * This gets an event timer arg from the onidle event, which we ignore
   */
-function checkQ ( ){
+function checkQ ( ignoreme = null){
     if ( ! this.makeQ.length ) {
         if (! this.tricklingQ.length ){
             if ( !this.trickleQ.length ){

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js  
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js  
2008-01-09 04:44:25 UTC (rev 7778)
@@ -274,6 +274,7 @@
 
     //    LzInstantiator.requestInstantiation(  this, sva );
     LzInstantiator.createImmediate(  this, sva );
+    //
 }
 
 

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 
2008-01-09 04:44:25 UTC (rev 7778)
@@ -425,6 +425,7 @@
   * (By the root resolver in LaszloLibrary).
   */
 function init (){
+    Debug.write("LzCanvas.init called");
 }
 
 /**

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js    
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js    
2008-01-09 04:44:25 UTC (rev 7778)
@@ -41,7 +41,6 @@
 
     function LzView ( parent:* , attrs:* , children:* = null, instcall:*  = 
null) {
         super(parent,attrs,children,instcall);
-
     }
 
     
@@ -968,7 +967,7 @@
   * @access private
   * 
   */
-    override function destroy( recursiveCall ) { }
+    override function destroy( recursiveCall = null ) { }
 
 /** @access private */
 function deleteView( recursiveCall ){
@@ -1229,7 +1228,7 @@
   * events
   */
 function mouseevent(eventname) {
-    trace('view mouseevent', eventname, this, this[eventname].ready);
+    //    trace('view mouseevent', eventname, this, this[eventname].ready);
     if (this[eventname] && this[eventname].ready) 
this[eventname].sendEvent(this);
 }    
 
@@ -1376,7 +1375,7 @@
 
 
 function setX ( v, force = null ){
-    trace('setX',this,v);
+    //trace('setX',this,v);
     if (force || this._x != v) {
         this._x = v;
         this.x = v;

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs      
2008-01-09 03:23:57 UTC (rev 7777)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs      
2008-01-09 04:44:25 UTC (rev 7778)
@@ -12,7 +12,7 @@
     #include "views/LaszloView.js"
     #include "views/LzViewLinkage.js"
 
-    //#include "views/LzText.js"
+    #include "views/LzText.js"
     //#include "views/LzInputText.js"
 
 

Added: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js


Property changes on: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to