gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp ...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/edit_text_character.cpp ...
Date: Thu, 29 May 2008 10:34:56 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/05/29 10:34:56

Modified files:
        .              : ChangeLog 
        server         : edit_text_character.cpp sprite_instance.cpp 
                         text.cpp text.h 
        server/parser  : edit_text_character_def.cpp 
                         edit_text_character_def.h 
                         text_character_def.cpp text_character_def.h 
        server/swf     : tag_loaders.cpp 

Log message:
        Drop references from font, edit_text_character_def and 
text_character_def
        to defining movie (unused).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6755&r2=1.6756
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.189&r2=1.190
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.544&r2=1.545
http://cvs.savannah.gnu.org/viewcvs/gnash/server/text.cpp?cvsroot=gnash&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/gnash/server/text.h?cvsroot=gnash&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/edit_text_character_def.cpp?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/edit_text_character_def.h?cvsroot=gnash&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/text_character_def.cpp?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/text_character_def.h?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.cpp?cvsroot=gnash&r1=1.200&r2=1.201

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6755
retrieving revision 1.6756
diff -u -b -r1.6755 -r1.6756
--- ChangeLog   29 May 2008 09:21:59 -0000      1.6755
+++ ChangeLog   29 May 2008 10:34:54 -0000      1.6756
@@ -1,3 +1,13 @@
+2008-05-29 Sandro Santilli <address@hidden>
+
+       * server/edit_text_character.cpp, server/sprite_instance.cpp,
+         server/text.{cpp,h}, server/parser/edit_text_character_def.{cpp,h},
+         server/parser/text_character_def.{cpp,h},
+         server/swf/tag_loaders.{cpp,h}:
+         Drop references from font, edit_text_character_def and
+         text_character_def to defining movie (unused).
+         
+
 2008-05-29 Benjamin Wolsey <address@hidden>
 
        * server/generic_character.cpp: header cleanup.

Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.189
retrieving revision 1.190
diff -u -b -r1.189 -r1.190
--- server/edit_text_character.cpp      29 May 2008 10:04:59 -0000      1.189
+++ server/edit_text_character.cpp      29 May 2008 10:34:55 -0000      1.190
@@ -652,8 +652,7 @@
        
        
        //log_debug("Displaying glyph records for textfield %s", getTarget());
-       display_glyph_records(m, this, m_text_glyph_records,
-                             m_def->get_root_def(), _embedFonts);
+       display_glyph_records(m, this, m_text_glyph_records, _embedFonts);
 
        if (m_has_focus)
        {

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.544
retrieving revision 1.545
diff -u -b -r1.544 -r1.545
--- server/sprite_instance.cpp  29 May 2008 09:22:00 -0000      1.544
+++ server/sprite_instance.cpp  29 May 2008 10:34:55 -0000      1.545
@@ -2661,7 +2661,7 @@
   matrix txt_matrix;
 
   // Create a definition (TODO: cleanup this thing, definitions should be 
immutable!)
-  boost::intrusive_ptr<edit_text_character_def> txt = new 
edit_text_character_def(get_movie_definition());
+  boost::intrusive_ptr<edit_text_character_def> txt = new 
edit_text_character_def();
 
   // Set textfield bounds
   txt->set_bounds(rect(0, 0, PIXELS_TO_TWIPS(width), PIXELS_TO_TWIPS(height)));

Index: server/text.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/text.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- server/text.cpp     17 Apr 2008 16:24:08 -0000      1.50
+++ server/text.cpp     29 May 2008 10:34:55 -0000      1.51
@@ -83,8 +83,7 @@
                const matrix& this_mat,
                character* inst,
                const std::vector<text_glyph_record>& records,
-               // root_def was used to resove fonts, now done at parse time
-               movie_definition* /*root_def*/, bool useEmbeddedGlyphs)
+               bool useEmbeddedGlyphs)
        {
                //GNASH_REPORT_FUNCTION;
                

Index: server/text.h
===================================================================
RCS file: /sources/gnash/gnash/server/text.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- server/text.h       11 Apr 2008 15:48:22 -0000      1.26
+++ server/text.h       29 May 2008 10:34:55 -0000      1.27
@@ -220,7 +220,7 @@
                const matrix& this_mat,
                character* inst,
                const std::vector<text_glyph_record>& records,
-               movie_definition* root_def, bool useEmbeddedGlyphs);
+               bool useEmbeddedGlyphs);
 
 } // namespace gnash
 

Index: server/parser/edit_text_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/edit_text_character_def.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- server/parser/edit_text_character_def.cpp   16 May 2008 07:22:35 -0000      
1.21
+++ server/parser/edit_text_character_def.cpp   29 May 2008 10:34:55 -0000      
1.22
@@ -27,7 +27,7 @@
 
 #include "edit_text_character_def.h"
 #include "edit_text_character.h"
-#include "font.h" // for setReachable call
+#include "font.h" // for setReachable call, ctor and dtor
 
 namespace gnash {
 
@@ -36,7 +36,7 @@
 
 void
 edit_text_character_def::read(stream* in, int tag_type,
-               movie_definition* /*m*/)
+               movie_definition* m)
 {
        //assert(m != NULL);
        assert(tag_type == SWF::DEFINEEDITTEXT); // 37
@@ -69,7 +69,14 @@
        if (has_font)
        {
                in->ensureBytes(4);
-               m_font_id = in->read_u16();
+               int fontID = in->read_u16();
+               m_font = m->get_font(fontID);
+               if (m_font == NULL)
+               {
+                       // this is fine, the textfield would use a default 
device font
+                       //log_debug(_("text style with undefined font; font_id 
= %d; using a default font"), m_font_id);
+                       m_font = fontlib::get_default_font().get();
+               }
                m_text_height = in->read_u16();
        }
 
@@ -117,19 +124,7 @@
 const font*
 edit_text_character_def::get_font()
 {
-       if (m_font == NULL)
-       {
-               // Resolve the font, if possible.
-               m_font = m_root_def->get_font(m_font_id);
-               if (m_font == NULL)
-               {
-                       // this is fine, the textfield would use a default 
device font
-                       //log_debug(_("text style with undefined font; font_id 
= %d; using a default font"), m_font_id);
-                       m_font = fontlib::get_default_font().get();
-               }
-       }
-
-       return m_font;
+       return m_font.get();
 }
 
 character*
@@ -168,11 +163,44 @@
 void
 edit_text_character_def::markReachableResources() const
 {
-       if ( m_root_def ) m_root_def->setReachable();
+       //if ( m_root_def ) m_root_def->setReachable();
        if ( m_font ) m_font->setReachable();
 }
 #endif // GNASH_USE_GC
 
+edit_text_character_def::edit_text_character_def()
+       :
+       m_has_text(true), // For an SWF-defined textfield we'll read
+                         // this from the tag. Dynamic textfields should
+                         // behave as always having text by default (not 
tested).
+
+       m_word_wrap(false),
+       m_multiline(false),
+       m_password(false),
+       m_readonly(true),
+       m_auto_size(false),
+       m_no_select(false),
+       m_border(false),
+       m_html(false),
+       m_use_outlines(false), // For an SWF-defined textfield we'll read
+                              // this from the tag. Dynamic textfields should
+                              // use device fonts by default (so not use 
outline ones)
+       m_font_id(-1),
+       m_font(),
+       m_text_height(1), // TODO: initialize to a meaningful value (see 
sprite_instance::add_textfield)
+                         //       and make sure get_font_height is not called 
for rendering purposes
+                         //       (instead call a method of 
edit_text_character_def)
+       m_max_length(0),
+       m_alignment(ALIGN_LEFT),
+       m_left_margin(0),
+       m_right_margin(0),
+       m_indent(0),
+       m_leading(0)
+{
+       m_color.set(0, 0, 0, 255);
+}
+
+
 } // namespace gnash
 
 // Local Variables:

Index: server/parser/edit_text_character_def.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/edit_text_character_def.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- server/parser/edit_text_character_def.h     21 Apr 2008 11:27:45 -0000      
1.28
+++ server/parser/edit_text_character_def.h     29 May 2008 10:34:56 -0000      
1.29
@@ -27,6 +27,7 @@
 
 // Forward declarations
 class movie_definition;
+class font;
 
 /// \brief
 /// A definition for a text display character, whose text can
@@ -47,45 +48,7 @@
                ALIGN_JUSTIFY
        };
 
-       edit_text_character_def(movie_definition* root_def)
-               :
-               m_root_def(root_def),
-
-               m_has_text(true), // For an SWF-defined textfield we'll read
-                                 // this from the tag. Dynamic textfields 
should
-                                 // behave as always having text by default 
(not tested).
-
-               m_word_wrap(false),
-               m_multiline(false),
-               m_password(false),
-               m_readonly(true),
-               m_auto_size(false),
-               m_no_select(false),
-               m_border(false),
-               m_html(false),
-               m_use_outlines(false), // For an SWF-defined textfield we'll 
read
-                                      // this from the tag. Dynamic textfields 
should
-                                      // use device fonts by default (so not 
use outline ones)
-               m_font_id(-1),
-               m_font(NULL),
-               m_text_height(1), // TODO: initialize to a meaningful value 
(see sprite_instance::add_textfield)
-                                 //       and make sure get_font_height is not 
called for rendering purposes
-                                 //       (instead call a method of 
edit_text_character_def)
-               m_max_length(0),
-               m_alignment(ALIGN_LEFT),
-               m_left_margin(0),
-               m_right_margin(0),
-               m_indent(0),
-               m_leading(0)
-       {
-               assert(m_root_def);
-
-               m_color.set(0, 0, 0, 255);
-       }
-
-       ~edit_text_character_def()
-       {
-       }
+       edit_text_character_def();
 
        /// Get width of this definition in twips (by definition)
        float width() const { return m_rect.width(); }
@@ -216,11 +179,6 @@
                return m_has_text;
        }
 
-       /// Get root movie definition
-       movie_definition* get_root_def() {
-               return m_root_def;
-       }
-
        bool get_readonly() const
        {
                return m_readonly;
@@ -257,7 +215,6 @@
        /// Mark all reachable resources (for GC)
        //
        /// Reachable resources are:
-       ///  - The root movie definition (m_root_def) @@ what do we use this 
for ?
        ///  - The font being used (m_font) 
        ///
        void markReachableResources() const;
@@ -265,9 +222,6 @@
 
 private:
 
-       /// Root movie_definition
-       movie_definition*       m_root_def;
-
        rect                    m_rect;
        std::string             m_variable_name;
        bool                    m_has_text;
@@ -321,7 +275,7 @@
        bool    m_use_outlines;
 
        int     m_font_id;
-       font*   m_font;
+       boost::intrusive_ptr<font> m_font;
 
        /// height of font text, in twips
        boost::uint16_t m_text_height;

Index: server/parser/text_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/text_character_def.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/parser/text_character_def.cpp        11 Apr 2008 15:48:22 -0000      
1.11
+++ server/parser/text_character_def.cpp        29 May 2008 10:34:56 -0000      
1.12
@@ -169,7 +169,7 @@
        bool useEmbeddedGlyphs = true;
 
        display_glyph_records(m_matrix, inst,
-               m_text_glyph_records, m_root_def, useEmbeddedGlyphs); 
+               m_text_glyph_records, useEmbeddedGlyphs); 
 }
 
 }      // end namespace gnash

Index: server/parser/text_character_def.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/text_character_def.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/parser/text_character_def.h  9 Apr 2008 20:52:46 -0000       1.11
+++ server/parser/text_character_def.h  29 May 2008 10:34:56 -0000      1.12
@@ -42,17 +42,11 @@
 class text_character_def : public character_def
 {
 public:
-       movie_definition*       m_root_def;
        rect    m_rect;
        matrix  m_matrix;
        std::vector<text_glyph_record>  m_text_glyph_records;
 
-       text_character_def(movie_definition* root_def)
-               :
-               m_root_def(root_def)
-       {
-               assert(m_root_def);
-       }
+       text_character_def() {}
 
        void read(stream* in, int tag_type, movie_definition* m);
 

Index: server/swf/tag_loaders.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/tag_loaders.cpp,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -b -r1.200 -r1.201
--- server/swf/tag_loaders.cpp  27 May 2008 13:27:25 -0000      1.200
+++ server/swf/tag_loaders.cpp  29 May 2008 10:34:56 -0000      1.201
@@ -1155,7 +1155,7 @@
     in->ensureBytes(2);
     boost::uint16_t    character_id = in->read_u16();
 
-    edit_text_character_def* ch = new edit_text_character_def(m);
+    edit_text_character_def* ch = new edit_text_character_def();
     IF_VERBOSE_PARSE
     (
        log_parse(_("edit_text_char, id = %d"), character_id);
@@ -1174,7 +1174,7 @@
     in->ensureBytes(2);
     boost::uint16_t    character_id = in->read_u16();
 
-    text_character_def* ch = new text_character_def(m);
+    text_character_def* ch = new text_character_def();
     IF_VERBOSE_PARSE
     (
        log_parse(_("text_character, id = %d"), character_id);




reply via email to

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