<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-13414841</id><updated>2022-11-08T05:32:24.789-08:00</updated><title type='text'>Endeavors in GPLFlash2</title><subtitle type='html'>All the notes along my path through the GPLFlash2 project</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default?alt=atom'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default?alt=atom&amp;start-index=26&amp;max-results=25'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-13414841.post-114763899007318143</id><published>2006-05-14T13:32:00.000-07:00</published><updated>2006-05-14T13:36:30.093-07:00</updated><title type='text'>Project moved&amp;hellip;</title><content type='html'>&lt;p&gt;GPLFlash2 has faded into the mist. Folks who still want to follow development on a &lt;acronym title=&quot;Free/Libre Open Source Software&quot;&gt;FLOSS&lt;/acronym&gt; SWF interpreter should check out &lt;a href=&quot;http://savannah.gnu.org/projects/gnash/&quot;&gt;gnash&lt;/a&gt;.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/114763899007318143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=114763899007318143' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/114763899007318143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/114763899007318143'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2006/05/project-moved.html' title='Project moved&amp;hellip;'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112287503811568819</id><published>2005-07-31T22:30:00.000-07:00</published><updated>2005-07-31T22:43:58.120-07:00</updated><title type='text'>More Dead Air, and More to Come</title><content type='html'>&lt;p&gt;All right, folks; sorry again for the huge delay in posting. I&#39;ve been letting my subconscious turn over the design (read: slacking off), and there are a few changes that will need to be made to some of the interfaces that I&#39;ve defined so far. I&#39;d really like to get at least the SWFIO design done before the end of the summer, but I don&#39;t think that&#39;s going to happen. Which leads to my next announcement&amp;hellip;&lt;/p&gt;
&lt;p&gt;I&#39;m going in tomorrow (Monday) to negotiate a short-term, full-time job at a software company I have prior dealings with. Short of dire budget problems or a major catastrophe, I suspect I&#39;ll be employed starting August 11th to September 27th, and school will be starting up directly afterward. Furthermore, I&#39;m going to be on a road trip and unavailable from August 4th to the 10th. Thus, I&#39;m probably not going to have too much time to do anything really substantial for the rest of the summer.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112287503811568819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112287503811568819' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112287503811568819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112287503811568819'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/more-dead-air-and-more-to-come.html' title='More Dead Air, and More to Come'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112250648749636617</id><published>2005-07-27T09:04:00.000-07:00</published><updated>2005-12-02T20:21:23.130-08:00</updated><title type='text'>SWFIO Filters Design</title><content type='html'>&lt;p&gt;All right, I sat down and hammered out the basics of the SWFIO Filters package. I still haven&#39;t documented the semantics of all of the calls yet, but I know what they are (I just need to write them down). Once I get the semantics documented, I can write the unit tests &amp;mdash; after that, I can implement the code, &lt;em&gt;or&lt;/em&gt; leave that for someone else to do while I move on to designing other pieces.&lt;/p&gt;
&lt;p&gt;I&#39;ve updated the Umbrello diagram on the server (check the links at the left), and have also generated an image of the diagram (click the image below to see the full-scale picture). Enjoy :).&lt;/p&gt;
&lt;!--
&lt;a href=&quot;http://photos1.blogger.com/blogger/3472/397/1600/SWFIO%20Filters.jpg&quot;&gt;&lt;img style=&quot;margin:0 10px 10px 0&quot; src=&quot;http://photos1.blogger.com/blogger/3472/397/400/SWFIO%20Filters.jpg&quot; /&gt;&lt;/a&gt;
--&gt;
&lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/SWFIO%20Filters.png&quot;&gt;&lt;img style=&quot;margin:0 10px 10px 0&quot; src=&quot;http://photos1.blogger.com/blogger/3472/397/400/SWFIO%20Filters.jpg&quot; alt=&quot;An unreadable, low-res UML diagram representing the SWFIO filters package&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112250648749636617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112250648749636617' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112250648749636617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112250648749636617'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/swfio-filters-design.html' title='SWFIO Filters Design'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112170356622209594</id><published>2005-07-18T08:30:00.000-07:00</published><updated>2005-07-21T15:12:06.100-07:00</updated><title type='text'>Cairo and GPLFlash</title><content type='html'>&lt;p&gt;All right; I&#39;m going to really drive the &quot;Cairo will/won&#39;t work for us&quot; argument into the dirt. I think it &lt;em&gt;will&lt;/em&gt; work for us, and I&#39;m prepared to do the research to back that hunch up.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://sourceforge.net/mailarchive/message.php?msg_id=11974740&quot;&gt;This email&lt;/a&gt; is a bit deceptive on a couple of points, though not intentionally so. Cairo, first off, is a vector drawing library, which means it talks in terms of paths (curves/lines), strokes, fills, and transforms. Both SWF and SVG are vector-based formats; SWF uses only paths, strokes, fills, and transforms, whereas &lt;a href=&quot;http://www.w3.org/TR/SVG11/paths.html&quot;&gt;SVG uses these&lt;/a&gt; &lt;strong&gt;in addition to&lt;/strong&gt; primitive shapes.&lt;/p&gt;
&lt;p&gt;The big issue for correctly rendering SWF shapes is how fills are performed. The aforementioned email states that there are &quot;left/right area[s]&quot;; drawing on the spec, I&#39;ll elaborate a little. The specification says that there are two fill types that a path can have: &quot;fillstyle0&quot;, which is applied to the left of the vectors in the path, and &quot;fillstyle1&quot;, which is applied to the right of the vectors in the path. However, due to the examples and language used after this statement, I am under the impression that &quot;fillstyle0&quot; is for interior fills, and &quot;fillstyle1&quot; is for overlap/self-intersection fills, and that the left/right nomenclature was purely for the sake of example. The only way to find out will be to run a test through MM&#39;s player; I&#39;ll try to construct such a test in the near future.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: I have constructed tests. I have been totally unable to get MM&#39;s player to render &quot;fillstyle1&quot; and &quot;fillstyle0&quot; simultaneously. MM&#39;s player, for all intents and purposes, behaves exactly like &quot;even/odd&quot; filling, which Cairo provides. If anyone is interested in getting the test files and source code used to generate those tests files, ask me for a URL in IRC (any link posted here would probably go stale too fast).&lt;/p&gt;

&lt;p&gt;Here&#39;s a table that compares SWF&#39;s functional needs with the drawing tools that Cairo provides:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
    &lt;tr&gt;&lt;th&gt;SWF-required&lt;/th&gt;&lt;th&gt;Cairo&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
    &lt;tr&gt;&lt;td&gt;RGB/A Solid fill&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-source-rgb&quot;&gt;Provided&lt;/a&gt; (&lt;a href=&quot;http://cairographics.org/samples/fill_and_stroke.html&quot;&gt;sample&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Linear Gradient&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-create-linear&quot;&gt;Provided&lt;/a&gt; (&lt;a href=&quot;http://cairographics.org/samples/gradient.html&quot;&gt;sample&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Radial Gradient&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-create-radial&quot;&gt;Provided&lt;/a&gt; (&lt;a href=&quot;http://cairographics.org/samples/gradient.html&quot;&gt;sample&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Clipped Bitmap Fill&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Not provided&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Tiled Bitmap Fill&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://cairographics.org/manual/cairo-cairo-t.html#cairo-image-surface-create&quot;&gt;Provided&lt;/a&gt; (&lt;a href=&quot;http://cairographics.org/samples/imagepattern.html&quot;&gt;sample&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Stroke width&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-line-width&quot;&gt;Provided&lt;/a&gt; (&lt;a href=&quot;http://cairographics.org/samples/fill_and_stroke.html&quot;&gt;sample&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Stroke color&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-source-rgb&quot;&gt;Provided&lt;/a&gt; (&lt;a href=&quot;http://cairographics.org/samples/fill_and_stroke.html&quot;&gt;sample&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Moving Without Drawing&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://cairographics.org/manual/cairo-cairo-t.html#cairo-move-to&quot;&gt;Provided&lt;/a&gt; (&lt;a href=&quot;http://cairographics.org/samples/fill_and_stroke2.html&quot;&gt;sample&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Affine Transforms&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-t&quot;&gt;Provided&lt;/a&gt; (&lt;a href=&quot;http://freedesktop.org/~keithp/tutorials/cairo/html/img31.jpg&quot;&gt;sample&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Drawing Lines&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://cairographics.org/manual/cairo-cairo-t.html#cairo-line-to&quot;&gt;Provided&lt;/a&gt; (&lt;a href=&quot;http://cairographics.org/samples/fill_and_stroke.html&quot;&gt;sample&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Drawing Curves&lt;a id=&quot;cairo_and_gplflash_curvenote_back&quot; href=&quot;#cairo_and_gplflash_curvenote&quot;&gt;*&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://cairographics.org/manual/cairo-cairo-t.html#cairo-curve-to&quot;&gt;Provided&lt;/a&gt; (&lt;a href=&quot;http://cairographics.org/samples/curve_to.html&quot;&gt;sample&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Even/Odd Filling&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-fill-rule&quot;&gt;Provided&lt;/a&gt; (&lt;a href=&quot;http://freedesktop.org/~keithp/tutorials/cairo/html/img32.jpg&quot;&gt;sample&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
&lt;!--    &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;&quot;&gt;Provided&lt;/a&gt; (&lt;a href=&quot;&quot;&gt;sample&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt; --&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;a id=&quot;cairo_and_gplflash_curvenote&quot; href=&quot;#cairo_and_gplflash_curvenote_back&quot;&gt;*&lt;/a&gt;Note that the Bezier curves must be converted from quadratic (SWF) to cubic (the rest of the world :p). This is a straightforward transformation.&lt;/p&gt;

&lt;p&gt;The only thing I can see standing in the way of using Cairo is the &quot;clipped bitmap fill,&quot; which takes a 1 pixel outline of the bitmap, then extends that outline as far as it needs to go to fill the area. I can&#39;t easily generate a test for this functionality to see how it works in MM&#39;s player, so I don&#39;t know if it will be easy to emulate (using something like imagemagick) or not.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112170356622209594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112170356622209594' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112170356622209594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112170356622209594'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/cairo-and-gplflash.html' title='Cairo and GPLFlash'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112161940347775259</id><published>2005-07-17T09:04:00.000-07:00</published><updated>2005-12-02T20:22:16.300-08:00</updated><title type='text'>Overdue Update</title><content type='html'>&lt;p&gt;Sorry about all of the dead air lately. I have been rather distracted these last few days, so I don&#39;t have much to show :p. There are still a couple of news-worthy tidbits, despite my lack of concentration.&lt;/p&gt;
&lt;h3&gt;ffmpeg Dependency Issues&lt;/h3&gt;
&lt;p&gt;First off, thanks to &lt;em&gt;willem&lt;/em&gt; for helping out with this matter.&lt;/p&gt;
&lt;p&gt;So, it turns out that ffmpeg actually generates .pc files (for the pkg-config system), but how those files are handled varies from distribution to distribution. Under Debian, an ffmpeg-config script is installed, and other under distributions, the .pc files &lt;em&gt;could&lt;/em&gt; be installed. Under Gentoo, none of those files is installed. Thus, I&#39;ve re-written our ffmpeg test so that it looks for &quot;ffmpeg-config&quot; first, &quot;pkg-config avcodec avformat&quot; next, and then finally tries to just right-out look for &quot;-lavcodec -lavformat&quot; (or &quot;-lavcodec_pic -lavformat_pic&quot;).&lt;/p&gt;
&lt;p&gt;The main reason we have to use ffmpeg-config or pkg-config first is because on systems like Debian, the ffmpeg libraries are cross-linked to lots of other optional libraries. Thus, there is a variable list of -l flags that must be used in addition to &quot;-lavcodec -lavformat&quot;, and it would be foolish to try to brute-force all of the possible combinations.&lt;/p&gt;
&lt;h3&gt;Edits &amp;amp; Corrections&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;kermit_&lt;/em&gt; has kindly donated his time and skills as a technical writer. He&#39;s already made a few adjustments to the &lt;a href=&quot;http://gplflash.sourceforge.net/&quot;&gt;GPLFlash homepage&lt;/a&gt;, and he&#39;s presently working on annotating and cleaning up the contents of gplflash2/doc/. Thanks kermit_!&lt;/p&gt;
&lt;h3&gt;NPAPI updates&lt;/h3&gt;
&lt;p&gt;I&#39;ve made various updates to the NPAPI docs (&lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/npapi.html&quot;&gt;html&lt;/a&gt;, &lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/npapi.pdf&quot;&gt;pdf&lt;/a&gt;, and &lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/npapi.texinfo&quot;&gt;texinfo source&lt;/a&gt;). The initial documents were totally, flat-out wrong in some respects. I could &lt;strong&gt;really&lt;/strong&gt; use a Windows programmer and a Mac programmer to help me write the platform-specific parts of the guide. Anyone interested?&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112161940347775259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112161940347775259' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112161940347775259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112161940347775259'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/overdue-update.html' title='Overdue Update'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112122554678357017</id><published>2005-07-12T19:32:00.000-07:00</published><updated>2005-07-12T21:32:38.403-07:00</updated><title type='text'>Scouting Documentation for NPAPI</title><content type='html'>&lt;p&gt;I&#39;m writing something that I&#39;ve dubbed a &quot;scouting document&quot; &amp;mdash; documentation that covers a whole topic that will affect us in the future, but only a subset of which I&#39;m interested in at the moment. In this case, I&#39;ve decided to take a detour and start working on a &lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/npapi.html&quot;&gt;thorough and comprehensive NPAPI guide&lt;/a&gt; (since even the official documentation has some holes and misinformation). When someone in the future goes out to re-write our plugin (as I&#39;m sure will happen eventually), this document will hopefully be the only thing they need to understand the requirements on the plugin side of things. I&#39;ve been working on it for about two days now, and hope to have my research and first draft completed within a week. For those interested in alternate formats, the &lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/npapi.texinfo&quot;&gt;texinfo source document&lt;/a&gt; and &lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/npapi.pdf&quot;&gt;pdf rendering&lt;/a&gt; are also available.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112122554678357017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112122554678357017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112122554678357017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112122554678357017'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/scouting-documentation-for-npapi.html' title='Scouting Documentation for NPAPI'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112110941784660617</id><published>2005-07-11T11:12:00.000-07:00</published><updated>2005-07-11T12:16:59.236-07:00</updated><title type='text'>Explaining SWFContext</title><content type='html'>&lt;p&gt;Someone, whilst looking over the diagrams in a &lt;a href=&quot;http://gplflash2.blogspot.com/2005/07/walk-through-design-lane.html&quot;&gt;previous post&lt;/a&gt;, asked me why the SWFContext package depended on the SWFIO package. The answer to that initial question is because the SWFContext package will (or has the high potential to) handle SWF tags, structures and/or primitives. I think it would be highly unlikely that, throughout the entire package, not one class or sub-package would handle objects from SWFIO. Handling (sans a higher-layer abstraction or wrapper) is enough to cause dependency.&lt;/p&gt;
&lt;p&gt;The path that our discussion took, however, went towards &quot;ActionScript only&quot; coding, and how it wouldn&#39;t make sense to have just tags for keeping context in that case. This is entirely true: in a file where you have only two tags (an ActionScript and an End), the vast majority of the work is not going to be done with tags; it&#39;ll be done in the ActionScript VM, using context-saving methods that are designed for that purpose. However, note that there is no conflict here: SWFContext is a &lt;em&gt;package&lt;/em&gt;, not a class. I used packages on purpose, because I really don&#39;t know enough about how the system should work overall (yet) to create classes.&lt;/p&gt;
&lt;p&gt;Now, I surely haven&#39;t thought deeply about AS and how to design its implementation yet &amp;mdash; and I most certainly didn&#39;t think about the situation of a completely programmatic SWF. However, the design does allow for these &quot;future requirements&quot; by creating appropriate extensibility points. To implement AS, we shouldn&#39;t need to change anything in the SWFContext package at all, nor should we have to change anything in the TagLogic package (aside from implementing the AS tag handler). Creating things inside of AS will be managed by the AS VM; the context will be allocated by that VM, and could then be stored in a variety of places (such as a void* in an STL map container, either in the TagData object itself, or back in some context object in SWFContext).&lt;/p&gt;
&lt;p&gt;Now keep in mind that I made up most of the last paragraph you just read (that is, I hadn&#39;t planned it out in advance). The design is &lt;strong&gt;far&lt;/strong&gt; from being coherent, let alone complete &amp;mdash; it&#39;s just a rough roadmap for the time being. In fact, a very important detail (having a SWF- and/or tag-central location where multiple &quot;plugins&quot; can store independent contexts) came out of the exercise. I&#39;m nowhere near touching AS, or rendering, or user input, or sound, or A/V sync, or any other of a million other broad and nuanced areas that the final player will encompass. That&#39;s why getting questioned and challenged along the way is ultimately a good thing &amp;mdash; other folks can see the potential mistakes I&#39;m making, and that gives me the chance to plan out and ensure I don&#39;t make that mistake. That is, after all, what design is about ;).&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112110941784660617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112110941784660617' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112110941784660617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112110941784660617'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/explaining-swfcontext.html' title='Explaining SWFContext'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112106585526468708</id><published>2005-07-11T00:03:00.000-07:00</published><updated>2005-07-11T00:10:55.276-07:00</updated><title type='text'>Asking the Mozilla Devs</title><content type='html'>&lt;p&gt;All right; the long and short of it is that the &quot;simple&quot; plugin from last time didn&#39;t register or  otherwise work. As such, I decided to pop over to irc.mozilla.org and see if I couldn&#39;t straighten things out directly with the developers. Apparently, the XPCOM plugin interfaces are &lt;em&gt;deprecated&lt;/em&gt; &amp;gt;_&amp;lt;. So&amp;hellip; there&#39;s no reason not to just use the plain-jane C NPAPI interface. I&#39;ll go ahead and design with that in mind.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112106585526468708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112106585526468708' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112106585526468708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112106585526468708'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/asking-mozilla-devs.html' title='Asking the Mozilla Devs'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112101010785508492</id><published>2005-07-10T08:12:00.000-07:00</published><updated>2005-07-10T08:41:47.870-07:00</updated><title type='text'>Pulling Mozilla CVS</title><content type='html'>&lt;p&gt;So, after looking at several &quot;real-world&quot; examples, it turns out that all of them (including the mplayerplug-in project) use NPAPI in order to actually register and communicate with the browser. There are, however, sample plug-ins in the Mozilla repository that appear to not use the old NPAPI at all. I&#39;ve been examining these plugins, but have not had any luck getting my own version to show up in about:plugins. I&#39;m currently building the whole Mozilla suite from CVS now in order to see if the sample plugins actually register properly, or if it&#39;s just me doing something wrong in my implementations.&lt;/p&gt;
&lt;p&gt;For the curious, here is the link to the &lt;a href=&quot;http://lxr.mozilla.org/seamonkey/source/modules/plugin/samples/simple/&quot;&gt;&quot;simple&quot; sample plugin&lt;/a&gt; that I&#39;m trying to build. I think I&#39;ve learned a lot about the architecture thus far, but since I have yet to get a plugin working, I can&#39;t be sure. As such, I&#39;m going to refrain from documenting my &quot;findings&quot; from studying that plugin until I&#39;m sure that what I think I&#39;ve learned is fact ;)&lt;/p&gt;
&lt;p&gt;I&#39;m also starting to wonder if this whole process is worth it. Since so many other plugins use the old NPAPI, why not go ahead and use it for GPLFlash? The old API certainly seems like it would be easier to use. I guess the big thing is the scripting interface that can be exposed with the new API, though that can be done in conjunction with using the old API calls for plugin registration. Ah well &amp;mdash; the &quot;simple&quot; plugin sample just finished compiling (with a little bit of tweaking), so I&#39;m off to test it.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112101010785508492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112101010785508492' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112101010785508492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112101010785508492'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/pulling-mozilla-cvs.html' title='Pulling Mozilla CVS'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112094712238722775</id><published>2005-07-09T15:04:00.000-07:00</published><updated>2005-07-09T15:12:02.393-07:00</updated><title type='text'>Pulling Real-World Examples</title><content type='html'>&lt;p&gt;Well, I decided I&#39;d go see how other folks have implemented plug-ins, and use that as a basis for building my own. I started out with the plug-ins that I have installed: &lt;a href=&quot;http://xinehq.de/index.php/releases&quot;&gt;gxine&lt;/a&gt; and &lt;a href=&quot;http://librsvg.sourceforge.net/&quot;&gt;librsvg&lt;/a&gt;. Both of these use the &quot;old&quot; NAPI style. Then it occurred to me that someone had mentioned another plug-in that we should borrow from &amp;mdash; the &lt;a href=&quot;http://mplayerplug-in.sourceforge.net/&quot;&gt;mplayer plug-in&lt;/a&gt;. I fetched the source for that plug-in again, and lo and behold &amp;mdash; it uses XPCOM. I went back and grep&#39;d my logs to see who suggested that; &lt;strong&gt;thanks tgc&lt;/strong&gt;! You had the right idea, you were just ahead of me in the scheme of things. I&#39;m going to spend today alternating between doing housework, and picking apart this plug-in.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112094712238722775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112094712238722775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112094712238722775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112094712238722775'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/pulling-real-world-examples.html' title='Pulling Real-World Examples'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112090695118098408</id><published>2005-07-09T03:52:00.000-07:00</published><updated>2005-07-09T04:02:37.686-07:00</updated><title type='text'>XPCOM and Gecko Plug-Ins: Help?</title><content type='html'>&lt;p&gt;So, it looks like the interface I currently have a link for (on in my &quot;reference&quot; links on the left) is for the &quot;pre-5.0&quot; plug-in system. Apparently, there&#39;s a new system based on &quot;cross-platform component object modules&quot; (XPCOM). This means that it&#39;s OO, interface-based, and roundabout ;). Unfortunately, there doesn&#39;t seem to be very good documentation on how to use the XPCOM system to make a plug-in, so I&#39;m a bit stuck. I was preparing to write a little program to figure out how Mozilla/Firefox&#39;s plug-in system works, so that I could better design the SWFIO::Filters::NAPI::Read class.&lt;/p&gt;
&lt;p&gt;Does anyone have familiarity with the XPCOM model in Mozilla? Does anyone know of a good reference for writing a plug-in based on this model? If not, I&#39;ll do my best to document my own path.&lt;/p&gt;
&lt;p&gt;On an unrelated note, I&#39;m going to try and be more regular with my updates. It appears as though folks are actually reading this thing now, and it&#39;s rude of me to be too far off in my corner without updating you all on what I&#39;m doing. I&#39;ll do my best not to dilute the posts, but I&#39;ll also be more forthcoming with the snags I&#39;ve hit, and the intermediate steps I&#39;m going through.&lt;/p&gt;
&lt;p&gt;that&#39;s all for now :)&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112090695118098408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112090695118098408' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112090695118098408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112090695118098408'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/xpcom-and-gecko-plug-ins-help.html' title='XPCOM and Gecko Plug-Ins: Help?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112085628742340527</id><published>2005-07-08T13:53:00.000-07:00</published><updated>2005-07-09T15:34:11.073-07:00</updated><title type='text'>Anon. Comments</title><content type='html'>&lt;p&gt;This is a bit of a delayed announcement, but I have turned anonymous comments on in order to allow a wider range of people to respond to the posts.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112085628742340527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112085628742340527' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112085628742340527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112085628742340527'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/anon-comments.html' title='Anon. Comments'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112071140726651617</id><published>2005-07-06T21:06:00.000-07:00</published><updated>2005-07-12T23:29:03.796-07:00</updated><title type='text'>A Walk Through Design Lane</title><content type='html'>&lt;p&gt;All right, I finished documenting my topmost level of design, as well as the first (of many) second-level design diagram. I&#39;ll be presenting these in this post; the original information is all available in the current &lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/gplflash.xmi.tar.bz2&quot;&gt;design document&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Top-level design&lt;/h3&gt;
&lt;img src=&quot;http://photos1.blogger.com/blogger/3472/397/1600/GPLFlash.jpg&quot; title=&quot;A top-level UML diagram for the proposed GPLFlash architecture&quot; alt=&quot;four packages: SWFIO, SWFContext, Frontend and TagLogic. SWFContext depends on SWFIO, and TagLogic depends on all of the other packages.&quot; /&gt;
&lt;p&gt;Because of the dependencies, the packages should be implemented in this order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;SWFIO&lt;/li&gt;
&lt;li&gt;SWFContext&lt;/li&gt;
&lt;li&gt;Frontend (can be done concurrently with 1 and 2)&lt;/li&gt;
&lt;li&gt;TagLogic&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Package Descriptions&lt;/h4&gt;
&lt;h5&gt;SWFIO&lt;/h5&gt;
&lt;p&gt;A strictly data-oriented interface to the SWF format.&lt;/p&gt;
&lt;p&gt;Handles reading and writing all primitive data types, and data-only structures from an SWF stream.&lt;/p&gt;
&lt;h5&gt;SWFContext&lt;/h5&gt;
&lt;p&gt;Provides different levels of containers that, as a whole, represent the state of an entire SWF file.&lt;/p&gt;
&lt;p&gt;The SWFContext package is intended to provide a common access point for external SWF processors (such as SWF interpreters, writers, or even dynamic filters). Some of these applications will want the SWF container to be smart (in the case of writers), whereas others will want the container to be as dumb as possible (in the case of interpreters and some special filters). This is why SWFContext is a package, and not just a single class.&lt;/p&gt;
&lt;h5&gt;Frontend&lt;/h5&gt;
&lt;p&gt;A normalized interface to shuffle data to and from the user.&lt;/p&gt;
&lt;p&gt;Any implementation of the Frontend package will need to provide functionality for reading keyboard events, reading mouse events, displaying graphical objects, playing sounds, and possibly reading graphical objects (webcam) and reading sounds (microphone).&lt;/p&gt;
&lt;h5&gt;TagLogic&lt;/h5&gt;
&lt;p&gt;A behavior-oriented interface to the SWF file format.&lt;/p&gt;
&lt;p&gt;TagLogic requires SWFIO for the TagData package it contains. Each TagLogic class representing a flash tag has a corresponding SWFIO TagData class embedded within it. TagLogic also requires the SWFContext package, since tags may need to refer to and modify other tags in the SWF file. Finally, TagLogic also requires an appropriate Frontend package (which could be implemented multiple times, allowing for the Frontend to be switched) in order to get input from the user, and provide the appropriate visual/audio output.&lt;/p&gt;

&lt;h3&gt;SWFIO package&lt;/h3&gt;
&lt;img src=&quot;http://photos1.blogger.com/blogger/3472/397/1600/SWFIO.jpg&quot; title=&quot;A UML diagram of the SWFIO package&quot; alt=&quot;Four packages: Filters, Datatypes, Structures, and TagData. Datatypes, Structures and TagData depend on Filters; Structures and TagData depend on Datatypes; and TagData depends on Structures.&quot; /&gt;
&lt;p&gt;Because of the dependencies, the packages should be implemented in this order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Filters&lt;/li&gt;
&lt;li&gt;Datatypes&lt;/li&gt;
&lt;li&gt;Structures&lt;/li&gt;
&lt;li&gt;TagData&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Package Descriptions&lt;/h4&gt;
&lt;h5&gt;Filters&lt;/h5&gt;
&lt;p&gt;Provides a framework for normalized I/O and drop-in data filters.&lt;/p&gt;
&lt;p&gt;This package defines filter classes that can be &quot;chained&quot; together, similar to a pipe on the command line. Filters can perform an in-line function (like encryption/decryption, compression/decompression, executing a SED script, etc.), normalize access to an existing data source/sink (STL iostreams, C file I/O, NAPI asynchronous I/O, etc.), and/or provide &quot;special&quot; data extraction/insertion methods (SWF primitive data types).&lt;/p&gt;

&lt;h5&gt;Datatypes&lt;/h5&gt;
&lt;p&gt;Provides a way to access SWF primitives that are not directly provided by the SWF filter.&lt;/p&gt;
&lt;p&gt;Some primitive data types (most noticeably the fixed-point types) are directly derived from other SWF primitives. As such, these types are not really primitive, but alternate interpretations of &quot;true&quot; primitive types. This package sits  on top of the SWF filter, and provides the primitives that the SWF filter does not directly support.&lt;/p&gt;

&lt;h5&gt;Structures&lt;/h5&gt;
&lt;p&gt;Contains classes for data structures that are used by several different SWF tags.&lt;/p&gt;
&lt;p&gt;The structure objects in Structures do not have any behavior other than asserting that the structure values are always within their bounds and providing correct serialization/deserialization to/from an SWF filter.&lt;/p&gt;

&lt;h5&gt;TagData&lt;/h5&gt;
&lt;p&gt;Contains classes that read and write entire SWF tag objects.&lt;/p&gt;
&lt;p&gt;The tag objects in TagData do not have any behavior other than asserting that the tag values are always within their bounds and providing correct serialization/deserialization to/from an SWF filter.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112071140726651617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112071140726651617' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112071140726651617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112071140726651617'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/walk-through-design-lane.html' title='A Walk Through Design Lane'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112070414014242095</id><published>2005-07-06T19:36:00.000-07:00</published><updated>2005-07-06T19:52:52.866-07:00</updated><title type='text'>I&#39;m Back!</title><content type='html'>&lt;p&gt;All right; now that I&#39;m back from my hiatus and settled in, I&#39;m ready to go back to doing some serious work. Here&#39;s what I&#39;m planning to take care of, in order of importance:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Getting more work done on the &lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/gplflash.xmi.tar.bz2&quot;&gt;new design&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Assisting newbies on IRC and the mailing list&lt;/li&gt;
&lt;li&gt;Helping the &lt;a href=&quot;http://gplflash.sourceforge.net/cgi-bin/moin.cgi&quot;&gt;wiki&lt;/a&gt; move along.&lt;/li&gt;
&lt;li&gt;Reviewing the &lt;a href=&quot;http://cvs.sourceforge.net/viewcvs.py/*checkout*/gplflash/gplflash2/doc/detailedDesign.sxw&quot;&gt;&quot;detailed&quot; design document&lt;/a&gt; for the current system.&lt;/li&gt;
&lt;li&gt;Replying to E-mails. My apologies to folks on this one, but crafting an E-mail is a 30 minute to 2 hour job for me, and I can&#39;t really work on anything else in that period. Catch me on IRC!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Expect updates on the design soonish. I&#39;ll try to generate some png files for important parts of the system for those who can&#39;t or don&#39;t want to muck with Umbrello.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112070414014242095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112070414014242095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112070414014242095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112070414014242095'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/07/im-back.html' title='I&#39;m Back!'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-112009224065165913</id><published>2005-06-29T17:34:00.000-07:00</published><updated>2005-06-29T17:44:00.656-07:00</updated><title type='text'>General Updates</title><content type='html'>&lt;p&gt;Well, I&#39;ve been busy over the last couple of days, mostly working on getting the &lt;a href=&quot;http://gplflash.sourceforge.net/cgi-bin/moin.cgi&quot;&gt;GPLFlash Wiki&lt;/a&gt; populated with some base-line information. I&#39;ve also filled in the final sections of my &lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/GPLFlash_KMS.pdf&quot;&gt;knowledge management paper&lt;/a&gt;; feedback on this paper would be welcome :).&lt;/p&gt;
&lt;p&gt;Also, I&#39;m probably going to be out of touch for the next 5 days &amp;mdash; going to visit relatives tomorrow, and then I&#39;ll be attending a four-day LAN party directly afterwards. I&#39;ll see what I can do between rounds at the party, but communication is likely to be sporadic; don&#39;t count on anything ;).&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/112009224065165913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=112009224065165913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112009224065165913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/112009224065165913'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/06/general-updates.html' title='General Updates'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-111972057421172927</id><published>2005-06-25T10:05:00.000-07:00</published><updated>2005-06-25T10:46:14.976-07:00</updated><title type='text'>MoinMoin: The Tentative Winner</title><content type='html'>&lt;p&gt;So, now that I&#39;ve tinkered around with it a bit, it looks like &lt;a href=&quot;http://moinmoin.wikiwikiweb.de/&quot;&gt;MoinMoin&lt;/a&gt; could come out as being the wiki that powers GPLFlash. Briefly, here are the pros and cons of the system:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pros
&lt;ul&gt;
&lt;li&gt;Seems very hack-able/extensible&lt;/li&gt;
&lt;li&gt;Log in works (as previously mentioned)&lt;/li&gt;
&lt;li&gt;User and group permissions are flexible, and lend themselves to delegation and the autonomous operation of sub-groups.&lt;/li&gt;
&lt;li&gt;Multiple indexing schemes should help both site users and maintainers to find what they need.&lt;/li&gt;
&lt;li&gt;Categories look like they have potential (but I have not tried the feature yet)&lt;/li&gt;
&lt;li&gt;With some hacking, RSS support now allows for fine-grained monitoring of the site for page updates&lt;/li&gt;
&lt;li&gt;The wiki syntax and macros provide a robust set of tools to create, reference, and re-use content within the site&lt;/li&gt;
&lt;li&gt;Skinnable with CSS, so people can color to taste. Also allows for the possibility of creating accessible versions of the site (e.g., &quot;high contrast,&quot; &quot;large print&quot;).&lt;/li&gt;
&lt;li&gt;File uploading/attachments&lt;/li&gt;
&lt;li&gt;Extensive documentation&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Cons
&lt;ul&gt;
&lt;li&gt;No database, which means the files eat our web quota, we have a file permissions nightmare, and the system is liable to be slower.&lt;/li&gt;
&lt;li&gt;CGI, and the server doesn&#39;t support FastCGI (at least for Python). This is a disadvantage to PHP, which can have a single (or many) long-running threads that can cache things in memory and share info between processes. CGI requires a new process to be started for every request, and any caching must be done to disk.&lt;/li&gt;
&lt;li&gt;Renaming a page makes all existing links to that page turn into &quot;create this page&quot; links. No redirect is inserted, and the links themselves aren&#39;t changed to point at the new page. This may be fixable by modifying the RenamePage plug-in.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If anything else springs to mind, I&#39;ll be sure to update this post. In the mean time, I&#39;m probably going to go about re-installing MoinMoin and setting up the site for a test pilot.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/111972057421172927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=111972057421172927' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111972057421172927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111972057421172927'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/06/moinmoin-tentative-winner.html' title='MoinMoin: The Tentative Winner'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-111966591776242851</id><published>2005-06-24T18:59:00.000-07:00</published><updated>2005-06-25T14:23:17.273-07:00</updated><title type='text'>So Many Wikis, So Little Time</title><content type='html'>&lt;p&gt;Well, I&#39;ve been installing and uninstalling wikis like crazy over the last couple of days, along with the assistance of Thomas. For future reference, here are the systems that we&#39;ve tested, and why we&#39;ve rejected each:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;UseModWiki: No real user handling/page control. &quot;logging in&quot; was not possible; a new user was always created.&lt;/li&gt;
&lt;li&gt;MediaWiki: Couldn&#39;t stay logged in.&lt;/li&gt;
&lt;li&gt;TWiki: Could create users, but no passwords; unable to log in.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Currently, I&#39;ve got MoinMoin installed. It was a bit of a pain to set up, but now that it is installed, it looks like it may actually have real user support (!). I wouldn&#39;t have thought that such a basic feature &amp;mdash; &lt;em&gt;logging in&lt;/em&gt; &amp;mdash; would be so hard to find. I&#39;ll continue tinkering with MoinMoin and see if it&#39;s all-around adequate for our needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Other wikis that were rejected:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;WackoWiki: (not installed) Documentation indicated that groups must be completely administered via configuration files on the server; no wiki interface, and no delegation.&lt;/li&gt;
&lt;li&gt;PhpWiki: Difficult to install, and difficult to administrate; spotty documentation.&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/111966591776242851/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=111966591776242851' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111966591776242851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111966591776242851'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/06/so-many-wikis-so-little-time.html' title='So Many Wikis, So Little Time'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-111954833770657127</id><published>2005-06-23T10:31:00.000-07:00</published><updated>2005-06-24T19:30:09.503-07:00</updated><title type='text'>GPLFlash and Knowledge Management</title><content type='html'>&lt;p&gt;Well, I decided to start putting a little more work into the knowledge management paper I&#39;m doing for school, and I&#39;m almost finished with it. I&#39;ve decided to put the &lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/GPLFlash_KMS.pdf&quot;&gt;work in progress&lt;/a&gt; (PDF) up for anyone who&#39;s interested &amp;mdash; if anyone would like to comment on it, please feel free.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/111954833770657127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=111954833770657127' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111954833770657127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111954833770657127'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/06/gplflash-and-knowledge-management.html' title='GPLFlash and Knowledge Management'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-111943721068559339</id><published>2005-06-22T03:29:00.000-07:00</published><updated>2005-06-23T14:14:57.820-07:00</updated><title type='text'>More Rotten Fruit</title><content type='html'>&lt;p&gt;ArgoUML can&#39;t differentiate between classes with the same name but in different namespaces. Hello, guys; remind me what the whole point of namespaces is? ArgoUML &lt;em&gt;also&lt;/em&gt; has a UI that is so painful to use, I almost want to slam my computer to the floor in frustration. Drag-and-drop works, but only some of the time in some cases; click-to-edit works, but sometimes the changes take and sometimes they don&#39;t; while working, internal parts of the program seem to crash and can only be fixed by a restart&amp;hellip; the thing feels like it&#39;s taking lessons from a younger M$. I &lt;strong&gt;swear&lt;/strong&gt; I have never been this angry at a program before &amp;mdash; and it takes a &lt;em&gt;lot&lt;/em&gt; to get me angry, especially at a computer.&lt;/p&gt;
&lt;p&gt;I think that the most frustrating thing is that the program seems like it could be vastly useful if the UI weren&#39;t so bad&amp;hellip; and the software weren&#39;t so buggy&amp;hellip; and the model elements interacted in an intuitive fashion&amp;hellip; and it could import XMI right&amp;hellip; I don&#39;t know how, through all these flaws, it manages to seem useful, but it does pull it off, and it&#39;s utterly infuriating. Unless you want to bash your head against the wall, &lt;a href=&quot;http://argouml.tigris.org/&quot;&gt;do not use this software&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So, here&#39;s the make/break list for the software I&#39;ve tried thus far:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ArgoUML: Namespace blind. Using it makes me see red.&lt;/li&gt;
&lt;li&gt;Umbrello: Bad C++ generation.&lt;/li&gt;
&lt;li&gt;Gaphor: No XMI import, no code generation, and it seems things must exist in a diagram to exist in the model overall.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, I&#39;m bust for tools. I think I&#39;ll go back to Umbrello, since it&#39;s pretty close, and very simple to use&amp;hellip; it just has crappy code gen. But I think I can live with that *sigh*. Can anyone else recommend a good tool?&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/111943721068559339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=111943721068559339' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111943721068559339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111943721068559339'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/06/more-rotten-fruit.html' title='More Rotten Fruit'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-111942253127594092</id><published>2005-06-21T23:33:00.000-07:00</published><updated>2005-06-21T23:42:11.280-07:00</updated><title type='text'>Rotten Fruit</title><content type='html'>&lt;p&gt;So, I got through a good chunk of design in Umbrello, only to realize that it doesn&#39;t have any concept of a const member function (i.e., a &quot;query&quot; stereotype method). I&#39;m a very const-aware person, and the lack of this feature makes the whole tool utterly worthless to me. What&#39;s even more aggravating is that I can&#39;t open the XMI file in ArgoUML. So much for interoperability&amp;hellip; I&#39;m currently hand-copying the information over to ArgoUML (which &lt;strong&gt;does&lt;/strong&gt; handle the query stereotype), and I&#39;ll post &lt;em&gt;that&lt;/em&gt; XMI file when I&#39;ve finished. If you haven&#39;t noticed, I&#39;m keeping the design link on the &quot;links&quot; list; the last updated time will help you figure out if you have the newest version or not.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/111942253127594092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=111942253127594092' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111942253127594092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111942253127594092'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/06/rotten-fruit.html' title='Rotten Fruit'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-111930678953304549</id><published>2005-06-20T14:33:00.000-07:00</published><updated>2005-06-24T19:27:23.986-07:00</updated><title type='text'>Fruits of Labor</title><content type='html'>&lt;p&gt;Well, I&#39;ve found a diagram editor that I really like, and it spits out files that seem to be standardized/portable (XMI). So, I&#39;ve gotten some very rough (and by &lt;strong&gt;no&lt;/strong&gt; means complete) &lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/gplflash.xmi.tar.bz2&quot;&gt;gplflash models&lt;/a&gt; done, at long last. You can read the files with &lt;a href=&quot;http://uml.sourceforge.net/index.php&quot;&gt;Umbrello&lt;/a&gt;, or with other tools that can read XMI (like &lt;a href=&quot;http://argouml.tigris.org/&quot;&gt;ArgoUML&lt;/a&gt;, or &lt;a href=&quot;http://gaphor.sourceforge.net/&quot;&gt;Gaphor&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;I&#39;ve also tarballed my &lt;a href=&quot;http://gplflash.sourceforge.net/gplflash2_blog/libswfio-0.0.0.tar.bz2&quot;&gt;current SWFIO concept&lt;/a&gt;, which at the moment provides access to only the SWF primitives.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I forgot to mention that feedback is requested; sending in diffs and ideas would be much appreciated!&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/111930678953304549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=111930678953304549' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111930678953304549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111930678953304549'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/06/fruits-of-labor.html' title='Fruits of Labor'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-111907427581060883</id><published>2005-06-17T20:37:00.000-07:00</published><updated>2005-06-17T22:57:55.850-07:00</updated><title type='text'>Coming Attractions</title><content type='html'>&lt;p&gt;I&#39;ve retargeted my school project to incorporate GPLFlash2 &amp;mdash; that way, I&#39;m really only working on one project, and getting &lt;em&gt;real&lt;/em&gt; work done with the project (instead of just fake academic-land &quot;work&quot;). It will be a small (fewer than 15 pages) report on Knowledge Management, and how the GPLFlash project could greatly benefit from it. I&#39;ll make it available as an sxw and a PDF as soon as I&#39;ve finished it.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/111907427581060883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=111907427581060883' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111907427581060883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111907427581060883'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/06/coming-attractions.html' title='Coming Attractions'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-111903938571832737</id><published>2005-06-17T11:42:00.000-07:00</published><updated>2005-06-17T16:42:55.530-07:00</updated><title type='text'>SWF Rendering: Part 1</title><content type='html'>&lt;p&gt;Now that I have the basics down, I&#39;ve started to take a deeper look into SWF overall, in order to get a better feeling of where I&#39;m going and what design decisions need to be made along the way. As part of this process, I&#39;ve decided to write a set of articles explaining how the SWF rendering process works. This will serve three purposes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It helps crystallize the idea in my mind&lt;/li&gt;
&lt;li&gt;It clarifies the ideas for people who have only cursory knowledge of the subject&lt;/li&gt;
&lt;li&gt;It exposes my ideas to critique, so flaws can be worked out&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article, we&#39;ll go over SWF interpretation up to and including definition tags. The next article will be dedicated to the interpretation of non-ActionScript control tags, and possibly the visual model that the SWF format should be interpreted with.&lt;/p&gt;

&lt;h3&gt;Step 1: Decoding Tags&lt;/h3&gt;
&lt;p&gt;Before anything else can happen, the data from the file must be parsed into data structures in memory. There are three major parts to this on the &lt;em&gt;file wide&lt;/em&gt; scale:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Header extraction&lt;/li&gt;
&lt;li&gt;Decompression (dependent on header)&lt;/li&gt;
&lt;li&gt;Tag extraction&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&quot;Tag extraction&quot; is a bit vague, however; the RecordHeader data structure means that we could extract all of the tags simply by pulling the appropriate number of bytes out of the stream and store them in a character array. This wouldn&#39;t be very useful, however, since we still wouldn&#39;t know what information is trying to be conveyed by the file. Thus, we have a little more to do on the &lt;em&gt;per record&lt;/em&gt; scale (header included):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Know what type of record we&#39;re extracting&lt;/li&gt;
&lt;li&gt;Know the SWF primitives (their type, order and meaning) that make up the record&lt;/li&gt;
&lt;li&gt;Extract each primitive to a corresponding, size-compatible, in-memory variable.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Once we can extract tags in a meaningful manner, we have enough infrastructure to start processing them. Because SWF is a streamable format, we don&#39;t need to have the whole file before we start working.&lt;/p&gt;
&lt;h3&gt;Step 2: Definitions and The Dictionary&lt;/h3&gt;
&lt;p&gt;As definition tags are discovered, they are then added to the &quot;dictionary.&quot; This is a &lt;em&gt;static&lt;/em&gt; repository for all of the objects with definition tags (called &quot;characters&quot;). Other tags (called control tags) generally refer to one or more tags in the dictionary, applying transforms in a cumulative filtering (or &quot;delta based&quot;) fashion. This makes implementing the dictionary straightforward, as all it has to do is allow new characters to be added, and report the values of existing characters.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/111903938571832737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=111903938571832737' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111903938571832737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111903938571832737'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/06/swf-rendering-part-1.html' title='SWF Rendering: Part 1'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-111898554067062391</id><published>2005-06-16T22:03:00.000-07:00</published><updated>2005-06-16T22:19:00.676-07:00</updated><title type='text'>SWFIO: Layer 0 Completed</title><content type='html'>&lt;p&gt;Well, I&#39;ve just got my lowest-level I/O code working. It now both writes and reads the integral SWF data types (UI8, UI16, UI32, UB, SI8, SI16, SI32, SB), and the hard bits (that is, the bitfield operators) pass a suite of tests that is thorough enough to make me comfortable that the code works. The only thing I can think of that I&#39;m missing is a mechanism to quickly pull out a very large quantity of data (such as an embedded JPEG or MP3), but I figure that&#39;s a feature I can add later if I really need it.&lt;/p&gt;
&lt;p&gt;The next thing up is layer 0.5, or the &quot;fixed point&quot; data type. After that will be the first substantial layer &amp;mdash; layer 1, the structure layer. I&#39;m eager to get to that point, and start getting the structures out of the way. I think it will be very easy going, since the nasty part (interfacing with the data stream at a bit-wise level) is done.&lt;/p&gt;
&lt;p&gt;Some other misc. stuff &lt;em&gt;does&lt;/em&gt; need to get done to the layer 0 code before it&#39;s really &quot;completed&quot; &amp;mdash; specifically, I need to add logging and create better unit tests for the non-bitfield operators. There exist tests for all of the operators at the moment, but the tests for the aligned accesses are wimpy (since the code implementing them is almost laughably trivial). Ah well.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/111898554067062391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=111898554067062391' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111898554067062391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111898554067062391'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/06/swfio-layer-0-completed.html' title='SWFIO: Layer 0 Completed'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13414841.post-111870722659710827</id><published>2005-06-13T15:09:00.000-07:00</published><updated>2005-06-13T21:22:14.533-07:00</updated><title type='text'>Better Design Through Layering</title><content type='html'>&lt;p&gt;Well, I finished the lowest level of my SWF I/O code (well, technically there&#39;s no I yet), and have been taking the time to think about what I&#39;m doing and why I&#39;m doing it. The nice thing about writing parsing code is that it&#39;s fairly straightforward, and you can be pretty much guaranteed that you&#39;ll need it later; thus, you can start hacking it up first (to handle that &quot;gotta code&quot; urge), and simultaneously contemplate what to do next.&lt;/p&gt;
&lt;p&gt;Someone asked me the other day what I thought the design flaws were in the current GPLFlash2 implementation, and I didn&#39;t give them a good answer. I&#39;ve been thinking about it, and have started to define exactly what it is that I don&#39;t like about the current design. The major things that I think are missing are the use of modularization and layering.&lt;/p&gt;
&lt;p&gt;As an example, the Swf_decoder class does absolutely &lt;em&gt;everything&lt;/em&gt; for decoding SWF. In fact, it knows every data struct and every class (!) that could be stored in the SWF. Furthermore, it knows the &lt;em&gt;exact&lt;/em&gt; order and type of data that needs to be pulled out of the SWF &amp;mdash; the objects don&#39;t read themselves in, the Swf_decode object encapsulates (IMHO, inappropriately) &lt;em&gt;all&lt;/em&gt; of the knowledge of &lt;em&gt;all&lt;/em&gt; of the tags. This &quot;everything at once&quot; approach is difficult to test, difficult to maintain, and difficult to get consistent and predictable quality out of.&lt;/p&gt;
&lt;p&gt;I propose a design that takes a much more modularized and layered approach to the problem. Instead of having one great big monolith that tries to do everything, I envision building up a system that depends on discreet services. The layers move from data to presentation in a gradient, fanning out as it moves closer to the &quot;end result&quot; that the user sees.&lt;/p&gt;
&lt;p&gt;The first bit that I&#39;m working on is the &quot;bitstream&quot; reader and writer. This is the absolute lowest layer, and acts as the most general interface to an SWF file. It provides only the functions needed to read and write the integral SWF data blocks: unsigned integers (little endian; 8, 16 and 32 bits), signed integers (little endian; 8, 16 and 32 bits), unsigned bitfields (big endian; 1-31 bits long), and signed bitfields (big endian; 1-31 [2-32 with sign] bits long). The other data types (fixed point integer and bitfield) can be derived from the types already included. In truth, we need only provide &quot;integer&quot; functionality without sign (sign is unimportant, and simply a matter of interpretation), but for the sake of consistency, I&#39;ve provided calls for both signed and unsigned integers. Since handling of signed bitfields is different than that of unsigned bitfields, both functions are necessary.&lt;/p&gt;
&lt;p&gt;This interface is the absolute bare minimum needed to interpret the contents of an SWF file. By choosing a very tight set of functionality, we can ensure better quality &amp;mdash; every one of these functions has a set of unit tests, as well as an integration test to ensure that they play nice together. This is an application of the &quot;do one thing and do it well&quot; principle &amp;mdash; the SWF stream wrapper doesn&#39;t need to know or care about tags or non-primitive data structures; all it needs to know are the primitives.&lt;/p&gt;
&lt;p&gt;Now, I&#39;ve been talking about layering, but so far I&#39;ve discussed only one component. Well, the SWF stream wrapper is the lowest layer in the system I&#39;m envisioning. Everything else is built on top of it, so it&#39;s absolutely critical that it provides rock-solid functionality. Because it&#39;s so small, we are much more able to build it up to the level of stability that an entire system can depend on. The very next layer is also thin: it&#39;s the set of structures that emulate the &quot;missing&quot; core types (fixed-point numbers). This layer need only know about the SWF bitstream wrapper, and doesn&#39;t care about anything else. The next layer up will be the data structures. They don&#39;t need to know about one another &amp;mdash; they just need to know how to read themselves out of a SWF stream wrapper, using the fixed-point classes if needed.&lt;/p&gt;
&lt;p&gt;As you can see, we&#39;re slowly building our way up. We now have the very core types, the fixed-point types, and the data structures (Rectangle, RGB, RGBA, Matrix, etc.), all of whom know how to use the lower layers to construct themselves. There is no interrelation between things at the same layer, so bugs are isolated &amp;mdash; the bug either exists in the class itself, or in subset of objects that it uses from the layer below it(&lt;a name=&quot;bdtl_unfoot1&quot; href=&quot;#bdtl_foot1&quot;&gt;1&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Moving up one more layer, we finally get to tags. The tags, like the structures, will know how to read themselves in off the stream &amp;mdash; nothing fancy in the tag classes themselves, they just use the lower layers to fill in their data when constructed with a SWF stream wrapper, or when asked to extract() themselves from a SWF stream.&lt;/p&gt;
&lt;p&gt;The alert readers in the crowd will probably be asking at this point, &quot;But Quandary, how will we know what tag to read off the stream? If the tags read themselves in, they won&#39;t know until it&#39;s too late if their object type is at the start of the stream!&quot; Well, to put it shortly, the tags themselves don&#39;t actually care. In fact, the tags don&#39;t even need to have a variable field for their ID (it can be a static const), because they aren&#39;t going to read the ID off the stream. It&#39;s not the job of the tag to know if it&#39;s next up on the stream &amp;mdash; that&#39;s someone else&#39;s job (we&#39;ll come back to this later).&lt;/p&gt;
&lt;p&gt;So, now we&#39;ve got three layers (and one mini-layer), with each class in each layer being nice, compact, focused, and (mostly) isolated from all of the other classes in its layer. All this infrastructure doesn&#39;t do much, though &amp;mdash; actually, all of these &quot;layers&quot; are really sub-layers of the overall system&#39;s &lt;em&gt;data layer&lt;/em&gt;. The data layer&#39;s responsibility is to read data in from a provided input stream and put it into objects that the rest of the system can understand and use in other operations. Having a solid data layer that can stand independent of the system is a crucial aspect for reusability &amp;mdash; it is difficult to re-use data layers if they take actions for or make assumptions about other parts of the system.&lt;/p&gt;
&lt;p&gt;So, getting back to the &quot;how can a tag read itself in?&quot; issue. That problem starts moving out of the pure data realm and starts treading into the realm of behavior, or the &lt;em&gt;application logic&lt;/em&gt; layer. The problem is still in the data layer, because the SWF specification tells us how the file is structured and how it must be read in order to make sense. However, the bit that actually makes decisions about how to decode the stream &lt;em&gt;uses&lt;/em&gt; the tags &amp;mdash; it is not a &lt;em&gt;part of&lt;/em&gt; the tags. I&#39;ve settled on using a &quot;class factory&quot; pattern to solve the discreet problem of reading a tag in from the stream. Given that we know a tag is at the start of the stream (and there will be a process that knows when this is the case; we haven&#39;t discussed it yet) we can have a RecordHeader read itself off the stream (and hey, it&#39;ll even automagically handle long versus short record types! The joys of encapsulation). We can then pass that RecordHeader to the TagFactory function&lt;a name=&quot;bdtl_unfoot2&quot; href=&quot;#bdtl_foot2&quot;&gt;(2)&lt;/a&gt;, which will use the tag type in the record header as an index into an array of function pointers. Each entry in the array will point to a static &quot;create&quot; function, to which we can pass an SWF stream wrapper (and tag length) to and get back an appropriate tag. In the cases where we cannot decode the tag, the corresponding table entry will point to the create function of the generic tag class. This will eat the unknown tag off the stream so that file processing can continue.&lt;/p&gt;
&lt;p&gt;So, we&#39;ve worked further and further up the chain, and this is all starting to look like a nice bottom-up design. We now have a mechanism to create tags from the SWF stream wrapper, so all that&#39;s left is the top-level controlling class that provides all the glitzy &quot;look, it&#39;s a parser!&quot; feel. This top-level class will be pretty straightforward: take a filename or an existing stream, create the stream (in the former case), wrap the stream with the SWF wrapper, tell the header to read itself in, check for validity, then go into a loop of reading RecordHeaders, passing them to the TagFactory, and getting back nice, pretty tags. And for anyone who&#39;s thinking &quot;Hey! You glossed over compressed SWFs!&quot; &amp;mdash; yes, you&#39;re right, I did.&lt;/p&gt;
&lt;p&gt;So, let&#39;s take the opportunity to extend the system. What happens when we have a compressed SWF file? Well, the data stream starts off uncompressed, then switches to compressed. So, all we have to do is modify the SWF wrapper class to have a new method (like decompress()) that instantiates a &lt;strong&gt;lower&lt;/strong&gt; layer wrapper class &amp;mdash; one that does on-the-fly ZLib decompression &amp;mdash; passes that lower layer wrapper the current stream, and then replaces the current stream with the ZLib-wrapped stream. From that point on, everything is exactly the same as it was before. In fact, we don&#39;t even need to implement this functionality directly in the SWF wrapper class &amp;mdash; the high-level control class can just toss out the SWF wrapper, re-wrap the stream in a ZLib wrapper stream, and create a new SWF wrapper class to wrap the ZLib wrapped stream.&lt;/p&gt;

&lt;p&gt;&lt;a name=&quot;bdtl_foot1&quot; href=&quot;#bdtl_unfoot1&quot;&gt;1&lt;/a&gt;: This is somewhat of an oversimplification; because the classes share a common data store (the SWF stream), a bug (reading/writing too much or not enough data to the stream) can cause later reads and writes to not return the expected results.&lt;/p&gt;

&lt;p&gt;&lt;a name=&quot;bdtl_foot2&quot; href=&quot;#bdtl_unfoot2&quot;&gt;2&lt;/a&gt;: Note that it would be an (understandable and common) error to make the TagFactory function a method on, say, the Tag class. Tag should not have to know each and every class that derives from it. The whole point of derived classes is that the parent has no clue what&#39;s being implemented under it &amp;mdash; any class that could benefit from inheriting the data and behaviors that the parent provides should be free to do so without having to notify the parent. TagFactory is a domain (if not an application) specific tool that works &lt;em&gt;with&lt;/em&gt; and &lt;em&gt;around&lt;/em&gt; tags &amp;mdash; it is not part of a tag (in much the same way an emergency dispatcher is not a policeman or firefighter).&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gplflash2.blogspot.com/feeds/111870722659710827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13414841&amp;postID=111870722659710827' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111870722659710827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13414841/posts/default/111870722659710827'/><link rel='alternate' type='text/html' href='http://gplflash2.blogspot.com/2005/06/better-design-through-layering.html' title='Better Design Through Layering'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>