gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r11758: Coding style improvements an


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11758: Coding style improvements and documentation of some unloved classes.
Date: Fri, 15 Jan 2010 09:23:23 +0100
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 11758 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Fri 2010-01-15 09:23:23 +0100
message:
  Coding style improvements and documentation of some unloved classes.
renamed:
  libcore/styles.cpp => libcore/LineStyle.cpp
  libcore/styles.h => libcore/LineStyle.h
modified:
  backend/Renderer.h
  backend/Renderer_agg.cpp
  backend/Renderer_cairo.cpp
  backend/Renderer_cairo.h
  backend/Renderer_ogl.cpp
  libcore/DynamicShape.cpp
  libcore/DynamicShape.h
  libcore/Geometry.cpp
  libcore/Geometry.h
  libcore/Makefile.am
  libcore/MovieClip.cpp
  libcore/MovieClip.h
  libcore/RGBA.cpp
  libcore/RGBA.h
  libcore/TextField.cpp
  libcore/TextField.h
  libcore/asobj/flash/display/MovieClip_as.cpp
  libcore/fill_style.cpp
  libcore/fontlib.cpp
  libcore/swf/DefineMorphShapeTag.cpp
  libcore/swf/DefineShapeTag.cpp
  libcore/swf/DefineTextTag.h
  libcore/swf/SetBackgroundColorTag.h
  libcore/swf/ShapeRecord.h
  libcore/swf/tag_loaders.cpp
  testsuite/FuzzyPixel.cpp
  testsuite/libcore.all/ClassSizes.cpp
  libcore/LineStyle.cpp
  libcore/LineStyle.h
=== modified file 'backend/Renderer.h'
--- a/backend/Renderer.h        2010-01-11 06:41:38 +0000
+++ b/backend/Renderer.h        2010-01-14 12:03:17 +0000
@@ -159,7 +159,7 @@
     class SWFMatrix;
     class cxform;
     class fill_style;
-    class line_style;
+    class LineStyle;
 
     namespace SWF {
         class ShapeRecord;

=== modified file 'backend/Renderer_agg.cpp'
--- a/backend/Renderer_agg.cpp  2010-01-11 06:41:38 +0000
+++ b/backend/Renderer_agg.cpp  2010-01-14 12:03:17 +0000
@@ -993,7 +993,7 @@
     }
 
     void drawShape(const std::vector<fill_style>& fill_styles,
-        const std::vector<line_style>& line_styles,
+        const std::vector<LineStyle>& line_styles,
         const std::vector<Path>& objpaths, const SWFMatrix& mat,
         const cxform& cx)
     {
@@ -1122,7 +1122,7 @@
   // TODO: Flash never aligns lines that are wider than 1 pixel on *screen*,
   // but we currently don't check the width.  
   void buildPaths_rounded(AggPaths& dest, 
-    const GnashPaths& paths, const std::vector<line_style>& line_styles)
+    const GnashPaths& paths, const std::vector<LineStyle>& line_styles)
   {
 
     const float subpixel_offset = 0.5f;
@@ -1139,7 +1139,7 @@
       bool hinting=false, closed=false, hairline=false;
       
       if (this_path.m_line) {
-        const line_style& lstyle = line_styles[this_path.m_line-1];
+        const LineStyle& lstyle = line_styles[this_path.m_line-1];
         
         hinting = lstyle.doPixelHinting();
         closed = this_path.isClosed() && !lstyle.noClose();
@@ -1619,7 +1619,7 @@
   /// Just like draw_shapes() except that it draws an outline.
   void draw_outlines(int subshape_id, const GnashPaths &paths,
     const AggPaths& agg_paths,
-    const std::vector<line_style> &line_styles, const cxform& cx,
+    const std::vector<LineStyle> &line_styles, const cxform& cx,
     const SWFMatrix& linestyle_matrix) {
     
     if (_alphaMasks.empty()) {
@@ -1653,7 +1653,7 @@
   template <class scanline_type>
   void draw_outlines_impl(int subshape_id, const GnashPaths &paths,
     const AggPaths& agg_paths,
-    const std::vector<line_style> &line_styles, const cxform& cx, 
+    const std::vector<LineStyle> &line_styles, const cxform& cx, 
     const SWFMatrix& linestyle_matrix, scanline_type& sl) {
     
     assert(m_pixf.get());
@@ -1714,7 +1714,7 @@
         agg::conv_stroke< agg::conv_curve < agg::path_storage > > 
           stroke(curve);  // to get an outline
         
-        const line_style& lstyle = line_styles[this_path_gnash.m_line-1];
+        const LineStyle& lstyle = line_styles[this_path_gnash.m_line-1];
           
         int thickness = lstyle.getThickness();
         if (!thickness) stroke.width(1); // hairline

=== modified file 'backend/Renderer_cairo.cpp'
--- a/backend/Renderer_cairo.cpp        2010-01-11 06:41:38 +0000
+++ b/backend/Renderer_cairo.cpp        2010-01-14 12:03:17 +0000
@@ -788,7 +788,7 @@
 }
 
 void
-Renderer_cairo::apply_line_style(const line_style& style, const cxform& cx)
+Renderer_cairo::apply_line_style(const LineStyle& style, const cxform& cx)
 {
     cairo_line_join_t join_style = CAIRO_LINE_JOIN_MITER;
     switch(style.joinStyle()) {
@@ -854,7 +854,7 @@
   
 void
 Renderer_cairo::draw_outlines(const PathVec& path_vec,
-                              const std::vector<line_style>& line_styles,
+                              const std::vector<LineStyle>& line_styles,
                               const cxform& cx)
 {
     for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
@@ -875,7 +875,7 @@
 Renderer_cairo::draw_subshape(const PathVec& path_vec, const SWFMatrix& mat,
                               const cxform& cx,
                               const std::vector<fill_style>& fill_styles,
-                              const std::vector<line_style>& line_styles)
+                              const std::vector<LineStyle>& line_styles)
 { 
     CairoPathRunner runner(*this, path_vec, fill_styles, _cr);
     runner.run(cx, mat);
@@ -966,7 +966,7 @@
     std::vector<PathVec::const_iterator> subshapes = find_subshapes(path_vec);
     
     const std::vector<fill_style>& fill_styles = shape.fillStyles();
-    const std::vector<line_style>& line_styles = shape.lineStyles();
+    const std::vector<LineStyle>& line_styles = shape.lineStyles();
 
     for (size_t i = 0; i < subshapes.size()-1; ++i) {
         PathVec subshape_paths;
@@ -996,7 +996,7 @@
     
     const PathVec& path_vec = rec.paths();
     
-    std::vector<line_style> dummy_ls;
+    std::vector<LineStyle> dummy_ls;
     
     CairoScopeMatrix mat_transformer(_cr, mat);
     

=== modified file 'backend/Renderer_cairo.h'
--- a/backend/Renderer_cairo.h  2010-01-11 06:41:38 +0000
+++ b/backend/Renderer_cairo.h  2010-01-14 12:03:17 +0000
@@ -75,10 +75,10 @@
 
     void add_path(cairo_t* cr, const Path& cur_path);
 
-    void apply_line_style(const line_style& style, const cxform& cx);
+    void apply_line_style(const LineStyle& style, const cxform& cx);
 
     void draw_outlines(const PathVec& path_vec,
-                       const std::vector<line_style>& line_styles,
+                       const std::vector<LineStyle>& line_styles,
                        const cxform& cx);
 
     std::vector<PathVec::const_iterator> find_subshapes(const PathVec& 
path_vec);
@@ -86,7 +86,7 @@
     void draw_subshape(const PathVec& path_vec,
                        const SWFMatrix& mat, const cxform& cx,
                        const std::vector<fill_style>& fill_styles,
-                       const std::vector<line_style>& line_styles);
+                       const std::vector<LineStyle>& line_styles);
 
     void draw_mask(const PathVec& path_vec);
 

=== modified file 'backend/Renderer_ogl.cpp'
--- a/backend/Renderer_ogl.cpp  2010-01-11 06:41:38 +0000
+++ b/backend/Renderer_ogl.cpp  2010-01-14 12:03:17 +0000
@@ -1019,7 +1019,7 @@
     
     dummy_fs.push_back(coloring);
     
-    std::vector<line_style> dummy_ls;
+    std::vector<LineStyle> dummy_ls;
     
     draw_subshape(path_vec, SWFMatrix(), dummy_cx, dummy_fs, dummy_ls);
   }
@@ -1278,7 +1278,7 @@
   
   
   
-  bool apply_line_style(const line_style& style, const cxform& cx, const 
SWFMatrix& mat)
+  bool apply_line_style(const LineStyle& style, const cxform& cx, const 
SWFMatrix& mat)
   {
   //  GNASH_REPORT_FUNCTION;
      
@@ -1380,7 +1380,7 @@
   void
   draw_outlines(const PathVec& path_vec, const PathPointMap& pathpoints, const 
SWFMatrix& mat,
                 const cxform& cx, const std::vector<fill_style>& fill_styles,
-                const std::vector<line_style>& line_styles)
+                const std::vector<LineStyle>& line_styles)
   {
   
     for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
@@ -1544,7 +1544,7 @@
     const SWFMatrix& mat,
     const cxform& cx,
     const std::vector<fill_style>& fill_styles,
-    const std::vector<line_style>& line_styles)
+    const std::vector<LineStyle>& line_styles)
   {
     PathVec normalized = normalize_paths(path_vec);
     PathPointMap pathpoints = getPathPoints(normalized);
@@ -1649,7 +1649,7 @@
     std::vector<PathVec::const_iterator> subshapes = find_subshapes(path_vec);
     
     const std::vector<fill_style>& fill_styles = shape.fillStyles();
-    const std::vector<line_style>& line_styles = shape.lineStyles();
+    const std::vector<LineStyle>& line_styles = shape.lineStyles();
     
     for (size_t i = 0; i < subshapes.size()-1; ++i) {
       PathVec subshape_paths;
@@ -1677,7 +1677,7 @@
     
     glyph_fs.push_back(coloring);
     
-    std::vector<line_style> dummy_ls;
+    std::vector<LineStyle> dummy_ls;
     
     oglScopeMatrix scope_mat(mat);
     

=== modified file 'libcore/DynamicShape.cpp'
--- a/libcore/DynamicShape.cpp  2010-01-08 09:49:57 +0000
+++ b/libcore/DynamicShape.cpp  2010-01-14 12:03:17 +0000
@@ -179,10 +179,10 @@
 void
 DynamicShape::lineStyle(boost::uint16_t thickness, const rgba& color,
        bool vScale, bool hScale, bool pixelHinting, bool noClose,
-       cap_style_e startCapStyle, cap_style_e endCapStyle,
-       join_style_e joinStyle, float miterLimitFactor)
+       CapStyle startCapStyle, CapStyle endCapStyle,
+       JoinStyle joinStyle, float miterLimitFactor)
 {
-       line_style style(thickness, color, vScale, hScale, pixelHinting,
+       LineStyle style(thickness, color, vScale, hScale, pixelHinting,
                noClose, startCapStyle, endCapStyle, joinStyle,
                miterLimitFactor);
 
@@ -282,7 +282,7 @@
 }
 
 size_t
-DynamicShape::add_line_style(const line_style& stl)
+DynamicShape::add_line_style(const LineStyle& stl)
 {
     _shape.addLineStyle(stl);
     return _shape.lineStyles().size();

=== modified file 'libcore/DynamicShape.h'
--- a/libcore/DynamicShape.h    2010-01-01 17:48:26 +0000
+++ b/libcore/DynamicShape.h    2010-01-14 12:03:17 +0000
@@ -20,7 +20,7 @@
 #ifndef GNASH_DYNAMIC_SHAPE_H
 #define GNASH_DYNAMIC_SHAPE_H
 
-#include "styles.h" 
+#include "LineStyle.h" 
 #include "ShapeRecord.h"
 
 namespace gnash {
@@ -110,9 +110,9 @@
                bool vScale=true, bool hScale=true,
                bool pixelHinting=false,
                bool noClose=false,
-               cap_style_e startCapStyle=CAP_ROUND,
-               cap_style_e endCapStyle=CAP_ROUND,
-               join_style_e joinStyle=JOIN_ROUND,
+               CapStyle startCapStyle=CAP_ROUND,
+               CapStyle endCapStyle=CAP_ROUND,
+               JoinStyle joinStyle=JOIN_ROUND,
                float miterLimitFactor=1.0f);
 
        /// Reset line style to no style and start a new path.
@@ -138,7 +138,7 @@
        ///     This offset is the one required to properly
        ///     reference it in gnash::path instances.
        ///
-       size_t add_line_style(const line_style& stl);
+       size_t add_line_style(const LineStyle& stl);
 
        // Override from DefineShapeTag to call ::finalize
        // NOTE: this is not correct in that a call to hitTest should

=== modified file 'libcore/Geometry.cpp'
--- a/libcore/Geometry.cpp      2010-01-11 06:41:38 +0000
+++ b/libcore/Geometry.cpp      2010-01-14 12:03:17 +0000
@@ -122,7 +122,7 @@
 
 bool
 pointTest(const std::vector<Path>& paths,
-        const std::vector<line_style>& lineStyles, boost::int32_t x,
+        const std::vector<LineStyle>& lineStyles, boost::int32_t x,
         boost::int32_t y, const SWFMatrix& wm)
 {
 
@@ -177,7 +177,7 @@
         if (pth.m_line != 0 )
         {
             assert(lineStyles.size() >= pth.m_line);
-            const line_style& ls = lineStyles[pth.m_line-1];
+            const LineStyle& ls = lineStyles[pth.m_line-1];
             double thickness = ls.getThickness();
             if (! thickness )
             {

=== modified file 'libcore/Geometry.h'
--- a/libcore/Geometry.h        2010-01-11 06:41:38 +0000
+++ b/libcore/Geometry.h        2010-01-14 12:03:17 +0000
@@ -21,7 +21,7 @@
 
 #include "dsodefs.h"
 #include "SWFMatrix.h" 
-#include "styles.h"
+#include "LineStyle.h"
 #include "log.h"
 
 #include <vector> // for path composition
@@ -524,10 +524,10 @@
     /// Set the line style to use for this path
     //
     /// @param f
-    ///    The line_style index (1-based).
+    ///    The LineStyle index (1-based).
     ///    When this path is added to a DefineShapeTag,
     ///    the index (decremented by 1) will reference an element
-    ///    in the line_style vector defined for that shape.
+    ///    in the LineStyle vector defined for that shape.
     ///    If zero, no fill will be active.
     ///
     void setLineStyle(unsigned i)
@@ -570,7 +570,7 @@
 {
 
 bool pointTest(const std::vector<Path>& paths,
-    const std::vector<line_style>& lineStyles, boost::int32_t x,
+    const std::vector<LineStyle>& lineStyles, boost::int32_t x,
     boost::int32_t y, const SWFMatrix& wm);
 
 } // namespace geometry

=== renamed file 'libcore/styles.cpp' => 'libcore/LineStyle.cpp'
--- a/libcore/styles.cpp        2009-07-13 08:06:09 +0000
+++ b/libcore/LineStyle.cpp     2010-01-14 12:03:17 +0000
@@ -6,7 +6,7 @@
 // Fill and line style types.
 
 
-#include "styles.h"
+#include "LineStyle.h"
 #include "log.h"
 #include "SWFStream.h"
 #include "movie_definition.h"
@@ -19,11 +19,11 @@
 
 
 //
-// line_style
+// LineStyle
 //
 
     
-line_style::line_style()
+LineStyle::LineStyle()
     :
     m_width(0),
     m_color(),
@@ -39,8 +39,8 @@
 }
 
 void
-line_style::read_morph(SWFStream& in, SWF::TagType t, movie_definition& md,
-    const RunResources& r, line_style *pOther)
+LineStyle::read_morph(SWFStream& in, SWF::TagType t, movie_definition& md,
+    const RunResources& r, LineStyle *pOther)
 {
     if (t == SWF::DEFINEMORPHSHAPE)
     {
@@ -60,14 +60,14 @@
 
     int flags1 = in.read_u8();
     int flags2 = in.read_u8();
-    _startCapStyle =  (cap_style_e)((flags1 & 0xC0) >> 6);
-    _joinStyle     = (join_style_e)((flags1 & 0x30) >> 4);
+    _startCapStyle =  (CapStyle)((flags1 & 0xC0) >> 6);
+    _joinStyle     = (JoinStyle)((flags1 & 0x30) >> 4);
     bool has_fill      =   flags1 & (1 << 3);
     _scaleHorizontally = !(flags1 & (1 << 2));
     _scaleVertically   = !(flags1 & (1 << 1));
     _pixelHinting      =   flags1 & (1 << 0);
     _noClose = flags2 & (1 << 2);
-    _endCapStyle = (cap_style_e) (flags2 & 0x03); 
+    _endCapStyle = (CapStyle) (flags2 & 0x03); 
 
     if (_joinStyle == JOIN_MITER)  
     {
@@ -91,7 +91,7 @@
 }
 
 void
-line_style::read(SWFStream& in, SWF::TagType t, movie_definition& md,
+LineStyle::read(SWFStream& in, SWF::TagType t, movie_definition& md,
         const RunResources& r)
 {
     if (!(t == SWF::DEFINESHAPE4 || t == SWF::DEFINESHAPE4_))
@@ -109,14 +109,14 @@
 
     int flags1 = in.read_u8();
     int flags2 = in.read_u8();
-    _startCapStyle =  (cap_style_e)((flags1 & 0xC0) >> 6);
-    _joinStyle     = (join_style_e)((flags1 & 0x30) >> 4);
+    _startCapStyle =  (CapStyle)((flags1 & 0xC0) >> 6);
+    _joinStyle     = (JoinStyle)((flags1 & 0x30) >> 4);
     bool has_fill      =   flags1 & (1 << 3);
     _scaleHorizontally = !(flags1 & (1 << 2));
     _scaleVertically   = !(flags1 & (1 << 1));
     _pixelHinting      =   flags1 & (1 << 0);
     _noClose = flags2 & (1 << 2);
-    _endCapStyle = (cap_style_e) (flags2 & 0x03); 
+    _endCapStyle = (CapStyle) (flags2 & 0x03); 
 
     if (_joinStyle == JOIN_MITER) 
     {
@@ -138,7 +138,7 @@
 }
 
 void
-line_style::set_lerp(const line_style& ls1, const line_style& ls2, float ratio)
+LineStyle::set_lerp(const LineStyle& ls1, const LineStyle& ls2, float ratio)
 {
     m_width = static_cast<boost::uint16_t>(
         frnd(flerp(ls1.getThickness(), ls2.getThickness(), ratio)));

=== renamed file 'libcore/styles.h' => 'libcore/LineStyle.h'
--- a/libcore/styles.h  2009-07-13 08:06:09 +0000
+++ b/libcore/LineStyle.h       2010-01-14 12:05:50 +0000
@@ -1,4 +1,4 @@
-// styles.h    -- Thatcher Ulrich <address@hidden> 2003
+// LineStyle.h    -- Thatcher Ulrich <address@hidden> 2003
 
 // This source code has been donated to the Public Domain.  Do
 // whatever you want with it.
@@ -6,183 +6,177 @@
 // line style types.
 
 
-#ifndef GNASH_STYLES_H
-#define GNASH_STYLES_H
+#ifndef GNASH_LINESTYLE_H
+#define GNASH_LINESTYLE_H
 
 #include "RGBA.h"
 #include "SWF.h"
 
 namespace gnash {
-
-class SWFStream;
-class movie_definition;
-class RunResources;
-
-  typedef enum { CAP_ROUND=0, CAP_NONE=1, CAP_SQUARE=2 } cap_style_e;
-  typedef enum { JOIN_ROUND=0, JOIN_BEVEL=1, JOIN_MITER=2 } join_style_e;
+    class SWFStream;
+    class movie_definition;
+    class RunResources;
+}
+
+namespace gnash {
+
+enum CapStyle {
+    CAP_ROUND = 0,
+    CAP_NONE = 1,
+    CAP_SQUARE = 2
+};
+
+enum JoinStyle {
+    JOIN_ROUND = 0,
+    JOIN_BEVEL = 1,
+    JOIN_MITER = 2
+};
   
 /// For the outside of outline shapes, or just bare lines.
-class line_style 
+class LineStyle 
 {
 public:
-       line_style();
-
-       /// Construct a line style with explicit values
-       ///
-       /// @param width
-       ///     Thickness of line, in TWIPS. 
-       ///     Zero for hair line
-       ///
-       /// @param color
-       ///     Line color
-       ///
-       /// @param scaleThicknessVertically
-       ///
-       /// @param scaleThicknessHorizontally
-       ///
-       /// @param noClose
-       ///
-       /// @param startCapStyle
-       ///
-       /// @param endCapStyle
-       ///
-       /// @param joinStyle
-       ///
-       /// @param miterLimitFactor
-       ///
-       line_style(boost::uint16_t width, const rgba& color,
-                       bool scaleThicknessVertically=true,
-                       bool scaleThicknessHorizontally=true,
-                       bool pixelHinting=false,
-                       bool noClose=false,
-                       cap_style_e startCapStyle=CAP_ROUND,
-                       cap_style_e endCapStyle=CAP_ROUND,
-                       join_style_e joinStyle=JOIN_ROUND,
-                       float miterLimitFactor=1.0f
-               )
-               :
-               m_width(width),
-               m_color(color),
-               _scaleVertically(scaleThicknessVertically),
-               _scaleHorizontally(scaleThicknessHorizontally),
-               _pixelHinting(pixelHinting),
-               _noClose(noClose),
-               _startCapStyle(startCapStyle),
-               _endCapStyle(endCapStyle),
-               _joinStyle(joinStyle),
-               _miterLimitFactor(miterLimitFactor)
-               
-       {
-       }
-
-       /// Read the line style from an SWF stream
-       //
-       /// Stream is assumed to be positioned at 
-       /// the right place.
-       ///
-       /// Throw a ParserException if there's no enough bytes in the
-       /// currently opened tag for reading. See stream::ensureBytes()
-       ///
-       void read(SWFStream& in, SWF::TagType t, movie_definition& md,
+
+    /// Construct a default LineStyle.
+    LineStyle();
+
+    /// Construct a line style with explicit values
+    ///
+    /// @param width        Thickness of line in twips. 
+    ///                     Zero for hair line
+    ///
+    /// @param color        Line color
+    /// @param scaleThicknessVertically
+    /// @param scaleThicknessHorizontally
+    /// @param noClose
+    /// @param startCapStyle
+    /// @param endCapStyle
+    /// @param joinStyle
+    /// @param miterLimitFactor
+    LineStyle(boost::uint16_t width, const rgba& color,
+            bool scaleThicknessVertically=true,
+            bool scaleThicknessHorizontally=true,
+            bool pixelHinting=false,
+            bool noClose=false,
+            CapStyle startCapStyle=CAP_ROUND,
+            CapStyle endCapStyle=CAP_ROUND,
+            JoinStyle joinStyle=JOIN_ROUND,
+            float miterLimitFactor=1.0f
+        )
+        :
+        m_width(width),
+        m_color(color),
+        _scaleVertically(scaleThicknessVertically),
+        _scaleHorizontally(scaleThicknessHorizontally),
+        _pixelHinting(pixelHinting),
+        _noClose(noClose),
+        _startCapStyle(startCapStyle),
+        _endCapStyle(endCapStyle),
+        _joinStyle(joinStyle),
+        _miterLimitFactor(miterLimitFactor)
+    {
+    }
+
+    /// Read the line style from an SWF stream
+    //
+    /// Stream is assumed to be positioned at 
+    /// the right place.
+    ///
+    /// Throw a ParserException if there's no enough bytes in the
+    /// currently opened tag for reading. See stream::ensureBytes()
+    void read(SWFStream& in, SWF::TagType t, movie_definition& md,
             const RunResources& r);
-       
-       /// Read two lines styles from the SWF stream
-       /// at the same time -- this is used in morphing.
-       void read_morph(SWFStream& in, SWF::TagType t, movie_definition& md,
-            const RunResources& r, line_style *pOther);
-
-       /// Return thickness of the line, in TWIPS
-       boost::uint16_t getThickness() const
-       {
-               return m_width;
-       }
-
-       /// Return true if line thickness should be scaled vertically
-       bool scaleThicknessVertically() const
-       {
-               return _scaleVertically;
-       }
-
-       /// Return true if line thickness should be scaled horizontally
-       bool scaleThicknessHorizontally() const
-       {
-               return _scaleHorizontally;
-       }
-       
-       /// Return the start cap style
-       cap_style_e startCapStyle() const
-       {
-         return _startCapStyle;
-  }
-       
-       /// Return the end cap style
-       cap_style_e endCapStyle() const
-       {
-         return _endCapStyle;
-  }
-  
-  /// Return the join style
-  join_style_e joinStyle() const
-  {
-    return _joinStyle;
-  }
-  
-  /// Return the miter limit factor
-  float miterLimitFactor() const
-  {
-    return _miterLimitFactor;
-  }
-  
-  /// Return true if stroke should not be closed if the stroke's last point
-  /// matches the first point. Caps should be applied instead of a join
-  bool noClose() const
-  {
-    return _noClose;
-  }
-
-       /// Return true if pixel hinting should be activated
-       bool doPixelHinting() const
-       {
-               return _pixelHinting;
-       }
-
-       /// Return line color and alpha
-       const rgba&     get_color() const { return m_color; }
-
-       /// Set this style to the interpolation of the given one
-       //
-       /// @param ls1
-       ///     First line_style to interpolate.
-       ///
-       /// @param ls2
-       ///     Second line_style to interpolate.
-       ///
-       /// @ratio
-       ///     The interpolation factor (0..1).
-       ///     When 0, this will be equal to ls1, when 1
-       ///     this will be equal to ls2.
-       ///
-        void set_lerp(const line_style& ls1, const line_style& ls2, float 
ratio);
-       
+    
+    /// Read two lines styles from the SWF stream
+    /// at the same time -- this is used in morphing.
+    void read_morph(SWFStream& in, SWF::TagType t, movie_definition& md,
+            const RunResources& r, LineStyle *pOther);
+
+    /// Return thickness of the line, in TWIPS
+    boost::uint16_t getThickness() const {
+        return m_width;
+    }
+
+    /// Return true if line thickness should be scaled vertically
+    bool scaleThicknessVertically() const {
+        return _scaleVertically;
+    }
+
+    /// Return true if line thickness should be scaled horizontally
+    bool scaleThicknessHorizontally() const {
+        return _scaleHorizontally;
+    }
+    
+    /// Return the start cap style
+    CapStyle startCapStyle() const {
+        return _startCapStyle;
+    }
+    
+    /// Return the end cap style
+    CapStyle endCapStyle() const {
+        return _endCapStyle;
+    }
+    
+    /// Return the join style
+    JoinStyle joinStyle() const {
+        return _joinStyle;
+    }
+    
+    /// Return the miter limit factor
+    float miterLimitFactor() const {
+        return _miterLimitFactor;
+    }
+  
+    /// Return true if stroke should not be closed if the stroke's last point
+    /// matches the first point. Caps should be applied instead of a join
+    bool noClose() const {
+        return _noClose;
+    }
+
+    /// Return true if pixel hinting should be activated
+    bool doPixelHinting() const {
+        return _pixelHinting;
+    }
+
+    /// Return line color and alpha
+    const rgba& get_color() const { return m_color; }
+
+    /// Set this style to the interpolation of the given one
+    //
+    /// @param ls1      First LineStyle to interpolate.
+    /// @param ls2      Second LineStyle to interpolate.
+    /// @ratio          The interpolation factor (0..1).
+    ///                 When 0, this will be equal to ls1, when 1
+    ///                 this will be equal to ls2.
+    void set_lerp(const LineStyle& ls1, const LineStyle& ls2, float ratio);
+    
 private:
-       
-       boost::uint16_t m_width;        // in TWIPS
-       rgba    m_color;
-       bool _scaleVertically;
-       bool _scaleHorizontally;
-       bool _pixelHinting;
-       bool _noClose;
-       cap_style_e _startCapStyle;
-       cap_style_e _endCapStyle;
-       join_style_e _joinStyle;
-       float _miterLimitFactor;
+    
+    /// Width in twips.
+    boost::uint16_t m_width;
+
+    rgba m_color;
+
+    bool _scaleVertically;
+
+    bool _scaleHorizontally;
+
+    bool _pixelHinting;
+
+    bool _noClose;
+
+    CapStyle _startCapStyle;
+
+    CapStyle _endCapStyle;
+
+    JoinStyle _joinStyle;
+
+    float _miterLimitFactor;
 };
 
 } // namespace gnash
 
-
-#endif // GNASH_STYLES_H
-
+#endif
 
 // Local Variables:
 // mode: C++

=== modified file 'libcore/Makefile.am'
--- a/libcore/Makefile.am       2010-01-01 17:48:26 +0000
+++ b/libcore/Makefile.am       2010-01-14 11:45:08 +0000
@@ -127,7 +127,7 @@
        impl.cpp \
        LoadVariablesThread.cpp \
        SWFStream.cpp \
-       styles.cpp \
+       LineStyle.cpp \
        Timers.cpp \
        RGBA.cpp        \
        MovieFactory.cpp \
@@ -268,7 +268,7 @@
        swf/SWF.h \
        MovieFactory.h \
        fill_style.h \
-       styles.h \
+       LineStyle.h \
        ExportableResource.h \
        BitmapInfo.h \
        RGBA.h  \

=== modified file 'libcore/MovieClip.cpp'
--- a/libcore/MovieClip.cpp     2010-01-13 09:32:52 +0000
+++ b/libcore/MovieClip.cpp     2010-01-14 11:45:08 +0000
@@ -51,7 +51,7 @@
 #include "ExecutableCode.h" // for inheritance of ConstructEvent
 #include "DynamicShape.h" // for composition
 #include "namedStrings.h"
-#include "styles.h" // for cap_style_e and join_style_e enums
+#include "LineStyle.h" // for CapStyle and JoinStyle enums
 #include "PlaceObject2Tag.h" 
 #include "flash/geom/Matrix_as.h"
 #include "ExportableResource.h"

=== modified file 'libcore/MovieClip.h'
--- a/libcore/MovieClip.h       2010-01-11 06:41:38 +0000
+++ b/libcore/MovieClip.h       2010-01-14 11:45:08 +0000
@@ -616,9 +616,9 @@
         bool vScale=true, bool hScale=true,
         bool pixelHinting=false,
         bool noClose=false,
-        cap_style_e startCapStyle=CAP_ROUND,
-        cap_style_e endCapStyle=CAP_ROUND,
-        join_style_e joinStyle=JOIN_ROUND,
+        CapStyle startCapStyle=CAP_ROUND,
+        CapStyle endCapStyle=CAP_ROUND,
+        JoinStyle joinStyle=JOIN_ROUND,
         float miterLimitFactor=1.0f)
     {
         _drawable.lineStyle(thickness, color, vScale, hScale,

=== modified file 'libcore/RGBA.cpp'
--- a/libcore/RGBA.cpp  2009-07-30 18:43:13 +0000
+++ b/libcore/RGBA.cpp  2010-01-14 11:29:45 +0000
@@ -1,23 +1,16 @@
-// types.h     -- Thatcher Ulrich <address@hidden> 2003
+// types.h    -- Thatcher Ulrich <address@hidden> 2003
 
 // This source code has been donated to the Public Domain.  Do
 // whatever you want with it.
 
-#include <boost/thread.hpp>
-
 #include "RGBA.h"
 #include "GnashNumeric.h"
 #include "log.h"
 #include "SWFStream.h"
-#include <sstream> // for ::print and ::toString
+#include <sstream> 
 
 namespace gnash {
 
-//
-// rgba
-//
-
-/// Can throw ParserException on premature end of input stream
 void
 rgba::read(SWFStream& in, SWF::TagType tag)
 {
@@ -34,12 +27,11 @@
     }
 }
 
-/// Can throw ParserException on premature end of input stream
 void
 rgba::read_rgba(SWFStream& in)
 {
     read_rgb(in);
-        in.ensureBytes(1);
+    in.ensureBytes(1);
     m_a = in.read_u8();
 }
 
@@ -54,25 +46,8 @@
     m_a = 0x0FF;
 }
 
-void
-rgba::print() const
-// For debugging.
-{
-    log_parse("rgba: %d %d %d %d", m_r, m_g, m_b, m_a);
-}
-
-std::string
-rgba::toString() const
-// For debugging.
-{
-    std::stringstream ss;
-    ss << *this;
-    return ss.str();
-}
-
 std::string
 rgba::toShortString() const
-// For debugging.
 {
     std::stringstream ss;
     ss << (unsigned)m_r << ","
@@ -83,16 +58,6 @@
 }
 
 void
-rgba::fromShortString(std::string color)
-{
-    std::stringstream ss(color);
-    int hexnumber;
-    ss.ignore();
-    ss >> std::hex >> hexnumber;
-    parseRGB(hexnumber);
-}
-
-void
 rgba::set_lerp(const rgba& a, const rgba& b, float f)
 {
     m_r = static_cast<boost::uint8_t>(frnd(flerp(a.m_r, b.m_r, f)));
@@ -101,17 +66,34 @@
     m_a = static_cast<boost::uint8_t>(frnd(flerp(a.m_a, b.m_a, f)));
 }
 
+rgba
+colorFromHexString(const std::string& color)
+{
+    std::stringstream ss(color);
+    boost::uint32_t hexnumber;
+    
+    if (!(ss >> std::hex >> hexnumber)) {
+        log_error("Failed to convert string to RGBA value! This is a "
+                "Gnash bug");
+        return rgba();
+    }
+
+    rgba ret;
+    ret.parseRGB(hexnumber);
+    return ret;
+}
+
 std::ostream&
-operator<< (std::ostream& os, const rgba& r)
+operator<<(std::ostream& os, const rgba& r)
 {
-       return os << "rgba: "
-               << (unsigned)r.m_r << ", "
-               << (unsigned)r.m_g << ", "
-               << (unsigned)r.m_b << ", "
-               << (unsigned)r.m_a;
+    return os << "rgba: "
+        << static_cast<unsigned>(r.m_r) << ","
+        << static_cast<unsigned>(r.m_g) << ","
+        << static_cast<unsigned>(r.m_b) << ","
+        << static_cast<unsigned>(r.m_a);
 }
 
-}      // end namespace gnash
+} // namespace gnash
 
 
 // Local Variables:

=== modified file 'libcore/RGBA.h'
--- a/libcore/RGBA.h    2009-07-30 18:43:13 +0000
+++ b/libcore/RGBA.h    2010-01-14 11:29:45 +0000
@@ -1,4 +1,4 @@
-// types.h     -- Thatcher Ulrich <address@hidden> 2003
+// types.h    -- Thatcher Ulrich <address@hidden> 2003
 
 // This source code has been donated to the Public Domain.  Do
 // whatever you want with it.
@@ -11,146 +11,148 @@
 #include "SWF.h"
 
 #include <string>
-#include <boost/cstdint.hpp> // for boost::?int??_t 
-
-namespace gnash {
-       class SWFStream;        // forward declaration
-
-       /// RGBA record
-       class rgba
-       {
-       public:
-
-               friend std::ostream& operator<< (std::ostream& os, const rgba& 
r);
-
-               boost::uint8_t  m_r, m_g, m_b, m_a;
-
-               /// Default RGBA value is FF.FF.FF.FF
-               rgba() : m_r(255), m_g(255), m_b(255), m_a(255) {}
-
-               /// Construct an RGBA with the provided values
-               //
-               /// @param r Red
-               /// @param g Green
-               /// @param b Blue
-               /// @param a Alpha (transparency)
-               ///
-               rgba(boost::uint8_t r, boost::uint8_t g, 
-                boost::uint8_t b, boost::uint8_t a)
-                       :
-                       m_r(r), m_g(g), m_b(b), m_a(a)
-               {
-               }
-
-               /// \brief
-               /// Parse a 32-bit unsigned integer
-               /// as three packed R,G,B bytes.
-               //
-               /// Alpha will be untouched.
-               /// Blue is the least significant byte.
-               ///
-               /// This function is meant to be used to
-               /// parse ActionScript colors in numeric format.
-               ///
-               void parseRGB(boost::uint32_t rgbCol)
-               {
-                       m_r = static_cast<boost::uint8_t>(rgbCol>>16);
-                       m_g = static_cast<boost::uint8_t>(rgbCol>>8);
-                       m_b = static_cast<boost::uint8_t>(rgbCol);
-               }
-
-               /// \brief
-               /// Return a 32-bit unsigned integer
-               /// as four packed R,G,B bytes.
-               //
-               /// Blue is the least significant byte.
-               ///
-               /// This function is meant to be used to
-               /// output ActionScript colors in numeric format.
-               ///
-               boost::uint32_t toRGB() const
-               {
-                       return (m_r<<16) + (m_g<<8) + m_b;
-               }
-
-        boost::uint32_t toRGBA() const
-        {
-            return toRGB() + (m_a << 24);
-        }
-
-               /// Initialize from input stream.
-               //
-               ///
-               /// @param in
-               ///     The input (SWF) stream
-               ///
-               /// @param t 
-               ///     I don't know by which logic but
-               ///     a value <= 22 makes it read RGB
-               ///     and value > 22 makes it read RGBA
-               ///
-               /// Throw a ParserException if there's no enough bytes in the
-               /// currently opened tag for reading. See stream::ensureBytes()
-               ///
-               void read(SWFStream& in, SWF::TagType t);
-
-               /// Initialize from input stream (reads RGBA)
-               //
-               /// Throw a ParserException if there's no enough bytes in the
-               /// currently opened tag for reading. See stream::ensureBytes()
-               ///
-               void read_rgba(SWFStream& in);
-
-               /// Initialize from intput stream (reads RGB)
-               void read_rgb(SWFStream& in);
-
-               /// Set r,g,b.a values
-               void set(boost::uint8_t r, boost::uint8_t g,
-                boost::uint8_t b, boost::uint8_t a)
-               {
-                       m_r = r;
-                       m_g = g;
-                       m_b = b;
-                       m_a = a;
-               }
-
-               void set_lerp(const rgba& a, const rgba& b, float f);
-
-               /// Debug log.
-               void print() const;
-
-               /// Debug print.
-               std::string toString() const;
-
-               // neater string output (example: "0,0,0,255")
-               std::string toShortString() const;
-
-               /// Set values from string (eg. #FF0000)
-               //
-               /// @param color Hex String in '#xxxxxx' format
-               void fromShortString(std::string color);
-
-               bool operator== (const rgba& o) const
-               {
-                       return m_r == o.m_r && 
-                               m_g == o.m_g && 
-                               m_b == o.m_b && 
-                               m_a == o.m_a;
-               }
-
-               bool operator!= (const rgba& o) const
-               {
-                       return ! ( *this == o );
-               }
-       };
-
-       std::ostream& operator<< (std::ostream& os, const rgba& r);
-
-
-}      // end namespace gnash
-
-
-#endif // GNASH_TYPES_H
+#include <boost/cstdint.hpp> 
+
+namespace gnash {
+    class SWFStream;
+}
+
+namespace gnash {
+
+/// A basic RGBA type
+//
+/// This both represents a SWF RGBA record and is a basic Gnash type for
+/// color values.
+class rgba
+{
+public:
+
+    /// Construct default RGBA value.
+    //
+    /// Default value is 0xffffffff (solid white).
+    rgba()
+        :
+        m_r(255),
+        m_g(255),
+        m_b(255),
+        m_a(255)
+    {}
+
+    /// Construct an RGBA with the provided values
+    //
+    /// @param r Red
+    /// @param g Green
+    /// @param b Blue
+    /// @param a Alpha (transparency)
+    rgba(boost::uint8_t r, boost::uint8_t g, boost::uint8_t b, 
+            boost::uint8_t a)
+        :
+        m_r(r),
+        m_g(g),
+        m_b(b),
+        m_a(a)
+    {
+    }
+
+    /// Parse a 32-bit unsigned integer as three packed R,G,B bytes.
+    //
+    /// Alpha will be untouched.
+    /// Blue is the least significant byte.
+    ///
+    /// This function is meant to be used to
+    /// parse ActionScript colors in numeric format.
+    void parseRGB(boost::uint32_t rgbCol) {
+        m_r = static_cast<boost::uint8_t>(rgbCol >> 16);
+        m_g = static_cast<boost::uint8_t>(rgbCol >> 8);
+        m_b = static_cast<boost::uint8_t>(rgbCol);
+    }
+
+    /// Return a 32-bit unsigned integer as four packed R,G,B bytes.
+    //
+    /// Blue is the least significant byte. The most significant (alpha)
+    /// byte is unused.
+    ///
+    /// This function is meant to be used to output ActionScript colors
+    /// in numeric format.
+    boost::uint32_t toRGB() const {
+        return (m_r << 16) + (m_g << 8) + m_b;
+    }
+
+    /// Return a 32-bit unsigned integer as four packed A,R,G,B bytes.
+    //
+    /// Blue is the least significant byte.
+    ///
+    /// This function is meant to be used to output ActionScript colors
+    /// in numeric format.
+    boost::uint32_t toRGBA() const {
+        return toRGB() + (m_a << 24);
+    }
+
+    /// Initialize from input stream.
+    //
+    /// @param in   The input SWFStream
+    ///
+    /// @param t    The tag type, used to determine whether to read an RGB
+    ///             or RGBA record.
+    //
+    /// Throw a ParserException if there are not enough bytes in the
+    /// currently opened tag for reading. See SWFStream::ensureBytes()
+    void read(SWFStream& in, SWF::TagType t);
+
+    /// Set r, g, b, a values
+    void set(boost::uint8_t r, boost::uint8_t g, boost::uint8_t b,
+            boost::uint8_t a) {
+        m_r = r;
+        m_g = g;
+        m_b = b;
+        m_a = a;
+    }
+
+    /// Used for morphing.
+    void set_lerp(const rgba& a, const rgba& b, float f);
+
+    /// Neater string output (example: "0,0,0,255")
+    std::string toShortString() const;
+
+    /// Initialize from input stream (reads RGBA)
+    //
+    /// Throw a ParserException if there's no enough bytes in the
+    /// currently opened tag for reading. See SWFStream::ensureBytes()
+    void read_rgba(SWFStream& in);
+
+    /// Initialize from intput stream (reads RGB)
+    void read_rgb(SWFStream& in);
+
+    friend std::ostream& operator<< (std::ostream& os, const rgba& r);
+
+    bool operator==(const rgba& o) const {
+        return m_r == o.m_r && 
+               m_g == o.m_g && 
+               m_b == o.m_b && 
+               m_a == o.m_a;
+    }
+
+    bool operator!=(const rgba& o) const {
+        return !(*this == o);
+    }
+
+    boost::uint8_t m_r, m_g, m_b, m_a;
+
+};
+
+std::ostream& operator<< (std::ostream& os, const rgba& r);
+    
+/// Create an RGBA value from a hex string (e.g. FF0000)
+//
+/// @param color    A hex string in 'rrbbgg' format. This must contain only
+///                 a valid hexadecimal number. It is the caller's
+///                 responsibility to check it.
+rgba colorFromHexString(const std::string& color);
+
+
+} // namespace gnash
+
+#endif 
 
 
 // Local Variables:

=== modified file 'libcore/TextField.cpp'
--- a/libcore/TextField.cpp     2010-01-11 06:41:38 +0000
+++ b/libcore/TextField.cpp     2010-01-14 08:11:30 +0000
@@ -336,7 +336,7 @@
         (point(x, y))
         (point(x, y + h));
     
-    renderer.drawLine(box, rgba(0,0,0,255), mat);
+    renderer.drawLine(box, rgba(0, 0, 0, 255), mat);
 }
 
 size_t
@@ -842,8 +842,7 @@
 
     if (!visible()) return 0;
     
-    // shouldn't this be !can_handle_mouse_event() instead ?
-    // not selectable, so don't catch mouse events!
+    // Not selectable, so don't catch mouse events!
     if (!_selectable) return 0;
 
     SWFMatrix m = getMatrix();
@@ -976,7 +975,7 @@
     // with a pre-existing value.
     const_cast<TextField*>(this)->registerTextVariable();
 
-    int version = getSWFVersion(*getObject(const_cast<TextField*>(this)));
+    const int version = getSWFVersion(*getObject(this));
 
     return utf8::encodeCanonicalString(_text, version);
 }
@@ -1024,9 +1023,8 @@
     float right_margin = getRightMargin();
 
     float extra_space = (width - right_margin) - x - PADDING_TWIPS;
-    //assert(extra_space >= 0.0f);
-    if (extra_space <= 0.0f)
-    {
+
+    if (extra_space <= 0.0f) {
 #ifdef GNASH_DEBUG_TEXTFIELDS
         log_debug(_("TextField text doesn't fit in its boundaries: "
                 "width %g, margin %g - nothing to align"),
@@ -1037,28 +1035,27 @@
 
     float shift_right = 0.0f;
 
-    if (align == ALIGN_LEFT)
-    {
-        // Nothing to do; already aligned left.
-        return 0.0f;
-    }
-    else if (align == ALIGN_CENTER)
-    {
-        // Distribute the space evenly on both sides.
-        shift_right = extra_space / 2;
-    }
-    else if (align == ALIGN_RIGHT)
-    {
-        // Shift all the way to the right.
-        shift_right = extra_space;
-    }
+    switch (align) {
+        case ALIGN_LEFT:
+            // Nothing to do; already aligned left.
+            return 0.0f;
+        case ALIGN_CENTER:
+            // Distribute the space evenly on both sides.
+            shift_right = extra_space / 2;
+            break;
+        case ALIGN_RIGHT:
+            // Shift all the way to the right.
+            shift_right = extra_space;
+            break;
+        case ALIGN_JUSTIFY:
+            // What should we do here?
+            break;
+    }
+
     // Shift the beginnings of the records on this line.
-    for (unsigned int i = last_line_start_record; i < _textRecords.size(); ++i)
-    {
+    for (size_t i = last_line_start_record; i < _textRecords.size(); ++i) {
         SWF::TextRecord& rec = _textRecords[i];
-
-        //if ( rec.hasXOffset() ) // why?
-            rec.setXOffset(rec.xOffset() + shift_right); 
+        rec.setXOffset(rec.xOffset() + shift_right); 
     }
     return shift_right;
 }
@@ -1534,9 +1531,8 @@
                             handleChar(it, e, x, y, newrec, last_code,
                                     last_space_glyph, last_line_start_record);
                         } else if (s == "A") {
-                            //anchor
-                                                       rgba color;
-                                                       
color.fromShortString("#0000FF");
+                            // anchor (blue text).
+                                                       rgba color(0, 0, 0xff, 
0xff);
                                                        newrec.setColor(color);
                                                        
newrec.setUnderline(true);
                                                        attloc = 
attributes.find("HREF");
@@ -1561,10 +1557,17 @@
                             boost::uint16_t originalsize = _fontHeight;
                             attloc = attributes.find("COLOR");
                             if (attloc != attributes.end()) {
-                                //font COLOR attribute
-                                rgba color;
-                                color.fromShortString(attloc->second);
-                                newrec.setColor(color);
+                                std::string hexval(attloc->second);
+                                if (hexval.empty() || hexval[0] != '#') {
+                                    log_error("Unexpected color value");
+                                }
+                                else {
+                                    hexval.erase(0, 1);
+                                    // font COLOR attribute
+                                    rgba color =
+                                        colorFromHexString(attloc->second);
+                                    newrec.setColor(color);
+                                }
                             }
                             attloc = attributes.find("FACE");
                             if (attloc != attributes.end()) {

=== modified file 'libcore/TextField.h'
--- a/libcore/TextField.h       2010-01-11 06:41:38 +0000
+++ b/libcore/TextField.h       2010-01-14 12:03:17 +0000
@@ -20,7 +20,7 @@
 #define GNASH_TEXTFIELD_H
 
 #include "InteractiveObject.h" // for inheritance
-#include "styles.h" // for line_style
+#include "LineStyle.h" // for LineStyle
 #include "Range2d.h"
 #include "SWFRect.h" // for inlines
 #include "Font.h" // for visibility of font add_ref/drop_ref

=== modified file 'libcore/asobj/flash/display/MovieClip_as.cpp'
--- a/libcore/asobj/flash/display/MovieClip_as.cpp      2010-01-08 10:37:35 
+0000
+++ b/libcore/asobj/flash/display/MovieClip_as.cpp      2010-01-14 11:45:08 
+0000
@@ -1619,8 +1619,8 @@
     bool scaleThicknessHorizontally = true;
     bool pixelHinting = false;
     bool noClose = false;
-    cap_style_e capStyle = CAP_ROUND;
-    join_style_e joinStyle = JOIN_ROUND;
+    CapStyle capStyle = CAP_ROUND;
+    JoinStyle joinStyle = JOIN_ROUND;
     float miterLimitFactor = 1.0f;
 
     int arguments = fn.nargs;

=== modified file 'libcore/fill_style.cpp'
--- a/libcore/fill_style.cpp    2010-01-13 08:19:25 +0000
+++ b/libcore/fill_style.cpp    2010-01-14 11:15:29 +0000
@@ -81,23 +81,20 @@
     if (m_type == SWF::FILL_SOLID)
     {
         // 0x00: solid fill
-        if ( t == SWF::DEFINESHAPE3 || t == SWF::DEFINESHAPE4
-            || t == SWF::DEFINESHAPE4_ || is_morph)
-        {
+        if (t == SWF::DEFINESHAPE3 || t == SWF::DEFINESHAPE4
+            || t == SWF::DEFINESHAPE4_ || is_morph) {
+
             m_color.read_rgba(in);
             if (is_morph)   pOther->m_color.read_rgba(in);
         }
-        else 
-        {
+        else {
             // For DefineMorphShape tags we should use morph_fill_style 
-            assert( t == SWF::DEFINESHAPE ||
-                    t == SWF::DEFINESHAPE2 );
+            assert(t == SWF::DEFINESHAPE || t == SWF::DEFINESHAPE2);
             m_color.read_rgb(in);
         }
 
-        IF_VERBOSE_PARSE
-        (
-            log_parse("  color: %s", m_color.toString());
+        IF_VERBOSE_PARSE(
+            log_parse("  color: %s", m_color);
         );
     }
     else if (m_type == SWF::FILL_LINEAR_GRADIENT

=== modified file 'libcore/fontlib.cpp'
--- a/libcore/fontlib.cpp       2009-07-13 07:07:26 +0000
+++ b/libcore/fontlib.cpp       2010-01-14 11:37:19 +0000
@@ -12,7 +12,7 @@
 #include "Font.h"
 #include "log.h"
 #include "DefineShapeTag.h"
-#include "styles.h"
+#include "LineStyle.h"
 #include "movie_definition.h"
 
 // Define to the name of a default font.

=== modified file 'libcore/swf/DefineMorphShapeTag.cpp'
--- a/libcore/swf/DefineMorphShapeTag.cpp       2010-01-11 06:41:38 +0000
+++ b/libcore/swf/DefineMorphShapeTag.cpp       2010-01-14 12:03:17 +0000
@@ -111,7 +111,7 @@
     }
 
     const boost::uint16_t lineCount = in.read_variable_count();
-    line_style ls1, ls2;
+    LineStyle ls1, ls2;
     for (size_t i = 0; i < lineCount; ++i) {
         ls1.read_morph(in, tag, md, r, &ls2);
         _shape1.addLineStyle(ls1);

=== modified file 'libcore/swf/DefineShapeTag.cpp'
--- a/libcore/swf/DefineShapeTag.cpp    2010-01-11 06:41:38 +0000
+++ b/libcore/swf/DefineShapeTag.cpp    2010-01-14 11:29:53 +0000
@@ -54,7 +54,8 @@
            tag == DEFINESHAPE4_);
 
     in.ensureBytes(2);
-    boost::uint16_t id = in.read_u16();
+    const boost::uint16_t id = in.read_u16();
+
     IF_VERBOSE_PARSE(
         log_parse(_("DefineShapeTag(%s): id = %d"), tag, id);
     );
@@ -65,8 +66,7 @@
 }
 
 DisplayObject*
-DefineShapeTag::createDisplayObject(Global_as& gl, DisplayObject* parent)
-    const
+DefineShapeTag::createDisplayObject(Global_as& gl, DisplayObject* parent) const
 {
        return new Shape(getRoot(gl), 0, this, parent);
 }

=== modified file 'libcore/swf/DefineTextTag.h'
--- a/libcore/swf/DefineTextTag.h       2010-01-11 06:41:38 +0000
+++ b/libcore/swf/DefineTextTag.h       2010-01-14 11:37:19 +0000
@@ -20,7 +20,7 @@
 #define GNASH_SWF_DEFINETEXTTAG_H
 
 #include "DefinitionTag.h" // for inheritance
-#include "styles.h" 
+#include "LineStyle.h" 
 #include "SWFRect.h" // for composition
 #include "SWF.h"
 #include "movie_definition.h"

=== modified file 'libcore/swf/SetBackgroundColorTag.h'
--- a/libcore/swf/SetBackgroundColorTag.h       2010-01-01 17:48:26 +0000
+++ b/libcore/swf/SetBackgroundColorTag.h       2010-01-14 11:15:29 +0000
@@ -61,8 +61,8 @@
                // may throw ParserException
                m_color.read_rgb(in);
 
-               IF_VERBOSE_PARSE (
-               log_parse(_("  SetBackgroundColor: %s"), m_color.toString());
+               IF_VERBOSE_PARSE(
+            log_parse(_("  SetBackgroundColor: %s"), m_color);
                );
        }
 

=== modified file 'libcore/swf/ShapeRecord.h'
--- a/libcore/swf/ShapeRecord.h 2010-01-11 06:41:38 +0000
+++ b/libcore/swf/ShapeRecord.h 2010-01-14 12:03:17 +0000
@@ -21,7 +21,7 @@
 
 #include "Geometry.h"
 #include "fill_style.h"
-#include "styles.h"
+#include "LineStyle.h"
 #include "SWFRect.h"
 
 #include <vector>
@@ -53,7 +53,7 @@
 public:
 
     typedef std::vector<fill_style> FillStyles;
-    typedef std::vector<line_style> LineStyles;
+    typedef std::vector<LineStyle> LineStyles;
     typedef std::vector<Path> Paths;
 
     /// Construct a ShapeRecord.
@@ -129,7 +129,7 @@
         _paths.push_back(path);
     }
 
-    void addLineStyle(const line_style& ls) {
+    void addLineStyle(const LineStyle& ls) {
         _lineStyles.push_back(ls);
     }
 

=== modified file 'libcore/swf/tag_loaders.cpp'
--- a/libcore/swf/tag_loaders.cpp       2010-01-11 06:41:38 +0000
+++ b/libcore/swf/tag_loaders.cpp       2010-01-14 11:37:19 +0000
@@ -30,7 +30,7 @@
 #include "log.h"
 #include "Geometry.h"
 #include "SWFStream.h"
-#include "styles.h"
+#include "LineStyle.h"
 #include "GnashImage.h"
 #include "zlib_adapter.h"
 #include "sprite_definition.h"

=== modified file 'testsuite/FuzzyPixel.cpp'
--- a/testsuite/FuzzyPixel.cpp  2010-01-01 17:48:26 +0000
+++ b/testsuite/FuzzyPixel.cpp  2010-01-14 11:15:29 +0000
@@ -40,7 +40,7 @@
 std::ostream&
 operator<< (std::ostream& o, const FuzzyPixel& p)
 {
-       return o << "FuzzyPixel(" << p._col.toString() << ") [tol:" << p._tol 
<< "]";
+       return o << "FuzzyPixel(" << p._col << ") [tol:" << p._tol << "]";
 }
 
 } // namespace gnash

=== modified file 'testsuite/libcore.all/ClassSizes.cpp'
--- a/testsuite/libcore.all/ClassSizes.cpp      2010-01-11 06:41:38 +0000
+++ b/testsuite/libcore.all/ClassSizes.cpp      2010-01-14 13:17:20 +0000
@@ -73,7 +73,7 @@
 (int) (float) (long) (double) \
 (Property*) (auto_ptr<Property>) (scoped_ptr<Property>) \
 (shared_ptr<Property>) (intrusive_ptr<as_object>) (GcResource) \
-(rgba) (SWFMatrix) (SWFRect) (line_style) (fill_style) (cxform) \
+(rgba) (SWFMatrix) (SWFRect) (LineStyle) (fill_style) (cxform) \
 (as_value) \
 (DynamicShape)(ShapeRecord)(TextRecord) \
 (Property) (PropertyList) \


reply via email to

[Prev in Thread] Current Thread [Next in Thread]