~ubuntu-branches/ubuntu/karmic/gnash/karmic

« back to all changes in this revision

Viewing changes to server/parser/shape_character_def.h

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2008-10-13 14:29:49 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20081013142949-f6qdvnu4mn05ltdc
Tags: 0.8.4~~bzr9980-0ubuntu1
* new upstream release 0.8.4 (LP: #240325)
* ship new lib usr/lib/gnash/libmozsdk.so.* in mozilla-plugin-gnash
  - update debian/mozilla-plugin-gnash.install
* ship new lib usr/lib/gnash/libgnashnet.so.* in gnash-common
  - update debian/gnash-common.install
* add basic debian/build_head script to build latest CVS head packages.
  - add debian/build_head
* new sound architecture requires build depend on libsdl1.2-dev
  - update debian/control
* head build script now has been completely migrated to bzr (upstream +
  ubuntu)
  - update debian/build_head
* disable kde gui until klash/qt4 has been fixed; keep kde packages as empty
  packages for now.
  - update debian/rules
  - debian/klash.install
  - debian/klash.links
  - debian/klash.manpages
  - debian/konqueror-plugin-gnash.install
* drop libkonq5-dev build dependency accordingly
  - update debian/control
* don't install headers manually anymore. gnash doesnt provide a -dev
  package after all
  - update debian/rules
* update libs installed in gnash-common; libgnashserver-*.so is not available
  anymore (removed); in turn we add the new libgnashcore-*.so
  - update debian/gnash-common.install
* use -Os for optimization and properly pass CXXFLAGS=$(CFLAGS) to configure
  - update debian/rules
* touch firefox .autoreg in postinst of mozilla plugin
  - update debian/mozilla-plugin-gnash.postinst
* link gnash in ubufox plugins directory for the plugin alternative switcher
  - add debian/mozilla-plugin-gnash.links
* suggest ubufox accordingly
  - update debian/control
* add new required build-depends on libgif-dev
  - update debian/control
* add Xb-Npp-Description and Xb-Npp-File as new plugin database meta data
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// shape.h      -- Thatcher Ulrich <tu@tulrich.com> 2003
2
 
 
3
 
// This source code has been donated to the Public Domain.  Do
4
 
// whatever you want with it.
5
 
 
6
 
// Quadratic bezier outline shapes, the basis for most SWF rendering.
7
 
 
8
 
/* $Id: shape_character_def.h,v 1.20 2007/12/01 15:40:59 strk Exp $ */
9
 
 
10
 
#ifndef GNASH_SHAPE_CHARACTER_DEF_H
11
 
#define GNASH_SHAPE_CHARACTER_DEF_H
12
 
 
13
 
 
14
 
#include "character_def.h" // for inheritance of shape_character_def
15
 
#include "shape.h" // for path
16
 
#include "rect.h" // for composition
17
 
 
18
 
#include <vector> // for composition
19
 
 
20
 
 
21
 
namespace gnash {
22
 
        class cxform;
23
 
        class matrix;
24
 
}
25
 
 
26
 
namespace gnash {
27
 
 
28
 
        /// \brief
29
 
        /// Represents the outline of one or more shapes, along with
30
 
        /// information on fill and line styles.
31
 
        //
32
 
        class shape_character_def : public character_def
33
 
        {
34
 
        public:
35
 
 
36
 
                typedef std::vector<fill_style> FillStyleVect;
37
 
                typedef std::vector<line_style> LineStyleVect;
38
 
                typedef std::vector<path> PathVect;
39
 
 
40
 
                shape_character_def();
41
 
                virtual ~shape_character_def();
42
 
 
43
 
                virtual void    display(character* inst);
44
 
                virtual bool point_test_local(float x, float y);
45
 
 
46
 
                float   get_height_local() const;
47
 
                float   get_width_local() const;
48
 
 
49
 
                /// \brief
50
 
                /// Read a shape definition as included in DEFINEFONT*,
51
 
                /// DEFINESHAPE* or DEFINEMORPH* tag
52
 
                //
53
 
                /// @param in
54
 
                ///     The stream to read the shape from
55
 
                ///
56
 
                /// @param tag_type
57
 
                ///     The SWF::tag_type this shape definition is read for.
58
 
                ///     TODO: change to an actual SWF::tag_type type
59
 
                ///
60
 
                /// @param with_style
61
 
                ///     If true, this definition includes bounds, fill styles and line styles.
62
 
                ///     Tipically, this is only false for DEFINEFONT* tags.
63
 
                ///     NOTE: if with_style is false, bounds of the shape will be computed
64
 
                ///           rather then read.
65
 
                ///     TODO: drop this function, set based on tag_type ?
66
 
                ///
67
 
                /// @param m
68
 
                ///     The movie definition corresponding to the SWF we/re parsing.
69
 
                ///     This is used to resolve bitmap characters for fill styles, never
70
 
                ///     used if with_style is false.
71
 
                ///
72
 
                void    read(stream* in, int tag_type, bool with_style, movie_definition* m);
73
 
 
74
 
                void    display(
75
 
                        const matrix& mat,
76
 
                        const cxform& cx,
77
 
                        float pixel_scale,
78
 
                        const std::vector<fill_style>& fill_styles,
79
 
                        const std::vector<line_style>& line_styles) const;
80
 
 
81
 
                /// Get cached bounds of this shape.
82
 
                const rect&     get_bound() const { return m_bound; }
83
 
 
84
 
                /// Compute bounds by looking at the component paths
85
 
                void    compute_bound(rect* r) const;
86
 
 
87
 
                const FillStyleVect& get_fill_styles() const { return m_fill_styles; }
88
 
                const LineStyleVect& get_line_styles() const { return m_line_styles; }
89
 
 
90
 
                const std::vector<path>& get_paths() const { return m_paths; }
91
 
 
92
 
                // morph uses this
93
 
                void    set_bound(const rect& r) { m_bound = r; /* should do some verifying */ }
94
 
 
95
 
                size_t numEdges() const;
96
 
 
97
 
                size_t numPaths() const;
98
 
 
99
 
        protected:
100
 
                friend class morph2_character_def;
101
 
 
102
 
#ifdef GNASH_USE_GC
103
 
                /// Mark reachable resources (for the GC)
104
 
                //
105
 
                /// Reachable resources are:
106
 
                ///     - Associated fill styles (m_fill_styles).
107
 
                ///       These are not actual resources, but may contain some.
108
 
                ///
109
 
                virtual void markReachableResources() const;
110
 
#endif // GNASH_USE_GC
111
 
 
112
 
                // derived morph classes changes these
113
 
                FillStyleVect m_fill_styles;
114
 
                LineStyleVect m_line_styles;
115
 
                PathVect m_paths;
116
 
                rect    m_bound;
117
 
 
118
 
                /// Free all meshes (deprecated)
119
 
                //void clear_meshes();
120
 
 
121
 
                /// Copy a shape character definition
122
 
                shape_character_def(const shape_character_def& o);
123
 
 
124
 
        private:
125
 
 
126
 
                /// Shape record flags
127
 
                enum ShapeRecordFlags {
128
 
                        flagEnd = 0x00,
129
 
                        flagMove = 0x01,
130
 
                        flagFillStyle0Change = 0x02,
131
 
                        flagFillStyle1Change = 0x04,
132
 
                        flagLineStyleChange = 0x08,
133
 
                        flagHasNewStyles = 0x10
134
 
                };
135
 
 
136
 
                void    sort_and_clean_meshes() const;
137
 
                
138
 
                // Don't assign to a shape character definition
139
 
                shape_character_def& operator= (const shape_character_def&)
140
 
                {
141
 
                        abort();
142
 
                        return *this;
143
 
                }
144
 
 
145
 
        };
146
 
 
147
 
}       // end namespace gnash
148
 
 
149
 
 
150
 
#endif // GNASH_SHAPE_CHARACTER_DEF_H
151
 
 
152
 
 
153
 
// Local Variables:
154
 
// mode: C++
155
 
// c-basic-offset: 8 
156
 
// tab-width: 8
157
 
// indent-tabs-mode: t
158
 
// End: