[Laszlo-dev] For Review: Change 20080112-dda-a Summary: SWF9: move code outside classes to 'main' class.

Donald Anderson dda at ddanderson.com
Sun Jan 13 06:22:32 PST 2008


Sure, I'll create a default constructor and put it all there.

Also, I'm assuming you will provide me with a LzApplication class?
It can be empty...   I'm not seeing it now, and I have extra code
in place to produce it.  I'm not sure we agreed on this or not.

- Don

On Jan 12, 2008, at 8:52 PM, Henry Minsky wrote:

> That looks almost right, but when compiling the application, can we  
> get the top level script codeo go inside of the constructor  method  
> of LzApplication
> instead of residing outside?
>
> E.g.,
>
> instead of
> package {
> canvas = new LzCanvas({__LZproxied: "true", bgcolor: 16777215,  
> embedfonts: true, fontname: "Verdana,Vera,sans-serif", fontsize: 11,  
> fontstyle: "plain", height: 600, lpsbuild: "7775 C:\\users\\hqm\ 
> \openlaszlo\\devildog", lpsbuilddate: "2008-01-12T20:35:54-0500",  
> lpsrelease: "Latest", lpsversion: " 4.1.x", runtime: "swf9", width:  
> 800});
> LzInstantiateView({attrs: {id: "bar", x: 200, y: 200}, children:  
> [{attrs: {$delegates: ["onclick", "$m1", null], $m1:
> ...
>
>
> it would be
>
> class LzApplication extends LFCApplication {
>    public function LzApplication() {
>  canvas = new LzCanvas({__LZproxied: "true", bgcolor: 16777215,  
> embedfonts: true, fontname: "Verdana,Vera,sans-serif", fontsize: 11,  
> fontstyle: "plain", height: 600, lpsbuild: "7775 C:\\users\\hqm\ 
> \openlaszlo\\devildog", lpsbuilddate: "2008-01-12T20:35:54-0500",  
> lpsrelease: "Latest", lpsversion: "4.1.x", runtime: "swf9", width:  
> 800});
> LzInstantiateView({attrs: {id: "bar", x: 200, y: 200}, children:  
> [{attrs: {$delegates: ["onclick", "$m1", null], $m1:
>      }
> ..
>
> }
>
>
>
>
>
> On Jan 12, 2008 6:13 PM, Donald Anderson <dda at ddanderson.com> wrote:
> Change 20080112-dda-a by dda at lester.local on 2008-01-12 18:05:49 EST
>     in /Users/dda/laszlo/src/svn/openlaszlo/branches/devildog
>     for http://svn.openlaszlo.org/openlaszlo/branches/devildog
>
> Summary: SWF9: move code outside classes to 'main' class.
>
> New Features:
>
> Bugs Fixed: LPP-5234
>
> Technical Reviewer: ptw (pending)
> QA Reviewer: hminsky (pending)
> Doc Reviewer: (pending)
>
> Documentation:
>
> Release Notes:
>
> Details:
>
> This change is motivated by discussions with Henry on where to
> put the main class.
>
> The big change was to put everything that appears outside of a class
> into the LFCApplication class (if we are building a
> library), or the LzApplication class (if we are building an
> application).  We expect that these classes exist in the input stream.
> If they do not we should throw an error - I'm not currently doing
> that, but rather temporarily creating a class by that name to hold
> this stuff - because the 'LzApplication' class is not currently being
> created by the tag compiler.  That code is marked by a TODO.
>
> Since we're collecting code and later stuffing it into a particular
> spot in the class, and to more nicely support the concept of
> 'top-level', this change adds the concept of 'insertStream markers'.
> We already had the concept of collecting output into different
> streams; now
> when we encounter one of these insert stream markers, we can insert
> the contents of a stream (for example the 'top-level stream'  
> containing
> stuff marked with #passthrough (toplevel:true)) at a certain
> point.  This substitution happens at the end of processing a
> translation unit.
>
> The smaller change was to fix the build to actually build LFC9.swc ,
> and put it in the right place.  Building 'debug', 'profile' versions
> etc. are ready to go in lps/lfc/build.xml, but are disabled for the
> moment (marked by TODO) until we get the basics of building an
> application end to end sorted out.
>
> With this change, the LFC builds cleanly, and an application
> with just a <canvas> and simple <script> builds cleanly,
> modulo the warning about a missing 'LzApplication' class,
> since we're adding that as discussed above.
>
> Tests:
>   builds lfc as checked into the tree.
>   builds the simplest app <canvas><script>var x = 1;</script></canvas>
>    against the built lfc.
>
>   runs smoketest for SWF8, DHTML.
>
> Files:
> M      WEB-INF/lps/lfc/build.xml
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/ 
> JavascriptGenerator.java
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/
> SWF9ParseTreePrinter.java
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/TranslationUnit.java
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java
> M      build.properties
>
> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080112-dda-a.tar
>
>
>
> --
>
> Don Anderson
> Java/C/C++, Berkeley DB, systems consultant
>
> voice: 617-547-7881
> email: dda at ddanderson.com
> www: http://www.ddanderson.com
>
>
>
>
>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com
>


--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-547-7881
email: dda at ddanderson.com
www: http://www.ddanderson.com




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080113/49e0f009/attachment.html


More information about the Laszlo-dev mailing list