[Tux4kids-commits] r1694 - in tuxtype/trunk: . src
David Bruce
dbruce-guest at alioth.debian.org
Wed Dec 23 03:30:52 UTC 2009
Author: dbruce-guest
Date: 2009-12-23 03:30:52 +0000 (Wed, 23 Dec 2009)
New Revision: 1694
Modified:
tuxtype/trunk/configure.ac
tuxtype/trunk/src/input_methods.c
tuxtype/trunk/src/input_methods.h
Log:
more work on input methods code from Tux Paint
Modified: tuxtype/trunk/configure.ac
===================================================================
--- tuxtype/trunk/configure.ac 2009-12-23 03:30:47 UTC (rev 1693)
+++ tuxtype/trunk/configure.ac 2009-12-23 03:30:52 UTC (rev 1694)
@@ -1,5 +1,5 @@
# Process this file with autoconf to produce a configure script.
-AC_INIT([Tux Typing],[1.8.0],[tux4kids-tuxtype-dev at lists.alioth.debian.org],[tuxtype])
+AC_INIT([Tux Typing],[1.8.1],[tux4kids-tuxtype-dev at lists.alioth.debian.org],[tuxtype])
AC_CONFIG_SRCDIR([src/playgame.c])
AC_PREREQ(2.61)
Modified: tuxtype/trunk/src/input_methods.c
===================================================================
--- tuxtype/trunk/src/input_methods.c 2009-12-23 03:30:47 UTC (rev 1693)
+++ tuxtype/trunk/src/input_methods.c 2009-12-23 03:30:52 UTC (rev 1694)
@@ -219,7 +219,99 @@
*/
static IM_EVENT_FN im_event_fp = NULL;
+/* Language enum copied from Tux Paint's i18n.h (same authors) to */
+/* avoid need to separately include that file: */
+/* Possible languages: */
+enum
+{
+ LANG_AF, /* Afrikaans */
+ LANG_AR, /* Arabic */
+ LANG_AST, /* Asturian */
+ LANG_AZ, /* Azerbaijani */
+ LANG_BE, /* Belarusian */
+ LANG_BG, /* Bulgarian */
+ LANG_BO, /* Tibetan */
+ LANG_BR, /* Breton */
+ LANG_CA, /* Catalan */
+ LANG_CS, /* Czech */
+ LANG_CY, /* Welsh */
+ LANG_DA, /* Danish */
+ LANG_DE, /* German */
+ LANG_EL, /* Greek */
+ LANG_EN, /* English (American) (DEFAULT) */
+ LANG_EN_AU, /* English (Australian) */
+ LANG_EN_CA, /* English (Canadian) */
+ LANG_EN_GB, /* English (British) */
+ LANG_EN_ZA, /* English (South African) */
+ LANG_EO, /* Esperanto */
+ LANG_ES, /* Spanish */
+ LANG_ES_MX, /* Spanish (Mexican) */
+ LANG_ET, /* Estonian */
+ LANG_EU, /* Basque */
+ LANG_FI, /* Finnish */
+ LANG_FO, /* Faroese */
+ LANG_FR, /* French */
+ LANG_GA, /* Irish Gaelic */
+ LANG_GD, /* Scottish Gaelic */
+ LANG_GL, /* Galician */
+ LANG_GR, /* Gronings */
+ LANG_GU, /* Gujarati */
+ LANG_HE, /* Hebrew */
+ LANG_HI, /* Hindi */
+ LANG_HR, /* Croatian */
+ LANG_HU, /* Hungarian */
+ LANG_I_KLINGON_ROMANIZED, /* Klingon (Romanized) */
+ LANG_ID, /* Indonesian */
+ LANG_IS, /* Icelandic */
+ LANG_IT, /* Italian */
+ LANG_JA, /* Japanese */
+ LANG_KA, /* Georgian */
+ LANG_KM, /* Khmer */
+ LANG_KO, /* Korean */
+ LANG_KU, /* Kurdish */
+ LANG_LT, /* Lithuanian */
+ LANG_LV, /* Latvian */
+ LANG_MK, /* Macedonian */
+ LANG_MS, /* Malay */
+ LANG_NB, /* Norwegian Bokmal */
+ LANG_NL, /* Dutch */
+ LANG_NN, /* Norwegian Nynorsk */
+ LANG_NR, /* Ndebele */
+ LANG_OC, /* Occitan */
+ LANG_OJ, /* Ojibway */
+ LANG_PL, /* Polish */
+ LANG_PT_BR, /* Portuguese (Brazilian) */
+ LANG_PT_PT, /* Portuguese (Portugal) */
+ LANG_RO, /* Romanian */
+ LANG_RU, /* Russian */
+ LANG_RW, /* Kinyarwanda */
+ LANG_SHS, /* Shuswap */
+ LANG_SK, /* Slovak */
+ LANG_SL, /* Slovenian */
+ LANG_SON, /* Songhay */
+ LANG_SQ, /* Albanian */
+ LANG_SR, /* Serbian */
+ LANG_SV, /* Swedish */
+ LANG_SW, /* Swahili */
+ LANG_TA, /* Tamil */
+ LANG_TE, /* Telugu */
+ LANG_TH, /* Thai */
+ LANG_TL, /* Tagalog */
+ LANG_TR, /* Turkish */
+ LANG_TWI, /* Twi */
+ LANG_UK, /* Ukrainian */
+ LANG_VE, /* Venda */
+ LANG_VI, /* Vietnamese */
+ LANG_WA, /* Walloon */
+ LANF_WO, /* Wolof */
+ LANG_XH, /* Xhosa */
+ LANG_ZH_CN, /* Chinese (Simplified) */
+ LANG_ZH_TW, /* Chinese (Traditional) */
+ LANG_ZAM, /* Zapotec (Miahuatlan) */
+ NUM_LANGS
+};
+
/** Moved from Tux Paint's i18n.c: */
const char *lang_prefixes[NUM_LANGS] = {
"af",
@@ -317,7 +409,7 @@
* @see im_init()
* @see im_read()
*/
-static IM_EVENT_FN im_event_fns[NUM_LANGS];
+static IM_EVENT_FN im_event_fns[NUM_LANGS] = {NULL};
/* ***************************************************************************
@@ -1699,7 +1791,9 @@
#ifdef DEBUG
assert(0 <= im->lang && im->lang < NUM_LANGS);
- if(im_event_fp) printf("Initializing IM for %s...\n", lang_prefixes[im->lang]);
+
+ if(im_event_fns[im->lang])
+ printf("Initializing IM for %s...\n", lang_prefixes[im->lang]);
#endif
/* Initialize the individual IM */
@@ -1752,7 +1846,7 @@
*/
int im_read(IM_DATA* im, SDL_keysym ks)
{
- im_event_fp = NULL;
+// im_event_fp = NULL;
int redraw = 0;
/* Sanity check */
@@ -1765,8 +1859,10 @@
im_event_fp = im_event_fns[im->lang];
/* Run the language-specific IM or run the default C IM */
- if(im_event_fp) redraw = (*im_event_fp)(im, ks);
- else redraw = im_event_c(im, ks);
+ if(im_event_fp)
+ redraw = (*im_event_fp)(im, ks);
+ else
+ redraw = im_event_c(im, ks);
#ifdef IM_DEBUG
wprintf(L"* [%8ls] [%8ls] %2d %2d (%2d)\n", im->s, im->buf, wcslen(im->s), wcslen(im->buf), im->redraw);
Modified: tuxtype/trunk/src/input_methods.h
===================================================================
--- tuxtype/trunk/src/input_methods.h 2009-12-23 03:30:47 UTC (rev 1693)
+++ tuxtype/trunk/src/input_methods.h 2009-12-23 03:30:52 UTC (rev 1694)
@@ -69,98 +69,7 @@
int im_read(IM_DATA* im, SDL_keysym ks);
-/* Language enum copied from Tux Paint's i18n.h (same authors) to */
-/* avoid need to separately include that file: */
-/* Possible languages: */
-enum
-{
- LANG_AF, /* Afrikaans */
- LANG_AR, /* Arabic */
- LANG_AST, /* Asturian */
- LANG_AZ, /* Azerbaijani */
- LANG_BE, /* Belarusian */
- LANG_BG, /* Bulgarian */
- LANG_BO, /* Tibetan */
- LANG_BR, /* Breton */
- LANG_CA, /* Catalan */
- LANG_CS, /* Czech */
- LANG_CY, /* Welsh */
- LANG_DA, /* Danish */
- LANG_DE, /* German */
- LANG_EL, /* Greek */
- LANG_EN, /* English (American) (DEFAULT) */
- LANG_EN_AU, /* English (Australian) */
- LANG_EN_CA, /* English (Canadian) */
- LANG_EN_GB, /* English (British) */
- LANG_EN_ZA, /* English (South African) */
- LANG_EO, /* Esperanto */
- LANG_ES, /* Spanish */
- LANG_ES_MX, /* Spanish (Mexican) */
- LANG_ET, /* Estonian */
- LANG_EU, /* Basque */
- LANG_FI, /* Finnish */
- LANG_FO, /* Faroese */
- LANG_FR, /* French */
- LANG_GA, /* Irish Gaelic */
- LANG_GD, /* Scottish Gaelic */
- LANG_GL, /* Galician */
- LANG_GR, /* Gronings */
- LANG_GU, /* Gujarati */
- LANG_HE, /* Hebrew */
- LANG_HI, /* Hindi */
- LANG_HR, /* Croatian */
- LANG_HU, /* Hungarian */
- LANG_I_KLINGON_ROMANIZED, /* Klingon (Romanized) */
- LANG_ID, /* Indonesian */
- LANG_IS, /* Icelandic */
- LANG_IT, /* Italian */
- LANG_JA, /* Japanese */
- LANG_KA, /* Georgian */
- LANG_KM, /* Khmer */
- LANG_KO, /* Korean */
- LANG_KU, /* Kurdish */
- LANG_LT, /* Lithuanian */
- LANG_LV, /* Latvian */
- LANG_MK, /* Macedonian */
- LANG_MS, /* Malay */
- LANG_NB, /* Norwegian Bokmal */
- LANG_NL, /* Dutch */
- LANG_NN, /* Norwegian Nynorsk */
- LANG_NR, /* Ndebele */
- LANG_OC, /* Occitan */
- LANG_OJ, /* Ojibway */
- LANG_PL, /* Polish */
- LANG_PT_BR, /* Portuguese (Brazilian) */
- LANG_PT_PT, /* Portuguese (Portugal) */
- LANG_RO, /* Romanian */
- LANG_RU, /* Russian */
- LANG_RW, /* Kinyarwanda */
- LANG_SHS, /* Shuswap */
- LANG_SK, /* Slovak */
- LANG_SL, /* Slovenian */
- LANG_SON, /* Songhay */
- LANG_SQ, /* Albanian */
- LANG_SR, /* Serbian */
- LANG_SV, /* Swedish */
- LANG_SW, /* Swahili */
- LANG_TA, /* Tamil */
- LANG_TE, /* Telugu */
- LANG_TH, /* Thai */
- LANG_TL, /* Tagalog */
- LANG_TR, /* Turkish */
- LANG_TWI, /* Twi */
- LANG_UK, /* Ukrainian */
- LANG_VE, /* Venda */
- LANG_VI, /* Vietnamese */
- LANG_WA, /* Walloon */
- LANF_WO, /* Wolof */
- LANG_XH, /* Xhosa */
- LANG_ZH_CN, /* Chinese (Simplified) */
- LANG_ZH_TW, /* Chinese (Traditional) */
- LANG_ZAM, /* Zapotec (Miahuatlan) */
- NUM_LANGS
-};
#endif /* TUXPAINT_IM_H */
/* vim:ts=8
More information about the Tux4kids-commits
mailing list