gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r9568: Parse CSMTextSettings tag (us


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r9568: Parse CSMTextSettings tag (used by myspace).
Date: Thu, 07 Aug 2008 21:23:56 +0200
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9568
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2008-08-07 21:23:56 +0200
message:
  Parse CSMTextSettings tag (used by myspace).
added:
  libcore/swf/CSMTextSettingsTag.cpp
  libcore/swf/CSMTextSettingsTag.h
modified:
  libcore/Makefile.am
  libcore/impl.cpp
    ------------------------------------------------------------
    revno: 9567.1.1
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Thu 2008-08-07 20:51:54 +0200
    message:
      Parse CSMTextSettings tag and log unimplemented.
    added:
      libcore/swf/CSMTextSettingsTag.cpp
      libcore/swf/CSMTextSettingsTag.h
    modified:
      libcore/Makefile.am
      libcore/impl.cpp
    ------------------------------------------------------------
    revno: 9567.1.2
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Thu 2008-08-07 20:53:45 +0200
    message:
      Add file description line.
    modified:
      libcore/swf/CSMTextSettingsTag.cpp
      libcore/swf/CSMTextSettingsTag.h
=== modified file 'libcore/Makefile.am'
--- a/libcore/Makefile.am       2008-07-22 21:24:49 +0000
+++ b/libcore/Makefile.am       2008-08-07 18:51:54 +0000
@@ -82,6 +82,7 @@
        swf/TagLoadersTable.cpp \
        swf/tag_loaders.cpp \
        swf/DefineFontAlignZonesTag.cpp \
+       swf/CSMTextSettingsTag.cpp \
        swf/PlaceObject2Tag.cpp \
        swf/RemoveObjectTag.cpp \
        swf/StartSoundTag.cpp \
@@ -172,6 +173,7 @@
        swf/tag_loaders.h \
        swf/ControlTag.h \
        swf/DefineFontAlignZonesTag.h \
+       swf/CSMTextSettingsTag.h \
        swf/PlaceObject2Tag.h \
        swf/RemoveObjectTag.h \
        swf/DisplayListTag.h \

=== modified file 'libcore/impl.cpp'
--- a/libcore/impl.cpp  2008-08-07 13:21:24 +0000
+++ b/libcore/impl.cpp  2008-08-07 18:51:54 +0000
@@ -45,6 +45,7 @@
 #include "ScriptLimitsTag.h"
 #include "BitmapMovieDefinition.h"
 #include "DefineFontAlignZonesTag.h"
+#include "CSMTextSettingsTag.h"
 #include "PlaceObject2Tag.h"
 #include "RemoveObjectTag.h"
 #include "DoActionTag.h"
@@ -236,7 +237,7 @@
     register_tag_loader(SWF::DOABC, abc_loader); // 72 -- AS3 codeblock.
     register_tag_loader(SWF::DEFINEALIGNZONES, 
DefineFontAlignZonesTag::loader); // 73
 
-    register_tag_loader(SWF::CSMTEXTSETTINGS, fixme_loader); // 74
+    register_tag_loader(SWF::CSMTEXTSETTINGS, CSMTextSettingsTag::loader); // 
74
     register_tag_loader(SWF::DEFINEFONT3, define_font_loader); // 75
     register_tag_loader(SWF::SYMBOLCLASS, fixme_loader); // 76 
     register_tag_loader(SWF::METADATA, metadata_loader); // 77

=== added file 'libcore/swf/CSMTextSettingsTag.cpp'
--- a/libcore/swf/CSMTextSettingsTag.cpp        1970-01-01 00:00:00 +0000
+++ b/libcore/swf/CSMTextSettingsTag.cpp        2008-08-07 18:53:45 +0000
@@ -0,0 +1,88 @@
+// CSMTextSettingsTag.cpp:  for Gnash.
+//
+//   Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#include "log.h"
+#include "stream.h"
+#include "movie_definition.h"
+#include "CSMTextSettingsTag.h"
+
+namespace gnash {
+namespace SWF {
+
+CSMTextSettingsTag::CSMTextSettingsTag(movie_definition& /* m */,
+    SWFStream& /* in */)
+{
+}
+
+void
+CSMTextSettingsTag::loader(SWFStream* in, tag_type tag, movie_definition* 
/*m*/)
+{
+    assert(tag == SWF::CSMTEXTSETTINGS); // 73
+
+    // TextID (UI16) 16 bit int.
+    // UseFlashType(UB[2]) 2 bits
+    // GridFit UB[3] 3 bits
+    // res (UB[3]) 3 bits
+    // Thickness F32
+    // Sharpness F32
+    // res UI8 must be 0. 8 bit int? 
+
+    in->ensureBytes(2 + 1 + 4 + 4 + 1);
+
+    boost::uint16_t textID = in->read_u16();
+    
+    // Should be either 1 or 0. TODO: what if it's something else?
+    bool flashType = in->read_uint(2); 
+    
+    // 0: no grid fitting.
+    // 1: Pixel grid fit (only for left-aligned dynamic text)
+    // 2: Sub-pixel grid fit.
+    boost::uint8_t gridFit = in->read_uint(3);
+
+    // Should be 0:
+    boost::uint8_t reserved = in->read_uint(3);
+
+    float thickness = in->read_long_float();
+    
+    float sharpness = in->read_long_float();
+    
+    // Should also be 0.
+    reserved = in->read_u8();
+
+    IF_VERBOSE_PARSE (
+        log_parse(_("  CSMTextSettings: TextID=%d, FlashType=%d, "
+                    "GridFit=%d, Thickness=%d, Sharpness=%d"),
+                    textID, static_cast<int>(flashType),
+                    static_cast<int>(gridFit), thickness, sharpness);
+    );
+
+    in->skip_to_tag_end();
+
+    LOG_ONCE(log_unimpl(_("CSMTextSettings")));
+
+}
+
+
+} // namespace gnash::SWF
+} // namespace gnash
+
+// Local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End:

=== added file 'libcore/swf/CSMTextSettingsTag.h'
--- a/libcore/swf/CSMTextSettingsTag.h  1970-01-01 00:00:00 +0000
+++ b/libcore/swf/CSMTextSettingsTag.h  2008-08-07 18:53:45 +0000
@@ -0,0 +1,57 @@
+// CSMTextSettingsTag.h: parse SWF CSMTextSettings tag
+// 
+//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+#ifndef GNASH_SWF_CSMTEXTSETTINGSTAG_H
+#define GNASH_SWF_CSMTEXTSETTINGSTAG_H
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+// Forward declarations
+namespace gnash {
+       class movie_definition;
+       class SWFStream;
+}
+
+namespace gnash {
+namespace SWF {
+
+class CSMTextSettingsTag {
+public:
+
+       CSMTextSettingsTag(movie_definition& m, SWFStream& in);
+
+       static void loader(SWFStream* in, tag_type tag, movie_definition* m);
+
+private:
+
+};
+
+} // namespace gnash::SWF
+} // namespace gnash
+
+
+#endif // GNASH_SWF_CSMTEXTSETTINGSTAG_H
+
+
+// Local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End:


reply via email to

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