00001 /* 00002 libwftk - Worldforge Toolkit - a widget library 00003 Copyright (C) 2002 Malcolm Walker <malcolm@worldforge.org> 00004 Based on code copyright (C) 1999-2002 Karsten Laux 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either 00009 version 2.1 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public 00017 License along with this library; if not, write to the 00018 Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, SA. 00020 */ 00021 00022 00023 #ifndef _MOVIE_H 00024 #define _MOVIE_H 00025 00026 00027 #include <wftk/screenarea.h> 00028 #include <wftk/timer.h> 00029 #include <wftk/surface.h> 00030 00031 namespace wftk { 00032 00034 class Movie : public ScreenArea 00035 { 00036 //OBJECT 00037 00038 public: 00040 Movie(); 00042 virtual ~Movie(); 00043 00045 void start(); 00047 void stop(); 00049 void load(const std::vector<Surface::Resource*>&); 00051 void setDelay(unsigned int); 00052 00053 protected: 00055 virtual void draw(Surface&, const Point&, const Region&); 00057 virtual void handleResize(Uint16 w, Uint16 h); 00059 virtual void setPackingInfo(); 00060 private: 00062 void tick(); 00064 void invalidateCurrentFrame(); 00066 std::vector<Surface::Resource*> frames_; 00068 int index_; 00070 Timer myTimer_; 00071 00072 }; 00073 00074 00075 } 00076 00077 00078 #endif // !_LABEL_H 00079
This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.