gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r11363: Add'l html tag support


From: Sharad Desai
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11363: Add'l html tag support
Date: Tue, 04 Aug 2009 11:15:08 -0600
User-agent: Bazaar (1.16.1)

------------------------------------------------------------
revno: 11363 [merge]
committer: Sharad Desai <address@hidden>
branch nick: trunk
timestamp: Tue 2009-08-04 11:15:08 -0600
message:
  Add'l html tag support
modified:
  libcore/TextField.cpp
  libcore/TextField.h
  libcore/asobj/TextFormat_as.cpp
=== modified file 'libcore/TextField.cpp'
--- a/libcore/TextField.cpp     2009-08-04 16:32:15 +0000
+++ b/libcore/TextField.cpp     2009-08-04 17:14:06 +0000
@@ -1550,7 +1550,7 @@
     linestartit = _line_starts.begin();
     linestartend = _line_starts.end();
     //Fit a line_start in the correct place
-    const size_t currentPos = it - _text.begin();
+    const size_t currentPos = _glyphcount;
 
     while (linestartit < linestartend && *linestartit < currentPos)
     {
@@ -1786,10 +1786,28 @@
                             handleChar(it, e, x, y, newrec, last_code,
                                     last_space_glyph, last_line_start_record);
                         } else if (s == "LI") {
-                            //list item (bullet)
-                            log_unimpl("<li> html tag in TextField");
+                            //list item (bullet)       
+                                                       int space = 
newrec.getFont()->get_glyph_index(32, _embedFonts);
+                                                       
SWF::TextRecord::GlyphEntry ge;
+                                                       ge.index = space;
+                                                       ge.advance = scale * 
newrec.getFont()->get_advance(space, _embedFonts);
+                                                       newrec.addGlyph(ge, 5);
+
+                                                       // We use an asterisk 
instead of a bullet
+                                                       int bullet = 
newrec.getFont()->get_glyph_index(42, _embedFonts);
+                                                       ge.index = bullet;
+                                                       ge.advance = scale * 
newrec.getFont()->get_advance(bullet, _embedFonts);
+                                                       newrec.addGlyph(ge);
+                                                       
+                                                       space = 
newrec.getFont()->get_glyph_index(32, _embedFonts);
+                                                       ge.index = space;
+                                                       ge.advance = scale * 
newrec.getFont()->get_advance(space, _embedFonts);
+                                                       newrec.addGlyph(ge, 4);
+
                                                        handleChar(it, e, x, y, 
newrec, last_code,
                                     last_space_glyph, last_line_start_record);
+                                                       newLine(it, x, y, 
newrec, last_space_glyph,
+                                    last_line_start_record, 1.0);
                         } else if (s == "SPAN") {
                             //span
                             log_unimpl("<span> html tag in TextField");
@@ -1965,7 +1983,7 @@
                         // using the empty-box glyph
                     }
                 );
-
+                               
                 SWF::TextRecord::GlyphEntry ge;
                 ge.index = index;
                 ge.advance = scale * rec.getFont()->get_advance(index, 

=== modified file 'libcore/TextField.h'
--- a/libcore/TextField.h       2009-08-04 16:32:15 +0000
+++ b/libcore/TextField.h       2009-08-04 17:14:06 +0000
@@ -270,7 +270,7 @@
     void multiline(bool b) {
         _multiline = b;
     }
-
+       
     /// Get the current password setting of the TextField
     bool password() const {
         return _password;
@@ -705,7 +705,8 @@
        std::set<wchar_t> _restrictedchars;
        TextFormatDisplay _display;
        std::vector<int> _tabStops;
-
+       
+       boost::int32_t _numChars;
        boost::int16_t _leading;
 
        TextAlignment _alignment;

=== modified file 'libcore/asobj/TextFormat_as.cpp'
--- a/libcore/asobj/TextFormat_as.cpp   2009-07-30 21:34:40 +0000
+++ b/libcore/asobj/TextFormat_as.cpp   2009-08-04 17:14:06 +0000
@@ -124,27 +124,11 @@
 TextFormat_as::TextFormat_as()
        :
        as_object(getTextFormatInterface()),
-       //~ _flags(0),
-       //~ _underline(false),
-       //~ _bold(false),
-       //~ _italic(false),
-       //~ _display(),
-       //~ _bullet(false),
-       //~ _align(TextField::ALIGN_LEFT),
-       //~ _blockIndent(-1),
-       //~ _color(),
-       //~ _indent(-1),
-       //~ _leading(-1),
-       //~ _leftMargin(-1),
-       //~ _rightMargin(-1),
-       //~ _pointSize(-1),
-       //~ _tabStops(),
-       //~ _target(),
-       //~ _url()
        
        _flags(0),
        _underline(false),
        _bold(false),
+       _display(),
        _italic(false),
        _bullet(false),
        _align(TextField::ALIGN_LEFT),
@@ -156,7 +140,8 @@
        _rightMargin(-1),
        _pointSize(-1),
        _tabStops(),
-       _target()
+       _target(),
+       _url()
 {
     Global_as* gl = getGlobal(*this);
        init_member("getTextExtent", 
gl->createFunction(textformat_getTextExtent));


reply via email to

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