• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

Bitmap.h

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

Generated on Thu Sep 30 2010 14:34:56 for Gnash by  doxygen 1.7.1