gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ./ChangeLog gui/Makefile.am gui/README gu...


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash ./ChangeLog gui/Makefile.am gui/README gu...
Date: Sun, 07 May 2006 15:33:08 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         
Changes by:     Bastiaan Jacques <address@hidden>       06/05/07 15:33:08

Modified files:
        .              : ChangeLog 
        gui            : Makefile.am README gnash.cpp gtk.cpp gtksup.h 
                         gui.cpp gui.h 
Added files:
        gui            : sdl.cpp sdlsup.h 

Log message:
        * gui/sdl.cpp, gui/sdlsup.h: implement an SDL frontend. Implemented
        backends are Cairo and OpenGL.
        * gui/gtk.cpp, gui/gtksup.h: shuffle some code around, integrate
        better with Gui class. Make event handlers work.
        * gui/Makefile.am: Enable the SDL frontend.
        * gui/gnash.cpp: Implement the remaining features from the old
        gnash.cpp; make the commandline options work.
        * gui/gui.cpp, gui/gui.h: Add some needed variables and methods. Do
        some cleanup.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/ChangeLog.diff?tr1=1.267&tr2=1.268&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/gui/Makefile.am.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/gui/README.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/gui/gnash.cpp.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/gui/gtk.cpp.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/gui/gtksup.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/gui/gui.cpp.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/gui/gui.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/gui/sdl.cpp?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/gui/sdlsup.h?rev=1.1

Patches:
Index: gnash/ChangeLog
diff -u gnash/ChangeLog:1.267 gnash/ChangeLog:1.268
--- gnash/ChangeLog:1.267       Sun May  7 12:19:06 2006
+++ gnash/ChangeLog     Sun May  7 15:33:08 2006
@@ -1,3 +1,15 @@
+2006-05-07 Bastiaan Jacques <address@hidden>
+
+       * gui/sdl.cpp, gui/sdlsup.h: implement an SDL frontend. Implemented
+       backends are Cairo and OpenGL.
+       * gui/gtk.cpp, gui/gtksup.h: shuffle some code around, integrate
+       better with Gui class. Make event handlers work.
+       * gui/Makefile.am: Enable the SDL frontend.
+       * gui/gnash.cpp: Implement the remaining features from the old
+       gnash.cpp; make the commandline options work.
+       * gui/gui.cpp, gui/gui.h: Add some needed variables and methods. Do
+       some cleanup.
+
 2006-05-07 Sandro Santilli <address@hidden>
 
        * renamed Movie.{h,cpp} to MovieClip.{h,cpp}
Index: gnash/gui/Makefile.am
diff -u gnash/gui/Makefile.am:1.1 gnash/gui/Makefile.am:1.2
--- gnash/gui/Makefile.am:1.1   Thu May  4 00:18:37 2006
+++ gnash/gui/Makefile.am       Sun May  7 15:33:08 2006
@@ -119,11 +119,11 @@
 GTK_SRCS = 
 endif
 
-#if HAS_SDL
-#SDL_SRCS = sdl.cpp sdlsup.h # glow for SDL widgets
-#else
-#SDL_SRCS = 
-#endif
+if HAS_SDL
+SDL_SRCS = sdl.cpp sdlsup.h # glow for SDL widgets
+else
+SDL_SRCS =
+endif
 
 #if HAS_FLTK
 #FLTK_SRCS = fltk.cpp fltksup.h
@@ -153,10 +153,10 @@
 
 
 
-#noinst_PROGRAMS = # guitest # klash flak
+#noinst_PROGRAMS = guitest # klash flak
 #guitest_SOURCES = guitest.cpp #fltk.cpp #fltksup.h fltksupp.h gnash.cpp 
gtk.cpp 
 #      gtksup.h gui.cpp gui.h menu.cpp menu.h sdl.cpp sdlsup.h sdlsupp.h
-#guitest_LDADD = $(gnashnew_LDADD)
+#guitest_LDADD = $(gnash_LDADD)
 
 
 # Rebuild with GCC 4.x Mudflap support
Index: gnash/gui/README
diff -u gnash/gui/README:1.1 gnash/gui/README:1.2
--- gnash/gui/README:1.1        Thu May  4 00:18:37 2006
+++ gnash/gui/README    Sun May  7 15:33:08 2006
@@ -1,3 +1,5 @@
+OVERVIEW
+
 This is a simple GUI layer to support using the menu and event
 handling systems of various toolkits. Initially Gnash used SDL, but
 this has slow event handling, and no GUI widgets to create something
@@ -19,9 +21,27 @@
 used. This will enable Gnash to have a GUI on platforms with no
 windowing system.
 
-At this time there is still a dependancy on OpenGL for graphics
-rendering. It should be possible to use OpenGLES (the embedded
-version), but plans are to ultimately write a cairo backend, which
-should give Gnash better 2D performance. Cairo runs on either OpenGL
-or a framebuffer device.
+At this time, OpenGL and (experimental) Cairo backends are available.
+It should be possible to use OpenGLES (the embedded version), but you
+may be able to run Cairo on a framebuffer device.
+
+STATUS
+
+GTK2:
+- implemented both OpenGL and Cairo backends.
+- Events work (mouse and some keyboard ones).
+- Pop-up menu is available.
+- Firefox plugin works!
+
+SDL:
+- OpenGL and Cairo.
+- Mouse events work (keyboard events don't).
+- There's no pop-up menu (and there probably never will be one).
+- Firefox plugin doesn't work, and I don't know why. The call to
+  SDL_SetVideoMode makes X throw an error.
+
+QT:
+- Unimplemented. (Klash plugin may still work.)
 
+FLTK:
+- Doesn't work just yet.
Index: gnash/gui/gnash.cpp
diff -u gnash/gui/gnash.cpp:1.1 gnash/gui/gnash.cpp:1.2
--- gnash/gui/gnash.cpp:1.1     Thu May  4 00:42:50 2006
+++ gnash/gui/gnash.cpp Sun May  7 15:33:08 2006
@@ -41,8 +41,7 @@
 #endif
 
 #ifdef HAVE_SDL_H
-#include "SDL.h"
-#include "SDL_thread.h"
+#include "sdlsup.h"
 #endif
 
 #include <unistd.h>
@@ -62,20 +61,14 @@
 #include "tu_file.h"
 #include "tu_types.h"
 #include "Movie.h"
+#include <sys/time.h>
 
 using namespace std;
 using namespace gnash;
 
 static void usage ();
 static void version_and_copyright();
-
-static float   s_scale = 1.0f;
-static int     s_bit_depth = 16;
-static bool    s_background = true;
-static bool    s_measure_performance = false;
-static bool    s_event_thread = false;
-
-static long int windowid = 0, width, height;
+static bool advance_movie(void* data);
 
 static tu_file*
 file_opener(const char* url)
@@ -107,21 +100,28 @@
 {
     int c;
     int render_arg;
-    std::vector<const char*> infiles;
+    char* infile = NULL;
     string url;
 
-    GtkGui gui;
-    gui.init(argc, &argv);
     
     assert(tu_types_validate());
-    
+
+    unsigned long windowid = 0;
     float      exit_timeout = 0;
     bool do_render = true;
     bool do_sound = false;
-    bool do_loop = true;
     bool sdl_abort = true;
-    int  delay = 31;
+    unsigned int  delay = 0;
     float      tex_lod_bias;
+    float      scale = 1.0f;
+    bool background = true;
+    long int width = 0, height = 0;
+    bool     do_loop = true;
+#if defined(RENDERER_CAIRO)
+    unsigned int bit_depth = 32;
+#else
+    unsigned int bit_depth = 16;
+#endif
     
     // -1.0 tends to look good.
     tex_lod_bias = -1.2f;
@@ -161,11 +161,13 @@
          case 'p':
              gnash::set_verbose_parse(true);
              break;
+#if 0
           case 'f':
               s_measure_performance = true;
               break;
+#endif
           case 's':
-              s_scale = fclamp((float) atof(optarg), 0.01f, 100.f);
+              scale = fclamp((float) atof(optarg), 0.01f, 100.f);
               break;
           case 'c':
               sdl_abort = false;
@@ -175,7 +177,7 @@
               break;
           case 'u':
               url = optarg;
-              dbglogfile << "Setting root URL to: " << width << endl;
+              dbglogfile << "Setting root URL to: " << url << endl;
               break;
           case 'j':
               width = strtol(optarg, NULL, 0);
@@ -185,9 +187,11 @@
               height = strtol(optarg, NULL, 0);
               dbglogfile << "Setting height to: " << height << endl;
               break;
+#if 0
           case 'e':
               s_event_thread = true;
               break;
+#endif
           case 'x':
               windowid = strtol(optarg, NULL, 0);
               break;
@@ -217,8 +221,7 @@
                     break;
                 default:
                     cerr << "-r must be followed by 0, 1 or 2 (" << 
-                        render_arg << " is invalid" << endl;
-                    
+                        render_arg << ") is invalid" << endl;
                     break;
               };
               break;
@@ -226,20 +229,22 @@
               exit_timeout = (float) atof(optarg);
               break;
           case 'b':
-              s_bit_depth = atoi(optarg);
+              bit_depth = atoi(optarg);
+              assert (!bit_depth || bit_depth == 16 || bit_depth == 32);
               break;
        }
     }
-    
+
     // get the file name from the command line
     while (optind < argc) {
-        // Some options set variables, like ip=127.0.0.1
-        if (strchr(argv[optind], '=')) {
-            dbglogfile << "Got variable option on command line!" << endl;
-        } else {
-            infiles.push_back(argv[optind]);
-        }
-       optind++;
+      // Some options set variables, like ip=127.0.0.1
+      if (strchr(argv[optind], '=')) {
+         dbglogfile << "Got variable option on command line!" << endl;
+      } else {
+         infile = argv[optind];
+         break;
+      }
+      optind++;
     }
 
     // Remove the logfile that's created by default, since leaving a short
@@ -248,25 +253,24 @@
         dbglogfile.removeLog();
     }
 
-    // No file names were supplied
-    if (infiles.size() == 0) {
-       printf("no input files\n");
+    // No file name was supplied
+    if (!infile) {
+       std::cerr << "Error: no input file was specified." << endl << endl;
        usage();
-       exit(1);
+       return EXIT_FAILURE;
     }
 
     gnash::register_file_opener_callback(file_opener);
     gnash::register_fscommand_callback(fs_callback);
 
     std::auto_ptr<gnash::sound_handler>  sound;
-    if (do_render) {
-        if (do_sound) {
+
+    if (do_sound) {
 #ifdef HAVE_SDL_MIXER_H
-            std::auto_ptr<gnash::sound_handler> 
tmp(gnash::create_sound_handler_sdl());
-            sound = tmp;
-            gnash::set_sound_handler(sound.get());
+      sound = std::auto_ptr<gnash::sound_handler>
+        (gnash::create_sound_handler_sdl());
+      gnash::set_sound_handler(sound.get());
 #endif
-        }
     }
 
     // Get info about the width & height of the movie.
@@ -274,145 +278,93 @@
     int        movie_width = 0;
     int        movie_height = 0;
     float      movie_fps = 30.0f;
-    gnash::get_movie_info(infiles[0], &movie_version, &movie_width,
+    gnash::get_movie_info(infile, &movie_version, &movie_width,
                           &movie_height, &movie_fps, NULL, NULL);
     if (movie_version == 0) {
-        fprintf(stderr, "error: can't get info about %s\n", infiles[0]);
-        exit(1);
+      std::cerr << "Error: can't get info about " << infile << "." << endl;
+      return EXIT_FAILURE;
     }
 
     if (!width) {
-        width = int(movie_width * s_scale);
+      width = int(movie_width * scale);
     }
     if (!height) {
-        height = int(movie_height * s_scale);
+      height = int(movie_height * scale);
     }
 
-    if (do_render) {
-      if (windowid) {
-        gui.createWindow(width, height, windowid);
-      } else {
-        gui.createWindow(width, height);
-      }
+#define GUI_CLASS GtkGui
+#define GUI_GTK 1
 
-#ifdef FIX_I810_LOD_BIAS       
-        // Change the LOD BIAS values to tweak blurriness.
-        if (tex_lod_bias != 0.0f) {
-          gui.fixLodBias();
-        }
-#endif // FIX_I810_LOD_BIAS
+
+    GUI_CLASS gui(windowid, scale, do_loop, bit_depth);
+#ifdef GUI_SDL
+    if (!sdl_abort) {
+      gui.disableCoreTrap();
     }
+#endif
+
+#if defined(RENDERER_OPENGL) && defined(FIX_I810_LOD_BIAS)
+    gui->setLodBias(tex_lod_bias);
+#endif
+
+    gui.init(argc, &argv);
+
+    gui.createWindow(width, height);
 
     // Load the actual movie.
-    smart_ptr<gnash::movie_definition> md = 
gnash::create_library_movie(infiles[0]);
-    if (!md.get_ptr()) {
-        fprintf(stderr, "error: can't create a movie from '%s'\n", infiles[0]);
-        exit(1);
-    }
+    smart_ptr<gnash::movie_definition> md = 
gnash::create_library_movie(infile);
+    if (!md.get_ptr())
+      return EXIT_FAILURE;
+
     smart_ptr<gnash::movie_interface>  m = 
create_library_movie_inst(md.get_ptr());
-    if (!m.get_ptr()) {
-        fprintf(stderr, "error: can't create movie instance\n");
-        exit(1);
-    }
+    assert(m.get_ptr());
+
     gnash::set_current_root(m.get_ptr());
 
-    float      speed_scale = 1.0f;
-    Uint32     start_ticks = 0;
-    if (do_render) {
-        start_ticks = SDL_GetTicks();
-    }
-    Uint32     last_ticks = start_ticks;
-    int        frame_counter = 0;
-    int        last_logged_fps = last_ticks;
-
-    gui.setupEvents();
-
-    // This is the main event loop.
-    for (;;) {
-        Uint32 ticks;
-        if (do_render) {
-            ticks = SDL_GetTicks();
-        } else {
-            // Simulate time.
-            ticks = last_ticks + (Uint32) (1000.0f / movie_fps);
-        }
-        int    delta_ticks = ticks - last_ticks;
-        float  delta_t = delta_ticks / 1000.f;
-        last_ticks = ticks;
-
-        // Check auto timeout counter.
-        if (exit_timeout > 0
-            && ticks - start_ticks > (Uint32) (exit_timeout * 1000)) {
-            // Auto exit now.
-            break;
-        }
+    m->set_display_viewport(0, 0, width, height);
+    m->set_background_alpha(background ? 1.0f : 0.05f);
 
-        if (do_render) {
-            gui.poll(m.get_ptr(), md.get_ptr());
-        }
+    if (!delay) {
+      delay = (unsigned int) (1000 / movie_fps) ; // milliseconds per frame
+    }
+    gui.setCallback(advance_movie, delay);
 
-#if 0
-        printf("%s(%d): Frame count is %d\n", __PRETTY_FUNCTION__, __LINE__,
-               md->get_frame_count());
-#endif
-        m = gnash::get_current_root();
-        gnash::delete_unused_root();
+    if (exit_timeout) {
+      gui.setTimeout((unsigned int)(exit_timeout * 1000));
+    }
 
-        m->set_display_viewport(0, 0, width, height);
-        m->set_background_alpha(s_background ? 1.0f : 0.05f);
+    gui.run();
 
-        m->notify_mouse_state(gui.getMouseX(), gui.getMouseY(), 
gui.getMouseButtons());
+    // Clean up as much as possible, so valgrind will help find actual leaks.
+    gnash::clear();
 
-        m->advance(delta_t *speed_scale);
+    return EXIT_SUCCESS;
+}
 
-        if (do_render) {
-#ifdef RENDERER_OPENGL
-// XXX we really want to do this in the opengl renderer handler itself
-       gui.swapBuffers();
-#endif
-        }
-        m->display();
-        frame_counter++;
+static bool
+advance_movie(void* data)
+{
+      Gui *gui = static_cast<Gui*> (data);
+      gnash::movie_interface* m = gnash::get_current_root();
 
-        
-        if (do_render) {
+      m->notify_mouse_state(gui->getMouseX(), gui->getMouseY(), 
gui->getMouseButtons());
 
-            if (!s_measure_performance) {
-                // Don't hog the CPU.
-                //                             if (!nodelay)
-//                 if (!gofast) {
-                    SDL_Delay(delay);
-//                 }
-            } else {
-                // Log the frame rate every second or so.
-                if (last_ticks - last_logged_fps > 1000) {
-                    float      delta = (last_ticks - last_logged_fps) / 1000.f;
-                    
-                    if (delta > 0) {
-                        printf("fps = %3.1f\n", frame_counter / delta);
-                    } else {
-                        printf("fps = *inf*\n");
-                    }
-                    
-                    last_logged_fps = last_ticks;
-                    frame_counter = 0;
-                }
-            }
-        }
+      m->advance(1.0);
+      m->display();
 
-        // See if we should exit.
-        if (do_loop == false
-            && m->get_current_frame() + 1 == md->get_frame_count()) {
-          // We're reached the end of the movie; exit.
-          break;
+      gui->renderBuffer();
+
+      if (!gui->loops()) {
+        if (m->get_current_frame() + 1 ==
+            m->get_root_movie()->get_movie_definition()->get_frame_count()) {
+          exit(0); // TODO: quit in a more gentile fashion.
         }
-    }
-    // Clean up as much as possible, so valgrind will help find actual leaks.
-    gnash::clear();
+      }
 
-    return 0;
+      return true;
 }
 
+
 void
 version_and_copyright()
 {
@@ -441,15 +393,15 @@
         "  -v          Be verbose; i.e. print log messages to stdout\n"
         "  -va         Be verbose about movie Actions\n"
         "  -vp         Be verbose about parsing the movie\n"
-        "  -m <bias>   Specify the texture LOD bias (float, default is -1)\n"
-        "  -f          Run full speed (no sleep) and log frame rate\n"
+        "  -m <bias>   Specify the texture LOD bias (float, default is -1.0)\n"
+//         "  -f          Run full speed (no sleep) and log frame rate\n"
 //         "  -e          Use SDL Event thread\n"
         "  -x <ID>     X11 Window ID for display\n"
         "  -w          Produce the disk based debug log\n"
         "  -1          Play once; exit when/if movie reaches the last frame\n"
         "  -r <0|1|2>  0 disables rendering & sound (good for batch tests)\n"
-        "              1 enables rendering & sound (default setting)\n"
-        "              2 enables rendering & disables sound\n"
+        "              1 enables rendering & sound\n"
+        "              2 enables rendering & disables sound (default)\n"
         "  -t <sec>    Timeout and exit after the specified number of 
seconds\n"
         "  -b <bits>   Bit depth of output window (16 or 32, default is 16)\n"
         "  --version   Print gnash's version number and exit\n"
Index: gnash/gui/gtk.cpp
diff -u gnash/gui/gtk.cpp:1.1 gnash/gui/gtk.cpp:1.2
--- gnash/gui/gtk.cpp:1.1       Thu May  4 00:18:37 2006
+++ gnash/gui/gtk.cpp   Sun May  7 15:33:08 2006
@@ -61,7 +61,7 @@
 #include "gui.h"
 #include "gtksup.h"
 
-#define OVERSIZE       1.0f
+
 
 using namespace std;
 
@@ -70,265 +70,154 @@
 
 GtkGui::~GtkGui()
 {
+#ifdef RENDERER_CAIRO
+    cairo_destroy(_cairo_handle);
+#endif
 }
 
-bool
-GtkGui::init(int xid, int argc, char **argv[])
+GtkGui::GtkGui(unsigned long xid, float scale, bool loop, unsigned int depth)
+ : Gui(xid, scale, loop, depth)
 {
-  _xembed = true;
-  _xid = xid;
-  return init(argc, argv);
+
 }
 
+
 bool
 GtkGui::init(int argc, char **argv[])
 {
     GNASH_REPORT_FUNCTION;
-#ifdef RENDERER_OPENGL
-    GdkGLConfigMode glcmode;
-#endif
-    gint major, minor;
-    
+
+
     gtk_init (&argc, argv);
 #ifdef RENDERER_OPENGL
     gtk_gl_init (&argc, argv);
+
+    gint major, minor;
     gdk_gl_query_version (&major, &minor);
     dbglogfile << "OpenGL extension version - "
                << (int)major << "." << (int)minor << endl;
-    glcmode = (GdkGLConfigMode)(GDK_GL_MODE_RGB
-                                | GDK_GL_MODE_DEPTH
-                                | GDK_GL_MODE_DOUBLE);
+
+    GdkGLConfigMode glcmode = (GdkGLConfigMode)(GDK_GL_MODE_RGB |
+                                                GDK_GL_MODE_DEPTH |
+                                                GDK_GL_MODE_DOUBLE);
     _glconfig = gdk_gl_config_new_by_mode (glcmode);
 
-    if (_glconfig == NULL) {
-        dbglogfile << "Cannot find the double-buffered visual." << endl;
-        dbglogfile << "Trying single-buffered visual." << endl;
-        
-        // Try single-buffered visual
-        glcmode = (GdkGLConfigMode)(GDK_GL_MODE_RGB | GDK_GL_MODE_DEPTH);
-        _glconfig = gdk_gl_config_new_by_mode (glcmode);
-        if (_glconfig == NULL) {
-            dbglogfile << "No appropriate OpenGL-capable visual found." << 
endl;
-            exit (1);
-        } else {
-            dbglogfile << "Got single-buffered visual." << endl;
-        }
+    if (!_glconfig) {
+      dbglogfile << "Cannot find the double-buffered visual." << endl;
+      dbglogfile << "Trying single-buffered visual." << endl;
+
+      glcmode = (GdkGLConfigMode)(GDK_GL_MODE_RGB | GDK_GL_MODE_DEPTH);
+      _glconfig = gdk_gl_config_new_by_mode (glcmode);
+      if (!_glconfig) {
+        dbglogfile << "No appropriate OpenGL-capable visual found." << endl;
+        gtk_main_quit();
+      } else {
+        dbglogfile << "Got single-buffered visual." << endl;
+      }
     } else {
-        dbglogfile << "Got double-buffered visual." << endl;
+      dbglogfile << "Got double-buffered visual." << endl;
     }
-#endif    
-//    examine_gl_config_attrib (_glconfig);
-  return true;
+#endif
+    return true;
 }
 
-void
-GtkGui::startGL()
+bool
+GtkGui::createWindow(int width, int height)
 {
     GNASH_REPORT_FUNCTION;
-#ifdef RENDERER_OPENGL   
-    GdkGLContext *glcontext = gtk_widget_get_gl_context (_drawing_area);
-    GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (_drawing_area);
-    if (!gdk_gl_drawable_gl_begin (gldrawable, glcontext)) {
-        dbglogfile << "ERROR: Couldn't start drawable!" << endl;
+
+    if (_xid) {
+      _window = gtk_plug_new(_xid);
+      dbglogfile << "Created XEmbedded window" << endl;
+    } else {
+      _window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+      dbglogfile << "Created top level window" << endl;
+    }
+
+    // XXXbjacques: why do we need this?
+    gtk_container_set_reallocate_redraws(GTK_CONTAINER (_window), TRUE);
+
+    _drawing_area = gtk_drawing_area_new();
+
+    if (!_xid) {
+      gtk_widget_set_size_request(_drawing_area, width, height);
     }
+
+#ifdef RENDERER_OPENGL
+    assert(gtk_widget_set_gl_capability(_drawing_area, _glconfig,
+                                 NULL, TRUE, GDK_GL_RGBA_TYPE));
 #endif
-}
+    createMenu();
+    setupEvents();
+
+    _width = width;
+    _height = height;
+
+    gtk_widget_realize(_window);
+    gtk_container_add(GTK_CONTAINER(_window), _drawing_area);
+    gtk_widget_show(_drawing_area);
+    gtk_widget_show(_window);
 
-void
-GtkGui::swapBuffers()
-{
 #ifdef RENDERER_OPENGL
+    GdkGLContext *glcontext = gtk_widget_get_gl_context (_drawing_area);
     GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (_drawing_area);
-    if (gdk_gl_drawable_is_double_buffered (gldrawable)) {
-        gdk_gl_drawable_swap_buffers (gldrawable);
-    } else {
-        glFlush();
-    }
+
+    // Attach our OpenGL context to the _drawing_area.
+    assert (gdk_gl_drawable_make_current(gldrawable, glcontext));
+
+    _renderer = create_render_handler_ogl();
+#  ifdef FIX_I810_LOD_BIAS
+    glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 
_tex_lod_bias);
+#  endif
+#elif defined (RENDERER_CAIRO)
+    _cairo_handle = gdk_cairo_create (_drawing_area->window);
+    _renderer = create_render_handler_cairo((void*)_cairo_handle);
 #endif
+
+    set_render_handler(_renderer);
+    log_msg("GL_VERSION: %s", (const char*) glGetString(GL_VERSION));
+
+    return true;
 }
 
 void
-GtkGui::endGL()
+GtkGui::renderBuffer()
 {
-    GNASH_REPORT_FUNCTION;
-#ifdef RENDERER_OPENGL    
+#ifdef RENDERER_OPENGL
     GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (_drawing_area);
     if (gdk_gl_drawable_is_double_buffered (gldrawable)) {
         gdk_gl_drawable_swap_buffers (gldrawable);
     } else {
         glFlush();
     }
-    
-    gdk_gl_drawable_gl_end (gldrawable);  
 #endif
 }
 
 void
-GtkGui::fixLodBias()
+GtkGui::setTimeout(unsigned int timeout)
 {
-#ifdef RENDERER_OPENGL
-       // If 2D textures weren't previously enabled, enable
-       // them now and force the driver to notice the update,
-       // then disable them again.
-       if (!glIsEnabled(GL_TEXTURE_2D)) {
-       // Clearing a mask of zero *should* have no
-       // side effects, but coupled with enbling
-       // GL_TEXTURE_2D it works around a segmentation
-       // fault in the driver for the Intel 810 chip.
-       glEnable(GL_TEXTURE_2D);
-       glClear(0);
-       glDisable(GL_TEXTURE_2D);
-       }
-#endif
-}
-
-bool
-GtkGui::createWindow(int width, int height, long int xid)
-{
-  GNASH_REPORT_FUNCTION;
-  if (xid) {
-    _window = gtk_plug_new(xid);
-    dbglogfile << "Created XEmbedded window" << endl;
-  } else {
-    _window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-    dbglogfile << "Created top level window" << endl;
-  }
-
-  // XXX why do we need this?
-  gtk_container_set_reallocate_redraws(GTK_CONTAINER (_window), TRUE);
-
-  _drawing_area = gtk_drawing_area_new();
-
-  if (!xid) {
-    gtk_widget_set_size_request(_drawing_area, width, height);
-  }
-
-#ifdef RENDERER_OPENGL
-  gtk_widget_set_gl_capability(_drawing_area, _glconfig,
-                               NULL, TRUE, GDK_GL_RGBA_TYPE);
-#endif
-  createMenu();
-  setupEvents();
-
-  if (xid) {
-    _xembed = true;
-    _xid = xid;
-  } else {
-    _xembed = false;
-  }
-  _width = width;
-  _height = height;
-  
-  gtk_widget_realize(_window);
-  gtk_container_add(GTK_CONTAINER(_window), _drawing_area);
-  gtk_widget_show(_drawing_area);
-  gtk_widget_show(_window);
-
-    gnash::render_handler *render;
-#ifdef RENDERER_CAIRO
-   cairo_t* cairohandle = gdk_cairo_create (_drawing_area->window);
-   render = gnash::create_render_handler_cairo((void*)cairohandle);
-#elif defined(RENDERER_OPENGL)
-   render = gnash::create_render_handler_ogl();
-#endif
-   gnash::set_render_handler(render);
-
-#ifdef RENDERER_OPENGL
-        // Turn on alpha blending.
-        glEnable(GL_BLEND);
-        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-        
-        // Turn on line smoothing.  Antialiased lines can be used to
-        // smooth the outsides of shapes.
-        glEnable(GL_LINE_SMOOTH);
-        glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);        // GL_NICEST, 
GL_FASTEST, GL_DONT_CARE
-        
-        glMatrixMode(GL_PROJECTION);
-        glOrtho(-OVERSIZE, OVERSIZE, OVERSIZE, -OVERSIZE, -1, 1);
-        glMatrixMode(GL_MODELVIEW);
-        glLoadIdentity();
-        
-        // We don't need lighting effects
-        glDisable(GL_LIGHTING);
-        // glColorPointer(4, GL_UNSIGNED_BYTE, 0, *);
-        // glInterleavedArrays(GL_T2F_N3F_V3F, 0, *)
-        glPushAttrib (GL_ALL_ATTRIB_BITS);             
-
-#endif
-  return true;
+    g_timeout_add(timeout, (GSourceFunc)gtk_main_quit, NULL);
 }
 
-bool
-GtkGui::poll(movie_interface* m, movie_definition*     md)
+void
+GtkGui::setCallback(callback_t func, unsigned int interval)
 {
-  GNASH_REPORT_FUNCTION;
-
-  while (gtk_events_pending ()) {
-//      dbglogfile << "Making GTK main iteration!" << endl;
-          // Poll for events instead of letting gtk_main() handle them
-       switch (menu_state) {
-               case PLAY_MOVIE:
-               m->set_play_state(gnash::movie_interface::PLAY);
-               break;
-               // Control-R restarts the movie
-               case RESTART_MOVIE:
-               m->restart();
-               break;
-               case STOP_MOVIE:
-               m->set_play_state(gnash::movie_interface::STOP);
-               break;
-               case PAUSE_MOVIE:
-               if (m->get_play_state() == gnash::movie_interface::STOP) {
-                       m->set_play_state(gnash::movie_interface::PLAY);
-               } else {
-                       m->set_play_state(gnash::movie_interface::STOP);
-               }
-               break;
-               // go backward one frame
-               case STEP_BACKWARD:
-               m->goto_frame(m->get_current_frame()-1);
-               break;
-               // go forward one frame
-               case STEP_FORWARD:
-               m->goto_frame(m->get_current_frame()+1);
-               break;
-               // jump goes backward 10 frames
-               case JUMP_BACKWARD:
-               m->goto_frame(m->get_current_frame()-10);
-               break;
-               // jump goes forward 10 frames
-               case JUMP_FORWARD:
-               {
-                       int forward_frame = m->get_current_frame()+10;
-                       if (forward_frame < md->get_frame_count()) {
-                               m->goto_frame(forward_frame);
-                       }
-               }
-               break;
-               case QUIT_MOVIE:
-               //goto done;
-               break;
-               default:
-               break;
-       }
-      menu_state = IDLE_MOVIE;
-      gtk_main_iteration();
-  }
-  return true;
+    g_timeout_add_full (G_PRIORITY_LOW, interval, (GSourceFunc)func, this,
+                        NULL);
 }
 
 bool
 GtkGui::run()
 {
-  GNASH_REPORT_FUNCTION;
-  gtk_main();
-  return true;
+    GNASH_REPORT_FUNCTION;
+    gtk_main();
+    return true;
 }
 
 void
 GtkGui::resizeWindow()
 {
-  GNASH_REPORT_FUNCTION;
+    GNASH_REPORT_FUNCTION;
 }
 
 bool
@@ -400,19 +289,18 @@
 GtkGui::setupEvents()
 {
   GNASH_REPORT_FUNCTION;
-  
+
   g_signal_connect(G_OBJECT(_window), "delete_event",
                    G_CALLBACK(delete_event), this);
   g_signal_connect(G_OBJECT(_window), "key_press_event",
                    G_CALLBACK(key_press_event), this);
-  
-  g_signal_connect_after(G_OBJECT (_drawing_area), "realize",
-                         G_CALLBACK (realize_event), this);
-  g_signal_connect(G_OBJECT (_drawing_area), "configure_event",
-                   G_CALLBACK (configure_event), this);
-  g_signal_connect(G_OBJECT (_drawing_area), "expose_event",
-                   G_CALLBACK (expose_event), this);
-  
+
+ //   g_signal_connect(G_OBJECT (_drawing_area), "configure_event",
+ //                    G_CALLBACK (configure_event), NULL);
+
+ // g_signal_connect(G_OBJECT (_drawing_area), "expose_event",
+ //                  G_CALLBACK (expose_event), this);
+
   gtk_widget_add_events(_drawing_area, GDK_EXPOSURE_MASK
                         | GDK_BUTTON_PRESS_MASK
                         | GDK_BUTTON_RELEASE_MASK
@@ -464,7 +352,7 @@
 GtkGui::menuitem_restart_callback(GtkMenuItem *menuitem, gpointer data)
 {
     GNASH_REPORT_FUNCTION;
-    menu_state = RESTART_MOVIE;
+    get_current_root()->restart();
 }
 
 /// \brief quit complete, and close the application
@@ -472,11 +360,8 @@
 GtkGui::menuitem_quit_callback(GtkMenuItem *menuitem, gpointer data)
 {
     GNASH_REPORT_FUNCTION;
-    menu_state = QUIT_MOVIE;
-// Only use gtk_main_quit() if gtk_main() is used. For now, we're using
-// a gtk_main_iteration() to do it in a polling fashion instead.    
-//    gtk_main_quit();
-    exit(0);
+
+    gtk_main_quit();
 }
 
 /// \brief Start the movie playing from the current frame.
@@ -484,7 +369,7 @@
 GtkGui::menuitem_play_callback(GtkMenuItem *menuitem, gpointer data)
 {
     GNASH_REPORT_FUNCTION;
-    menu_state = PLAY_MOVIE;
+    get_current_root()->set_play_state(gnash::movie_interface::PLAY);
 }
 
 /// \brief toggle that's playing or paused.
@@ -493,7 +378,13 @@
                         gpointer data)
 {
     GNASH_REPORT_FUNCTION;
-    menu_state = PAUSE_MOVIE;
+
+    movie_interface* m = get_current_root();
+    if (m->get_play_state() == gnash::movie_interface::STOP) {
+      m->set_play_state(gnash::movie_interface::PLAY);
+    } else {
+      m->set_play_state(gnash::movie_interface::STOP);
+    }
 }
 
 /// \brief stop the movie that's playing.
@@ -502,7 +393,7 @@
                        gpointer data)
 {
     GNASH_REPORT_FUNCTION;
-    menu_state = STOP_MOVIE;
+    get_current_root()->set_play_state(gnash::movie_interface::STOP);
 }
 
 /// \brief step forward 1 frame
@@ -511,7 +402,8 @@
                                gpointer data)
 {
     GNASH_REPORT_FUNCTION;
-    menu_state = STEP_FORWARD;
+    movie_interface* m = get_current_root();
+    m->goto_frame(m->get_current_frame()+1);
 }
 
 /// \brief step backward 1 frame
@@ -520,7 +412,8 @@
                                 gpointer data)
 {
     GNASH_REPORT_FUNCTION;
-    menu_state = STEP_BACKWARD;
+    movie_interface* m = get_current_root();
+    m->goto_frame(m->get_current_frame()-1);
 }
 
 /// \brief jump forward 10 frames
@@ -529,7 +422,8 @@
                                gpointer data)
 {
     GNASH_REPORT_FUNCTION;
-    menu_state = JUMP_FORWARD;
+    movie_interface* m = get_current_root();
+    m->goto_frame(m->get_current_frame()+10);
 }
 
 /// \brief jump backward 10 frames
@@ -538,7 +432,8 @@
                                 gpointer data)
 {
     GNASH_REPORT_FUNCTION;
-    menu_state = JUMP_BACKWARD;
+    movie_interface* m = get_current_root();
+    m->goto_frame(m->get_current_frame()-10);
 }
 
 //
@@ -550,72 +445,19 @@
 GtkGui::delete_event(GtkWidget *widget, GdkEvent *event, gpointer data)
 {
     GNASH_REPORT_FUNCTION;
-// Only use gtk_main_quit() if gtk_main() is used. For now, we're using
-// a gtk_main_iteration() to do it in a polling fashion instead.    
-//    gtk_main_quit();
-    exit(0);
-    return TRUE;
-}
 
-// 
-gboolean
-GtkGui::realize_event(GtkWidget *widget, GdkEvent *event, gpointer data)
-{
-    GNASH_REPORT_FUNCTION;
-    
-    return true;
-}
-
-gboolean
-GtkGui::expose_event(GtkWidget *const widget,
-             GdkEventExpose *const event,
-             const gpointer data)
-{
-    GNASH_REPORT_FUNCTION;
-#ifdef RENDERER_OPENGL   
-    GdkGLDrawable *const gldrawable = gtk_widget_get_gl_drawable(widget);
-    g_assert(gldrawable);
-    GdkGLContext *const glcontext = gtk_widget_get_gl_context(widget);
-    g_assert(glcontext);
-
-   if (event->count == 0
-        && gdk_gl_drawable_make_current(gldrawable, glcontext)) {
-//        viewer.redraw();
-    }
-#endif  
-    return true;
+    gtk_main_quit();
+    return TRUE;
 }
 
-gboolean
-GtkGui::configure_event(GtkWidget *const widget,
-                GdkEventConfigure *const event,
-                const gpointer data)
-{
-    GNASH_REPORT_FUNCTION;
-#ifdef RENDERER_OPENGL
-    GdkGLContext *glcontext = gtk_widget_get_gl_context (widget);
-    GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget);
-
-    if (gdk_gl_drawable_make_current(gldrawable, glcontext)) {
-
-        glViewport (event->x, event->y, event->width, event->height);
-        // Reset the size of the frame. This is really ugly but these
-        // global variables are used by the existing main event loop
-        // in gnash.cpp to set the size of the rendered image.
-
-    }
-       // gnash::mwidth = event->width;
-       // gnash::mheight = event->height;
-#endif
-
-    return true;
-}
 
 gboolean
 GtkGui::key_press_event(GtkWidget *const widget,
                 GdkEventKey *const event,
                 const gpointer data)
 {
+
+
     GNASH_REPORT_FUNCTION;
 
     switch (event->keyval) {
@@ -658,10 +500,10 @@
         if (event->state == GDK_CONTROL_MASK) {
             switch(key) {
               case 'r':
-                  menu_state = RESTART_MOVIE;
+                  menuitem_restart_callback(NULL, NULL);
                   break;
               case 'p':
-                  menu_state = PAUSE_MOVIE;
+                  menuitem_pause_callback(NULL, NULL);
                   break;
               default:
                   dbglogfile << "Got Control-key: " << key << endl;
@@ -683,10 +525,10 @@
         }
         switch (key) {
           case '[':
-              menu_state = STEP_FORWARD;
+              menuitem_step_forward_callback(NULL, NULL);
               break;
           case ']':
-              menu_state = STEP_BACKWARD;
+              menuitem_step_backward_callback(NULL, NULL);
               break;
           default:
               break;
@@ -695,8 +537,7 @@
         if (c != gnash::key::INVALID) {
 //            gnash::notify_key_event(c, true);
         }
-    };
-        
+    }
     return true;
 }
 
@@ -706,14 +547,15 @@
                    const gpointer data)
 {
     GNASH_REPORT_FUNCTION;
-    
-    Gui *obj = (Gui *)data;
+
+    Gui *obj = static_cast<Gui *>(data);
     int        mask = 1 << (event->button - 1);
     int buttons = obj->getMouseButtons();
     obj->setMouseButtons(buttons |= mask);
-    obj->setMouseX(int(event->x));
-    obj->setMouseY(int(event->y));
-    
+    float scale = obj->getScale();
+    obj->setMouseX(int(event->x / scale));
+    obj->setMouseY(int(event->y / scale));
+
     return true;
 }
 
@@ -723,13 +565,14 @@
                      const gpointer data)
 {
     GNASH_REPORT_FUNCTION;
-    Gui *obj = (Gui *)data;
+    Gui *obj = static_cast<Gui *>(data);
     int        mask = 1 << (event->button - 1);
     int buttons = obj->getMouseButtons();
+
     obj->setMouseButtons(buttons &= ~mask);
-    
-    obj->setMouseX(int(event->x));
-    obj->setMouseY(int(event->y));
+    float scale = obj->getScale();
+    obj->setMouseX(int(event->x / scale));
+    obj->setMouseY(int(event->y / scale));
 
     return true;
 }
@@ -740,18 +583,11 @@
                     const gpointer data)
 {
 //    GNASH_REPORT_FUNCTION;
-    Gui *obj = (Gui *)data;
-//     if (event->state & Button1Mask) {
-//         info.what = 0;
-//     } else if (event->state & Button2Mask) {
-//         info.what = 1;
-//     } else if (event->state & Button3Mask) {
-//         info.what = 2;
-//     } else {
-//         info.event = viewer::event_mouse_move;
-//     }
-    obj->setMouseX(int(event->x));
-    obj->setMouseY(int(event->y));
+    Gui *obj = static_cast<Gui *>(data);
+
+    float scale = obj->getScale();
+    obj->setMouseX(int(event->x / scale));
+    obj->setMouseY(int(event->y / scale));
 
     return true;
 }
@@ -820,6 +656,9 @@
   g_print ("\n");
 }
 
+
+
+
 void
 GtkGui::drawTestGraphic()
 {
Index: gnash/gui/gtksup.h
diff -u gnash/gui/gtksup.h:1.1 gnash/gui/gtksup.h:1.2
--- gnash/gui/gtksup.h:1.1      Thu May  4 00:18:37 2006
+++ gnash/gui/gtksup.h  Sun May  7 15:33:08 2006
@@ -60,22 +60,25 @@
 class GtkGui : public Gui
 {
  public:
+    GtkGui(unsigned long xid, float scale, bool loop, unsigned int depth);
     virtual ~GtkGui();
     virtual bool init(int argc, char **argv[]);
-    virtual bool init(int xid, int argc, char **argv[]);
-    virtual bool createWindow(int width, int height, long int xid = 0);
-    virtual bool poll(gnash::movie_interface*  m, gnash::movie_definition*     
md);
+    virtual bool createWindow(int width, int height);
     virtual bool run();    
     virtual void resizeWindow();
     virtual bool createMenu();
     virtual bool setupEvents();
-    virtual void startGL();
-    virtual void endGL();
-    virtual void fixLodBias();
     virtual void drawTestGraphic();
-    virtual void swapBuffers();
-    
+    virtual void renderBuffer();
+    virtual void setCallback(callback_t f, unsigned int interval);
+    virtual void setTimeout(unsigned int timeout);
+#if defined(RENDERER_OPENGL) && defined(FIX_I810_LOD_BIAS)
+    virtual void setLodBias(float tex_lod_bias);
+#endif
+
+
     // Menu Item callbacks
+
     static void menuitem_restart_callback(GtkMenuItem *menuitem,
                                    gpointer instance);
     static void menuitem_quit_callback(GtkMenuItem *menuitem,
@@ -94,6 +97,7 @@
                                         gpointer instance);
     static void menuitem_jump_backward_callback(GtkMenuItem *menuitem,
                                          gpointer instance);
+
     // GTK Event handlers
     static gboolean realize_event(GtkWidget *widget, GdkEvent *event,
                                   gpointer data);
@@ -122,7 +126,12 @@
     GtkWidget   *_window;
     GtkWidget   *_drawing_area;    
     GtkMenu     *_popup_menu;
+#ifdef RENDERER_CAIRO
+    cairo_t     *_cairo_handle;
+#elif defined(RENDERER_OPENGL)
     GdkGLConfig *_glconfig;
+#endif
+
 };
 
 
Index: gnash/gui/gui.cpp
diff -u gnash/gui/gui.cpp:1.1 gnash/gui/gui.cpp:1.2
--- gnash/gui/gui.cpp:1.1       Thu May  4 00:18:37 2006
+++ gnash/gui/gui.cpp   Sun May  7 15:33:08 2006
@@ -56,19 +56,26 @@
 
 namespace gnash {
 
-movie_state_e menu_state;
-
 const char *GNASH = "Gnash";
 
-Gui::Gui() : _xid(0), _width(0), _height(0), _mouse_x(0), _mouse_y(0), 
_mouse_buttons(0),
-             _xembed(0), _depth(16)
+Gui::Gui(unsigned long xid, float scale, bool loop, unsigned int depth)
+  : _xid(xid),
+    _scale(scale),
+    _loop(loop),
+    _mouse_x(0),
+    _mouse_y(0),
+    _mouse_buttons(0),
+    _depth(depth)
+#if defined(FIX_I810_LOD_BIAS)
+   ,_tex_lod_bias(-1.2f)
+#endif
 {
-    GNASH_REPORT_FUNCTION;    
 }
 
 Gui::~Gui()
 {
-    GNASH_REPORT_FUNCTION;    
+    GNASH_REPORT_FUNCTION;
+    delete _renderer;
 }
 
 
Index: gnash/gui/gui.h
diff -u gnash/gui/gui.h:1.1 gnash/gui/gui.h:1.2
--- gnash/gui/gui.h:1.1 Thu May  4 00:18:37 2006
+++ gnash/gui/gui.h     Sun May  7 15:33:08 2006
@@ -50,56 +50,55 @@
 namespace gnash
 {
 
-typedef bool (*callback_t)(int x);
-typedef enum {IDLE_MOVIE, PLAY_MOVIE, RESTART_MOVIE, PAUSE_MOVIE, STOP_MOVIE, 
STEP_FORWARD, STEP_BACKWARD, JUMP_FORWARD, JUMP_BACKWARD, QUIT_MOVIE} 
movie_state_e;
+typedef bool (*callback_t)(void*);
+typedef enum {IDLE_MOVIE = 0, PLAY_MOVIE = 1, RESTART_MOVIE, PAUSE_MOVIE, 
STOP_MOVIE, STEP_FORWARD, STEP_BACKWARD, JUMP_FORWARD, JUMP_BACKWARD, 
QUIT_MOVIE} movie_state_e;
 
 extern const char *GNASH;
 extern movie_state_e menu_state;
- 
+
+
 class Gui {
 public:
-    Gui();
-    Gui(int argc, char **argv[]);
-    Gui(int x, int y, int width, int height, const char *label);
+    Gui(unsigned long xid, float scale, bool loop, unsigned int depth);
     virtual ~Gui();
     
-    virtual bool init(int xid, int argc, char **argv[]) = 0;
     virtual bool init(int argc, char **argv[]) = 0;
-    virtual bool createWindow(int width, int height, long int xid) = 0;
-//    virtual bool checkEvents(movie_interface *movie);
-    
-    virtual bool poll(gnash::movie_interface* m, gnash::movie_definition* md) 
= 0;
+    virtual bool createWindow(int width, int height) = 0;
     virtual bool run() = 0;
     virtual void resizeWindow() = 0;
     virtual bool createMenu() = 0;
     virtual bool setupEvents() = 0;
-    virtual void startGL() = 0;
-    virtual void endGL() = 0;
-    virtual void drawTestGraphic() = 0;
-    
-    void setMouseX(int x) { _mouse_x = x; };
-    void setMouseY(int y) { _mouse_y= y; };
-    void setMouseButtons(int mask) { _mouse_buttons = mask; };
-    int getMouseX() { return _mouse_x; };
-    int getMouseY() { return _mouse_y; };
-    int getMouseButtons() { return _mouse_buttons; };
-    
+    virtual void renderBuffer() = 0;
+
+    void setMouseX(int x)           { _mouse_x = x; }
+    void setMouseY(int y)           { _mouse_y= y; }
+    void setMouseButtons(int mask)  { _mouse_buttons = mask; }
+    int getMouseX()                 { return _mouse_x; }
+    int getMouseY()                 { return _mouse_y; }
+    int getMouseButtons()           { return _mouse_buttons; }
+    float getScale()                { return _scale; }
+    bool loops()                    { return _loop; }
+
     void addMouseHandler(callback_t ptr);
     void addKeyboardHandler(callback_t ptr);
-    void setXembed(int xid);
 
 protected:
-    int         _xid;
-    int         _width;
-    int         _height;
-    int         _mouse_x;
-    int         _mouse_y;
-    int         _mouse_buttons;
-    bool        _xembed;
-    int         _depth;
-    std::string _name;
-    callback_t _mouse_handler;
-    callback_t _heyboard_handler;
+    bool            _loop;
+    unsigned long   _xid;
+    int             _width;
+    int             _height;
+    int             _mouse_x;
+    int             _mouse_y;
+    float           _scale;
+    int             _mouse_buttons;
+    int             _depth;
+    std::string     _name;
+    callback_t      _mouse_handler;
+    callback_t      _heyboard_handler;
+    render_handler* _renderer;
+#if defined(RENDERER_OPENGL) && defined(FIX_I810_LOD_BIAS)
+    float           _tex_lod_bias;
+#endif
 };
  
   




reply via email to

[Prev in Thread] Current Thread [Next in Thread]