[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog backend/sound_handler_sdl.cpp e...
From: |
John Gilmore |
Subject: |
[Gnash-commit] gnash ChangeLog backend/sound_handler_sdl.cpp e... |
Date: |
Wed, 18 Apr 2007 09:35:42 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: John Gilmore <jgilmore> 07/04/18 09:35:42
Modified files:
. : ChangeLog
backend : sound_handler_sdl.cpp
extensions/mysql: mysql_db.cpp
gui : Player.cpp gnash.cpp gui.cpp
plugin/klash : klash.cpp
plugin/win32 : plugin.cpp
server : PropertyList.cpp StreamProvider.cpp array.cpp
as_environment.cpp as_function.cpp
as_object.cpp as_value.cpp
button_character_instance.cpp character.cpp
dlist.cpp edit_text_character.cpp
fill_style.cpp font.cpp generic_character.cpp
impl.cpp
Log message:
* Internationalization, phase 2.
* These modules have had their printed messages passed through
_(...). Those messages have also been cleaned up, thusly:
* Stray \n's removed
* Exclamation points and periods removed at ends of messages
* Typos corrected, and English language wording adjusted.
* Misplaced UPPER CASE shouting removed.
* Many complaints about unknown types, values, etc, now include
the offending value, for ease of remote diagnosis.
* C++-style << printouts converted to log_xxx calls.
* Direct accesses to dbglogfile converted to log_xxx calls.
These changes should also make the messages easier to translate.
* Commented-out messages were also cleaned up as above.
* Many modules have also had log_warning calls changed to
log_error, log_aserror, log_swferror, or log_unimp, according to
the documentation checked in earlier by strk and gnu.
IF_VERBOSE_xxx macros were inserted around some calls that
lacked them.
* Header comments (at the top of the file) added or adjusted, to
describe each file in its initial line, and to correct whitespace
in the copyright notices.
* The list of files affected by the above changes:
backend/sound_handler_sdl.cpp
extensions/mysql/mysql_db.cpp
gui/Player.cpp
gui/gnash.cpp
gui/gui.cpp
plugin/klash/klash.cpp
plugin/win32/plugin.cpp
server/PropertyList.cpp
server/StreamProvider.cpp
server/array.cpp
server/as_environment.cpp
server/as_function.cpp
server/as_object.cpp
server/as_value.cpp
server/button_character_instance.cpp
server/character.cpp
server/dlist.cpp
server/edit_text_character.cpp
server/fill_style.cpp
server/font.cpp
server/generic_character.cpp
server/impl.cpp
* 2007 copyright notices were inserted in:
backend/sound_handler_sdl.cpp
extensions/mysql/mysql_db.cpp
gui/gnash.cpp
plugin/klash/klash.cpp
plugin/win32/plugin.cpp
server/generic_character.cpp
* New 2006, 2007 Free Software Foundation copyrights applied (to
formerly public domain code):
server/font.cpp
* backend/sound_handler_sdl.cpp: Move stray FORMAT_VORBIS comment.
* gui/gui.cpp: Commented out "Resize request when no movie" error
that appears every time gnash is run.
* plugins/klash/klash.cpp: Translated pop-up menu items, about-box,
and updated copyright notice printed by --version and --help.
* server/array.cpp (as_array_object::index_requested): Avoid
c_str accessor when converting string to number.
* server/dlist.{h,cpp}: Change API of DisplayList::dump debug
function, so it can use log_xxx functions.
I'm sure that I've missed some messages that ought to get
translated (with _(...)). Those will be fixed over time.
All new messages should be created with _(...) so they can
be translated.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2904&r2=1.2905
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/sound_handler_sdl.cpp?cvsroot=gnash&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/gnash/extensions/mysql/mysql_db.cpp?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.cpp?cvsroot=gnash&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gnash.cpp?cvsroot=gnash&r1=1.68&r2=1.69
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.72&r2=1.73
http://cvs.savannah.gnu.org/viewcvs/gnash/plugin/klash/klash.cpp?cvsroot=gnash&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/gnash/plugin/win32/plugin.cpp?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/PropertyList.cpp?cvsroot=gnash&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/gnash/server/StreamProvider.cpp?cvsroot=gnash&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/gnash/server/array.cpp?cvsroot=gnash&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.cpp?cvsroot=gnash&r1=1.69&r2=1.70
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_function.cpp?cvsroot=gnash&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_object.cpp?cvsroot=gnash&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_value.cpp?cvsroot=gnash&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/gnash/server/button_character_instance.cpp?cvsroot=gnash&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.58&r2=1.59
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.56&r2=1.57
http://cvs.savannah.gnu.org/viewcvs/gnash/server/fill_style.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/font.cpp?cvsroot=gnash&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/gnash/server/generic_character.cpp?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.cpp?cvsroot=gnash&r1=1.103&r2=1.104
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2904
retrieving revision 1.2905
diff -u -b -r1.2904 -r1.2905
--- ChangeLog 18 Apr 2007 08:43:33 -0000 1.2904
+++ ChangeLog 18 Apr 2007 09:35:41 -0000 1.2905
@@ -1,3 +1,79 @@
+2007-04-18 John Gilmore <address@hidden>
+
+ * Internationalization, phase 2.
+
+ * These modules have had their printed messages passed through
+ _(...). Those messages have also been cleaned up, thusly:
+ * Stray \n's removed
+ * Exclamation points and periods removed at ends of messages
+ * Typos corrected, and English language wording adjusted.
+ * Misplaced UPPER CASE shouting removed.
+ * Many complaints about unknown types, values, etc, now include
+ the offending value, for ease of remote diagnosis.
+ * C++-style << printouts converted to log_xxx calls.
+ * Direct accesses to dbglogfile converted to log_xxx calls.
+ These changes should also make the messages easier to translate.
+ * Commented-out messages were also cleaned up as above.
+ * Many modules have also had log_warning calls changed to
+ log_error, log_aserror, log_swferror, or log_unimp, according to
+ the documentation checked in earlier by strk and gnu.
+ IF_VERBOSE_xxx macros were inserted around some calls that
+ lacked them.
+ * Header comments (at the top of the file) added or adjusted, to
+ describe each file in its initial line, and to correct whitespace
+ in the copyright notices.
+
+ * The list of files affected by the above changes:
+ backend/sound_handler_sdl.cpp
+ extensions/mysql/mysql_db.cpp
+ gui/Player.cpp
+ gui/gnash.cpp
+ gui/gui.cpp
+ plugin/klash/klash.cpp
+ plugin/win32/plugin.cpp
+ server/PropertyList.cpp
+ server/StreamProvider.cpp
+ server/array.cpp
+ server/as_environment.cpp
+ server/as_function.cpp
+ server/as_object.cpp
+ server/as_value.cpp
+ server/button_character_instance.cpp
+ server/character.cpp
+ server/dlist.cpp
+ server/edit_text_character.cpp
+ server/fill_style.cpp
+ server/font.cpp
+ server/generic_character.cpp
+ server/impl.cpp
+
+ * 2007 copyright notices were inserted in:
+ backend/sound_handler_sdl.cpp
+ extensions/mysql/mysql_db.cpp
+ gui/gnash.cpp
+ plugin/klash/klash.cpp
+ plugin/win32/plugin.cpp
+ server/generic_character.cpp
+
+ * New 2006, 2007 Free Software Foundation copyrights applied (to
+ formerly public domain code):
+ server/font.cpp
+
+ * backend/sound_handler_sdl.cpp: Move stray FORMAT_VORBIS comment.
+ * gui/gui.cpp: Commented out "Resize request when no movie" error
+ that appears every time gnash is run.
+ * plugins/klash/klash.cpp: Translated pop-up menu items, about-box,
+ and updated copyright notice printed by --version and --help.
+ * server/array.cpp (as_array_object::index_requested): Avoid
+ c_str accessor when converting string to number.
+ * server/dlist.{h,cpp}: Change API of DisplayList::dump debug
+ function, so it can use log_xxx functions.
+
+ I'm sure that I've missed some messages that ought to get
+ translated (with _(...)). Those will be fixed over time.
+ All new messages should be created with _(...) so they can
+ be translated.
+
2007-04-18 Sandro Santilli <address@hidden>
* testsuite/misc-ming.all/loadMovieTest.c: add
Index: backend/sound_handler_sdl.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/sound_handler_sdl.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- backend/sound_handler_sdl.cpp 13 Apr 2007 07:35:55 -0000 1.50
+++ backend/sound_handler_sdl.cpp 18 Apr 2007 09:35:41 -0000 1.51
@@ -1,4 +1,4 @@
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
// Based on sound_handler_sdl.cpp by Thatcher Ulrich http://tulrich.com 2003
// which has been donated to the Public Domain.
-// $Id: sound_handler_sdl.cpp,v 1.50 2007/04/13 07:35:55 bjacques Exp $
+// $Id: sound_handler_sdl.cpp,v 1.51 2007/04/18 09:35:41 jgilmore Exp $
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -73,7 +73,7 @@
sound_data *sounddata = new sound_data;
if (!sounddata) {
- gnash::log_error("could not allocate memory for sounddata !");
+ gnash::log_error(_("could not allocate memory for sound data"));
return -1;
}
@@ -96,7 +96,7 @@
if (data_bytes > 0) {
convert_raw_data(&adjusted_data, &adjusted_size, data,
sample_count, 1, sample_rate, stereo);
if (!adjusted_data) {
- gnash::log_error("Some kind of error with raw
sound data.");
+ gnash::log_error(_("Some kind of error occurred
with raw sound data"));
return -1;
}
sounddata->data_size = adjusted_size;
@@ -109,7 +109,7 @@
if (data_bytes > 0) {
convert_raw_data(&adjusted_data, &adjusted_size, data,
sample_count, 2, sample_rate, stereo);
if (!adjusted_data) {
- gnash::log_error("Some kind of error with adpcm
sound data.");
+ gnash::log_error(_("Some kind of error occurred
with adpcm sound data"));
return -1;
}
sounddata->data_size = adjusted_size;
@@ -118,24 +118,24 @@
break;
case FORMAT_MP3:
- //case FORMAT_VORBIS:
#ifndef USE_FFMPEG
#ifndef USE_MAD
- gnash::log_warning("gnash has not been compiled to handle mp3
audio.");
+ gnash::log_error(_("gnash has not been compiled to handle mp3
audio"));
return -1;
#endif
#endif
sounddata->data = new Uint8[data_bytes];
if (!sounddata->data) {
- gnash::log_error("could not allocate space for data in
soundhandler.");
+ gnash::log_error(_("could not allocate space for data
in sound handler"));
return -1;
}
memcpy(sounddata->data, data, data_bytes);
break;
+ //case FORMAT_VORBIS:
default:
// Unhandled format.
- gnash::log_error("unknown format sound requested; gnash does
not handle it.");
+ gnash::log_error(_("unknown sound format %d requested; gnash
does not handle it"), (int)format);
return -1; // Unhandled format, set to NULL.
}
@@ -167,7 +167,7 @@
convert_raw_data(&adjusted_data, &adjusted_size, data,
sample_count, 2, sounddata->sample_rate, sounddata->stereo);
if (!adjusted_data || adjusted_size < 1) {
- gnash::log_error("Some kind of error with resampling
sound data.");
+ gnash::log_error(_("Some kind of error with resampling
sound data"));
return -1;
}
adjusted_data = static_cast<int16_t*>(data);
@@ -212,7 +212,7 @@
}
} else {
- gnash::log_error("Behavior for this audio codec is unknown.
Please send this SWF to the developers!");
+ gnash::log_error(_("Behavior for this audio codec %d is
unknown. Please send this SWF to the developers"), (int)(sounddata->format));
}
return start_size;
@@ -273,7 +273,7 @@
sound->parser = av_parser_init(CODEC_ID_MP3);
if (!sound->codec) {
- gnash::log_error("Your FFMPEG can't decode MP3?!");
+ gnash::log_error(_("Your FFMPEG can't decode MP3?!"));
return;
}
@@ -301,7 +301,7 @@
if (!soundOpened) {
if (SDL_OpenAudio(&audioSpec, NULL) < 0 ) {
- gnash::log_error("Unable to START SOUND: %s.",
SDL_GetError());
+ gnash::log_error(_("Unable to start SDL sound: %s"),
SDL_GetError());
return;
}
soundOpened = true;
@@ -493,7 +493,7 @@
if (!soundOpened) {
if (SDL_OpenAudio(&audioSpec, NULL) < 0 ) {
- gnash::log_error("Unable to START SOUND: %s.",
SDL_GetError());
+ gnash::log_error(_("Unable to start aux SDL sound:
%s"), SDL_GetError());
return;
}
soundOpened = true;
@@ -726,7 +726,7 @@
{
if ( buffer_length_in < 0 )
{
- gnash::log_error("Negative buffer length in sdl_audio_callback
(%d)", buffer_length_in);
+ gnash::log_error(_("Negative buffer length in
sdl_audio_callback (%d)"), buffer_length_in);
return;
}
@@ -843,7 +843,7 @@
#endif
if (bytes_decoded < 0 || tmp <
0 || outsize < 0) {
- gnash::log_error("Error
while decoding MP3-stream. Upgrading ffmpeg/libavcodec might fix this issue.");
+
gnash::log_error(_("Error while decoding MP3-stream. Upgrading
ffmpeg/libavcodec might fix this issue."));
// Setting data
position to data size will get the sound removed
// from the active
sound list later on.
sound->position =
sound->data_size;
@@ -873,7 +873,7 @@
// Error handling is done by
relooping (max. 8 times) and just hooping that it will work...
if (loops > 8) break;
if (ret == -1 &&
sound->stream.error != MAD_ERROR_BUFLEN &&
MAD_RECOVERABLE(sound->stream.error)) {
-
gnash::log_warning("Recoverable error while decoding MP3-stream, MAD error:
%s", mad_stream_errorstr (&sound->stream));
+
gnash::log_error(_("Recoverable error while decoding MP3-stream, MAD error:
%s"), mad_stream_errorstr (&sound->stream));
continue;
}
@@ -881,7 +881,7 @@
}
if (ret == -1 && sound->stream.error !=
MAD_ERROR_BUFLEN) {
- gnash::log_error("Unrecoverable
error while decoding MP3-stream, MAD error: %s", mad_stream_errorstr
(&sound->stream));
+
gnash::log_error(_("Unrecoverable error while decoding MP3-stream, MAD error:
%s"), mad_stream_errorstr (&sound->stream));
sound->position =
sound->data_size;
continue;
} else if (ret == -1 &&
sound->stream.error == MAD_ERROR_BUFLEN) {
@@ -938,7 +938,7 @@
// Hopefully this wont happen
if (!adjusted_data) {
-
gnash::log_warning("Error in sound sample convertion");
+
gnash::log_error(_("Error in sound sample conversion"));
continue;
}
Index: extensions/mysql/mysql_db.cpp
===================================================================
RCS file: /sources/gnash/gnash/extensions/mysql/mysql_db.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- extensions/mysql/mysql_db.cpp 22 Mar 2007 22:37:45 -0000 1.7
+++ extensions/mysql/mysql_db.cpp 18 Apr 2007 09:35:41 -0000 1.8
@@ -1,5 +1,6 @@
+// mysql_db.cpp: MySQL database interface ActionScript objects, for Gnash.
//
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -10,6 +11,7 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
@@ -181,12 +183,12 @@
disconnect();
if ((_db = mysql_init(NULL)) == NULL ) {
- log_error("Couldn't initialize Database!");
+ log_error(_("Couldn't initialize database"));
return false;
}
if (mysql_real_connect(_db, host, user, passwd, dbname, 0, NULL, 0) ==
NULL) {
- log_error("Couldn't connect to Database!");
+ log_error(_("Couldn't connect to database"));
return false;
}
@@ -212,16 +214,15 @@
case CR_SERVER_LOST:
case CR_COMMANDS_OUT_OF_SYNC:
case CR_SERVER_GONE_ERROR:
- dbglogfile << "MySQL connection error: " << mysql_error(_db) << endl;
+ log_error (_("MySQL connection error: %s"), mysql_error(_db));
// Try to reconnect to the database
// closeDB();
// openDB();
break;
case -1:
case CR_UNKNOWN_ERROR:
- dbglogfile << "MySQL error on query for:\n\t " <<
- mysql_error(_db) << endl;
- dbglogfile << "Query was: " << sql << endl;
+ log_error (_("MySQL error on query for:\n\t%s\nQuery was: %s"),
+ mysql_error(_db), sql);
return false;
break;
default:
@@ -240,16 +241,15 @@
case CR_SERVER_LOST:
case CR_COMMANDS_OUT_OF_SYNC:
case CR_SERVER_GONE_ERROR:
- dbglogfile << "MySQL connection error: " << mysql_error(_db) << endl;
+ log_error(_("MySQL connection error: %s", mysql_error(_db));
// Try to reconnect to the database
// closeDB();
// openDB();
break;
case -1:
case CR_UNKNOWN_ERROR:
- dbglogfile << "MySQL error on query for:\n\t " <<
- mysql_error(_db) << endl;
- dbglogfile << "Query was: " << sql << endl;
+ log_error (_("MySQL error on query for:\n\t%s\nQuery was: %s"),
+ mysql_error(_db), sql);
// return false;
break;
// default:
@@ -262,7 +262,7 @@
#if 0
for (size_t i=0; i<mysql_num_fields(_result); i++) {
MYSQL_FIELD *fields = mysql_fetch_fields(_result);
- log_msg("Field name is: %s: ", fields->name);
+ log_msg(_("Field name is: %s: "), fields->name);
}
#endif
Index: gui/Player.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- gui/Player.cpp 28 Mar 2007 08:40:44 -0000 1.45
+++ gui/Player.cpp 18 Apr 2007 09:35:41 -0000 1.46
@@ -1,3 +1,4 @@
+// Player.cpp: Top level flash player, for gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -10,12 +11,10 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-//
//
#ifdef HAVE_CONFIG_H
@@ -185,7 +184,7 @@
#elif defined(SOUND_GST)
_sound_handler.reset( gnash::create_sound_handler_gst() );
#else
- log_error("Sound requested but no sound support compiled in");
+ log_error(_("Sound requested but no sound support compiled in"));
return;
#endif
@@ -326,7 +325,7 @@
}
// too much noise...
- //log_warning("Unused parameter %s = %s",
+ //log_warning(_("Unused parameter %s = %s"),
// it->first.c_str(), it->second.c_str());
}
@@ -362,6 +361,5 @@
Player::fs_callback(gnash::sprite_instance* movie, const char* command, const
char* args)
// For handling notification callbacks from ActionScript.
{
- log_msg("fs_callback(%p): %s %s'", (void*)movie, command, args);
+ log_msg(_("fs_callback(%p): %s %s"), (void*)movie, command, args);
}
-
Index: gui/gnash.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gnash.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- gui/gnash.cpp 6 Apr 2007 07:58:15 -0000 1.68
+++ gui/gnash.cpp 18 Apr 2007 09:35:41 -0000 1.69
@@ -1,5 +1,6 @@
+// gnash.cpp: Main routine for top-level flash player, for Gnash.
//
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -10,17 +11,18 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
+//
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "Player.h"
-#include "log.h" // for dbglogfile (I hate this)
+#include "log.h"
#include "rc.h" // for use of rcfile
#include "debugger.h"
@@ -67,35 +69,43 @@
static void
usage()
{
- printf(
+ printf("%s%s%s%s%s%s%s%s", _(
"usage: gnash [options] movie_file.swf\n"
"\n"
"Plays a SWF (Shockwave Flash) movie\n"
"options:\n"
- "\n"
+ "\n"), _(
" -h, --help Print this info.\n"
" -s <factor> Scale the movie up/down by the specified factor\n"
" -c Produce a core file instead of letting SDL trap it\n"
" -d num Number of milliseconds to delay in main loop\n"
" -v Be verbose; i.e. print log messages to stdout\n"
+ ),
#if VERBOSE_ACTION
- " -va Be verbose about movie Actions\n"
+ _(" -va Be verbose about movie Actions\n"),
+#else
+ "",
#endif
#if VERBOSE_PARSE
- " -vp Be verbose about parsing the movie\n"
+ _(" -vp Be verbose about parsing the movie\n"),
+#else
+ "",
#endif
+ _(
" -m <bias> Specify the texture LOD bias (float, default is -1.0)\n"
" -x <ID> X11 Window ID for display\n"
" -w Produce the disk based debug log\n"
" -j <width> Set window width\n"
" -k <height> Set window height\n"
" -1 Play once; exit when/if movie reaches the last frame\n"
+ ), _(
" -g Turn on the Flash debugger\n"
" -r <0|1|2|3>\n"
" 0 disables both rendering & sound (good for batch
tests)\n"
" 1 enables rendering & disables sound\n"
" 2 enables sound & disables rendering\n"
" 3 enables both rendering & 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"
" -u <url> Set \"real\" url of the movie\n"
@@ -104,6 +114,7 @@
" (used to resolve relative urls, defaults to movie url)\n"
" -P <param> Set parameter (ie. \"FlashVars=A=1&b=2\")\n"
" --version Print gnash's version number and exit\n"
+ ), _(
"\n"
"keys:\n"
" CTRL-Q, CTRL-W, ESC Quit/Exit\n"
@@ -111,35 +122,35 @@
" CTRL-R Restart the movie\n"
" CTRL-[ or kp- Step back one frame\n"
" CTRL-] or kp+ Step forward one frame\n"
+ " CTRL-B Toggle background color\n"
#if 0
" CTRL-A Toggle antialiasing (doesn't work)\n"
" CTRL-T Debug. Test the set_variable() function\n"
" CTRL-G Debug. Test the get_variable() function\n"
" CTRL-M Debug. Test the call_method() function\n"
#endif
- " CTRL-B Toggle background color\n"
- );
+ ));
}
static void version_and_copyright()
{
- printf (
+ printf (_(
"Gnash " VERSION "\n"
"Copyright (C) 2005-2007 Free Software Foundation, Inc.\n"
"Gnash comes with NO WARRANTY, to the extent permitted by law.\n"
"You may redistribute copies of Gnash under the terms of the GNU General\n"
"Public License. For more information, see the file named COPYING.\n"
- );
+ ));
}
+
static void build_options()
{
- cout << "Build options " << VERSION << endl
- << " Target: " << TARGET_CONFIG << endl
- << " Renderer: " << RENDERER_CONFIG
- << " GUI: " << GUI_CONFIG
- << " Media handler: " << MEDIA_CONFIG
- << endl;
+ printf (_("Build options %s\n"
+ " Target: %s\n"
+ " Renderer: %s GUI: %s Media handler: %s\n"),
+ VERSION, TARGET_CONFIG, RENDERER_CONFIG, GUI_CONFIG,
+ MEDIA_CONFIG);
}
@@ -176,24 +187,24 @@
exit(0);
case 'v':
dbglogfile.setVerbosity();
- dbglogfile << "Verbose output turned on" << std::endl;
+ log_msg (_("Verbose output turned on"));
break;
case 'w':
dbglogfile.setWriteDisk(true);
- dbglogfile << "Logging to disk enabled." << std::endl;
+ log_msg (_("Logging to disk enabled"));
break;
case 'a':
#if VERBOSE_ACTION
dbglogfile.setActionDump(true); //gnash::set_verbose_action(true);
#else
- dbglogfile << "Verbose actions disabled at compile time" <<
std::endl;
+ log_error (_("No verbose actions; disabled at compile time"));
#endif
break;
case 'p':
#if VERBOSE_PARSE
dbglogfile.setParserDump(true); // gnash::set_verbose_parse(true);
#else
- dbglogfile << "Verbose parsing disabled at compile time" <<
std::endl;
+ log_error (_("No verbose parsing; disabled at compile time"));
#endif
break;
case 's':
@@ -204,32 +215,32 @@
break;
case 'u':
url = optarg;
- dbglogfile << "Setting root URL to: " << url << std::endl;
+ log_msg (_("Setting root URL to %s"), url);
break;
case 'U':
{
const char* baseurl = optarg;
player.setBaseUrl(baseurl);
- dbglogfile << "Setting base URL to: " << baseurl << std::endl;
+ log_msg (_("Setting base URL to %s"), baseurl);
break;
}
case 'j':
player.setWidth ( strtol(optarg, NULL, 0) );
- dbglogfile << "Setting width to: " << player.getWidth() <<
std::endl;
+ log_msg (_("Setting width to %d"), player.getWidth());
break;
case 'g':
#ifdef USE_DEBUGGER
- dbglogfile << "Setting debugger ON" << std::endl;
+ log_msg (_("Setting debugger ON"));
debugger.enabled(true);
// debugger.startServer(&debugger);
debugger.console();
#else
- dbglogfile << "WARNING: The debugger has been disabled at
configuration time" << std::endl;
+ log_error (_("No debugger; disabled at compile time"));
#endif
break;
case 'k':
player.setHeight ( strtol(optarg, NULL, 0) );
- dbglogfile << "Setting height to: " << player.getHeight() <<
std::endl;
+ log_msg (_("Setting height to %d"), player.getHeight());
break;
case 'x':
called_by_plugin=true;
@@ -265,8 +276,8 @@
player.setDoSound(true);
break;
default:
- cerr << "-r must be followed by 0, 1, 2 or 3 (" <<
- render_arg << ") is invalid" << std::endl;
+ log_error (_("-r must be followed by 0, 1, 2 or 3 "
+ "(%ld is invalid)"), render_arg);
break;
}
break;
@@ -300,7 +311,7 @@
}
if ( ! specified_rendering_flag ) {
- gnash::log_msg("no rendering flags specified, using rcfile");
+ log_msg (_("No rendering flags specified, using rcfile"));
if ( called_by_plugin ) {
player.setDoSound( rcfile.usePluginSound() );
} else {
@@ -314,7 +325,8 @@
#if 0 // Options setting variables should use the getopt style!
// Some options set variables, like ip=127.0.0.1
if (argc > 2 && strchr(argv[optind], '=')) {
- dbglogfile << "Got variable option on command line!" << std::endl;
+ log_error (_("Got variable option (%s) on command line"),
+ argv[optind]);
} else {
#endif
infile = argv[optind];
@@ -351,4 +363,3 @@
return player.run(argc, argv, infile, url);
}
-
Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -b -r1.72 -r1.73
--- gui/gui.cpp 13 Apr 2007 09:15:54 -0000 1.72
+++ gui/gui.cpp 18 Apr 2007 09:35:41 -0000 1.73
@@ -1,3 +1,4 @@
+// gui.cpp: Top level GUI for flash player, for Gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -10,11 +11,10 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-//
//
#ifdef HAVE_CONFIG_H
@@ -136,8 +136,8 @@
}
else
{
- log_warning("Resize request received while there's still"
- " no movie loaded, can't correctly set movie scale");
+ //log_msg(_("Resize request received while there's still"
+ // " no movie loaded, can't correctly set movie scale"));
}
// trigger redraw
@@ -147,8 +147,7 @@
_width = width;
_height = height;
_validbounds.setTo(0, 0, _width, _height);
- //log_msg("new size (in twips) is: %dx%d", _width*20, _height*20);
-
+ //log_msg(_("new size (in twips) is: %dx%d"), _width*20, _height*20);
}
void
@@ -246,7 +245,7 @@
{
movie_root* m = get_current_root();
- //log_msg("mouse @ %d,%d", x, y);
+ //log_msg(_("mouse @ %d,%d"), x, y);
if ( m->notify_mouse_moved(x, y) )
{
// any action triggered by the
@@ -458,7 +457,7 @@
m->get_movie_definition()->ensure_frame_loaded(tot_frames);
m->goto_frame(cur_frame+1);
m->set_play_state(gnash::sprite_instance::PLAY);
- log_msg("Frame %d", m->get_current_frame());
+ log_msg(_("Frame %d"), m->get_current_frame());
#endif
gui->display(m);
Index: plugin/klash/klash.cpp
===================================================================
RCS file: /sources/gnash/gnash/plugin/klash/klash.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- plugin/klash/klash.cpp 23 Jan 2007 22:50:32 -0000 1.26
+++ plugin/klash/klash.cpp 18 Apr 2007 09:35:41 -0000 1.27
@@ -1,5 +1,6 @@
+// klash.cpp: KDE flash player plugin, for Gnash.
//
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -10,11 +11,13 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
-/* $Id: klash.cpp,v 1.26 2007/01/23 22:50:32 martinwguy Exp $ */
+/* $Id: klash.cpp,v 1.27 2007/04/18 09:35:41 jgilmore Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -95,15 +98,15 @@
create (embed);
qwidget = this;
qmenu = new QPopupMenu(this);
- qmenu->insertItem("Play Movie", this, SLOT(menuitem_play_callback()));
- qmenu->insertItem("Pause Movie", this,
SLOT(menuitem_pause_callback()));
- qmenu->insertItem("Stop Movie", this, SLOT(menuitem_stop_callback()));
- qmenu->insertItem("Restart Movie", this,
SLOT(menuitem_restart_callback()));
- qmenu->insertItem("Step Forward", this,
SLOT(menuitem_step_forward_callback()));
- qmenu->insertItem("Step Backward", this, SLOT(
menuitem_step_backward_callback()));
- qmenu->insertItem("Jump Forward", this,
SLOT(menuitem_jump_forward_callback()));
- qmenu->insertItem("Jump Backward", this,
SLOT(menuitem_jump_backward_callback()));
- qmenu->insertItem("Quit Gnash", this, SLOT(menuitem_quit_callback()));
+ qmenu->insertItem(_("Play Movie"), this,
SLOT(menuitem_play_callback()));
+ qmenu->insertItem(_("Pause Movie"), this,
SLOT(menuitem_pause_callback()));
+ qmenu->insertItem(_("Stop Movie"), this,
SLOT(menuitem_stop_callback()));
+ qmenu->insertItem(_("Restart Movie"), this,
SLOT(menuitem_restart_callback()));
+ qmenu->insertItem(_("Step Forward"), this,
SLOT(menuitem_step_forward_callback()));
+ qmenu->insertItem(_("Step Backward"), this, SLOT(
menuitem_step_backward_callback()));
+ qmenu->insertItem(_("Jump Forward"), this,
SLOT(menuitem_jump_forward_callback()));
+ qmenu->insertItem(_("Jump Backward"), this,
SLOT(menuitem_jump_backward_callback()));
+ qmenu->insertItem(_("Quit Gnash"), this,
SLOT(menuitem_quit_callback()));
// qmenu->insertItem("&About", this, SLOT(about()), CTRL+Key_H);
}
@@ -141,8 +144,8 @@
void EmbedWidget::about()
{
- QMessageBox::about( this, "Klash",
- "The Gnash Flash player for KDE.\n");
+ QMessageBox::about( this, _("Klash"),
+ _("The Gnash Flash player for KDE.\n"));
}
void
@@ -303,7 +306,7 @@
if (rcfile.getTimerDelay() > 0) {
delay = rcfile.getTimerDelay();
- dbglogfile << "Timer delay set to " << delay << "milliseconds" << endl;
+ log_msg (_("Timer delay set to %d milliseconds"), delay);
}
while ((c = getopt (argc, argv, "hvaps:cd:m:x:r:t:b:1wj:k:u:")) != -1) {
@@ -313,11 +316,11 @@
break;
case 'v':
dbglogfile.setVerbosity();
- dbglogfile << "Verbose output turned on" << endl;
+ log_msg (_("Verbose output turned on"));
break;
case 'w':
dbglogfile.setWriteDisk(true);
- dbglogfile << "Logging to disk enabled." << endl;
+ log_msg (_("Logging to disk enabled."));
break;
case 'a':
dbglogfile.setActionDump(true);
@@ -336,15 +339,15 @@
break;
case 'u':
url = optarg;
- dbglogfile << "Setting root URL to: " << width << endl;
+ log_msg(_("Setting root URL to: %s"), url);
break;
case 'j':
width = strtol(optarg, NULL, 0);
- dbglogfile << "Setting width to: " << width << endl;
+ log_msg (_("Setting width to: %d", width);
break;
case 'k':
height = strtol(optarg, NULL, 0);
- dbglogfile << "Setting height to: " << height << endl;
+ log_msg (_("Setting height to: %d", height);
break;
case 'x':
windowid = strtol(optarg, NULL, 0);
@@ -374,9 +377,9 @@
do_sound = false;
break;
default:
- cerr << "-r must be followed by 0, 1 or 2 (" <<
- render_arg << " is invalid" << endl;
-
+ log_error (
+ _("-r must be followed by 0, 1 or 2 (%d is invalid)"),
+ render_arg);
break;
};
break;
@@ -393,7 +396,7 @@
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;
+ log_error (_("Got variable option on command line!");
} else {
infiles.push_back(argv[optind]);
}
@@ -408,7 +411,7 @@
// No file names were supplied
if (infiles.size() == 0) {
- printf("no input files\n");
+ printf(_("No input files"));
usage();
exit(1);
}
@@ -442,7 +445,7 @@
gnash::get_movie_info(URL(infiles[0]), &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]);
+ fprintf(stderr, _("error: can't get info about %s\n"), infiles[0]);
exit(1);
}
@@ -502,12 +505,12 @@
// Load the actual movie.
gnash::movie_definition* md =
gnash::create_library_movie(URL(infiles[0]));
if (md == NULL) {
- fprintf(stderr, "error: can't create a movie from '%s'\n", infiles[0]);
+ fprintf(stderr, _("error: can't create a movie from '%s'\n"),
infiles[0]);
exit(1);
}
gnash::sprite_instance* m = create_library_movie_inst(md);
if (m == NULL) {
- fprintf(stderr, "error: can't create movie instance\n");
+ fprintf(stderr, _("error: can't create movie instance\n"));
exit(1);
}
gnash::set_current_root(m);
@@ -653,20 +656,20 @@
void
version_and_copyright()
{
- printf (
+ printf (_(
"Gnash " VERSION "\n"
-"Copyright (C) 2006 Free Software Foundation, Inc.\n"
+"Copyright (C) 2006, 2007 Free Software Foundation, Inc.\n"
"Gnash comes with NO WARRANTY, to the extent permitted by law.\n"
"You may redistribute copies of Gnash under the terms of the GNU General\n"
"Public License. For more information, see the file named COPYING.\n"
- );
+ ));
}
void
usage()
{
- printf(
+ printf("%s%s%s", _(
"usage: gnash [options] movie_file.swf\n"
"\n"
"Plays a SWF (Shockwave Flash) movie\n"
@@ -678,7 +681,7 @@
" -d num Number of milliseconds to delay in main loop\n"
" -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"
+ " -vp Be verbose about parsing the movie\n"), _(
" -m <bias> Specify the texture LOD bias (float, default is -1)\n"
" -x <ID> X11 Window ID for display\n"
" -w Produce the disk based debug log\n"
@@ -689,7 +692,7 @@
" -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"
- "\n"
+ "\n"), _(
"keys:\n"
" CTRL-Q, CTRL-W, ESC Quit/Exit\n"
" CTRL-P Toggle Pause\n"
@@ -701,5 +704,5 @@
// " CTRL-G Debug. Test the get_variable() function\n"
// " CTRL-M Debug. Test the call_method() function\n"
" CTRL-B Toggle background color\n"
- );
+ ));
}
Index: plugin/win32/plugin.cpp
===================================================================
RCS file: /sources/gnash/gnash/plugin/win32/plugin.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- plugin/win32/plugin.cpp 11 Apr 2007 17:54:21 -0000 1.6
+++ plugin/win32/plugin.cpp 18 Apr 2007 09:35:42 -0000 1.7
@@ -1,5 +1,6 @@
+// plugin.cpp: Windows "win32" flash player Mozilla plugin, for Gnash.
//
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -10,12 +11,10 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-//
-//
//
#define NO_NSPR_10_SUPPORT
@@ -257,10 +256,10 @@
gnash::get_movie_info(URL(getFilename()), &movie_version, &movie_width,
&movie_height, &movie_fps, NULL, NULL);
if (movie_version == 0)
{
- dbglogfile << "error: can't get info about " << getFilename()
<< endl;
+ log_error (_("can't get info about %s"), getFilename());
return;
}
- log_msg("Movie %s: width is %d, height is %d, version is %d\n",
getFilename(),
+ log_msg(_("Movie %s: width is %d, height is %d, version is %d\n"),
getFilename(),
movie_width, movie_height, movie_version);
// new thread must have own movie instance
@@ -270,7 +269,7 @@
gnash::movie_definition* md =
gnash::create_movie(URL(getFilename()));
if (md == NULL)
{
- dbglogfile << "error: can't create a movie from " <<
getFilename() << endl;
+ log_error (_("can't create a movie from %s"), getFilename());
return;
}
@@ -278,7 +277,7 @@
gnash::movie_interface* m = md->create_instance();
if (m == NULL)
{
- dbglogfile << "error: can't create movie instance" << endl;
+ log_error (_("can't create movie instance"));
return;
}
@@ -346,7 +345,7 @@
// nsPluginInstance::shut() has been called for this instance.
if (getShutdown())
{
- dbglogfile << "player: Shutting down as requested..."
<< endl;
+ log_msg (_("player: Shutting down as requested..."));
break;
}
Index: server/PropertyList.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/PropertyList.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- server/PropertyList.cpp 15 Apr 2007 10:52:09 -0000 1.13
+++ server/PropertyList.cpp 18 Apr 2007 09:35:42 -0000 1.14
@@ -1,3 +1,4 @@
+// PropertyList.cpp: ActionScript property lists, for Gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -10,12 +11,10 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-//
-//
//
#ifdef HAVE_CONFIG_H
@@ -70,7 +69,7 @@
val=found->second->getValue(this_ptr);
- //log_msg("Property %s found, assigning to return (%s)", key.c_str(),
val.to_string());
+ //log_msg(_("Property %s found, value is (%s)"), key.c_str(),
val.to_string());
return true;
}
@@ -91,11 +90,11 @@
if ( prop->isReadOnly() )
{
- log_warning("Property %s is read-only, not setting it",
key.c_str());
+ log_error(_("Property %s is read-only, not setting it to %s"),
key.c_str(), val.to_string().c_str());
return false;
}
- //log_msg("Property %s set to value %s", key.c_str(), val.to_string());
+ //log_msg(_("Property %s set to value %s"), key.c_str(),
val.to_string());
prop->setValue(this_ptr, val);
return true;
}
Index: server/StreamProvider.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/StreamProvider.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- server/StreamProvider.cpp 10 Apr 2007 18:18:45 -0000 1.16
+++ server/StreamProvider.cpp 18 Apr 2007 09:35:42 -0000 1.17
@@ -1,5 +1,6 @@
+// StreamProvider.cpp: ActionScript file: or http: stream reader, for Gnash.
//
-// Copyright (C) 2005, 2006. 2007 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -10,9 +11,11 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -85,7 +88,8 @@
return NULL;
}
#else
- log_error("Unsupported network connections");
+ log_error(_("Unsupported network connection %s"),
+ url.str().c_str());
return NULL;
#endif
}
@@ -98,7 +102,7 @@
if (url.protocol() == "file")
{
- log_warning("POST data discarded while getting a stream from
non-http uri");
+ log_error(_("POST data discarded while getting a stream from
file: uri"));
std::string path = url.path();
if ( path == "-" )
{
@@ -125,7 +129,8 @@
return NULL;
}
#else
- log_error("Unsupported network connections");
+ log_error(_("Unsupported network connection %s"),
+ url.str().c_str();
return NULL;
#endif
}
Index: server/array.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/array.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- server/array.cpp 15 Apr 2007 10:52:09 -0000 1.59
+++ server/array.cpp 18 Apr 2007 09:35:42 -0000 1.60
@@ -1,3 +1,4 @@
+// array.cpp: ActionScript array class, for Gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -10,12 +11,10 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-//
-//
//
#ifdef HAVE_CONFIG_H
@@ -149,7 +148,9 @@
as_object(getArrayInterface()), // pass Array inheritance
elements(0)
{
- //log_action("%s : %p\n", __FUNCTION__, (void*)this);
+ //IF_VERBOSE_ACTION (
+ //log_action("%s: %p", __FUNCTION__, (void*)this);
+ //)
attachArrayProperties(*this);
}
@@ -158,14 +159,16 @@
as_object(other),
elements(other.elements)
{
- //log_action("%s : %p\n", __FUNCTION__, (void*)this);
+ //IF_VERBOSE_ACTION (
+ //log_action("%s: %p", __FUNCTION__, (void*)this);
+ //)
}
int
as_array_object::index_requested(const std::string& name)
{
as_value temp;
- temp.set_string(name.c_str());
+ temp.set_string(name);
double value = temp.to_number();
// if we were sent a string that can't convert like "asdf", it returns
as NaN. -1 means invalid index
@@ -197,7 +200,7 @@
// If the array is empty, report an error and return undefined!
if (elements.size() <= 0)
{
- log_warning("tried to pop element from back of empty array,
returning undef!\n");
+ log_error(_("tried to pop element from back of empty array,
returning undef"));
return as_value(); // undefined
}
@@ -213,7 +216,7 @@
// If the array is empty, report an error and return undefined!
if (elements.size() <= 0)
{
- log_warning("tried to shift element from front of empty array,
returning undef!\n");
+ log_error(_("tried to shift element from front of empty array,
returning undef"));
return as_value(); // undefined
}
@@ -307,7 +310,7 @@
std::auto_ptr<as_array_object> newarray(new as_array_object);
#ifdef GNASH_DEBUG
- log_msg("Array.slice(%u, %u) called", start, one_past_end);
+ log_msg(_("Array.slice(%u, %u) called"), start, one_past_end);
#endif
size_t newsize = one_past_end - start;
@@ -337,7 +340,7 @@
std::copy(replace.begin(), replace.end(), ostrIter);
ss << ") called";
log_msg("%s", ss.str().c_str());
- log_msg("Current array is %s", toString().c_str());
+ log_msg(_("Current array is %s"), toString().c_str());
#endif
container::iterator itStart = elements.begin()+start;
@@ -415,7 +418,7 @@
as_array_object::sorted_indexes(uint8_t flags)
{
assert(flags & as_array_object::fReturnIndexedArray);
- log_error("Array.sorted_index() method not implemented yet!\n");
+ log_unimpl("Array.sorted_index");
return std::auto_ptr<as_array_object>(NULL);
}
@@ -434,43 +437,43 @@
switch ( flags )
{
case 0: // default sorting
- //log_msg("Default sorting");
+ //log_msg(_("Default sorting"));
std::sort(elements.begin(), elements.end(),
AsValueLessThen());
break;
case as_array_object::fDescending:
- //log_msg("Default descending");
+ //log_msg(_("Default descending"));
std::sort(elements.begin(), elements.end(),
AsValueLessThenDesc());
break;
case as_array_object::fCaseInsensitive:
- //log_msg("case insensitive");
+ //log_msg(_("case insensitive"));
std::sort(elements.begin(), elements.end(),
AsValueLessThenNoCase());
break;
case as_array_object::fCaseInsensitive |
as_array_object::fDescending:
- //log_msg("case insensitive descending");
+ //log_msg(_("case insensitive descending"));
std::sort(elements.begin(), elements.end(),
AsValueLessThenDescNoCase());
break;
case as_array_object::fNumeric:
- //log_msg("numeric");
+ //log_msg(_("numeric"));
std::sort(elements.begin(), elements.end(),
AsValueLessThenNumeric());
break;
case as_array_object::fNumeric | as_array_object::fDescending:
- //log_msg("numeric descending");
+ //log_msg(_("numeric descending"));
std::sort(elements.begin(), elements.end(),
AsValueLessThenDescNumeric());
break;
default:
- log_error("Unhandled sort flags: %d (0x%X)", flags,
flags);
+ log_error(_("Unhandled sort flags: %d (0x%X)"), flags,
flags);
break;
}
@@ -480,7 +483,7 @@
// to either use std::sort or std::uniq or similar
if ( do_unique )
{
- log_msg("Should unique now");
+ log_unimpl(_("array.sort with unique flag"));
}
}
@@ -506,13 +509,13 @@
#ifdef GNASH_DEBUG
std::stringstream ss;
fn.dump_args(ss);
- log_msg("Array(%s).splice(%s) called", array->toString().c_str(),
ss.str().c_str());
+ log_msg(_("Array(%s).splice(%s) called"), array->toString().c_str(),
ss.str().c_str());
#endif
if (fn.nargs < 1)
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Array.splice() needs at least 1 argument, call
ignored");
+ log_aserror(_("Array.splice() needs at least 1 argument, call
ignored"));
);
return as_value();
}
@@ -527,7 +530,8 @@
if ( start < 0 ) start = array->size()+start; // start is negative, so
+ means -abs()
startoffset = iclamp(start, 0, origlen);
#ifdef GNASH_DEBUG
- if ( startoffset != start ) log_msg("Array.splice: start:%d became %u",
start, startoffset);
+ if ( startoffset != start )
+ log_msg(_("Array.splice: start:%d became %u"), start,
startoffset);
#endif
//----------------
@@ -540,7 +544,7 @@
if ( lenval < 0 )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Array.splice(%d,%d): negative length
given, call ignored",
+ log_aserror(_("Array.splice(%d,%d): negative length
given, call ignored"),
start, lenval);
);
return as_value();
@@ -581,7 +585,7 @@
}
else
{
- log_error("Array.sort(comparator) method not implemented!\n");
+ log_unimpl("Array.sort(comparator)");
return as_value();
}
@@ -596,7 +600,7 @@
boost::intrusive_ptr<as_array_object> array =
ensureType<as_array_object>(fn.this_ptr);
UNUSED(array);
- log_error("FIXME: Array.sortOn() method not implemented yet!");
+ log_unimpl("Array.sortOn()");
return as_value();
}
@@ -607,7 +611,7 @@
boost::intrusive_ptr<as_array_object> array =
ensureType<as_array_object>(fn.this_ptr);
IF_VERBOSE_ACTION (
- log_action("calling array push, pushing %d values onto back of
array",fn.nargs);
+ log_action(_("calling array push, pushing %d values onto back of
array"),fn.nargs);
);
for (unsigned int i=0;i<fn.nargs;i++)
@@ -623,7 +627,7 @@
boost::intrusive_ptr<as_array_object> array =
ensureType<as_array_object>(fn.this_ptr);
IF_VERBOSE_ACTION (
- log_action("calling array unshift, pushing %d values onto front of
array",fn.nargs);
+ log_action(_("calling array unshift, pushing %d values onto front of
array"), fn.nargs);
);
for (int i=fn.nargs-1; i>=0; i--)
@@ -642,7 +646,7 @@
as_value rv = array->pop();
IF_VERBOSE_ACTION (
- log_action("calling array pop, result:%s, new array size:%d",
+ log_action(_("calling array pop, result:%s, new array size:%d"),
rv.to_string().c_str(), array->size());
);
return rv;
@@ -658,7 +662,7 @@
as_value rv = array->shift();
IF_VERBOSE_ACTION (
- log_action("calling array shift, result:%s, new array size:%d",
+ log_action(_("calling array shift, result:%s, new array size:%d"),
rv.to_string().c_str(), array->size());
);
return rv;
@@ -675,7 +679,7 @@
as_value rv(array.get());
IF_VERBOSE_ACTION (
- log_action("called array reverse, result:%s, new array size:%d",
+ log_action(_("called array reverse, result:%s, new array size:%d"),
rv.to_string().c_str(), array->size());
);
return rv;
@@ -716,10 +720,10 @@
IF_VERBOSE_ACTION
(
- log_action("array_to_string called, nargs = %d, "
- "this_ptr = %p",
+ log_action(_("array_to_string called, nargs = %d, "
+ "this_ptr = %p"),
fn.nargs, (void*)fn.this_ptr.get());
- log_action("to_string result is: %s", ret.c_str());
+ log_action(_("to_string result is: %s"), ret.c_str());
);
return as_value(ret.c_str());
@@ -768,9 +772,9 @@
if (fn.nargs > 2)
{
IF_VERBOSE_ASCODING_ERRORS(
- log_warning("More than 2 arguments sent to slice, "
- "and I don't know what to do with them!\n"
- "Ignoring them as we continue...\n");
+ log_aserror(_("More than 2 arguments to Array.slice, "
+ "and I don't know what to do with them. "
+ "Ignoring them"));
);
}
@@ -838,7 +842,7 @@
array_new(const fn_call& fn)
{
IF_VERBOSE_ACTION (
- log_action("array_new called, nargs = %d", fn.nargs);
+ log_action(_("array_new called, nargs = %d"), fn.nargs);
);
boost::intrusive_ptr<as_array_object> ao = new as_array_object;
@@ -871,7 +875,7 @@
}
IF_VERBOSE_ACTION (
- log_action("array_new setting object %p in result",
(void*)ao.get());
+ log_action(_("array_new setting object %p in result"),
(void*)ao.get());
);
return as_value(ao.get());
Index: server/as_environment.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- server/as_environment.cpp 16 Apr 2007 18:23:05 -0000 1.69
+++ server/as_environment.cpp 18 Apr 2007 09:35:42 -0000 1.70
@@ -1,3 +1,4 @@
+// as_environment.cpp: Variable, Sprite, and Movie locators, for Gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -10,13 +11,13 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
//
-/* $Id: as_environment.cpp,v 1.69 2007/04/16 18:23:05 strk Exp $ */
+/* $Id: as_environment.cpp,v 1.70 2007/04/18 09:35:42 jgilmore Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -47,7 +48,7 @@
// Path lookup rigamarole.
std::string path;
std::string var;
- //log_msg("get_variable(%s)", varname.c_str());
+ //log_msg(_("get_variable(%s)"), varname.c_str());
bool is_slash_based;
if (parse_path(varname, path, var, &is_slash_based)) {
//as_value target_val = get_variable_raw(path, with_stack);
@@ -64,7 +65,7 @@
} else {
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("find_object%s(\"%s\") [ varname = '%s' - current
target = '%s' ] failed",
+ log_aserror(_("find_object%s(\"%s\") [ varname = '%s' - current
target = '%s' ] failed"),
is_slash_based ? "_slashsyntax" : "_dotsyntax",
path.c_str(),
varname.c_str(),
@@ -75,9 +76,9 @@
as_value tmp = get_variable_raw(path, with_stack);
if ( ! tmp.is_undefined() )
{
-#ifdef DEBUG_GET_VARIABLE
- log_msg("But get_variable_raw(%s, <with_stack>)
succeeded!", path.c_str());
-#endif
+ IF_VERBOSE_ASCODING_ERRORS(
+ log_aserror(_("...but get_variable_raw(%s, <with_stack>)
succeeded!"), path.c_str());
+ )
}
return as_value();
}
@@ -151,8 +152,9 @@
}
// Fallback.
+ // FIXME, should this be log_error? or log_swferror?
IF_VERBOSE_ACTION (
- log_action("get_variable_raw(\"%s\" failed, returning UNDEFINED.)",
+ log_action(_("get_variable_raw(\"%s\") failed, returning UNDEFINED"),
varname.c_str());
);
@@ -229,10 +231,10 @@
as_object* target = m_target;
std::string path;
std::string var;
- //log_msg("set_variable(%s, %s)", varname.c_str(),
val.to_debug_string().c_str());
+ //log_msg(_("set_variable(%s, %s)"), varname.c_str(),
val.to_debug_string().c_str());
bool is_slash_based;
if (parse_path(varname, path, var, &is_slash_based)) {
- //log_msg("Variable '%s' parsed into path='%s', var='%s'",
varname.c_str(), path.c_str(), var.c_str());
+ //log_msg(_("Variable '%s' parsed into path='%s', var='%s'"),
varname.c_str(), path.c_str(), var.c_str());
//target = find_target(path);
target = is_slash_based ? find_object_slashsyntax(path) :
find_object_dotsyntax(path);
if (target)
@@ -242,7 +244,7 @@
else
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Path target '%s' not found while setting %s=%s",
+ log_aserror(_("Path target '%s' not found while setting %s=%s"),
path.c_str(), varname.c_str(),
val.to_debug_string().c_str());
);
}
@@ -366,7 +368,7 @@
as_environment::parse_path(const std::string& var_path,
std::string& path, std::string& var, bool* is_slash_based)
{
-//log_msg("parse_path(%s)", var_path.c_str());
+//log_msg(_("parse_path(%s)"), var_path.c_str());
// Search for colon.
int colon_index = 0;
int var_path_length = var_path.length();
@@ -389,7 +391,7 @@
}
}
if (colon_index < 0) {
-//log_msg(" no colon index");
+//log_msg(_(" no colon index"));
return false;
}
}
@@ -403,7 +405,7 @@
path = var_path;
path.resize(colon_index);
-//log_msg(" path=%s var=%s", path.c_str(), var.c_str());
+//log_msg(_(" path=%s var=%s"), path.c_str(), var.c_str());
return true;
}
@@ -439,7 +441,7 @@
assert (obj);
character* s=dynamic_cast<character*>(obj.get());
assert(s->get_ref_count() > 1); // or the intrusive_ptr above
going out-of-scope will kill it
- //log_msg("find_target is a character, returning it");
+ //log_msg(_("find_target is a character, returning it"));
return s; // might be NULL
}
else if ( val.is_string() )
@@ -450,8 +452,8 @@
{
// TODO: should we *force* string conversion above instead ?
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("as_environment::find_target: '%s': "
- "invalid path; neither string nor object",
+ log_aserror(_("as_environment::find_target: '%s': "
+ "invalid path; neither string nor object"),
val.to_debug_string().c_str() );
);
return NULL;
@@ -506,12 +508,12 @@
as_environment::find_target(const std::string& path) const
{
#ifdef DEBUG_TARGET_FINDING
- log_msg("find_target(%s) called", path.c_str());
+ log_msg(_("find_target(%s) called"), path.c_str());
#endif
if (path.length() <= 0) {
#ifdef DEBUG_TARGET_FINDING
- log_msg("Returning m_target (empty path)");
+ log_msg(_("Returning m_target (empty path)"));
#endif
return m_target;
}
@@ -528,14 +530,14 @@
// Absolute path. Start at the root.
env = env->get_root_movie();
#ifdef DEBUG_TARGET_FINDING
- log_msg("Absolute path, start at the root (%p)", (void*)env);
+ log_msg(_("Absolute path, start at the root (%p)"), (void*)env);
#endif
p++;
}
if (*p == '\0') {
#ifdef DEBUG_TARGET_FINDING
- log_msg("Null path, returning m_target");
+ log_msg(_("Null path, returning m_target"));
#endif
return env;
}
@@ -546,7 +548,7 @@
subpart = p;
if (next_slash == p) {
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("invalid path '%s'", path.c_str());
+ log_aserror(_("invalid path '%s'"), path.c_str());
);
return NULL;
//break;
@@ -559,13 +561,13 @@
if ( subpart.empty() )
{
#ifdef DEBUG_TARGET_FINDING
- log_msg("No more subparts, env is %p", (void*)env);
+ log_msg(_("No more subparts, env is %p"), (void*)env);
#endif
break;
}
#ifdef DEBUG_TARGET_FINDING
- log_msg("Invoking get_relative_target(%s) on object %p (%s)",
subpart.c_str(), (void *)env, env->get_name().c_str());
+ log_msg(_("Invoking get_relative_target(%s) on object %p (%s)"),
subpart.c_str(), (void *)env, env->get_name().c_str());
#endif
env = env->get_relative_target(subpart);
//@@ _level0 --> root, .. --> parent, . --> this, other == character
@@ -583,12 +585,12 @@
as_environment::find_object_dotsyntax(const std::string& path) const
{
#ifdef DEBUG_TARGET_FINDING
- log_msg("find_object_dotsyntax(%s) called", path.c_str());
+ log_msg(_("find_object_dotsyntax(%s) called"), path.c_str());
#endif
if (path.length() <= 0) {
#ifdef DEBUG_TARGET_FINDING
- log_msg("Returning m_target (empty path)");
+ log_msg(_("Returning m_target (empty path)"));
#endif
return m_target;
}
@@ -601,7 +603,7 @@
if ( path.empty() ) {
#ifdef DEBUG_TARGET_FINDING
- log_msg("Null path, returning m_target");
+ log_msg(_("Null path, returning m_target"));
#endif
return env;
}
@@ -614,7 +616,7 @@
std::string subpart = p;
if (next_dot == p) {
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("invalid path '%s'", path.c_str());
+ log_aserror(_("invalid path '%s'"), path.c_str());
);
return NULL; // TODO: check me
//break;
@@ -624,20 +626,20 @@
}
#ifdef DEBUG_TARGET_FINDING
- log_msg("Subpart == %s", subpart.c_str());
+ log_msg(_("Subpart == %s"), subpart.c_str());
#endif
// No more components to scan
if ( subpart.empty() )
{
#ifdef DEBUG_TARGET_FINDING
- log_msg("No more subparts, env is %p", (void*)env);
+ log_msg(_("No more subparts, env is %p"), (void*)env);
#endif
break;
}
#ifdef DEBUG_TARGET_FINDING
- log_msg("Invoking get_member(%s) on object %p", subpart.c_str(), (void
*)env);
+ log_msg(_("Invoking get_member(%s) on object %p"), subpart.c_str(),
(void *)env);
#endif
as_value tmp;
// TODO: make sure sprite_instances know about ".."
@@ -647,7 +649,7 @@
if ( depth > 0 )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Member %s for object %p not found
(dotsyntax). Path was %s.",
+ log_aserror(_("Member %s for object %p not found
(dotsyntax). Path was %s"),
subpart.c_str(), env, path.c_str());
);
return NULL;
@@ -656,7 +658,7 @@
if ( ! VM::get().getGlobal()->get_member(subpart.c_str(), &tmp)
)
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Element '%s' of variable '%s' not found in
object %p nor in _global (dotsyntax)",
+ log_aserror(_("Element '%s' of variable '%s' not found
in object %p nor in _global (dotsyntax)"),
subpart.c_str(), path.c_str(), env);
);
return NULL;
@@ -666,8 +668,8 @@
// Debugging only:
if ( ! tmp.is_object() ) {
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Member %s of object %p doesn't cast to an Object
(%s) "
- "evaluating target path %s (dotsyntax)",
+ log_aserror(_("Member %s of object %p doesn't cast to an Object
(%s) "
+ "evaluating target path %s (dotsyntax)"),
subpart.c_str(), env, tmp.to_debug_string().c_str(),
path.c_str());
);
return NULL;
@@ -693,12 +695,12 @@
as_environment::find_object_slashsyntax(const std::string& path) const
{
#ifdef DEBUG_TARGET_FINDING
- log_msg("find_object_slashsyntax(%s) called", path.c_str());
+ log_msg(_("find_object_slashsyntax(%s) called"), path.c_str());
#endif
if (path.length() <= 0) {
#ifdef DEBUG_TARGET_FINDING
- log_msg("Returning m_target (empty path)");
+ log_msg(_("Returning m_target (empty path)"));
#endif
return m_target;
}
@@ -716,14 +718,14 @@
// TODO: should this be VM::get().getRoot().get_root_movie() ?
env = m_target->get_root_movie();
#ifdef DEBUG_TARGET_FINDING
- log_msg("Absolute path, start at the root (%p)", (void*)env);
+ log_msg(_("Absolute path, start at the root (%p)"), (void*)env);
#endif
p++;
}
if (*p == '\0') {
#ifdef DEBUG_TARGET_FINDING
- log_msg("Null path, returning m_target");
+ log_msg(_("Null path, returning m_target"));
#endif
return env;
}
@@ -735,7 +737,7 @@
subpart = p;
if (next_slash == p) {
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("invalid path '%s'", path.c_str());
+ log_aserror(_("invalid path '%s'"), path.c_str());
);
return NULL; // TODO: check me
//break;
@@ -745,14 +747,14 @@
}
#ifdef DEBUG_TARGET_FINDING
- log_msg("Subpart == %s", subpart.c_str());
+ log_msg(_("Subpart == %s"), subpart.c_str());
#endif
// No more components to scan
if ( subpart.empty() )
{
#ifdef DEBUG_TARGET_FINDING
- log_msg("No more subparts, env is %p", (void*)env);
+ log_msg(_("No more subparts, env is %p"), (void*)env);
#endif
break;
}
@@ -762,7 +764,7 @@
character* ch = dynamic_cast<character*>(env);
if ( ! ch ) {
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("'..' element in path '%s' follows a
non-character object %p",
+ log_aserror(_("'..' element in path '%s' follows a
non-character object %p"),
path.c_str(), env);
);
return NULL;
@@ -771,7 +773,7 @@
if ( ! env ) // root movie doesn't have a parent
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("'..' in path '%s' follows a character with
no parent (%s : %p) (root is %p)",
+ log_aserror(_("'..' in path '%s' follows a character
with no parent (%s : %p) (root is %p)"),
path.c_str(), ch->get_text_value(), ch,
VM::get().getRoot().get_root_movie());
);
// if we override env, getvariable.as fails [line 57]
@@ -782,7 +784,7 @@
{
#ifdef DEBUG_TARGET_FINDING
- log_msg("Invoking get_member(%s) on object %p",
subpart.c_str(), (void *)env);
+ log_msg(_("Invoking get_member(%s) on object %p"),
subpart.c_str(), (void *)env);
#endif
as_value tmp;
// TODO: make sure sprite_instances know about ".."
@@ -792,7 +794,7 @@
if ( depth > 0 )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Member %s for object %p not found
(slashsytax). Path was %s",
+ log_aserror(_("Member %s for object %p not
found (slashsyntax). Path was %s"),
subpart.c_str(), env, path.c_str());
);
return NULL;
@@ -801,7 +803,7 @@
if ( !
VM::get().getGlobal()->get_member(subpart.c_str(), &tmp) )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Element '%s' of variable '%s' not
found in object %p nor in _global (slashsyntax)",
+ log_aserror(_("Element '%s' of variable '%s'
not found in object %p nor in _global (slashsyntax)"),
subpart.c_str(), path.c_str(), env);
);
return NULL;
@@ -811,8 +813,8 @@
// Debugging only:
if ( ! tmp.is_object() ) {
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Member %s of object %p doesn't cast to an
Object (%s) "
- "evaluating target path %s (slashsyntax)",
+ log_aserror(_("Member %s of object %p doesn't cast to
an Object (%s) "
+ "evaluating target path %s (slashsyntax)"),
subpart.c_str(), env,
tmp.to_debug_string().c_str(), path.c_str());
);
return NULL;
@@ -1036,7 +1038,7 @@
if ( _localFrames.size() == maxstacksize )
{
- log_warning("Max stack count reached (%u) - should abort
execution",
+ log_error(_("Max stack count reached (%u) - should abort
execution"),
maxstacksize);
// throw something
throw ActionLimitException("Call stack limit exceeded");
Index: server/as_function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_function.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- server/as_function.cpp 15 Apr 2007 10:52:09 -0000 1.29
+++ server/as_function.cpp 18 Apr 2007 09:35:42 -0000 1.30
@@ -1,3 +1,4 @@
+// as_function.cpp: ActionScript Functions, for Gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -10,12 +11,10 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-//
-//
//
#ifdef HAVE_CONFIG_H
@@ -94,7 +93,7 @@
function_ctor(const fn_call& /* fn */)
{
boost::intrusive_ptr<as_object> func = new
as_object(getFunctionPrototype());
- //log_msg("User tried to invoke new Function()");
+ //log_msg(_("User tried to invoke new Function()"));
return as_value(func.get());
}
@@ -146,8 +145,8 @@
get_member("prototype", &proto);
if ( proto.to_object() != _properties.get() )
{
- log_warning("Exported interface of function %p "
- "has been overwritten (from %p to %p)!",
+ log_warning(_("Exported interface of function %p "
+ "has been overwritten (from %p to %p)"),
this, _properties.get(),
(void*)proto.to_object().get());
_properties = proto.to_object();
@@ -195,7 +194,7 @@
if ( ! fn.nargs )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror ("Function.apply() called with no args");
+ log_aserror (_("Function.apply() called with no args"));
);
}
else
@@ -215,10 +214,10 @@
IF_VERBOSE_ASCODING_ERRORS(
if ( fn.nargs > 2 )
{
- log_aserror("Function.apply() got %d"
+ log_aserror(_("Function.apply() got %d"
" args, expected at most 2"
" -- discarding the ones in"
- " excess",
+ " excess"),
fn.nargs);
}
);
@@ -227,9 +226,9 @@
if ( ! arg1 )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Second arg of
Function.apply"
+ log_aserror(_("Second arg of
Function.apply"
" is %s (expected array)"
- " - considering as call with no
args",
+ " - considering as call with no
args"),
fn.arg(1).to_debug_string().c_str());
);
goto call_it;
@@ -241,10 +240,10 @@
if ( ! arg_array )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Second arg of
Function.apply"
+ log_aserror(_("Second arg of
Function.apply"
" is of type %s, with value %s"
" (expected array)"
- " - considering as call with no
args",
+ " - considering as call with no
args"),
fn.arg(1).typeOf(),
fn.arg(1).to_string().c_str());
);
@@ -253,7 +252,7 @@
unsigned int nelems = arg_array->size();
- //log_error("Function.apply(this_ref, array[%d])\n",
nelems);
+ //log_error(_("Function.apply(this_ref, array[%d])\n"),
nelems);
as_value index, value;
for (unsigned int i=nelems; i; i--)
{
@@ -306,9 +305,9 @@
// Call the function
return (*function_obj)(new_fn_call);
- //log_msg("at function_call exit, stack: \n"); fn.env->dump_stack();
+ //log_msg(_("at function_call exit, stack: \n")); fn.env->dump_stack();
- //log_msg("%s: tocheck \n", __FUNCTION__);
+ //log_msg(_("%s: tocheck \n"), __FUNCTION__);
}
boost::intrusive_ptr<as_object>
@@ -329,7 +328,7 @@
{
IF_VERBOSE_ACTION (
- log_action("it's a built-in class");
+ log_action(_("it's a built-in class"));
);
fn_call fn(NULL, &env, nargs, first_arg_index);
@@ -362,7 +361,7 @@
assert(func_has_prototype);
IF_VERBOSE_ACTION (
- log_action("constructor prototype is %s",
proto.to_debug_string().c_str());
+ log_action(_("constructor prototype is %s"),
proto.to_debug_string().c_str());
);
// Create an empty object, with a ref to the constructor's
prototype.
Index: server/as_object.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_object.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- server/as_object.cpp 3 Apr 2007 16:13:07 -0000 1.47
+++ server/as_object.cpp 18 Apr 2007 09:35:42 -0000 1.48
@@ -1,3 +1,4 @@
+// as_object.cpp: ActionScript Object class and its properties, for Gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -62,7 +63,7 @@
///
void operator() (const std::string& name, const as_value& val)
{
- //log_msg("Setting member '%s' to value '%s'", name.c_str(),
val.to_string());
+ //log_msg(_("Setting member '%s' to value '%s'"), name.c_str(),
val.to_string());
_tgt.set_member(name, val);
}
};
@@ -94,7 +95,7 @@
{
assert(val);
- //log_msg("Getting member %s (SWF version:%d)", name.c_str(),
vm.getSWFVersion());
+ //log_msg(_("Getting member %s (SWF version:%d)"), name.c_str(),
vm.getSWFVersion());
// TODO: inspect wheter it is possible to make __proto__ a
// getter/setter property instead, to take this into account
@@ -117,7 +118,7 @@
}
catch (ActionException& exc)
{
- log_warning("%s", exc.what());
+ log_error(_("Caught exception: %s"), exc.what());
return false;
}
@@ -181,9 +182,9 @@
as_object::set_member_default(const std::string& key, const as_value& val )
{
- //log_msg("set_member_default( %s ) ", key.c_str() );
+ //log_msg(_("set_member_default(%s)"), key.c_str());
- // TODO: make __proto__ a getter/setter ?
+ // TODO: make __proto__ a getter/setter?
if (key == "__proto__")
{
set_prototype(val.to_object());
@@ -197,11 +198,11 @@
{
try
{
- //log_msg("Found a getter/setter property for key %s",
key.c_str());
+ //log_msg(_("Found a getter/setter property for key
%s"), key.c_str());
if (prop->isReadOnly())
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Attempt to set read-only
property '%s'",
+ log_aserror(_("Attempt to set read-only
property '%s'"),
key.c_str());
);
} else
@@ -212,18 +213,18 @@
}
catch (ActionException& exc)
{
- log_warning("%s: %s. Will create a new member.",
key.c_str(), exc.what());
+ log_msg(_("%s: Exception %s. Will create a new
member"), key.c_str(), exc.what());
}
}
- //log_msg("Found NO getter/setter property for key %s", key.c_str());
+ //log_msg(_("Found no getter/setter property for key %s"), key.c_str());
// No getter/setter property found, so set (or create) a
// SimpleProperty (if possible)
if ( ! _members.setValue(key, val, *this) )
{
- log_warning("Attempt to set Read-Only property ``%s''"
- " on object ``%p''",
+ log_error(_("Attempt to set read-only property ``%s''"
+ " on object ``%p''"),
key.c_str(), (void*)this);
}
@@ -233,8 +234,7 @@
as_object::init_member(const std::string& key, const as_value& val, int flags)
{
- //log_msg("Setting member %s (SWF version:%d)", key.c_str(),
vm.getSWFVersion());
- //log_msg("Found NO getter/setter property for key %s", key.c_str());
+ //log_msg(_("Setting member %s (SWF version:%d)"), key.c_str(),
vm.getSWFVersion());
VM& vm = _vm;
@@ -246,8 +246,8 @@
// Set (or create) a SimpleProperty
if ( ! _members.setValue(keylower, val, *this) )
{
- log_error("Attempt to initialize Read-Only property
``%s''"
- " (%s) on object ``%p''",
+ log_error(_("Attempt to initialize read-only property
``%s''"
+ " (%s) on object ``%p''"),
keylower.c_str(), key.c_str(), (void*)this);
// We shouldn't attempt to initialize a member twice,
should we ?
assert(0);
@@ -260,8 +260,8 @@
// Set (or create) a SimpleProperty
if ( ! _members.setValue(key, val, *this) )
{
- log_error("Attempt to initialize Read-Only property
``%s''"
- " on object ``%p''",
+ log_error(_("Attempt to initialize read-only property
``%s''"
+ " on object ``%p''"),
key.c_str(), (void*)this);
// We shouldn't attempt to initialize a member twice,
should we ?
assert(0);
@@ -285,14 +285,14 @@
std::string name = key;
boost::to_lower(name, _vm.getLocale());
success = _members.addGetterSetter(name, getter, setter);
- //log_msg("Initialized property '%s'", name.c_str());
+ //log_msg(_("Initialized property '%s'"), name.c_str());
// TODO: optimize this, don't scan again !
_members.setFlags(name, flags, 0);
}
else
{
success = _members.addGetterSetter(key, getter, setter);
- //log_msg("Initialized property '%s'", key.c_str());
+ //log_msg(_("Initialized property '%s'"), key.c_str());
// TODO: optimize this, don't scan again !
_members.setFlags(key, flags, 0);
}
@@ -359,7 +359,7 @@
// See actionscript.all/Inheritance.as for a way to trigger this
IF_VERBOSE_ASCODING_ERRORS(
- if ( obj ) log_aserror("Circular inheritance chain detected during
instanceOf call");
+ if ( obj ) log_aserror(_("Circular inheritance chain detected during
instanceOf call"));
);
return false;
@@ -380,7 +380,7 @@
// See actionscript.all/Inheritance.as for a way to trigger this
IF_VERBOSE_ASCODING_ERRORS(
- if ( obj ) log_aserror("Circular inheritance chain detected during
isPrototypeOf call");
+ if ( obj ) log_aserror(_("Circular inheritance chain detected during
isPrototypeOf call"));
);
return false;
@@ -389,7 +389,7 @@
void
as_object::dump_members()
{
- log_msg(SIZET_FMT " members of object %p follow",
+ log_msg(_(SIZET_FMT " members of object %p follow"),
_members.size(), (const void*)this);
_members.dump(*this);
}
@@ -417,9 +417,9 @@
// set_member_flags will take care of case conversion
if ( ! set_member_flags(prop.c_str(), set_true,
set_false) )
{
- log_warning("Can't set propflags on object "
+ log_error(_("Can't set propflags on object "
"property %s "
- "(either not found or protected)",
+ "(either not found or protected)"),
prop.c_str());
}
@@ -495,7 +495,7 @@
// This happens always since top object in hierarchy
// is always Object, which in turn derives from itself
- //if ( obj ) log_warning("prototype loop during Enumeration");
+ //if ( obj ) log_error(_("prototype loop during Enumeration"));
}
void
@@ -606,9 +606,8 @@
as_object::get_prototype()
{
if ( m_prototype ) return m_prototype.get();
- //log_msg("as_object::get_prototype(): Hit top of inheritance chain");
+ //log_msg(_("as_object::get_prototype(): Hit top of inheritance
chain"));
return getObjectInterface();
}
} // end of gnash namespace
-
Index: server/as_value.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_value.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- server/as_value.cpp 16 Apr 2007 18:23:05 -0000 1.37
+++ server/as_value.cpp 18 Apr 2007 09:35:42 -0000 1.38
@@ -1,3 +1,4 @@
+// as_value.cpp: ActionScript values, for Gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -10,10 +11,10 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
//
#ifdef HAVE_CONFIG_H
@@ -168,12 +169,12 @@
}
else
{
- log_msg("call_method0(%s) did
not return a string", methodname.c_str());
+ log_msg(_("call_method0(%s) did
not return a string"), methodname.c_str());
}
}
else
{
- log_msg("get_member(%s) returned
false", methodname.c_str());
+ log_msg(_("get_member(%s) returned
false"), methodname.c_str());
}
}
if ( ! gotValidToStringResult )
@@ -295,7 +296,7 @@
//
// Arrays and Movieclips should return NaN.
- //log_msg("OBJECT to number conversion, env is %p",
env);
+ //log_msg(_("OBJECT to number conversion, env is %p"),
env);
as_object* obj = m_object_value;
bool gotValidValueOfResult = false;
@@ -314,12 +315,12 @@
}
else
{
- log_msg("call_method0(%s) did
not return a number", methodname.c_str());
+ log_msg(_("call_method0(%s) did
not return a number"), methodname.c_str());
}
}
else
{
- log_msg("get_member(%s) returned
false", methodname.c_str());
+ log_msg(_("get_member(%s) returned
false"), methodname.c_str());
}
}
if ( ! gotValidValueOfResult )
@@ -378,7 +379,7 @@
{
double num = to_number();
bool ret = num && ! isnan(num);
- //log_msg("m_string_value: %s, to_number: %g,
to_bool: %d", m_string_value.c_str(), num, ret);
+ //log_msg(_("m_string_value: %s, to_number: %g,
to_bool: %d"), m_string_value.c_str(), num, ret);
return ret;
}
}
@@ -412,7 +413,7 @@
{
double num = to_number();
bool ret = num && ! isnan(num);
- //log_msg("m_string_value: %s, to_number: %g,
to_bool: %d", m_string_value.c_str(), num, ret);
+ //log_msg(_("m_string_value: %s, to_number: %g,
to_bool: %d"), m_string_value.c_str(), num, ret);
return ret;
}
}
@@ -486,8 +487,8 @@
character* target =
env.find_target(std::string(m_string_value.c_str()));
if ( ! target )
{
- log_warning("MovieClip value is a dangling reference: "
- "target '%s' not found (should set to NULL?)",
+ log_error(_("MovieClip value is a dangling reference: "
+ "target '%s' not found (should set to NULL?)"),
m_string_value.c_str());
return NULL;
}
Index: server/button_character_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/button_character_instance.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- server/button_character_instance.cpp 12 Apr 2007 11:35:30 -0000
1.42
+++ server/button_character_instance.cpp 18 Apr 2007 09:35:42 -0000
1.43
@@ -1,3 +1,4 @@
+// button_character_instance.cpp: Mouse-sensitive buttons, for Gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -10,16 +11,11 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-//
-//
-//
-
-
-// SWF buttons. Mouse-sensitive update/display, actions, etc.
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -325,7 +321,7 @@
#if 0
if (id.m_id != event_id::KEY_PRESS)
{
- log_warning("Unsupported event for button instance: %s",
id.get_function_name().c_str());
+ log_warning(_("Unsupported event for button instance: %s"),
id.get_function_name().c_str());
return false;
}
#endif
@@ -530,7 +526,7 @@
default:
//assert(0); // missed a case?
- log_error("Unhandled button event %s",
event.get_function_name().c_str());
+ log_error(_("Unhandled button event %s"),
event.get_function_name().c_str());
break;
};
@@ -620,8 +616,8 @@
action_buffer* ab =
m_def->m_button_actions[i].m_actions[j];
assert(ab);
IF_VERBOSE_ACTION(
- log_action("Executing actions for "
- "button condition %d\n", c);
+ log_action(_("Executing actions for "
+ "button condition %d"), c);
);
ActionExec exec(*ab, get_environment());
exec();
@@ -638,7 +634,7 @@
}
else
{
- //log_warning("No handler for event: %s",
event.get_function_name().c_str());
+ //log_warning(_("No handler for event: %s"),
event.get_function_name().c_str());
}
Index: server/character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/character.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- server/character.cpp 15 Apr 2007 14:31:19 -0000 1.35
+++ server/character.cpp 18 Apr 2007 09:35:42 -0000 1.36
@@ -1,3 +1,4 @@
+// character.cpp: ActionScript Character class, for Gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -10,15 +11,13 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-//
-//
//
-/* $Id: character.cpp,v 1.35 2007/04/15 14:31:19 strk Exp $ */
+/* $Id: character.cpp,v 1.36 2007/04/18 09:35:42 jgilmore Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -93,11 +92,11 @@
}
else
{
- // Implement relative drag...
+ // FIXME: Implement relative drag...
static bool warned_relative_drag = false;
if ( ! warned_relative_drag )
{
- log_warning("FIXME: Relative drag unsupported");
+ log_unimpl(_("Relative drag"));
warned_relative_drag = true;
}
}
@@ -161,12 +160,12 @@
{
IF_VERBOSE_ASCODING_ERRORS(
// AS code trying to access something before the root
- log_warning("ActionScript code trying to reference"
- " an unexistent parent with '..' "
- " (an unexistent parent probably only "
+ log_warning(_("ActionScript code trying to reference"
+ " a nonexistent parent with '..' "
+ " (a nonexistent parent probably only "
"occurs in the root MovieClip)."
" Returning a reference to top parent "
- "(probably the root clip).");
+ "(probably the root clip)."));
);
//parent = this;
assert(this == get_root_movie());
@@ -303,7 +302,7 @@
if (isnan(scale_percent))
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Attempt to set _xscale to %g, refused",
+ log_aserror(_("Attempt to set _xscale to %g, refused"),
scale_percent);
);
return as_value();
@@ -311,7 +310,7 @@
else if (scale_percent < 0 )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Attempt to set _xscale to %g, use 0",
+ log_aserror(_("Attempt to set _xscale to %g, use 0"),
scale_percent);
);
scale_percent = 0;
@@ -347,7 +346,7 @@
if (isnan(scale_percent))
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Attempt to set _yscale to %g, refused",
+ log_aserror(_("Attempt to set _yscale to %g, refused"),
scale_percent);
);
return as_value();
@@ -355,7 +354,7 @@
else if (scale_percent < 0 )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Attempt to set _yscale to %g, use 0",
+ log_aserror(_("Attempt to set _yscale to %g, use 0"),
scale_percent);
);
scale_percent = 0;
@@ -473,7 +472,7 @@
{
if ( ! bounds.isFinite() )
{
- log_error("FIXME: can't set _width on character with
null or world bounds");
+ log_unimpl(_("FIXME: can't set _width on character with
null or world bounds"));
return rv;
}
@@ -484,7 +483,7 @@
if ( newwidth <= 0 )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Setting _width=%g ?", newwidth/20);
+ log_aserror(_("Setting _width=%g"), newwidth/20);
);
}
@@ -518,7 +517,7 @@
{
if ( ! bounds.isFinite() )
{
- log_error("FIXME: can't set _height on character with
null or world bounds");
+ log_unimpl(_("FIXME: can't set _height on character
with null or world bounds"));
return rv;
}
@@ -529,7 +528,7 @@
if ( newheight <= 0 )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("Setting _height=%g ?", newheight/20);
+ log_aserror(_("Setting _height=%g"), newheight/20);
);
}
@@ -607,7 +606,7 @@
{
_event_handlers[id].push_back(&code);
- //log_msg("Setting handler for event %s",
id.get_function_name().c_str());
+ //log_msg(_("Setting handler for event %s"),
id.get_function_name().c_str());
// Set the character as a listener iff the
// kind of event is a KEY or MOUSE one
@@ -619,7 +618,7 @@
case event_id::MOUSE_UP:
case event_id::MOUSE_DOWN:
case event_id::MOUSE_MOVE:
- //log_msg("Registering character as having mouse
events");
+ //log_msg(_("Registering character as having mouse
events"));
has_mouse_event();
break;
default:
@@ -654,7 +653,7 @@
character::unload()
{
_unloaded = true;
- //log_msg("Queuing unload event for character %p", this);
+ //log_msg(_("Queuing unload event for character %p"), this);
queueEventHandler(event_id::UNLOAD);
//on_event(event_id::UNLOAD);
}
Index: server/dlist.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- server/dlist.cpp 11 Apr 2007 14:20:20 -0000 1.58
+++ server/dlist.cpp 18 Apr 2007 09:35:42 -0000 1.59
@@ -1,3 +1,4 @@
+// dlist.cpp: Display lists, for Gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -10,12 +11,11 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-//
-//
#include "dlist.h"
#include "log.h"
@@ -122,7 +122,7 @@
DisplayList::get_character_at_depth(int depth)
{
//GNASH_REPORT_FUNCTION;
- //dump(std::cout);
+ //dump();
for (iterator it = _characters.begin(),
itEnd = _characters.end();
@@ -179,10 +179,10 @@
int clip_depth)
{
// GNASH_REPORT_FUNCTION;
- //IF_VERBOSE_DEBUG(log_msg("dl::add(%d, '%s')\n", depth,
ch->get_name()));//xxxxx
+ //log_msg(_("dl::add(%d, '%s')"), depth, ch->get_name());
- //log_msg("Before adding, list is:");
- //dump(std::cout);
+ //log_msg(_("Before adding, list is:"));
+ //dump();
assert(ch);
ch->set_invalidated();
@@ -198,13 +198,13 @@
if ( it == _characters.end() || (*it)->get_depth() != depth )
{
- //log_msg("place_character: new character at depth %d", depth);
+ //log_msg(_("place_character: new character at depth %d"),
depth);
// add the new char
_characters.insert(it, DisplayItem(ch));
}
else
{
- //log_msg("place_character: replacing existing character at
depth %d", depth);
+ //log_msg(_("place_character: replacing existing character at
depth %d"), depth);
(*it)->unload();
// replace existing char
*it = DisplayItem(ch);
@@ -275,8 +275,8 @@
// Error, no existing object found at depth.
// IF_VERBOSE_DEBUG(
-// log_msg("dl::replace_display_object()"
-// " no obj at depth %d\n", depth)
+// log_msg(_("dl::replace_display_object()"
+// " no obj at depth %d"), depth)
// );
// add the new char
@@ -322,14 +322,15 @@
int /* clip_depth */)
{
//GNASH_REPORT_FUNCTION;
- //IF_VERBOSE_DEBUG(log_msg("dl::move(%d)\n", depth));//xxxxx
+ //IF_VERBOSE_DEBUG(log_msg(_("dl::move(%d)"), depth));
character* ch = get_character_at_depth(depth);
if ( ! ch )
{
+ // FIXME, should this be log_aserror?
IF_VERBOSE_MALFORMED_SWF(
- log_warning("move_display_object() -- "
- "can't find object at depth %d",
+ log_swferror(_("move_display_object() -- "
+ "can't find object at depth %d"),
depth);
);
return;
@@ -361,8 +362,8 @@
{
//GNASH_REPORT_FUNCTION;
- //log_msg("Before removing, list is:");
- //dump(std::cout);
+ //log_msg(_("Before removing, list is:"));
+ //dump();
#ifndef NDEBUG
container_type::size_type size = _characters.size();
@@ -385,8 +386,8 @@
assert(size >= _characters.size());
#endif
- //log_msg("Done removing, list is:");
- //dump(std::cout);
+ //log_msg(_("Done removing, list is:"));
+ //dump();
}
@@ -585,7 +586,7 @@
// if (_characters.size() != size)
// {
-// log_error("gnash bug: dlist size changed due to
character actions, bailing on update!\n");
+// log_error(_("gnash bug: dlist size changed due to
character actions, bailing on update"));
// break;
// }
@@ -612,7 +613,7 @@
bool masked = false;
int highest_masked_layer = 0;
- //log_msg("number of objects to be drawn %i\n",
m_display_object_array.size());
+ //log_msg(_("number of objects to be drawn %d"),
m_display_object_array.size());
for( iterator it = _characters.begin(),
endIt = _characters.end();
@@ -637,7 +638,7 @@
{
if (ch->get_depth() > highest_masked_layer)
{
-// log_msg("disabled mask before drawing
depth %i\n", ch->get_depth());
+// log_msg(_("disabled mask before drawing
depth %d"), ch->get_depth());
masked = false;
// turn off mask
render::disable_mask();
@@ -647,7 +648,7 @@
// check whether this object should become mask
if (ch->get_clip_depth() > 0)
{
- //log_msg("begin submit mask\n");
+ //log_msg(_("begin submit mask"));
render::begin_submit_mask();
}
@@ -658,7 +659,7 @@
// information about it
if (ch->get_clip_depth() > 0)
{
- //log_msg("end submit mask\n");
+ //log_msg(_("end submit mask"));
render::end_submit_mask();
highest_masked_layer = ch->get_clip_depth();
masked = true;
@@ -676,7 +677,7 @@
/*public*/
void
-DisplayList::dump(std::ostream& os) const
+DisplayList::dump() const
{
int num=0;
for( const_iterator it = _characters.begin(),
@@ -684,11 +685,9 @@
it != endIt; ++it)
{
const DisplayItem& dobj = *it;
- os << "Item " << num << " at depth " << dobj->get_depth()
- << " (char id " << dobj->get_id()
- << ", name " << dobj->get_name()
- << ", type " << typeid(*dobj).name()
- << ")" << std::endl;
+ log_msg(_("Item %d at depth %d (char id %d, name %s, type %s"),
+ num, dobj->get_depth(), dobj->get_id(),
+ dobj->get_name().c_str(), typeid(*dobj).name());
num++;
}
}
Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- server/edit_text_character.cpp 16 Apr 2007 18:23:05 -0000 1.56
+++ server/edit_text_character.cpp 18 Apr 2007 09:35:42 -0000 1.57
@@ -1,3 +1,4 @@
+// edit_text_character.cpp: User-editable text regions, for Gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -10,12 +11,13 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
-
-/* $Id: edit_text_character.cpp,v 1.56 2007/04/16 18:23:05 strk Exp $ */
+/* $Id: edit_text_character.cpp,v 1.57 2007/04/18 09:35:42 jgilmore Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -94,7 +96,7 @@
static bool warned = false;
if ( ! warned ) {
- log_error("FIXME: TextField.setTextFormat() unimplemented");
+ log_unimpl("TextField.setTextFormat()");
warned = true;
}
@@ -110,7 +112,7 @@
static bool warned = false;
if ( ! warned ) {
- log_error("FIXME: TextField.addListener() unimplemented");
+ log_unimpl("TextField.addListener()");
warned = true;
}
@@ -125,7 +127,7 @@
static bool warned = false;
if ( ! warned ) {
- log_error("FIXME: TextField.removeListener() unimplemented");
+ log_unimpl("TextField.removeListener()");
warned = true;
}
@@ -140,7 +142,7 @@
static bool warned = false;
if ( ! warned ) {
- log_error("FIXME: TextField.setNewTextFormat() unimplemented");
+ log_unimpl("TextField.setNewTextFormat()");
warned = true;
}
@@ -155,7 +157,7 @@
static bool warned = false;
if ( ! warned ) {
- log_error("FIXME: TextField.getDepth() unimplemented");
+ log_unimpl("TextField.getDepth()");
warned = true;
}
@@ -170,7 +172,7 @@
static bool warned = false;
if ( ! warned ) {
- log_error("FIXME: TextField.getFontList() unimplemented");
+ log_unimpl("TextField.getFontList()");
warned = true;
}
@@ -185,7 +187,7 @@
static bool warned = false;
if ( ! warned ) {
- log_error("FIXME: TextField.getNewTextFormat() unimplemented");
+ log_unimpl("TextField.getNewTextFormat()");
warned = true;
}
@@ -200,7 +202,7 @@
static bool warned = false;
if ( ! warned ) {
- log_error("FIXME: TextField.getTextFormat() unimplemented");
+ log_unimpl("TextField.getTextFormat()");
warned = true;
}
@@ -215,7 +217,7 @@
static bool warned = false;
if ( ! warned ) {
- log_error("FIXME: TextField.replaceSel() unimplemented");
+ log_unimpl("TextField.replaceSel()");
warned = true;
}
@@ -230,7 +232,7 @@
static bool warned = false;
if ( ! warned ) {
- log_error("FIXME: TextField.replaceText() unimplemented");
+ log_unimpl("TextField.replaceText()");
warned = true;
}
@@ -245,7 +247,7 @@
static bool warned = false;
if ( ! warned ) {
- log_error("FIXME: TextField.removeTextField() unimplemented");
+ log_unimpl("TextField.removeTextField()");
warned = true;
}
@@ -637,7 +639,7 @@
format_text();
- //log_msg("Text set to %s", new_text.c_str());
+ //log_msg(_("Text set to %s"), new_text.c_str());
}
@@ -842,9 +844,9 @@
//assert(extra_space >= 0.0f);
if (extra_space <= 0.0f)
{
- log_warning("TextField text doesn't fit in it's boundaries");
- log_warning(" m_def->width() == %g", m_def->width());
- log_warning(" m_def->get_right_margin() == %d",
m_def->get_right_margin());
+ log_error(_("TextField text doesn't fit in its boundaries: "
+ "width %g, margin %d"),
+ m_def->width(), m_def->get_right_margin());
return 0.0f;
}
@@ -901,7 +903,7 @@
//
if (_font == NULL)
{
- log_error("No font for edit_text_character! [%s:%d]",
+ log_error(_("No font for edit_text_character! [%s:%d]"),
__FILE__, __LINE__);
return;
}
@@ -929,7 +931,8 @@
if (_font != newfont)
{
- log_error("error: substituting font! font '%s' has no
glyphs, using font '%s'\n",
+ log_error(_("substituting font! font '%s' has "
+ "no glyphs, using font '%s'"),
fontlib::get_font_name(_font),
fontlib::get_font_name(newfont)
);
@@ -938,8 +941,8 @@
}
else
{
- log_error("Current font has no glyphs and I couldn't"
- " find another font with glyphs... :(");
+ log_error(_("Current font has no glyphs and I couldn't"
+ " find another font with glyphs... :("));
}
}
@@ -1062,11 +1065,13 @@
int index = _font->get_glyph_index(32); // ascii SPACE
if ( index == -1 )
{
- log_warning("%s -- missing glyph for space char
(needed for TAB)."
+ IF_VERBOSE_MALFORMED_SWF (
+ log_error(_("%s -- missing glyph for space
char (needed for TAB). "
" Make sure character shapes for
font %s are being exported "
- "into your SWF file!",
+ "into your SWF file."),
__PRETTY_FUNCTION__,
_font->get_name());
+ );
}
else
{
@@ -1090,6 +1095,7 @@
{ // need a sub-scope to avoid the 'goto' in TAB handling to
cross
// initialization of the 'index' variable
int index = _font->get_glyph_index((uint16_t) code);
+ IF_VERBOSE_MALFORMED_SWF (
if (index == -1)
{
// error -- missing glyph!
@@ -1099,9 +1105,9 @@
if (s_log_count < 10)
{
s_log_count++;
- log_warning("%s -- missing glyph for char %d."
+ log_swferror(_("%s -- missing glyph for
char %d. "
" Make sure character shapes for
font %s are being exported "
- "into your SWF file!",
+ "into your SWF file"),
__PRETTY_FUNCTION__,
code,
_font->get_name()
@@ -1111,6 +1117,7 @@
// Drop through and use index == -1; this will display
// using the empty-box glyph
}
+ );
text_glyph_record::glyph_entry ge;
ge.m_glyph_index = index;
ge.m_glyph_advance = scale * _font->get_advance(index);
@@ -1132,7 +1139,7 @@
static bool warned=false;
if ( ! warned )
{
- log_warning("FIXME: implement no word
wrap");
+ log_unimpl("edit_text_character: no
word wrap");
warned=true;
}
}
@@ -1217,7 +1224,7 @@
if ( _text_variable_registered )
{
#ifdef DEBUG_DYNTEXT_VARIABLES
- log_msg(" registerTextVariable() no-op call (alread
registered)");
+ log_msg(_("registerTextVariable() no-op call (already
registered)"));
#endif
return;
}
@@ -1225,7 +1232,7 @@
if ( _variable_name.empty() )
{
#ifdef DEBUG_DYNTEXT_VARIABLES
- log_msg(" string is empty, consider as registered");
+ log_msg(_("string is empty, consider as registered"));
#endif
_text_variable_registered=true;
return;
@@ -1241,7 +1248,7 @@
const char* varname = var_str.c_str();
#ifdef DEBUG_DYNTEXT_VARIABLES
- log_msg(" VariableName: %s", var_str.c_str());
+ log_msg(_("VariableName: %s"), var_str.c_str());
#endif
as_environment& env = get_environment();
@@ -1256,7 +1263,7 @@
if ( as_environment::parse_path(varname, path, var) )
{
#ifdef DEBUG_DYNTEXT_VARIABLES
- log_msg("Variable text Path: %s, Var: %s", path.c_str(),
var.c_str());
+ log_msg(_("Variable text Path: %s, Var: %s"), path.c_str(),
var.c_str());
#endif
// find target for the path component
// we use our parent's environment for this
@@ -1269,7 +1276,7 @@
if ( ! target )
{
IF_VERBOSE_MALFORMED_SWF(
- log_warning("VariableName associated to text field
refer to an unknown target (%s). It is possible that the character will be
instantiated later in the SWF stream. Gnash will try to register again on next
access.", path.c_str());
+ log_swferror(_("VariableName associated to text field
refer to an unknown target (%s). It is possible that the character will be
instantiated later in the SWF stream. Gnash will try to register again on next
access."), path.c_str());
);
return;
}
@@ -1284,14 +1291,14 @@
if ( sprite->get_member(varname, &val) )
{
#ifdef DEBUG_DYNTEXT_VARIABLES
- log_msg("target sprite (%p) does have a member named %s",
(void*)sprite, varname);
+ log_msg(_("target sprite (%p) does have a member named %s"),
(void*)sprite, varname);
#endif
set_text_value(val.to_string().c_str());
}
#ifdef DEBUG_DYNTEXT_VARIABLES
else
{
- log_msg("target sprite (%p) does NOT have a member named %s (no
problem, we'll add it)", (void*)sprite, varname);
+ log_msg(_("target sprite (%p) does NOT have a member named %s
(no problem, we'll add it)"), (void*)sprite, varname);
}
#endif
Index: server/fill_style.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/fill_style.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/fill_style.cpp 19 Feb 2007 11:56:21 -0000 1.2
+++ server/fill_style.cpp 18 Apr 2007 09:35:42 -0000 1.3
@@ -1,3 +1,4 @@
+// fill_style.cpp: Graphical region filling styles, for Gnash.
//
// Copyright (C) 2007 Free Software Foundation, Inc.
//
@@ -10,13 +11,14 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
// Based on work of Thatcher Ulrich <address@hidden> 2003
-
#include "fill_style.h"
#include "impl.h"
#include "log.h"
@@ -127,7 +129,7 @@
if ( ! num_gradients )
{
IF_VERBOSE_MALFORMED_SWF(
- log_swferror("num gradients 0");
+ log_swferror(_("num gradients 0"));
);
return;
}
@@ -136,7 +138,7 @@
// and we don't have this limitation anyway
{
// see: http://sswf.sourceforge.net/SWFalexref.html#swf_gradient
- log_warning("Unexpected num gradients (%d), expected 1 to 8",
+ log_error(_("Unexpected num gradients (%d), expected 1 to 8"),
num_gradients);
}
@@ -185,13 +187,13 @@
static bool warned_about_invalid_char=false;
if ( ! warned_about_invalid_char )
{
- log_swferror("Bitmap fill specifies '%d' as associated"
+ log_swferror(_("Bitmap fill specifies '%d' as
associated"
" bitmap character id,"
" but that character is not found"
" in the Characters Dictionary."
" It seems common to find such "
" malformed SWF, so we'll only warn once "
- "about this.",
+ "about this."),
bitmap_char_id);
warned_about_invalid_char=true;
}
@@ -211,7 +213,7 @@
}
else
{
- log_error("Unsupported fill style type: 0x%X", m_type);
+ log_unimpl("Unsupported fill style type: 0x%X", m_type);
// This is a fatal error, we'll be leaving the stream
// read pointer in an unknown position.
throw ParserException("Unsupported fill style (Malformed SWF?)");
@@ -241,7 +243,7 @@
return need_gradient_bitmap();
} else {
- log_msg("Unknown fill style");
+ log_error(_("Unknown fill style %d"), m_type);
assert(0);
}
}
@@ -277,11 +279,10 @@
static bool warned=false;
if ( ! warned ) {
log_swferror(
- "First gradient in a fill_style "
+ _("First gradient in a fill_style "
"have position==%d (expected 0)."
" This seems to be common, so will"
- " warn only once."
- ,
+ " warn only once."),
m_gradients[0].m_ratio);
warned=true;
}
@@ -314,8 +315,8 @@
// have the same ratio. This would be a malformed SWF.
IF_VERBOSE_MALFORMED_SWF(
log_swferror(
- "two gradients in a fill_style "
- "have the same position/ratio: %d",
+ _("two gradients in a fill_style "
+ "have the same position/ratio: %d"),
gr0.m_ratio);
);
}
Index: server/font.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/font.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- server/font.cpp 22 Mar 2007 10:51:49 -0000 1.27
+++ server/font.cpp 18 Apr 2007 09:35:42 -0000 1.28
@@ -1,10 +1,25 @@
-// font.cpp -- Thatcher Ulrich <address@hidden> 2003
+// font.cpp: ActionScript font handling, for Gnash.
+//
+// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
-// This source code has been donated to the Public Domain. Do
-// whatever you want with it.
-
-// A font type for gnash.
+/* $Id: font.cpp,v 1.28 2007/04/18 09:35:42 jgilmore Exp $ */
+// Based on the public domain work of Thatcher Ulrich <address@hidden> 2003
#include "font.h"
#include "stream.h"
@@ -121,7 +136,7 @@
void font::readDefineFont(stream* in, movie_definition* m)
{
IF_VERBOSE_PARSE (
- log_parse("reading DefineFont");
+ log_parse(_("reading DefineFont"));
);
int table_base = in->get_position();
@@ -171,7 +186,7 @@
void font::readDefineFont2_or_3(stream* in, movie_definition* m)
{
IF_VERBOSE_PARSE (
- log_parse("reading DefineFont2 or DefineFont3");
+ log_parse(_("reading DefineFont2 or DefineFont3"));
);
bool has_layout = (in->read_uint(1) != 0);
@@ -184,7 +199,7 @@
m_is_bold = (in->read_uint(1) != 0);
uint8_t reserved = in->read_u8();
- // Inhibit warning.
+ // Inhibit compiler warning.
reserved = reserved;
m_name = in->read_string_with_length();
@@ -206,7 +221,7 @@
uint32_t off = in->read_u32();
IF_VERBOSE_PARSE (
- log_parse("Glyph %d at offset %u", i, off);
+ log_parse(_("Glyph %d at offset %u"), i, off);
);
offsets.push_back(off);
@@ -221,7 +236,7 @@
uint16_t off = in->read_u16();
IF_VERBOSE_PARSE (
- log_parse("Glyph %d at offset %u", i, off);
+ log_parse(_("Glyph %d at offset %u"), i, off);
);
offsets.push_back(off);
@@ -257,7 +272,7 @@
if (font_code_offset + table_base != current_position)
{
// Bad offset! Don't try to read any more.
- log_warning("Bad offset in DefineFont2!");
+ log_error(_("Bad offset in DefineFont2"));
return;
}
}
@@ -324,7 +339,7 @@
// later using the character pair as the key.
if ( ! m_kerning_pairs.insert(std::make_pair(k, adjustment)).second )
{
- log_warning("Repeated kerning pair found - ignoring\n");
+ log_error(_("Repeated kerning pair found - ignoring"));
}
}
@@ -346,10 +361,9 @@
// See: SWFalexref/SWFalexref.html#tag_definefont2
static bool warned = false;
if ( ! warned ) {
- log_warning("DefineFontInfo2 partially
implemented");
+ log_unimpl(_("DefineFontInfo2 partially
implemented"));
warned = true;
}
-
}
delete [] m_name;
@@ -378,7 +392,7 @@
// codes.
{
IF_VERBOSE_PARSE (
- log_parse("reading code table at offset %lu",
in->get_position());
+ log_parse(_("reading code table at offset %lu"),
in->get_position());
);
assert(m_code_table.empty());
@@ -412,14 +426,14 @@
{
int glyph_index = it->second;
#if 0
- log_msg("get_glyph_index(%u) returning %d",
+ log_msg(_("get_glyph_index(%u) returning %d"),
code, glyph_index);
#endif
return glyph_index;
}
#if 0
- log_msg("get_glyph_index(%u) returning -1", code);
+ log_msg(_("get_glyph_index(%u) returning -1"), code);
#endif
return -1;
}
@@ -439,7 +453,7 @@
if (s_logged == false)
{
s_logged = true;
- log_error("empty advance table in font %s\n",
get_name());
+ log_error(_("empty advance table in font %s"),
get_name());
}
return 0;
}
@@ -506,8 +520,8 @@
int n = in->read_le32();
if (n != m_glyphs.size())
{
- log_error("error reading cache file in
font::input_cached_data() "
- "glyph count mismatch.\n");
+ log_error(_("error reading cache file in
font::input_cached_data(): "
+ "glyph count mismatch"));
in->go_to_end(); // ensure that no more data
will be read from this stream.
return;
}
Index: server/generic_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/generic_character.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- server/generic_character.cpp 28 Feb 2007 17:25:26 -0000 1.4
+++ server/generic_character.cpp 18 Apr 2007 09:35:42 -0000 1.5
@@ -1,5 +1,6 @@
+// generic_character.cpp: Mouse/Character handling, for Gnash.
//
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -10,15 +11,13 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-//
-//
//
-/* $Id: generic_character.cpp,v 1.4 2007/02/28 17:25:26 udog Exp $ */
+/* $Id: generic_character.cpp,v 1.5 2007/04/18 09:35:42 jgilmore Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -46,7 +45,7 @@
void
generic_character::enclose_own_bounds(rect *) const
{
- log_error("generic_character::enclose_own_bounds unimplemented");
+ log_unimpl("generic_character::enclose_own_bounds");
assert(0); // TO BE IMPLEMENTED!!!!!
}
Index: server/impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/impl.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -b -r1.103 -r1.104
--- server/impl.cpp 13 Apr 2007 07:35:55 -0000 1.103
+++ server/impl.cpp 18 Apr 2007 09:35:42 -0000 1.104
@@ -1,3 +1,4 @@
+// impl.cpp: Implement ActionScript tags, movie loading, library, for Gnash.
//
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
@@ -10,11 +11,13 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
-/* $Id: impl.cpp,v 1.103 2007/04/13 07:35:55 bjacques Exp $ */
+/* $Id: impl.cpp,v 1.104 2007/04/18 09:35:42 jgilmore Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -83,7 +86,7 @@
// can call this only once during a single run
assert(!globals::baseurl.get());
globals::baseurl.reset(new URL(url));
- log_msg("Base url set to: %s", globals::baseurl->str().c_str());
+ log_msg(_("Base url set to: %s"), globals::baseurl->str().c_str());
}
const URL&
@@ -244,11 +247,11 @@
// Put extracted info in the given vars.
// Sets *version to 0 if info can't be extracted.
{
- //printf("%s: url is %s\n", __PRETTY_FUNCTION__, url.str().c_str());
+ //log_msg(_("%s: url is %s"), __PRETTY_FUNCTION__, url.str().c_str());
tu_file* in = globals::streamProvider.getStream(url);
if (in == NULL || in->get_error() != TU_FILE_NO_ERROR) {
- log_error("get_movie_info(): can't open '%s'\n", url.str().c_str());
+ log_error(_("get_movie_info(): can't open '%s'"), url.str().c_str());
if (version) *version = 0;
//delete in;
return;
@@ -263,7 +266,7 @@
if ((header & 0x0FFFFFF) != 0x00535746
&& (header & 0x0FFFFFF) != 0x00535743) {
// ERROR
- log_error("get_movie_info(): file '%s' does not start with a SWF
header!\n", url.str().c_str());
+ log_error(_("get_movie_info(): file '%s' does not start with a SWF
header"), url.str().c_str());
if (version) *version = 0;
//delete in;
return;
@@ -273,7 +276,7 @@
tu_file* original_in = NULL;
if (compressed) {
#if TU_CONFIG_LINK_TO_ZLIB == 0
- log_error("get_movie_info(): can't read zipped SWF data;
TU_CONFIG_LINK_TO_ZLIB is 0!\n");
+ log_error(_("get_movie_info(): can't read zipped SWF data;
TU_CONFIG_LINK_TO_ZLIB is 0"));
return;
#endif
original_in = in;
@@ -325,7 +328,7 @@
create_jpeg_movie(std::auto_ptr<tu_file> in, const std::string& url)
{
// FIXME: temporarly disabled
- //log_msg("Loading of jpegs unsupported");
+ //log_unimpl(_("Loading of jpegs"));
//return NULL;
@@ -333,12 +336,12 @@
if ( ! im.get() )
{
- log_error("Can't read jpeg\n");
+ log_error(_("Can't read jpeg"));
return NULL;
}
BitmapMovieDefinition* mdef = new BitmapMovieDefinition(im, url);
- //log_msg("BitmapMovieDefinition %p created", mdef);
+ //log_msg(_("BitmapMovieDefinition %p created"), mdef);
return mdef;
@@ -347,7 +350,7 @@
}
// Get type of file looking at first bytes
-// return 'jpeg', 'swf' or 'unknown'
+// return "jpeg", "swf" or "unknown"
//
static std::string
get_file_type(tu_file* in)
@@ -358,7 +361,7 @@
memset(buf, 0, 3);
if ( 3 < in->read_bytes(buf, 3) )
{
- log_error("Can't read file header!\n");
+ log_error(_("Can't read file header"));
return "unknown";
}
@@ -435,7 +438,7 @@
{
if ( startLoaderThread == false )
{
- log_warning("Requested to keep from completely loading
a movie, but the movie in question is a jpeg, for which we don't have the
concept of a 'loading thread'");
+ log_unimpl(_("Requested to keep from completely loading
a movie, but the movie in question is a jpeg, for which we don't yet have the
concept of a 'loading thread'"));
}
return create_jpeg_movie(in, url);
}
@@ -444,7 +447,7 @@
return create_swf_movie(in, url, startLoaderThread);
}
- log_error("unknown file type (%s)", type.c_str());
+ log_error(_("unknown file type (%s)"), type.c_str());
return NULL;
}
@@ -455,17 +458,17 @@
std::string url_str = url.str();
const char* c_url = url_str.c_str();
-// printf("%s: url is %s\n", __PRETTY_FUNCTION__, c_url);
+// log_msg(_("%s: url is %s"), __PRETTY_FUNCTION__, c_url);
std::auto_ptr<tu_file> in ( globals::streamProvider.getStream(url) );
if ( ! in.get() )
{
- log_error("failed to open '%s'; can't create movie.", c_url);
+ log_error(_("failed to open '%s'; can't create movie"), c_url);
return NULL;
}
else if ( in->get_error() )
{
- log_error("streamProvider opener can't open '%s'", c_url);
+ log_error(_("streamProvider opener can't open '%s'"), c_url);
return NULL;
}
@@ -483,15 +486,17 @@
|| cache_in->get_error() != TU_FILE_NO_ERROR)
{
// Can't open cache file; don't sweat it.
- log_parse("note: couldn't open cache file '%s'\n",
+ IF_VERBOSE_PARSE (
+ log_parse(_("note: couldn't open cache file '%s'"),
cache_filename.c_str());
+ )
// can't read cache, so generate font texture data.
ret->generate_font_bitmaps();
}
else
{
- log_msg("Loading cache file %s",
+ log_msg(_("Loading cache file %s"),
cache_filename.c_str());
// Load the cached data.
ret->input_cached_data(cache_in.get());
@@ -619,7 +624,7 @@
if (m->get_ref_count() < 2)
{
- log_action("extern movie deleted");
+ log_action(_("extern movie deleted"));
s_extern_sprites.erase(s_extern_sprites.begin() + i);
i--;
root_m->drop_ref();
@@ -659,7 +664,7 @@
//
movie_definition* create_library_movie(const URL& url, const char* real_url,
bool startLoaderThread)
{
-// log_msg("%s: url is %s", __PRETTY_FUNCTION__, url.str().c_str());
+// log_msg(_("%s: url is %s"), __PRETTY_FUNCTION__, url.str().c_str());
// Use real_url as label for cache if available
std::string cache_label = real_url ? URL(real_url).str() : url.str();
@@ -669,7 +674,7 @@
boost::intrusive_ptr<movie_definition> m;
if ( s_movie_library.get(cache_label, &m) )
{
- log_msg("Movie %s already in library", cache_label.c_str());
+ log_msg(_("Movie %s already in library"), cache_label.c_str());
// Return cached movie.
// m->add_ref(); let caller add the ref, if needed
return m.get();
@@ -681,18 +686,18 @@
// calling create_library_movie() again and NOT finding
// the just-created movie.
movie_definition* mov = create_movie(url, real_url, false);
- //log_msg("create_movie(%s, %s, false) returned %p", url.str().c_str(),
real_url, mov);
+ //log_msg(_("create_movie(%s, %s, false) returned %p"),
url.str().c_str(), real_url, mov);
if (mov == NULL)
{
- log_error("Couldn't load library movie '%s'",
+ log_error(_("Couldn't load library movie '%s'"),
url.str().c_str());
return NULL;
}
// Movie is good, add to the library
s_movie_library.add(cache_label, mov);
- log_msg("Movie %s (SWF%d) added to library", cache_label.c_str(),
mov->get_version());
+ log_msg(_("Movie %s (SWF%d) added to library"), cache_label.c_str(),
mov->get_version());
// Now complete the load if the movie is an SWF movie
//
@@ -708,7 +713,7 @@
}
}
- //log_msg("create_library_movie(%s, %s, startLoaderThread=%d) about to
return %p", url.str().c_str(), real_url, startLoaderThread, mov);
+ //log_msg(_("create_library_movie(%s, %s, startLoaderThread=%d) about
to return %p"), url.str().c_str(), real_url, startLoaderThread, mov);
return mov;
}
@@ -731,7 +736,7 @@
if (mov == NULL)
{
- log_error("couldn't create instance\n");
+ log_error(_("%s: couldn't create instance"), __FUNCTION__);
return NULL;
}
@@ -783,7 +788,7 @@
gnash::sprite_instance* m = movie_def->create_instance();
if (m == NULL)
{
- log_error("precompute_cached_data can't create instance of
movie\n");
+ log_error(_("precompute_cached_data can't create instance of
movie"));
return;
}
@@ -818,21 +823,21 @@
if (m->get_play_state() == gnash::sprite_instance::STOP)
{
// Kick the movie.
- //printf("kicking movie, kick ct = %d\n", kick_count);
+ //log_msg(_("kicking movie, kick ct = %d"), kick_count);
m->goto_frame(last_frame + 1);
m->set_play_state(gnash::sprite_instance::PLAY);
kick_count++;
if (kick_count > 10)
{
- //printf("movie is stalled; giving up on playing it
through.\n");
+ //log_msg(_("movie is stalled; giving up on playing
it through"));
break;
}
}
else if (m->get_current_frame() < last_frame)
{
// Hm, apparently we looped back. Skip ahead...
- log_error("loop back; jumping to frame " SIZET_FMT "\n",
last_frame);
+ log_error(_("loop back; jumping to frame " SIZET_FMT),
last_frame);
m->goto_frame(last_frame + 1);
}
else
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog backend/sound_handler_sdl.cpp e...,
John Gilmore <=