Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

image_create.h

Go to the documentation of this file.
00001 /*
00002  * image_create.h -- RGB24 image create
00003  * Copyright (C) 2002 Charles Yates <charles.yates@pandora.be>
00004  * Copyright (C) 2002-2007 Dan Dennedy <dan@dennedy.org>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program 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
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00019  */
00020 
00021 #ifndef _IMAGE_CREATE_H_
00022 #define _IMAGE_CREATE_H_
00023 
00024 // C++ Includes
00025 
00026 #include <vector>
00027 using std::vector;
00028 
00029 // C Includes
00030 
00031 #include <stdint.h>
00032 #include <gtk/gtk.h>
00033 
00044 class ImageCreate 
00045 {
00046     public:
00047         virtual ~ImageCreate() {}
00048         virtual char *GetDescription( ) const = 0;
00049         virtual void CreatePAL( bool is_pal ) { }
00050         virtual void CreateFrame( uint8_t *pixels, int width, int height, double position, double frame_delta ) = 0;
00051         virtual int GetNumberOfFrames( ) = 0;
00052         virtual bool IsUsable( ) { return true; }
00053 };
00054 
00071 class GDKImageCreate : public ImageCreate
00072 {
00073     public:
00074         virtual ~GDKImageCreate() {}
00075         virtual void AttachWidgets( GtkBin *bin ) { }
00076         virtual void DetachWidgets( GtkBin *bin ) { }
00077         virtual void InterpretWidgets( GtkBin *bin ) { }
00078 };
00079 
00093 class GDKAudioImport : public GDKImageCreate
00094 {
00095     public:
00096         virtual ~GDKAudioImport() {}
00097         virtual void CreateAudio( int16_t **buffer, short int *channels, int *frequency, int *samples ) = 0;
00098 };
00099 
00106 class GDKImageCreateAdapter : public GDKImageCreate
00107 {
00108     private:
00109         ImageCreate *creator;
00110 
00111     public:
00112         GDKImageCreateAdapter( ImageCreate *creator ) { this->creator = creator; }
00113         virtual ~GDKImageCreateAdapter( ) { delete creator; }
00114         void AttachWidgets( GtkBin *bin ) { }
00115         void DetachWidgets( GtkBin *bin ) { }
00116         void InterpretWidgets( GtkBin *bin ) { }
00117         char *GetDescription( ) const { return this->creator->GetDescription( ); }
00118         void CreateFrame( uint8_t *pixels, int width, int height, double position, double frame_delta ) 
00119         { 
00120             return this->creator->CreateFrame( pixels, width, height, position, frame_delta ); 
00121         }
00122 };
00123 
00134 class GDKImageCreateRepository
00135 {
00136     private:
00137         vector <GDKImageCreate *> creators;
00138         GDKImageCreate *selected_creator;
00139         GtkOptionMenu *menu;
00140         GtkBin *container;
00141     public:
00142         GDKImageCreateRepository();
00143         ~GDKImageCreateRepository();
00144         void Register( GDKImageCreate *creator );
00145         void Initialise( GtkOptionMenu *menu, GtkBin *container );
00146         GDKImageCreate *Get( ) const;
00147         void SelectionChange( );
00148 };
00149 
00150 #endif

Generated on Sun Mar 11 22:11:45 2007 for Kino by  doxygen 1.4.2