gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash backend/render_handler_agg.cpp gui/README...


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash backend/render_handler_agg.cpp gui/README...
Date: Wed, 31 Jan 2007 15:24:14 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Bastiaan Jacques <bjacques>     07/01/31 15:24:13

Modified files:
        backend        : render_handler_agg.cpp 
        gui            : README fb.cpp fbsup.h fltk.cpp fltksup.h 
                         fltk_glue_agg.cpp fltk_glue_agg.h gtk.cpp 
                         gtk_glue_agg.cpp gtksup.h gui.cpp gui.h 
                         riscos.cpp riscossup.h sdl.cpp 
        server         : movie_root.h 
        .              : ChangeLog 

Log message:
                * backend/render_handler_agg.cpp, gui/{gui.cpp, gtk.cpp}: Do not
                subtract 1 from the rendering width and height (fixes bug 
#18904).
                * gui/README: update to current status.
                * gui: Rename Gui::set_invalidated_region to 
setInvalidatedRegion to
                match naming style.
                * gui/fltk{.cpp, sup.h, _glue_agg.cpp, _glue_agg.h}: Add a menu 
bar
                to the FLTK window. Make the AGG glue inherit from 
fltk::Widget, so
                it can be added to the FLTK window without interfering with menu
                drawing. Since the same hasn't yet been done for the Cairo glue,
                disable Cairo/FLTK for now. Account for the menu height when 
passing
                the mouse position to the rest of Gnash. Delay initialisation 
of the
                Glue until we are ready to add it to the FLTK window. Until we 
can
                solve rendering issues, disable region based clipping for AGG.
                Note that some FLTK menu items are not yet implemented.
                * gui/gtk{.cpp, _glue_agg.cpp}: Remove the unused valid_coord 
method.
                * gui/gui{.cpp, .h}: Declarations in the header, implementation 
in
                the .cpp file. Shuffle the order of declarations so they are 
grouped
                by type.
                * server/movie_root.h: set_invalidated_region is used across 
libraries,
                so visibility should be DSO_EXPORT.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_agg.cpp?cvsroot=gnash&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/README?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/fb.cpp?cvsroot=gnash&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/fbsup.h?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/fltk.cpp?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/fltksup.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/fltk_glue_agg.cpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/fltk_glue_agg.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtk.cpp?cvsroot=gnash&r1=1.64&r2=1.65
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtk_glue_agg.cpp?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtksup.h?cvsroot=gnash&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.58&r2=1.59
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.h?cvsroot=gnash&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/riscos.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/riscossup.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/sdl.cpp?cvsroot=gnash&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2206&r2=1.2207

Patches:
Index: backend/render_handler_agg.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_agg.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- backend/render_handler_agg.cpp      17 Jan 2007 16:31:30 -0000      1.54
+++ backend/render_handler_agg.cpp      31 Jan 2007 15:24:13 -0000      1.55
@@ -16,7 +16,7 @@
 
  
 
-/* $Id: render_handler_agg.cpp,v 1.54 2007/01/17 16:31:30 bjacques Exp $ */
+/* $Id: render_handler_agg.cpp,v 1.55 2007/01/31 15:24:13 bjacques Exp $ */
 
 // Original version by Udo Giacomozzi and Hannes Mayr, 
 // INDUNET GmbH (www.indunet.it)
@@ -523,7 +523,7 @@
     m_pixf = new PixelFormat(m_rbuf);
     //m_rbase = new renderer_base(*m_pixf);  --> does not work!!??
     
-    _clipbounds.setTo(0, 0, xres-1, yres-1);
+    _clipbounds.setTo(0, 0, xres, yres);
         
     log_msg("initialized AGG buffer <%p>, %d bytes, %dx%d, rowsize is %d 
bytes", 
       mem, size, x, y, row_size);
@@ -1441,7 +1441,7 @@
   
       // TODO: cache 'visiblerect' and maintain in sync with
       //       xres/yres.
-      Range2d<int> visiblerect(0, 0, xres-1, yres-1);
+      Range2d<int> visiblerect(0, 0, xres, yres);
       _clipbounds = Intersection(pixbounds, visiblerect);
   
   }

Index: gui/README
===================================================================
RCS file: /sources/gnash/gnash/gui/README,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- gui/README  16 Oct 2006 15:27:53 -0000      1.5
+++ gui/README  31 Jan 2007 15:24:13 -0000      1.6
@@ -32,10 +32,10 @@
 GTK2:
 - implemented OpenGL, Agg and Cairo backends.
 - Events work.
-- Pop-up menu is available.
+- Pop-up menu is available. Window menu available for standalone.
 - Firefox plugin works.
 
-SDL:
+SDL: deprecated in favour of FLTK.
 - OpenGL, Agg and Cairo backends.
 - Mouse events work (keyboard events don't).
 - There's no pop-up menu (and there probably never will be one).
@@ -47,7 +47,11 @@
 - Klash plugin for konqueror is available.
 
 FLTK:
-- Doesn't work just yet.
+- Requires FLTK2.
+- Implements Agg and Cairo backends.
+- Events work.
+- Popup menu is available.
+- Firefox plugin and KDE Kpart work.
 
 Framebuffer:
 - Working as output device only, no input devices currently supported.

Index: gui/fb.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/fb.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- gui/fb.cpp  2 Dec 2006 21:28:06 -0000       1.20
+++ gui/fb.cpp  31 Jan 2007 15:24:13 -0000      1.21
@@ -401,7 +401,7 @@
   return y;
 }
 
-void FBGui::set_invalidated_region(const rect& bounds) {
+void FBGui::setInvalidatedRegion(const rect& bounds) {
 
 #ifdef DOUBLE_BUFFER
   
@@ -419,7 +419,7 @@
 
 #endif
   
-}  // set_invalidated_region
+}  // setInvalidatedRegion
 
 void FBGui::disable_terminal() {
   /*

Index: gui/fbsup.h
===================================================================
RCS file: /sources/gnash/gnash/gui/fbsup.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- gui/fbsup.h 6 Dec 2006 10:58:34 -0000       1.12
+++ gui/fbsup.h 31 Jan 2007 15:24:13 -0000      1.13
@@ -105,7 +105,7 @@
     virtual void setInterval(unsigned int interval);
     virtual void setTimeout(unsigned int timeout);
     
-    virtual void set_invalidated_region(const rect& bounds);
+    virtual void setInvalidatedRegion(const rect& bounds);
 };
 
 // end of namespace gnash

Index: gui/fltk.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/fltk.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- gui/fltk.cpp        25 Jan 2007 17:24:35 -0000      1.5
+++ gui/fltk.cpp        31 Jan 2007 15:24:13 -0000      1.6
@@ -25,6 +25,9 @@
 #include <fltk/run.h>
 #include <fltk/Cursor.h>
 #include <fltk/layout.h>
+#include <fltk/MenuBar.h>
+#include <fltk/ItemGroup.h>
+#include <fltk/file_chooser.h>
 
 #include "fltksup.h"
 #include "gnash.h"
@@ -36,13 +39,16 @@
 using namespace std;
 using namespace fltk;
 
+
+
 namespace gnash 
 {
 
 
 FltkGui::FltkGui(unsigned long xid, float scale, bool loop, unsigned int depth)
   : Window(0, 0),
-    Gui(xid, scale, loop, depth)
+    Gui(xid, scale, loop, depth),
+    _menu_height(_xid ? 0 : 20)
 {
 }
 
@@ -55,14 +61,6 @@
 void
 FltkGui::renderBuffer()
 {
-    redraw();
-}
-
-// All drawing operations (i.e., the drawing calls the renderer makes) must 
take
-// place in draw().
-void
-FltkGui::draw()
-{
     // FLTK has a nice mechanism where you can set damage() to whatever you 
want
     // so in draw() you can check what exactly you want to redraw. But
     // unfortunately it doesn't seem to remember what bits you turn on. So I'll
@@ -71,12 +69,12 @@
 
     if (firstRun) {
       // Redraw the whole rendering area.
-      rect draw_bounds(-1e10f, -1e10f, +1e10f, +1e10f);
-      set_invalidated_region(draw_bounds);
+      rect draw_bounds(0, 0, _width, _height);
+      setInvalidatedRegion(draw_bounds);
       firstRun = false;
     }
 
-    _glue.draw();
+    _glue->redraw();
 }
 
 int
@@ -97,10 +95,13 @@
         return true;
       case MOVE:
       {
+        if (!_xid && event_y() < _menu_height) {
+          return Window::handle(event);
+        }
         int x = event_x() / _xscale;
-        int y = event_y() / _yscale;
+        int y = (event_y() - _menu_height) / _yscale;
         notify_mouse_moved(x, y);
-        return true;
+        return Window::handle(event);;
       }
       case KEY:
         handleKey(event_key());
@@ -158,6 +159,7 @@
 #endif
     };
 
+
     for (int i = 0; table[i].fltkKey; i++) {
         if (key == table[i].fltkKey) {
             gnash::notify_key_event(table[i].gnashKey, true);
@@ -177,8 +179,6 @@
 bool
 FltkGui::init(int argc, char **argv[])
 {
-    _renderer = _glue.createRenderHandler();
-    set_render_handler(_renderer);
 
     return true;
 }
@@ -204,15 +204,32 @@
 bool
 FltkGui::createWindow(const char* title, int width, int height)
 {
-    resize(width, height);
+    resize(width, _menu_height + height);
 
-    _glue.initBuffer(width, height);
 
     label(title);
     begin();
+
+    if (!_xid) {
+      MenuBar* menubar = new MenuBar(0, 0, width, _menu_height);
+      menubar->begin();
+      addMenuItems();
+      menubar->end();
+    }
+#ifdef RENDERER_AGG
+    _glue = new FltkAggGlue(0, _menu_height, width, height);
+#elif defined(RENDERER_CAIRO)
+#error FLTK/Cairo is currently broken. Please try again soon... 
+    FltkCairoGlue _glue;
+#endif
     createMenu();
     end();
 
+    _renderer = _glue->createRenderHandler();
+    set_render_handler(_renderer);
+
+    _glue->initBuffer(width, height);
+
     // The minimum size of the window is 1x1 pixels.
     size_range (1, 1);
 
@@ -221,15 +238,72 @@
     return true;
 }
 
-bool
-FltkGui::createMenu()
+
+static void menu_fltk_open_file()
 {
-    _popup_menu = new PopupMenu(0, 0, w(), h());
-    _popup_menu->type(PopupMenu::POPUP3);
+    const char *newfile = fltk::file_chooser("Open File", "*.swf", NULL);
+    if (!newfile) {
+      return;
+    }
 
-    _popup_menu->begin();
+    // menu_open_file()..
+}
+
+static void menu_fltk_save_file_as()
+{
+    const char* savefile = file_chooser("Save File as", NULL, NULL);
+    if (!savefile) {
+      return;
+    }
+
+    // menu_save_file();
+}
+
+static void full(Widget*, void* ptr)
+{
+    GNASH_REPORT_FUNCTION;
+
+    static bool fullscreen = false;
+    static Rectangle oldBounds;
+
+    fullscreen = !fullscreen;
+
+    FltkGui* gui = static_cast<FltkGui*>(ptr);
+    if (fullscreen) {
+      oldBounds.set(gui->x(), gui->y(), gui->w(), gui->h());
+      gui->fullscreen();
+    } else {
+      gui->fullscreen_off(oldBounds.x(), oldBounds.y(), oldBounds.w(), 
oldBounds.h());
+    }
+}
+
+
+void
+FltkGui::addMenuItems()
+{
 
 #define callback_cast(ptr) reinterpret_cast<Callback*>(ptr)
+    ItemGroup* file = new ItemGroup("File");
+    file->begin();
+    new Item("Open",                    0, callback_cast(menu_fltk_open_file));
+    new Item("Save as",                 0, 
callback_cast(menu_fltk_save_file_as));
+    //new Item("Save as..."               0, callback_cast(menu_fltk_save_as));
+    new Item("Quit",                    0, callback_cast(menu_quit));
+    file->end();
+
+    ItemGroup* edit = new ItemGroup("Edit");
+    edit->begin();
+    new Item("Preferences");
+    edit->end();
+
+    ItemGroup* view = new ItemGroup("View");
+    view->begin();
+    new Item("Double size");
+    new Item("Fullscreen",              0, callback_cast(full), this);
+    view->end();
+
+    ItemGroup* movie_ctrl = new ItemGroup("Movie control");
+    movie_ctrl->begin();
     new Item("Play Movie",              0, callback_cast(menu_play));
     new Item("Pause Movie",             0, callback_cast(menu_pause));
     new Item("Stop Movie",              0, callback_cast(menu_stop));
@@ -239,8 +313,27 @@
     new Item("Jump Forward 10 Frames",  0, callback_cast(menu_jump_forward));
     new Item("Jump Backward 10 Frames", 0, callback_cast(menu_jump_backward));
     new Item("Toggle Sound",            0, callback_cast(menu_toggle_sound));
-    new Item("Quit",                    0, callback_cast(menu_quit));
+    movie_ctrl->end();
+
+    ItemGroup* help = new ItemGroup("Help");
+    help->begin();
+    new Item("About");
+    help->end();
+
 #undef callback_cast
+}
+
+
+
+bool
+FltkGui::createMenu()
+{
+    _popup_menu = new PopupMenu(0, 0, w(), h());
+    _popup_menu->type(PopupMenu::POPUP3);
+
+    _popup_menu->begin();
+
+     addMenuItems();
 
     _popup_menu->end();
 
@@ -250,10 +343,6 @@
 void
 FltkGui::layout()
 {
-    if ((layout_damage() & LAYOUT_CHILD )) {
-      // We're not interested in children. Sorry.
-      return;
-    }
     if (!VM::isInitialized()) {
       // No movie yet; don't bother resizing anything.
       return;
@@ -263,15 +352,15 @@
     Window::layout();
 
     if ((layout_damage() & LAYOUT_WH)) {
-      _glue.resize(w(), h());
-      resize_view(w(), h());
+      _glue->resize(w(), h() - _menu_height);
+      resize_view(w(), h() - _menu_height);
     }
 
     // Invalidate the whole drawing area.
-    rect draw_bounds(-1e10f, -1e10f, +1e10f, +1e10f);
-    set_invalidated_region(draw_bounds);
+    rect draw_bounds(0, 0, _width, _height);
+    setInvalidatedRegion(draw_bounds);
 
-    redraw();
+    _glue->redraw();
 }
 
 void 
@@ -294,9 +383,12 @@
 }
 
 void
-FltkGui::set_invalidated_region(const rect& bounds)
+FltkGui::setInvalidatedRegion(const rect& bounds)
 {
-    _glue.invalidateRegion(bounds);
+#if 0
+    // temporarily disabled
+    _glue->invalidateRegion(bounds);
+#endif
 }
 
 

Index: gui/fltksup.h
===================================================================
RCS file: /sources/gnash/gnash/gui/fltksup.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gui/fltksup.h       16 Jan 2007 14:02:45 -0000      1.2
+++ gui/fltksup.h       31 Jan 2007 15:24:13 -0000      1.3
@@ -55,21 +55,23 @@
     virtual void setCursor(gnash_cursor_type newcursor);
     virtual bool setupEvents() { return true;}
 
-    void set_invalidated_region(const rect& bounds);
+    void setInvalidatedRegion(const rect& bounds);
 
     void create();
-    void draw();
     int handle(int event);
     void layout();
+    void addMenuItems();
  private:
     void handleKey(unsigned key);
 
     fltk::PopupMenu  *_popup_menu;
     float _interval;
+    unsigned int _menu_height;
+
 #ifdef RENDERER_AGG
-    FltkAggGlue _glue;
+    FltkAggGlue *_glue;
 #elif defined(RENDERER_CAIRO)
-    FltkCairoGlue _glue;
+    FltkCairoGlue* _glue;
 #endif
 };
 

Index: gui/fltk_glue_agg.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/fltk_glue_agg.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- gui/fltk_glue_agg.cpp       16 Jan 2007 14:02:45 -0000      1.3
+++ gui/fltk_glue_agg.cpp       31 Jan 2007 15:24:13 -0000      1.4
@@ -32,8 +32,9 @@
 
 namespace gnash {
 
-FltkAggGlue::FltkAggGlue()
- : _offscreenbuf(NULL)
+FltkAggGlue::FltkAggGlue(int x, int y, int width, int height)
+ : Widget(x, y, width, height),
+   _offscreenbuf(NULL)
 {
 }
 
@@ -77,7 +78,7 @@
     _width = width;
     _height = height;
 
-    _validbounds.setTo(0, 0, _width-1, _height-1);
+    _validbounds.setTo(0, 0, _width, _height);
     _drawbounds = _validbounds;
 
 }
@@ -93,7 +94,7 @@
 
     fltk::drawimage(_offscreenbuf + offset, fltk::RGB, bounds, _stride);
 }
-//miny*(_width*(_bpp/8)) + minx*(_bpp/8)
+
 void
 FltkAggGlue::resize(int width, int height)
 {

Index: gui/fltk_glue_agg.h
===================================================================
RCS file: /sources/gnash/gnash/gui/fltk_glue_agg.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- gui/fltk_glue_agg.h 16 Jan 2007 14:02:45 -0000      1.3
+++ gui/fltk_glue_agg.h 31 Jan 2007 15:24:13 -0000      1.4
@@ -21,6 +21,8 @@
 #include "config.h"
 #endif
 
+#include <fltk/Widget.h>
+
 #include "gnash.h"
 #include "log.h"
 #include "gui.h"
@@ -33,10 +35,10 @@
 
 namespace gnash {
 
-class FltkAggGlue
+class FltkAggGlue : public fltk::Widget
 {
     public:
-      FltkAggGlue();
+      FltkAggGlue(int x, int y, int width, int height);
       ~FltkAggGlue();
      // resize(int width, int height);
       void draw();

Index: gui/gtk.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gtk.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- gui/gtk.cpp 23 Jan 2007 19:53:41 -0000      1.64
+++ gui/gtk.cpp 31 Jan 2007 15:24:13 -0000      1.65
@@ -17,7 +17,7 @@
 // 
 //
 
-/* $Id: gtk.cpp,v 1.64 2007/01/23 19:53:41 martinwguy Exp $ */
+/* $Id: gtk.cpp,v 1.65 2007/01/31 15:24:13 bjacques Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -234,7 +234,7 @@
        _width = width;
        _height = height;
 
-       _validbounds.setTo(0, 0, _width-1, _height-1);
+       _validbounds.setTo(0, 0, _width, _height);
        _drawbounds = _validbounds;
     
        glue.setRenderHandlerSize(_width, _height);
@@ -251,16 +251,8 @@
                _drawbounds.getMaxX(), _drawbounds.getMaxY());
 }
 
-int
-GtkGui::valid_coord(int coord, int max)
-{
-       if (coord<0) return 0;
-       else if (coord>=max) return max;
-       return coord;
-}
-
 void
-GtkGui::set_invalidated_region(const rect& bounds)
+GtkGui::setInvalidatedRegion(const rect& bounds)
 {
 #ifdef RENDERER_AGG
        // forward to renderer
@@ -998,7 +990,7 @@
        //       (look at the GdkEventExpose)
        rect draw_bounds; draw_bounds.set_world();
 
-       gui->set_invalidated_region(draw_bounds);
+       gui->setInvalidatedRegion(draw_bounds);
 
        gui->renderBuffer();
 

Index: gui/gtk_glue_agg.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gtk_glue_agg.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- gui/gtk_glue_agg.cpp        2 Nov 2006 14:00:12 -0000       1.11
+++ gui/gtk_glue_agg.cpp        31 Jan 2007 15:24:13 -0000      1.12
@@ -17,7 +17,7 @@
 //
 //
 
-/* $Id: gtk_glue_agg.cpp,v 1.11 2006/11/02 14:00:12 udog Exp $ */
+/* $Id: gtk_glue_agg.cpp,v 1.12 2007/01/31 15:24:13 bjacques Exp $ */
 
 #include <cstdio>
 #include <cerrno>
@@ -123,16 +123,6 @@
        
 }
 
-static int
-valid_coord(int coord, int max)
-{ 
-    if (coord<0) return 0;
-    else if (coord>=max) return max;
-
-    return coord;
-}
-
-
 void
 GtkAggGlue::render()
 {

Index: gui/gtksup.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gtksup.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- gui/gtksup.h        10 Jan 2007 14:17:34 -0000      1.33
+++ gui/gtksup.h        31 Jan 2007 15:24:13 -0000      1.34
@@ -131,7 +131,7 @@
 
     GdkPixbuf* create_pixbuf(const gchar *filename);
     
-    void set_invalidated_region(const rect& bounds);
+    void setInvalidatedRegion(const rect& bounds);
 
     virtual void setCursor(gnash_cursor_type newcursor);
     
@@ -157,7 +157,6 @@
     static gnash::key::code gdk_to_gnash_key(guint key);
     static void             open_file(GtkWidget* dialog, gpointer data);
 
-    int    valid_coord(int coord, int max);
 };
 
 

Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- gui/gui.cpp 29 Jan 2007 09:31:39 -0000      1.58
+++ gui/gui.cpp 31 Jan 2007 15:24:13 -0000      1.59
@@ -132,7 +132,7 @@
        // set new size ?
        _width = width;
        _height = height;
-       _validbounds.setTo(0, 0, _width-1, _height-1);
+       _validbounds.setTo(0, 0, _width, _height);
        //log_msg("new size (in twips) is: %dx%d", _width*20, _height*20); 
 
 }
@@ -302,9 +302,9 @@
                // *new* invalidated region is visible
                // (helps debugging)
                rect worldregion; worldregion.set_world();
-               set_invalidated_region(worldregion);
+               setInvalidatedRegion(worldregion);
 #else
-               set_invalidated_region(changed_bounds);
+               setInvalidatedRegion(changed_bounds);
 #endif
 
                // render the frame.
@@ -392,6 +392,35 @@
 {
 }
 
+bool
+Gui::want_redraw()
+{
+    return false;
+}
+
+float
+Gui::getXScale()
+{
+    return _xscale;
+}
+
+float
+Gui::getYScale()
+{
+    return _yscale;
+}
+
+bool
+Gui::loops()
+{
+    return _loop;
+}
+
+void
+Gui::setInvalidatedRegion (const rect& bounds)
+{
+}
+
 // end of namespace
 }
 

Index: gui/gui.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- gui/gui.h   10 Jan 2007 19:21:15 -0000      1.43
+++ gui/gui.h   31 Jan 2007 15:24:13 -0000      1.44
@@ -104,6 +104,11 @@
     /// Register event handlers.
     virtual bool setupEvents() = 0;
     
+    /// Render the current buffer.
+
+    /// For OpenGL, this means that the front and back buffers are swapped.
+    virtual void renderBuffer() = 0;
+
     /// Gives the GUI a *hint* which region of the stage should be redrawn.
     //
     /// There is *no* restriction what the GUI might do with these 
coordinates. 
@@ -119,7 +124,6 @@
     /// correct results. It is up to the GUI to forward this information to
     /// the renderer.
     ///
-    virtual void set_invalidated_region(const rect& /*bounds*/) {
       // does not need to be implemented (optional feature),
       // but still needs to be available.
       //
@@ -130,52 +134,27 @@
       //        coordinate space, which is integer values...
       //        The question really is: why floats for TWIPS ?
       //        (guess this goes deep in the core/server libs)
-    } 
+    virtual void setInvalidatedRegion(const rect& bounds);
 
     /// Asks the GUI handler if the next frame should be redrawn completely. 
     //
     /// For example, when the contents of the player window have been 
destroyed,
-    /// then want_redraw() should return true so that set_invalidated_region() 
is
+    /// then want_redraw() should return true so that setInvalidatedRegion() is
     /// called with the coordinates of the complete screen. 
-    virtual bool want_redraw() {
-      return false;
-    }
+    virtual bool want_redraw();
 
 
     /// Sets the current mouse cursor for the Gui window.
     virtual void setCursor(gnash_cursor_type newcursor);
 
-
-    /// Render the current buffer.
-    //
-    /// For OpenGL, this means that the buffer is swapped.
-    virtual void renderBuffer() = 0;
-
     /// @return The value to which the movie width should be scaled.
-    float getXScale()                { return _xscale; }
+    float getXScale();
 
     /// @return The value to which the movie height shold be scaled.
-    float getYScale()                { return _yscale; }
+    float getYScale();
 
     /// @return Whether or not the movie should be looped indefinitely.
-    bool loops()                     { return _loop; }
-
-    /** @name Menu callbacks
-     *  These callbacks will be called when a menu item is clicked.
-     *  @{
-     */
-    static void menu_restart();
-    static void menu_quit();
-    static void menu_about();
-    static void menu_play();
-    static void menu_pause();
-    static void menu_stop();
-    static void menu_step_forward();
-    static void menu_step_backward();
-    static void menu_jump_forward();
-    static void menu_jump_backward();
-    static void menu_toggle_sound();
-    /// @}
+    bool loops();
  
     /// Mouse notification callback to be called when the mouse is moved.
     //
@@ -190,17 +169,35 @@
     /// @param mask A binary representation of the buttons currently pressed.
     void notify_mouse_clicked(bool mouse_pressed, int mask);
 
-    /// \brief
-    /// Advances the movie to the next frame. This is to take place after the
-    /// interval specified in the call to setInterval().
-    static bool advance_movie(Gui* gui);
-
     /// Resize the client area view and the window accordingly.
     //
     /// @param width  The desired width in pixels.
     /// @param height The desired height in pixels.
     void resize_view(int width, int height);
 
+
+    /// \brief
+    /// Advances the movie to the next frame. This is to take place after the
+    /// interval specified in the call to setInterval().
+    static bool advance_movie(Gui* gui);
+
+    /** @name Menu callbacks
+     *  These callbacks will be called when a menu item is clicked.
+     *  @{
+     */
+    static void menu_restart();
+    static void menu_quit();
+    static void menu_about();
+    static void menu_play();
+    static void menu_pause();
+    static void menu_stop();
+    static void menu_step_forward();
+    static void menu_step_backward();
+    static void menu_jump_forward();
+    static void menu_jump_backward();
+    static void menu_toggle_sound();
+    /// @}
+
 protected:
     /// Determines if playback should restart after the movie ends.
     bool            _loop;

Index: gui/riscos.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/riscos.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gui/riscos.cpp      28 Nov 2006 12:34:47 -0000      1.2
+++ gui/riscos.cpp      31 Jan 2007 15:24:13 -0000      1.3
@@ -17,7 +17,7 @@
 //
 //
 
-/* $Id: riscos.cpp,v 1.2 2006/11/28 12:34:47 nihilus Exp $ */
+/* $Id: riscos.cpp,v 1.3 2007/01/31 15:24:13 bjacques Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -191,7 +191,7 @@
 }
 
 void
-RiscosGui::set_invalidated_region(const rect& bounds)
+RiscosGui::setInvalidatedRegion(const rect& bounds)
 {
     // Note: Bounds coordinates are in TWIPS
 
@@ -277,7 +277,7 @@
           // TODO: Make this use the clipping rectangle (convert to TWIPS)
           rect bounds(-1e10f, -1e10f, 1e10f, 1e10f);
 #ifdef RENDERER_AGG
-          set_invalidated_region(bounds);
+          setInvalidatedRegion(bounds);
 #endif
           renderBuffer();
           error = xwimp_get_rectangle(&block.redraw, &more);

Index: gui/riscossup.h
===================================================================
RCS file: /sources/gnash/gnash/gui/riscossup.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gui/riscossup.h     28 Nov 2006 12:34:47 -0000      1.2
+++ gui/riscossup.h     31 Jan 2007 15:24:13 -0000      1.3
@@ -17,7 +17,7 @@
 //
 //
 
-/* $Id: riscossup.h,v 1.2 2006/11/28 12:34:47 nihilus Exp $ */
+/* $Id: riscossup.h,v 1.3 2007/01/31 15:24:13 bjacques Exp $ */
 
 #ifndef __ROSUP_H__
 #define __ROSUP_H__
@@ -55,7 +55,7 @@
     virtual void renderBuffer();
     virtual void setInterval(unsigned int interval);
     virtual void setTimeout(unsigned int timeout);
-    virtual void set_invalidated_region(const rect& bounds);
+    virtual void setInvalidatedRegion(const rect& bounds);
 
 
  private:

Index: gui/sdl.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/sdl.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- gui/sdl.cpp 22 Dec 2006 09:21:00 -0000      1.50
+++ gui/sdl.cpp 31 Jan 2007 15:24:13 -0000      1.51
@@ -17,7 +17,7 @@
 // 
 //
 
-/* $Id: sdl.cpp,v 1.50 2006/12/22 09:21:00 strk Exp $ */
+/* $Id: sdl.cpp,v 1.51 2007/01/31 15:24:13 bjacques Exp $ */
 
 // XXXbjacques: Screw up the indentation in this file, and you're dead. And by
 //              screw up, I mean not adhering the indentation used throughout
@@ -324,7 +324,7 @@
 void
 SDLGui::expose_event()
 {
-       // TODO: implement and use set_invalidated_region instead?
+       // TODO: implement and use setInvalidatedRegion instead?
        renderBuffer();
 }
 

Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- server/movie_root.h 18 Jan 2007 22:53:21 -0000      1.32
+++ server/movie_root.h 31 Jan 2007 15:24:13 -0000      1.33
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: movie_root.h,v 1.32 2007/01/18 22:53:21 strk Exp $ */
+/* $Id: movie_root.h,v 1.33 2007/01/31 15:24:13 bjacques Exp $ */
 
 /// \page events_handling Handling of user events
 ///
@@ -342,7 +342,7 @@
        ///
        void set_active_entity(character* ch);
        
-       void get_invalidated_bounds(rect* bounds, bool force);
+       DSOEXPORT void get_invalidated_bounds(rect* bounds, bool force);
 
        /// Return true if the mouse pointer is over an active entity
        bool isMouseOverActiveEntity() const;

Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2206
retrieving revision 1.2207
diff -u -b -r1.2206 -r1.2207
--- ChangeLog   31 Jan 2007 15:11:57 -0000      1.2206
+++ ChangeLog   31 Jan 2007 15:24:13 -0000      1.2207
@@ -1,3 +1,26 @@
+2007-01-31 Bastiaan Jacques <address@hidden>
+
+       * backend/render_handler_agg.cpp, gui/{gui.cpp, gtk.cpp}: Do not
+       subtract 1 from the rendering width and height (fixes bug #18904).
+       * gui/README: update to current status.
+       * gui: Rename Gui::set_invalidated_region to setInvalidatedRegion to
+       match naming style.
+       * gui/fltk{.cpp, sup.h, _glue_agg.cpp, _glue_agg.h}: Add a menu bar
+       to the FLTK window. Make the AGG glue inherit from fltk::Widget, so
+       it can be added to the FLTK window without interfering with menu
+       drawing. Since the same hasn't yet been done for the Cairo glue,
+       disable Cairo/FLTK for now. Account for the menu height when passing
+       the mouse position to the rest of Gnash. Delay initialisation of the
+       Glue until we are ready to add it to the FLTK window. Until we can
+       solve rendering issues, disable region based clipping for AGG.
+       Note that some FLTK menu items are not yet implemented.
+       * gui/gtk{.cpp, _glue_agg.cpp}: Remove the unused valid_coord method.
+       * gui/gui{.cpp, .h}: Declarations in the header, implementation in
+       the .cpp file. Shuffle the order of declarations so they are grouped
+       by type.
+       * server/movie_root.h: set_invalidated_region is used across libraries,
+       so visibility should be DSO_EXPORT.
+
 2007-01-31 Sandro Santilli <address@hidden>
 
        * server/button_character_instance.{h,cpp}:




reply via email to

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