gnash-commit
[Top][All Lists]
Advanced

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

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


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash ./ChangeLog server/Movie.cpp server/Movie...
Date: Sun, 23 Apr 2006 14:40:10 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         
Changes by:     Bastiaan Jacques <address@hidden>       06/04/23 14:40:10

Modified files:
        .              : ChangeLog 
        server         : Movie.cpp Movie.h Object.h font.h morph2.h 
                         shape.h stream.h styles.h 

Log message:
        Switch some structs to classes.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/ChangeLog.diff?tr1=1.226&tr2=1.227&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Movie.cpp.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Movie.h.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Object.h.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/font.h.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/morph2.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/shape.h.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/stream.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/styles.h.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: gnash/ChangeLog
diff -u gnash/ChangeLog:1.226 gnash/ChangeLog:1.227
--- gnash/ChangeLog:1.226       Sun Apr 23 11:20:40 2006
+++ gnash/ChangeLog     Sun Apr 23 14:40:09 2006
@@ -1,3 +1,9 @@
+2006-04-23 <address@hidden>
+
+       * server/Movie.cpp, server/Movie.h, server/Object.h,
+       server/font.h, server/morph2.h, server/shape.h,
+       server/stream.h, server/styles.h: Switch structs to classes.
+
 2006-04-23  Bastiaan Jacques  <address@hidden>
 
        * server/Movie.h: make movie_def_impl a friend of import_info.
Index: gnash/server/Movie.cpp
diff -u gnash/server/Movie.cpp:1.15 gnash/server/Movie.cpp:1.16
--- gnash/server/Movie.cpp:1.15 Sun Apr 23 11:20:40 2006
+++ gnash/server/Movie.cpp      Sun Apr 23 14:40:10 2006
@@ -585,7 +585,6 @@
 movie_root::movie_root(movie_def_impl* def)
     :
     m_def(def),
-    m_movie(NULL),
     m_viewport_x0(0),
     m_viewport_y0(0),
     m_viewport_width(1),
@@ -630,8 +629,10 @@
     m_viewport_height = h;
 
     // Recompute pixel scale.
-    float      scale_x = m_viewport_width / 
TWIPS_TO_PIXELS(m_def->m_frame_size.width());
-    float      scale_y = m_viewport_height / 
TWIPS_TO_PIXELS(m_def->m_frame_size.height());
+    const rect& frame_size = m_def->get_frame_size();
+
+    float      scale_x = m_viewport_width / 
TWIPS_TO_PIXELS(frame_size.width());
+    float      scale_y = m_viewport_height / 
TWIPS_TO_PIXELS(frame_size.height());
     m_pixel_scale = fmax(scale_x, scale_y);
 }
 
@@ -757,12 +758,14 @@
             return;
         }
 
+    const rect& frame_size = m_def->get_frame_size();
+
     gnash::render::begin_display(
         m_background_color,
         m_viewport_x0, m_viewport_y0,
         m_viewport_width, m_viewport_height,
-        m_def->m_frame_size.m_x_min, m_def->m_frame_size.m_x_max,
-        m_def->m_frame_size.m_y_min, m_def->m_frame_size.m_y_max);
+        frame_size.m_x_min, frame_size.m_x_max,
+        frame_size.m_y_min, frame_size.m_y_max);
 
     m_movie->display();
 
Index: gnash/server/Movie.h
diff -u gnash/server/Movie.h:1.12 gnash/server/Movie.h:1.13
--- gnash/server/Movie.h:1.12   Sun Apr 23 11:20:40 2006
+++ gnash/server/Movie.h        Sun Apr 23 14:40:10 2006
@@ -232,7 +232,7 @@
 /// current state; for that you need to call create_instance()
 /// to get a movie_instance (movie_interface).
 ///
-struct movie_def_impl : public movie_definition
+class movie_def_impl : public movie_definition
 {
        hash<int, smart_ptr<character_def> >            m_characters;
        hash<int, smart_ptr<font> >                     m_fonts;
@@ -273,6 +273,7 @@
 
        jpeg::input*    m_jpeg_in;
 
+public:
        movie_def_impl(create_bitmaps_flag cbf,
                        create_font_shapes_flag cfs)
                :
@@ -291,6 +292,7 @@
        // ...
        int     get_frame_count() const { return m_frame_count; }
        float   get_frame_rate() const { return m_frame_rate; }
+       const rect& get_frame_size() const { return m_frame_size; }
 
        float   get_width_pixels() const
        {
@@ -486,10 +488,9 @@
 
 
        /// Global, shared root state for a movie and all its characters.
-       struct movie_root : public movie_interface
+       class movie_root : public movie_interface
        {
                smart_ptr<movie_def_impl>       m_def;
-               smart_ptr<movie>        m_movie;
                int                     m_viewport_x0, m_viewport_y0;
                int                     m_viewport_width, m_viewport_height;
                float                   m_pixel_scale;
@@ -499,9 +500,6 @@
                int                     m_mouse_x, m_mouse_y, m_mouse_buttons;
                void *                  m_userdata;
 
-               /// @@ fold this into m_mouse_button_state?
-               movie::drag_state       m_drag_state;
-
                mouse_button_state      m_mouse_button_state;
                bool                    m_on_event_load_called;
 
@@ -511,6 +509,12 @@
                bool                    m_on_event_load_progress_called;
                std::vector<Timer *>    m_interval_timers;
 
+       public:
+               // XXXbastiaan: make these two variables private
+               smart_ptr<movie>        m_movie;
+               /// @@ fold this into m_mouse_button_state?
+               movie::drag_state       m_drag_state;
+
                movie_root(movie_def_impl* def);
 
                ~movie_root();
Index: gnash/server/Object.h
diff -u gnash/server/Object.h:1.6 gnash/server/Object.h:1.7
--- gnash/server/Object.h:1.6   Thu Mar 30 01:52:00 2006
+++ gnash/server/Object.h       Sun Apr 23 14:40:10 2006
@@ -399,13 +399,14 @@
 
 
 /// Member for as_object: value + flags
-struct as_member
+class as_member
 {
        /// value
        as_value m_value;
        /// Properties flags
        as_prop_flags m_flags;
 
+public:
        /// Default constructor
        as_member() {
        }
@@ -431,17 +432,17 @@
 };
 
 /// For stuff that's tricky to keep track of w/r/t ownership & cleanup.
-struct ref_counted
+class ref_counted
 {
+       mutable int     m_ref_count;
+       mutable weak_proxy*     m_weak_proxy;
+public:
        ref_counted();
        virtual ~ref_counted();
        void    add_ref() const;
        void    drop_ref() const;
        int     get_ref_count() const { return m_ref_count; }
        weak_proxy*     get_weak_proxy() const;
-private:
-       mutable int     m_ref_count;
-       mutable weak_proxy*     m_weak_proxy;
 };
 
 
Index: gnash/server/font.h
diff -u gnash/server/font.h:1.3 gnash/server/font.h:1.4
--- gnash/server/font.h:1.3     Sun Feb 26 21:44:53 2006
+++ gnash/server/font.h Sun Apr 23 14:40:10 2006
@@ -49,8 +49,9 @@
        };
 
 
-       struct font : public resource
+       class font : public resource
        {
+       public:
                font();
                ~font();
 
Index: gnash/server/morph2.h
diff -u gnash/server/morph2.h:1.2 gnash/server/morph2.h:1.3
--- gnash/server/morph2.h:1.2   Sun Feb 26 21:44:53 2006
+++ gnash/server/morph2.h       Sun Apr 23 14:40:10 2006
@@ -10,8 +10,9 @@
 
 
 namespace gnash {
-       struct morph2_character_def : public shape_character_def
+       class morph2_character_def : public shape_character_def
        {
+       public:
                morph2_character_def();
                virtual ~morph2_character_def();
                void    read(stream* in, int tag_type, bool with_style, 
movie_definition* m);
Index: gnash/server/shape.h
diff -u gnash/server/shape.h:1.5 gnash/server/shape.h:1.6
--- gnash/server/shape.h:1.5    Sun Feb 26 21:44:53 2006
+++ gnash/server/shape.h        Sun Apr 23 14:40:10 2006
@@ -65,9 +65,10 @@
                bool    m_new_shape;
        };
 
-       struct mesh
+       class mesh
        // For holding a pre-tesselated shape.
        {
+       public:
                mesh();
 
                void    set_tri_strip(const point pts[], int count);
@@ -81,9 +82,10 @@
        };
 
 
-       struct line_strip
+       class line_strip
        // For holding a line-strip (i.e. polyline).
        {
+       public:
                line_strip();
                line_strip(int style, const point coords[], int coord_count);
 
@@ -99,8 +101,9 @@
 
 
        /// A whole shape, tesselated to a certain error tolerance.
-       struct mesh_set
+       class mesh_set
        {
+       public:
                mesh_set();
                mesh_set(const tesselate::tesselating_shape* sh,
                         float error_tolerance);
@@ -139,8 +142,9 @@
        /// \brief
        /// Represents the outline of one or more shapes, along with
        /// information on fill and line styles.
-       struct shape_character_def : public character_def, public 
tesselate::tesselating_shape
+       class shape_character_def : public character_def, public 
tesselate::tesselating_shape
        {
+       public:
                shape_character_def();
                virtual ~shape_character_def();
 
Index: gnash/server/stream.h
diff -u gnash/server/stream.h:1.2 gnash/server/stream.h:1.3
--- gnash/server/stream.h:1.2   Sat Feb 25 03:54:03 2006
+++ gnash/server/stream.h       Sun Apr 23 14:40:10 2006
@@ -14,8 +14,9 @@
 
 namespace gnash {
        // stream is used to encapsulate bit-packed file reads.
-       struct stream
+       class stream
        {
+       public:
                stream(tu_file* input);
                ~stream();
 
Index: gnash/server/styles.h
diff -u gnash/server/styles.h:1.5 gnash/server/styles.h:1.6
--- gnash/server/styles.h:1.5   Wed Mar 29 05:42:41 2006
+++ gnash/server/styles.h       Sun Apr 23 14:40:10 2006
@@ -32,9 +32,10 @@
        virtual void apply(int fill_side, float ratio) const = 0;
 };
 
-struct fill_style : public base_fill_style
+class fill_style : public base_fill_style
 // For the interior of outline shapes.
 {
+public:
        fill_style();
        virtual ~fill_style();
        
@@ -63,8 +64,9 @@
 };
 
 
-struct morph_fill_style : public base_fill_style
+class morph_fill_style : public base_fill_style
 {
+public:
        morph_fill_style();
        morph_fill_style(stream* in, movie_definition* m);
        virtual ~morph_fill_style();
@@ -91,9 +93,10 @@
        virtual void apply(float ratio) const = 0;
 };
 
-struct line_style : public base_line_style
+class line_style : public base_line_style
 // For the outside of outline shapes, or just bare lines.
 {
+public:
        line_style();
        void    read(stream* in, int tag_type);
        virtual void    apply(float ratio) const;
@@ -108,8 +111,9 @@
        rgba    m_color;
 };
 
-struct morph_line_style : public base_line_style
+class morph_line_style : public base_line_style
 {
+public:
        morph_line_style();
        morph_line_style(stream* in);
        




reply via email to

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