[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash gui/gtk.cpp gui/gui.cpp gui/gui.h gui/kde...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash gui/gtk.cpp gui/gui.cpp gui/gui.h gui/kde... |
Date: |
Wed, 12 Sep 2007 10:57:06 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 07/09/12 10:57:06
Modified files:
gui : gtk.cpp gui.cpp gui.h kde.cpp
server : edit_text_character.cpp event_id.h
movie_root.cpp movie_root.h
server/asobj : Key.cpp Key.h
testsuite : MovieTester.cpp
Log message:
Revert utf8 changes
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtk.cpp?cvsroot=gnash&r1=1.108&r2=1.109
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.95&r2=1.96
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.h?cvsroot=gnash&r1=1.61&r2=1.62
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/kde.cpp?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.111&r2=1.112
http://cvs.savannah.gnu.org/viewcvs/gnash/server/event_id.h?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.86&r2=1.87
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.72&r2=1.73
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Key.cpp?cvsroot=gnash&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Key.h?cvsroot=gnash&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/MovieTester.cpp?cvsroot=gnash&r1=1.50&r2=1.51
Patches:
Index: gui/gtk.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gtk.cpp,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -b -r1.108 -r1.109
--- gui/gtk.cpp 12 Sep 2007 08:25:37 -0000 1.108
+++ gui/gtk.cpp 12 Sep 2007 10:57:05 -0000 1.109
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: gtk.cpp,v 1.108 2007/09/12 08:25:37 bwy Exp $ */
+/* $Id: gtk.cpp,v 1.109 2007/09/12 10:57:05 bwy Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1518,7 +1518,7 @@
int mod = gdk_to_gnash_modifier(event->state);
if (c != gnash::key::INVALID) {
- gui->notify_key_event(c, gdk_keyval_to_unicode(event->keyval), mod,
true);
+ gui->notify_key_event(c, mod, true);
}
return true;
@@ -1539,7 +1539,7 @@
int mod = gdk_to_gnash_modifier(event->state);
if (c != gnash::key::INVALID) {
- gui->notify_key_event(c, gdk_keyval_to_unicode(event->keyval), mod,
false);
+ gui->notify_key_event(c, mod, false);
}
return true;
Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- gui/gui.cpp 12 Sep 2007 08:25:37 -0000 1.95
+++ gui/gui.cpp 12 Sep 2007 10:57:05 -0000 1.96
@@ -312,11 +312,11 @@
}
void
-Gui::notify_key_event(gnash::key::code k, uint32_t utf_8, int modifier, bool
pressed)
+Gui::notify_key_event(gnash::key::code k, int modifier, bool pressed)
{
movie_root* m = get_current_root();
- if ( m->notify_key_event(k, utf_8, pressed) )
+ if ( m->notify_key_event(k, pressed) )
{
// any action triggered by the
// event required screen refresh
Index: gui/gui.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- gui/gui.h 12 Sep 2007 08:25:37 -0000 1.61
+++ gui/gui.h 12 Sep 2007 10:57:05 -0000 1.62
@@ -182,7 +182,7 @@
/// @param pressed Determines whether the key is being
/// pressed (true) or being released (false)
///
- void notify_key_event(gnash::key::code k, uint32_t utf_8, int modifier,
bool pressed);
+ void notify_key_event(gnash::key::code k, int modifier, bool pressed);
/// Resize the client area view and the window accordingly.
//
Index: gui/kde.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/kde.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- gui/kde.cpp 12 Sep 2007 09:55:59 -0000 1.21
+++ gui/kde.cpp 12 Sep 2007 10:57:05 -0000 1.22
@@ -246,7 +246,7 @@
{
gnash::key::code c = qtToGnashKey(event);
int mod = qtToGnashModifier(event->state());
- notify_key_event(c, 0, mod, down);
+ notify_key_event(c, mod, down);
}
void
Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -b -r1.111 -r1.112
--- server/edit_text_character.cpp 12 Sep 2007 08:25:37 -0000 1.111
+++ server/edit_text_character.cpp 12 Sep 2007 10:57:05 -0000 1.112
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: edit_text_character.cpp,v 1.111 2007/09/12 08:25:37 bwy Exp $ */
+/* $Id: edit_text_character.cpp,v 1.112 2007/09/12 10:57:05 bwy Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -586,15 +586,13 @@
case event_id::KEY_PRESS:
{
std::string s(_text);
- int c;
- std::string uc;
- c = id.m_key_code;
- uc = (char) id.m_unicode;
+ std::string c;
+ c = (char) id.m_key_code;
// may be _text is changed in ActionScript
m_cursor = imin(m_cursor, _text.size());
- switch (c)
+ switch (c[0])
{
case key::BACKSPACE:
if (m_cursor > 0)
@@ -642,7 +640,7 @@
default:
{
- s.insert(m_cursor, uc);
+ s.insert(m_cursor, c);
m_cursor++;
set_text_value(s.c_str());
break;
Index: server/event_id.h
===================================================================
RCS file: /sources/gnash/gnash/server/event_id.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/event_id.h 12 Sep 2007 08:25:38 -0000 1.11
+++ server/event_id.h 12 Sep 2007 10:57:05 -0000 1.12
@@ -95,15 +95,13 @@
id_code m_id;
unsigned char m_key_code;
- uint32_t m_unicode;
- event_id() : m_id(INVALID), m_key_code(key::INVALID), m_unicode(0) {}
+ event_id() : m_id(INVALID), m_key_code(key::INVALID) {}
- event_id(id_code id, key::code c = key::INVALID, uint32_t utf_8 = 0)
+ event_id(id_code id, key::code c = key::INVALID)
:
m_id(id),
- m_key_code((unsigned char) c),
- m_unicode ((uint32_t) utf_8)
+ m_key_code((unsigned char) c)
{
// you must supply a key code for KEY_PRESS event
//
Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -b -r1.86 -r1.87
--- server/movie_root.cpp 12 Sep 2007 08:25:38 -0000 1.86
+++ server/movie_root.cpp 12 Sep 2007 10:57:05 -0000 1.87
@@ -290,7 +290,7 @@
key_as_object *
-movie_root::notify_global_key(key::code k, uint32_t utf_8, bool down)
+movie_root::notify_global_key(key::code k, bool down)
{
VM& vm = VM::get();
if ( vm.getSWFVersion() < 5 )
@@ -302,7 +302,7 @@
boost::intrusive_ptr<key_as_object> keyobject = getKeyObject();
if ( keyobject )
{
- if (down) _keyobject->set_key_down(k, utf_8);
+ if (down) _keyobject->set_key_down(k);
else _keyobject->set_key_up(k);
}
else
@@ -314,17 +314,17 @@
}
bool
-movie_root::notify_key_event(key::code k, uint32_t utf_8, bool down)
+movie_root::notify_key_event(key::code k, bool down)
{
//GNASH_REPORT_FUNCTION;
//
// First of all, notify the _global.Key object about key event
//
- key_as_object * global_key = notify_global_key(k, utf_8, down);
+ key_as_object * global_key = notify_global_key(k, down);
// Notify character key listeners.
- notify_key_listeners(k, utf_8, down);
+ notify_key_listeners(k, down);
#ifndef NEW_KEY_LISTENER_LIST_DESIGN
// Notify both character and non-character Key listeners
@@ -794,7 +794,7 @@
#endif
}
-void movie_root::notify_key_listeners(key::code k, uint32_t utf_8, bool down)
+void movie_root::notify_key_listeners(key::code k, bool down)
{
//log_msg("Notifying " SIZET_FMT " keypress listeners",
_keyListeners.size());
@@ -824,7 +824,7 @@
}
}
// invoke onClipKeyPress handler
- ch->on_event(event_id(event_id::KEY_PRESS, k, utf_8));
+ ch->on_event(event_id(event_id::KEY_PRESS, k));
}
else
{
@@ -922,7 +922,7 @@
#endif
}
-void movie_root::notify_key_listeners(key::code k, uint32_t utf_8, bool down)
+void movie_root::notify_key_listeners(key::code k, bool down)
{
log_msg("Notifying " SIZET_FMT " keypress listeners",
m_key_listeners.size());
Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -b -r1.72 -r1.73
--- server/movie_root.h 12 Sep 2007 08:25:38 -0000 1.72
+++ server/movie_root.h 12 Sep 2007 10:57:05 -0000 1.73
@@ -15,7 +15,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.72 2007/09/12 08:25:38 bwy Exp $ */
+/* $Id: movie_root.h,v 1.73 2007/09/12 10:57:05 bwy Exp $ */
/// \page events_handling Handling of user events
///
@@ -332,7 +332,7 @@
/// by the event requires redraw, see \ref events_handling for
/// more info.
///
- bool notify_key_event(key::code k, uint32_t utf_8, bool down);
+ bool notify_key_event(key::code k, bool down);
/// \brief
/// Use this to retrieve the last state of the mouse, as set via
@@ -477,7 +477,7 @@
void * get_userdata() { return m_userdata; }
void set_userdata(void * ud ) { m_userdata = ud; }
- DSOEXPORT void notify_key_listeners(key::code k, uint32_t utf_8, bool
down);
+ DSOEXPORT void notify_key_listeners(key::code k, bool down);
#ifdef NEW_KEY_LISTENER_LIST_DESIGN
// Push a new key listener to the container if it is not there,
// otherwise, just register it.
@@ -556,7 +556,7 @@
void executeTimers();
/// Notify the global Key ActionScript object about a key status change
- key_as_object * notify_global_key(key::code k, uint32_t utf_8, bool down);
+ key_as_object * notify_global_key(key::code k, bool down);
/// Remove all listeners with a ref-count of 1
/// (only referenced as key listeners)
Index: server/asobj/Key.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Key.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- server/asobj/Key.cpp 12 Sep 2007 08:25:38 -0000 1.32
+++ server/asobj/Key.cpp 12 Sep 2007 10:57:05 -0000 1.33
@@ -72,14 +72,12 @@
}
void
-key_as_object::set_key_down(int code, uint32_t utf_8)
+key_as_object::set_key_down(int code)
{
if (code < 0 || code >= key::KEYCOUNT) return;
m_last_key_pressed = code;
- m_last_unicode = utf_8;
-
int byte_index = code >> 3;
int bit_index = code - (byte_index << 3);
int mask = 1 << bit_index;
@@ -200,11 +198,6 @@
return m_last_key_pressed;
}
-uint32_t
-key_as_object::get_last_unicode() const
-{
- return m_last_unicode;
-}
as_value
key_add_listener(const fn_call& fn)
@@ -250,13 +243,19 @@
{
boost::intrusive_ptr<key_as_object> ko =
ensureType<key_as_object>(fn.this_ptr);
- if (ko->get_last_key_pressed() < 0 ) return as_value();
+ int code = ko->get_last_key_pressed();
+ if (code < 0)
+ return as_value();
- int utf8 = ko->get_last_unicode();
+ // @@ Crude for now; just jamming the key code in a string, as a character.
+ // Need to apply shift/capslock/numlock, etc...
+ char buf[2];
+ buf[0] = (char) code;
+ buf[1] = 0;
- if (utf8 < 0 || utf8 > 255) return as_value();
+ log_unimpl("Key.getAscii partially implemented");
- return as_value(int(utf8));
+ return as_value(buf);
}
// Returns the keycode of the last key pressed.
Index: server/asobj/Key.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Key.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- server/asobj/Key.h 12 Sep 2007 08:25:38 -0000 1.25
+++ server/asobj/Key.h 12 Sep 2007 10:57:06 -0000 1.26
@@ -16,7 +16,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: Key.h,v 1.25 2007/09/12 08:25:38 bwy Exp $ */
+/* $Id: Key.h,v 1.26 2007/09/12 10:57:06 bwy Exp $ */
#ifndef __KEY_H__
#define __KEY_H__
@@ -63,7 +63,6 @@
#endif
int m_last_key_pressed;
- uint32_t m_last_unicode;
protected:
@@ -82,7 +81,7 @@
bool is_key_down(int code);
- void set_key_down(int code, uint32_t utf_8);
+ void set_key_down(int code);
void set_key_up(int code);
@@ -104,8 +103,6 @@
int get_last_key_pressed() const;
- uint32_t get_last_unicode() const;
-
};
void key_class_init(as_object& global);
Index: testsuite/MovieTester.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/MovieTester.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- testsuite/MovieTester.cpp 12 Sep 2007 09:21:03 -0000 1.50
+++ testsuite/MovieTester.cpp 12 Sep 2007 10:57:06 -0000 1.51
@@ -334,7 +334,7 @@
void
MovieTester::pressKey(key::code code)
{
- if ( _movie_root->notify_key_event(code, 0, true) )
+ if ( _movie_root->notify_key_event(code, true) )
{
render();
}
@@ -343,7 +343,7 @@
void
MovieTester::releaseKey(key::code code)
{
- if ( _movie_root->notify_key_event(code, 0, false) )
+ if ( _movie_root->notify_key_event(code, false) )
{
render();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash gui/gtk.cpp gui/gui.cpp gui/gui.h gui/kde...,
Benjamin Wolsey <=