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

« back to all changes in this revision

Viewing changes to server/parser/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
 
// 
2
 
//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
3
 
// 
4
 
// This program is free software; you can redistribute it and/or modify
5
 
// it under the terms of the GNU General Public License as published by
6
 
// the Free Software Foundation; either version 3 of the License, or
7
 
// (at your option) any later version.
8
 
// 
9
 
// This program is distributed in the hope that it will be useful,
10
 
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
// GNU General Public License for more details.
13
 
// 
14
 
// You should have received a copy of the GNU General Public License
15
 
// along with this program; if not, write to the Free Software
16
 
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
 
 
18
 
#ifndef GNASH_CHARACTER_DEF_H
19
 
#define GNASH_CHARACTER_DEF_H
20
 
 
21
 
#ifdef HAVE_CONFIG_H
22
 
#include "gnashconfig.h"
23
 
#endif
24
 
 
25
 
#include "resource.h" // for inheritance from resource class
26
 
 
27
 
// Forward declarations
28
 
class tu_file;
29
 
 
30
 
namespace gnash {
31
 
        class character;
32
 
        class cache_options;
33
 
        class rect;
34
 
}
35
 
 
36
 
namespace gnash {
37
 
 
38
 
 
39
 
class render_cache_manager; 
40
 
 
41
 
 
42
 
/// Immutable data representing the template of a movie element.
43
 
//
44
 
/// This is not really a public interface.  It's here so it
45
 
/// can be mixed into movie_definition and sprite_definition,
46
 
/// without using multiple inheritance.
47
 
///
48
 
class character_def : public resource
49
 
{
50
 
private:
51
 
        int     m_id;
52
 
                
53
 
        // don't assign-to
54
 
        character_def& operator= (const character_def&) { abort(); return *this; }
55
 
public:
56
 
        character_def()
57
 
                :
58
 
                m_id(-1),
59
 
                m_render_cache(NULL)
60
 
                {
61
 
                }
62
 
 
63
 
        
64
 
        virtual ~character_def();
65
 
        
66
 
        virtual void display(character* /*instance_info*/)
67
 
        {
68
 
        }
69
 
 
70
 
        /// Return true if the specified point is on the interior of our shape.
71
 
        //
72
 
        /// Point coordinates are local coords (TWIPS)
73
 
        ///
74
 
        virtual bool point_test_local(float /*x*/, float /*y*/)
75
 
        {
76
 
                return false;
77
 
        }
78
 
 
79
 
        virtual float get_height_local() const
80
 
        {
81
 
                return 0.0f;
82
 
        }
83
 
 
84
 
        virtual float get_width_local() const
85
 
        {
86
 
                return 0.0f;
87
 
        }
88
 
 
89
 
        /// Should stick the result in a boost::intrusive_ptr immediately.
90
 
        //
91
 
        /// default is to make a generic_character
92
 
        ///
93
 
        virtual character* create_character_instance(character* parent,
94
 
                        int id);
95
 
        
96
 
        // From resource interface.
97
 
        virtual character_def*  cast_to_character_def()
98
 
        {
99
 
                return this;
100
 
        }
101
 
        
102
 
        // Declared as virtual here because generic_character needs access to it
103
 
        virtual const rect&     get_bound() const = 0;
104
 
        
105
 
public:  
106
 
  
107
 
  /// Cache holder for renderer (contents depend on renderer handler)
108
 
  /// Will be deleted by destructor of the character_def.
109
 
  /// We could store by auto_ptr, but I'm afraid that would mean
110
 
  /// including render_handler.h in this header, which I don't like.
111
 
  /// (REF: PIMPL)
112
 
  ///
113
 
  render_cache_manager* m_render_cache;
114
 
 
115
 
protected:
116
 
 
117
 
        /// Copy a character definition
118
 
        //
119
 
        /// The copy will have a NULL render cache object.
120
 
        /// The only known use of copy constructor is from
121
 
        /// duplicateMovieClip, in particular during copy
122
 
        /// of the drawable object, which is a subclass
123
 
        /// of a shape_character_def
124
 
        ///
125
 
        /// The choice of NOT copying the cache manager
126
 
        /// is a choice of simplicity. We can't copy the
127
 
        /// pointer as the character_def destructor will
128
 
        /// destroy it, and we don't want to destroy it twice.
129
 
        /// We don't want to make a copy of the whole cache
130
 
        /// as it might be a waste of resource, we don't want
131
 
        /// to share ownership as some character_def ended up
132
 
        /// NOT being immutable any more !! :(
133
 
        ///
134
 
        /// By setting the cache to NULL we'll leave reconstruction
135
 
        /// of a cache to the renderers.
136
 
        ///
137
 
        /// TODO: improve by implementing copy on write for the cache ?
138
 
        ///
139
 
        character_def(const character_def& o)
140
 
                :
141
 
                resource(), // this is a new resource, nothing to copy
142
 
                m_id(o.m_id),
143
 
                m_render_cache(NULL)
144
 
        {}
145
 
 
146
 
        
147
 
};
148
 
 
149
 
 
150
 
}       // namespace gnash
151
 
 
152
 
#endif // GNASH_CHARACTER_DEF_H
153
 
 
154
 
 
155
 
// Local Variables:
156
 
// mode: C++
157
 
// indent-tabs-mode: t
158
 
// End: