gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/gnash.h server/movie.h s...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/gnash.h server/movie.h s...
Date: Thu, 19 Oct 2006 09:17:06 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/10/19 09:17:06

Modified files:
        .              : ChangeLog 
        server         : gnash.h movie.h movie_interface.h 
                         movie_root.cpp movie_root.h 
        gui            : gui.cpp 

Log message:
                * gui/gui.cpp: use return value of mouse move and click events
                  notifier to decide wheter to trigger redisplay.
                * server/gnash.h: added note in key event handler about the
                  need to conform to the event handling described in the new
                  doxygen page.
                * server/movie.h, server/movie_root.cpp, server/movie_root.h:
                  switched mouse movement and click event notification functions
                  to the new interface (note: they always return true currently)
                * server/movie_interface.h: added a doxygen page about events
                  handling, changed notify_mouse_moved() and 
notify_mouse_clicked()
                  to return a bool as to wheter redisplay is needed.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1310&r2=1.1311
http://cvs.savannah.gnu.org/viewcvs/gnash/server/gnash.h?cvsroot=gnash&r1=1.65&r2=1.66
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie.h?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_interface.h?cvsroot=gnash&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.36&r2=1.37

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1310
retrieving revision 1.1311
diff -u -b -r1.1310 -r1.1311
--- ChangeLog   19 Oct 2006 07:32:49 -0000      1.1310
+++ ChangeLog   19 Oct 2006 09:17:06 -0000      1.1311
@@ -1,3 +1,17 @@
+2006-10-19 Sandro Santilli <address@hidden>
+
+       * gui/gui.cpp: use return value of mouse move and click events
+         notifier to decide wheter to trigger redisplay.
+       * server/gnash.h: added note in key event handler about the
+         need to conform to the event handling described in the new
+         doxygen page.
+       * server/movie.h, server/movie_root.cpp, server/movie_root.h:
+         switched mouse movement and click event notification functions
+         to the new interface (note: they always return true currently)
+       * server/movie_interface.h: added a doxygen page about events
+         handling, changed notify_mouse_moved() and notify_mouse_clicked()
+         to return a bool as to wheter redisplay is needed.
+
 2006-10-18 Udo Giacomozzi <address@hidden>
 
        * gui/gui.h, gui/gui.cpp: Immediate redraw after mouse click

Index: server/gnash.h
===================================================================
RCS file: /sources/gnash/gnash/server/gnash.h,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -b -r1.65 -r1.66
--- server/gnash.h      17 Oct 2006 15:32:48 -0000      1.65
+++ server/gnash.h      19 Oct 2006 09:17:06 -0000      1.66
@@ -35,7 +35,7 @@
 // 
 //
 
-/* $Id: gnash.h,v 1.65 2006/10/17 15:32:48 strk Exp $ */
+/* $Id: gnash.h,v 1.66 2006/10/19 09:17:06 strk Exp $ */
 
 /// \mainpage
 ///
@@ -694,6 +694,7 @@
 
 /// Key events are global throughout gnash.
 /// @@ Maybe someday make these local to the movie_interface?
+/// See \ref events_handling for more info
 DSOEXPORT void notify_key_event(key::code k, bool down);
 
 

Index: server/movie.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- server/movie.h      14 Oct 2006 14:37:21 -0000      1.21
+++ server/movie.h      19 Oct 2006 09:17:06 -0000      1.22
@@ -232,16 +232,13 @@
        }
 
        // derived from movie_interface, see dox in movie_interface.h
-        virtual void notify_mouse_moved(int /*x*/, int /*y*/)
+        virtual bool notify_mouse_moved(int /*x*/, int /*y*/)
         {
 //         GNASH_REPORT_FUNCTION;
         }
 
-       /// \brief
-        /// The host app can use this to tell the movie when a
-        /// button on the user's mouse has been pressed or released.
-        /// Set mouse_pressed to true on click, false on release.
-        virtual void notify_mouse_clicked(bool /*mouse_pressed*/, int /*mask*/)
+       // derived from movie_interface, see dox in movie_interface.h
+        virtual bool notify_mouse_clicked(bool /*mouse_pressed*/, int /*mask*/)
         {
 //         GNASH_REPORT_FUNCTION;
         }

Index: server/movie_interface.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_interface.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- server/movie_interface.h    18 Oct 2006 18:16:01 -0000      1.13
+++ server/movie_interface.h    19 Oct 2006 09:17:06 -0000      1.14
@@ -35,7 +35,55 @@
 // 
 //
 
-/* $Id: movie_interface.h,v 1.13 2006/10/18 18:16:01 udog Exp $ */
+/* $Id: movie_interface.h,v 1.14 2006/10/19 09:17:06 strk Exp $ */
+
+
+/// \page events_handling Handling of user events
+///
+/// There are two kinds of events:
+/// - system generated
+/// - user generated
+///
+/// System generated events are those like load, data recive, unload,
+/// enter frame, etc.
+/// User generated events are mouse movements and clicks, keyboard activity.
+///
+/// Events can trigger actions execution, if "handlers" are specified for
+/// a specific event with ActionScript code.
+/// The actions triggered by user events are executed *immediately*, not
+/// at the next frame iteration. Nonetheless, since rendering of the stage
+/// usually happens at fixed rate (frame rate) you won't see the effects
+/// of actions execution until next iteration... unless...
+///
+/// Well, *some* events actions always trigger immediate redisplay, while
+/// some others require a call to a special function to do so.
+///
+/// The events actions that trigger immediate redisplay are Button actions.
+/// Colin Mook, in his "ActionScript - The Definitive Guide" sais:
+/// << Buttons naturally update between frames >>
+///
+/// Other events, in particular MovieClip events such as mouseDown, mouseUp,
+/// mouseMove, keyDown and keyUp don't by default trigger redisplay, unless
+/// the attached action code makes a call to the special function named
+/// 'updateAfterEvent()'.
+///
+/// For this purpose, user events notification functions in gnash core 
+/// library return a boolean value, which tells wheter any action triggered
+/// by the event requires immediate redisplay.
+///
+/// At the time of writing (2006-10-19) this is not implemented yet and
+/// the return code is always TRUE. We shall work on it :)
+///
+/// The events notification functions that currently support this interface
+/// are:
+///
+/// - bool movie_interface::notify_mouse_moved(int x, int y);
+/// - bool movie_interfacenotify_mouse_clicked(bool mouse_pressed, int mask);
+/// 
+/// Note that the notify_key_event() method is a global function, which should
+/// likely be moved somewhere else, and that has not been fixed yet to support
+/// the new interface.
+/// 
 
 #ifndef GNASH_MOVIE_INTERFACE_H
 #define GNASH_MOVIE_INTERFACE_H
@@ -107,16 +155,34 @@
        /// move/scale the movie...
        virtual void    set_display_viewport(int x0, int y0, int w, int h) = 0;
        
-       /// Input.
        /// \brief
         /// The host app can use this to tell the movie when
         /// user's mouse pointer has moved.
        //
        /// Coordinates are in pixels.
        ///
-        virtual void    notify_mouse_moved(int x, int y) = 0;
+       /// This function should return TRUE iff any action triggered
+       /// by the event requires redraw, see \ref events_handling for
+       /// more info.
+       ///
+        virtual bool    notify_mouse_moved(int x, int y) = 0;
+
+       /// \brief
+        /// The host app can use this to tell the movie when the
+        /// user clicked or released the mouse button.
+       //
+       /// @param mouse_pressed
+       ///     true if the mouse has been pressed, false if released
+       ///
+       /// @param mask
+       ///     ???
+       ///
+       /// This function should return TRUE iff any action triggered
+       /// by the event requires redraw, see \ref events_handling for
+       /// more info.
+       ///
+        virtual bool notify_mouse_clicked(bool mouse_pressed, int mask) = 0;
 
-        virtual void    notify_mouse_clicked(bool mouse_pressed, int mask) = 0;
        virtual void    notify_mouse_state(int x, int y, int buttons) = 0;
        
        /// Set an ActionScript variable within this movie.

Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- server/movie_root.cpp       18 Oct 2006 14:23:27 -0000      1.17
+++ server/movie_root.cpp       19 Oct 2006 09:17:06 -0000      1.18
@@ -119,15 +119,23 @@
     m_pixel_scale = fmax(scale_x, scale_y);
 }
 
-void
+bool
 movie_root::notify_mouse_moved(int x, int y)
 {
     m_mouse_x = x;
     m_mouse_y = y;
     fire_mouse_event();
+
+       // theoretically, we should return wheter
+       // any action triggered by this event requires
+       // display redraw, this is not implemented currently
+       // so we always return true (TODO).
+       // See page about events_handling (in movie_interface.h)
+       // for more information.
+       return true;
 }
 
-void
+bool
 movie_root::notify_mouse_clicked(bool mouse_pressed, int button_mask)
 {
     if (mouse_pressed) {
@@ -136,6 +144,14 @@
         m_mouse_buttons &= ~button_mask;
     }
     fire_mouse_event();
+
+       // theoretically, we should return wheter
+       // any action triggered by this event requires
+       // display redraw, this is not implemented currently
+       // so we always return true (TODO).
+       // See page about events_handling (in movie_interface.h)
+       // for more information.
+       return true;
 }
 
 void

Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- server/movie_root.h 17 Oct 2006 14:33:07 -0000      1.16
+++ server/movie_root.h 19 Oct 2006 09:17:06 -0000      1.17
@@ -35,7 +35,7 @@
 // 
 //
 
-/* $Id: movie_root.h,v 1.16 2006/10/17 14:33:07 strk Exp $ */
+/* $Id: movie_root.h,v 1.17 2006/10/19 09:17:06 strk Exp $ */
 
 #ifndef GNASH_MOVIE_ROOT_H
 #define GNASH_MOVIE_ROOT_H
@@ -116,12 +116,10 @@
        void set_display_viewport(int x0, int y0, int w, int h);
 
        // derived from movie_interface, see dox in movie_interface.h
-        void notify_mouse_moved(int x, int y);
+        bool notify_mouse_moved(int x, int y);
 
-       /// The host app can use this to tell the movie when a
-       /// button on the user's mouse has been pressed or released.
-        /// Set mouse_pressed to true on click, false on release.
-        void notify_mouse_clicked(bool mouse_pressed, int mask);
+       // derived from movie_interface, see dox in movie_interface.h
+        bool notify_mouse_clicked(bool mouse_pressed, int mask);
 
        /// The host app can use this to tell the movie where the
        /// user's mouse pointer is.

Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- gui/gui.cpp 19 Oct 2006 07:32:49 -0000      1.36
+++ gui/gui.cpp 19 Oct 2006 09:17:06 -0000      1.37
@@ -201,14 +201,13 @@
 Gui::notify_mouse_moved(int x, int y) 
 {
        movie_interface* m = get_current_root();
-       m->notify_mouse_moved(x, y);
 
-       // it might be worth having notify_mouse_moved
-       // return a variable telling wheter any event was
-       // triggered. If no event was triggered we can
-       // directly skip the display call.
-       //
+       if ( m->notify_mouse_moved(x, y) )
+       {
+               // any action triggered by the
+               // event required screen refresh
        display(m);
+       }
 }
 
 void
@@ -216,9 +215,13 @@
 {
     movie_interface* m = get_current_root();
 
-    m->notify_mouse_clicked(mouse_pressed, mask);
-    
+       if ( m->notify_mouse_clicked(mouse_pressed, mask) )
+       {
+               // any action triggered by the
+               // event required screen refresh
     display(m);
+       }
+    
 }
 
 bool




reply via email to

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