[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog gui/gui.cpp gui/gui.h
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog gui/gui.cpp gui/gui.h |
Date: |
Tue, 30 Oct 2007 11:03:47 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/10/30 11:03:47
Modified files:
. : ChangeLog
gui : gui.cpp gui.h
Log message:
* gui/gui.{cpp,h}: Add support for mouse pointer movements
using the
keyboard arrow keys. Support is currently enabled but can be
switched off at compile time. If compile-time enabled support
can
still be toggled at runtime, currently defaults to enabled and
menu items to toggle it are missing.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4741&r2=1.4742
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.110&r2=1.111
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.h?cvsroot=gnash&r1=1.68&r2=1.69
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4741
retrieving revision 1.4742
diff -u -b -r1.4741 -r1.4742
--- ChangeLog 30 Oct 2007 09:38:33 -0000 1.4741
+++ ChangeLog 30 Oct 2007 11:03:46 -0000 1.4742
@@ -1,5 +1,13 @@
2007-10-30 Sandro Santilli <address@hidden>
+ * gui/gui.{cpp,h}: Add support for mouse pointer movements using the
+ keyboard arrow keys. Support is currently enabled but can be
+ switched off at compile time. If compile-time enabled support can
+ still be toggled at runtime, currently defaults to enabled and
+ menu items to toggle it are missing.
+
+2007-10-30 Sandro Santilli <address@hidden>
+
* server/dlist.cpp (display): don't render dynamic masks.
* testsuite/misc-ming.all/masks_testrunner.cpp: no more failures here.
Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -b -r1.110 -r1.111
--- gui/gui.cpp 22 Oct 2007 19:19:20 -0000 1.110
+++ gui/gui.cpp 30 Oct 2007 11:03:47 -0000 1.111
@@ -72,7 +72,9 @@
#endif
// Define this to have gnash print the mouse pointer coordinates
-// as the mouse moves
+// as the mouse moves. See also ENABLE_KEYBOARD_MOUSE_MOVEMENTS
+// to have more control over mouse pointer.
+//
//#define DEBUG_MOUSE_COORDINATES 1
@@ -102,6 +104,12 @@
,_stage(0)
,_stopped(false)
,_started(false)
+#ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS
+ ,_xpointer(0)
+ ,_ypointer(0)
+ ,_keyboardMouseMovements(true) // TODO: base default on gnashrc or always
false and provide menu item to toggle
+ ,_keyboardMouseMovementsStep(1)
+#endif
{
// GNASH_REPORT_FUNCTION;
}
@@ -131,6 +139,12 @@
,_stage(0)
,_stopped(false)
,_started(false)
+#ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS
+ ,_xpointer(0)
+ ,_ypointer(0)
+ ,_keyboardMouseMovements(true) // TODO: base default on gnashrc or always
false and provide menu item to toggle
+ ,_keyboardMouseMovementsStep(1)
+#endif
{
}
@@ -337,6 +351,12 @@
setCursor(CURSOR_NORMAL);
}
+#ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS
+ _xpointer = x;
+ _ypointer = y;
+#endif
+
+
}
void
@@ -376,9 +396,12 @@
movie_root* m = _stage;
/* Handle GUI shortcuts */
- if (pressed) {
- if (modifier & gnash::key::MOD_CONTROL) {
- switch(k) {
+ if (pressed)
+ {
+ if (modifier & gnash::key::MOD_CONTROL)
+ {
+ switch(k)
+ {
case gnash::key::r:
case gnash::key::R:
menu_restart();
@@ -406,6 +429,59 @@
default:
break;
}
+
+#ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS
+ if ( _keyboardMouseMovements )
+ {
+ int step = _keyboardMouseMovementsStep;
+ if (modifier & gnash::key::MOD_SHIFT) step*=5;
// x5 if SHIFT is pressed
+ switch(k)
+ {
+ case gnash::key::UP:
+ {
+ int newx = _xpointer;
+ int newy = _ypointer-step;
+ log_debug("(theoretically) From
%d,%d to %d,%d (step %d)", _xpointer, _ypointer, newx, newy, step);
+ if ( newy < 0 ) newy=0;
+ log_debug("From %d,%d to
%d,%d", _xpointer, _ypointer, newx, newy);
+ notify_mouse_moved(newx, newy);
+ break;
+ }
+ case gnash::key::DOWN:
+ {
+ int newx = _xpointer;
+ int newy = _ypointer+step;
+ log_debug("(theoretically) From
%d,%d to %d,%d (step %d)", _xpointer, _ypointer, newx, newy, step);
+ if ( newy >= _height ) newy =
_height-1;
+ log_debug("From %d,%d to
%d,%d", _xpointer, _ypointer, newx, newy);
+ notify_mouse_moved(newx, newy);
+ break;
+ }
+ case gnash::key::LEFT:
+ {
+ int newx = _xpointer-step;
+ int newy = _ypointer;
+ log_debug("(theoretically) From
%d,%d to %d,%d (step %d)", _xpointer, _ypointer, newx, newy, step);
+ if ( newx < 0 ) newx = 0;
+ log_debug("From %d,%d to
%d,%d", _xpointer, _ypointer, newx, newy);
+ notify_mouse_moved(newx, newy);
+ break;
+ }
+ case gnash::key::RIGHT:
+ {
+ int newy = _ypointer;
+ int newx = _xpointer+step;
+ log_debug("(theoretically) From
%d,%d to %d,%d (step %d)", _xpointer, _ypointer, newx, newy, step);
+ if ( newx >= _width ) newx =
_width-1;
+ log_debug("From %d,%d to
%d,%d", _xpointer, _ypointer, newx, newy);
+ notify_mouse_moved(newx, newy);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+#endif // ENABLE_KEYBOARD_MOUSE_MOVEMENTS
}
}
Index: gui/gui.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.h,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- gui/gui.h 28 Oct 2007 22:01:32 -0000 1.68
+++ gui/gui.h 30 Oct 2007 11:03:47 -0000 1.69
@@ -40,6 +40,9 @@
// This is an experimental feature, so it's off by default
//#define SKIP_RENDERING_IF_LATE
+/// Define this to support keyboard-based pointer movements
+#define ENABLE_KEYBOARD_MOUSE_MOVEMENTS 1
+
// Forward declarations
namespace gnash
{
@@ -392,6 +395,13 @@
/// True if the application didn't start yet
bool _started;
+#ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS
+ int _xpointer;
+ int _ypointer;
+ bool _keyboardMouseMovements;
+ int _keyboardMouseMovementsStep;
+#endif // ENABLE_KEYBOARD_MOUSE_MOVEMENTS
+
};
/// Named constructors
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog gui/gui.cpp gui/gui.h,
Sandro Santilli <=