importer.h

Go to the documentation of this file.
00001 /* === S Y N F I G ========================================================= */
00021 /* ========================================================================= */
00022 
00023 /* === S T A R T =========================================================== */
00024 
00025 #ifndef __SYNFIG_IMPORTER_H
00026 #define __SYNFIG_IMPORTER_H
00027 
00028 /* === H E A D E R S ======================================================= */
00029 
00030 #include <map>
00031 //#include <cmath>
00032 #include <ETL/handle>
00033 #include "string.h"
00034 //#include "surface.h"
00035 //#include "general.h"
00036 //#include "vector.h"
00037 #include "time.h"
00038 #include "gamma.h"
00039 
00040 /* === M A C R O S ========================================================= */
00041 
00043 #define SYNFIG_IMPORTER_MODULE_EXT public: static const char name__[], version__[], ext__[],cvs_id__[]; static Importer *create(const char *filename);
00044 
00046 #define SYNFIG_IMPORTER_SET_NAME(class,x) const char class::name__[]=x
00047 
00049 #define SYNFIG_IMPORTER_SET_EXT(class,x) const char class::ext__[]=x
00050 
00052 #define SYNFIG_IMPORTER_SET_VERSION(class,x) const char class::version__[]=x
00053 
00055 #define SYNFIG_IMPORTER_SET_CVS_ID(class,x) const char class::cvs_id__[]=x
00056 
00058 #define SYNFIG_IMPORTER_INIT(class) synfig::Importer* class::create(const char *filename) { return new class(filename); }
00059 
00060 /* === T Y P E D E F S ===================================================== */
00061 
00062 /* === C L A S S E S & S T R U C T S ======================================= */
00063 
00064 namespace synfig {
00065 
00066 class Surface;
00067 class ProgressCallback;
00068 
00073 class Importer : public etl::shared_object
00074 {
00075 public:
00076     typedef Importer* (*Factory)(const char *filename);
00077     typedef std::map<String,Factory> Book;
00078     static Book* book_;
00079 
00080     static Book& book();
00081 
00082     static bool subsys_init();
00083     static bool subsys_stop();
00084 
00085     typedef etl::handle<Importer> Handle;
00086     typedef etl::loose_handle<Importer> LooseHandle;
00087     typedef etl::handle<const Importer> ConstHandle;
00088 
00089 private:
00090     Gamma gamma_;
00091 
00092 protected:
00093     Importer();
00094 
00095 public:
00096 
00097     Gamma& gamma() { return gamma_; }
00098     const Gamma& gamma()const { return gamma_; }
00099 
00100     virtual ~Importer();
00101 
00103 
00110     virtual bool get_frame(Surface &surface,Time time, ProgressCallback *callback=NULL)=0;
00111 
00113     virtual bool is_animated() { return false; }
00114 
00116     static Handle open(const String &filename);
00117 };
00118 
00119 }; // END of namespace synfig
00120 
00121 /* === E N D =============================================================== */
00122 
00123 #endif

Generated on Wed Aug 15 05:00:23 2007 for synfig by  doxygen 1.5.3