Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SDLSUP_H
00021 #define SDLSUP_H
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include "gnashconfig.h"
00025 #endif
00026
00027 #include "gui.h"
00028
00029 #include "SDL.h"
00030 #include "SDL_thread.h"
00031
00032 #ifdef RENDERER_AGG
00033 # include "sdl_agg_glue.h"
00034 #elif defined(RENDERER_CAIRO)
00035 # include "sdl_cairo_glue.h"
00036 #elif defined(RENDERER_OPENGL)
00037 # include "sdl_ogl_glue.h"
00038 #endif
00039
00040
00041 #ifdef RENDERER_CAIRO
00042 # include <cairo.h>
00043 #endif
00044
00045 namespace gnash
00046 {
00047
00048 class SDLGui : public Gui
00049 {
00050 public:
00051 SDLGui(unsigned long xid, float scale, bool loop, RunResources& r);
00052 virtual ~SDLGui();
00053 virtual bool init(int argc, char **argv[]);
00054 virtual bool createWindow(const char *title, int width, int height,
00055 int xPosition = 0, int yPosition = 0);
00056 virtual bool run();
00057 virtual bool createMenu();
00058 virtual bool setupEvents();
00059 virtual void renderBuffer();
00060 virtual void setInterval(unsigned int interval);
00061 virtual void disableCoreTrap();
00062 virtual void setTimeout(unsigned int timeout);
00063
00064 void key_event(SDL_KeyboardEvent * key, bool down);
00065
00066
00067 void setInvalidatedRegions(const InvalidatedRanges& ranges);
00068
00069 private:
00070 unsigned int _timeout;
00071 bool _core_trap;
00072
00074 void resize_event();
00075
00077 void expose_event();
00078
00079 static key::code sdl_to_gnash_key(SDL_KeyboardEvent* key);
00080 static int sdl_to_gnash_modifier(int state);
00081
00082 #ifdef RENDERER_AGG
00083 SdlAggGlue _glue;
00084 #elif defined(RENDERER_CAIRO)
00085 SdlCairoGlue _glue;
00086 #elif defined(RENDERER_OPENGL)
00087 SdlOglGlue _glue;
00088 #endif
00089
00090 };
00091
00092
00093
00094
00095
00096 }
00097
00098
00099 #endif