Gnash  0.8.10
Bitmap.h
Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
00003 //   Free Software Foundation, Inc.
00004 // 
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or
00008 // (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019 
00020 #ifndef GNASH_BITMAP_H
00021 #define GNASH_BITMAP_H
00022 
00023 #include <boost/intrusive_ptr.hpp>
00024 #include "DisplayObject.h" 
00025 #include "flash/display/BitmapData_as.h"
00026 #include "BitmapMovieDefinition.h"
00027 #include "DynamicShape.h"
00028 
00029 namespace gnash {
00030     class CachedBitmap;
00031 }
00032 
00033 
00034 namespace gnash {
00035 
00036 
00039 //
00042 //
00045 //
00049 class Bitmap : public DisplayObject
00050 {
00051 public:
00052 
00054         Bitmap(movie_root& mr, as_object* object, BitmapData_as* bd,
00055             DisplayObject* parent);
00056         
00058     Bitmap(movie_root& mr, as_object* object, const BitmapMovieDefinition* def,
00059             DisplayObject* parent);
00060 
00061     virtual ~Bitmap();
00062 
00064     virtual void update();
00065 
00066     virtual void add_invalidated_bounds(InvalidatedRanges& ranges, bool force);
00067 
00069         virtual void display(Renderer& renderer, const Transform& xform);
00070 
00072     virtual SWFRect getBounds() const;
00073 
00075     virtual bool pointInShape(boost::int32_t x, boost::int32_t y) const;
00076 
00078     virtual void construct(as_object* init = 0);
00079 
00080 protected:
00081 
00082     void markReachableObjects() const {
00083         if (_bitmapData) _bitmapData->setReachable();
00084     }
00085 
00086 private:
00087 
00089     //
00091     const CachedBitmap* bitmap() const;
00092 
00094     //
00097     void checkBitmapData();
00098 
00100     //
00103     const boost::intrusive_ptr<const BitmapMovieDefinition> _def;
00104 
00105     BitmapData_as* _bitmapData;
00106 
00108     DynamicShape _shape;
00109 
00111     size_t _width;
00112 
00114     size_t _height;
00115 
00116 };
00117 
00118 }       // end namespace gnash
00119 
00120 
00121 #endif // GNASH_DYNAMIC_SHAPE_H
00122 
00123 
00124 // Local Variables:
00125 // mode: C++
00126 // c-basic-offset: 8 
00127 // tab-width: 8
00128 // indent-tabs-mode: t
00129 // End: