Commit 2904455a authored by Bruno Coudoin's avatar Bruno Coudoin

*** RELEASE 8.0BETA6 ***

	- Fixed clickgame and chess on windows (uses the old chess.c code)
	- chess on linux updated to use the new glib API
	- More GC API fix:
	  board_pause now gc_board_pause
	  board_play now gc_board_play
	  board_stop now gc_board_stop
parent 4b953d15
*** RELEASE 8.0BETA6 ***
2006-09-18 Bruno coudoin <bruno.coudoin@free.fr>
- Fixed clickgame and chess on windows (uses the old chess.c code)
- chess on linux updated to use the new glib API
- More GC API fix:
board_pause now gc_board_pause
board_play now gc_board_play
board_stop now gc_board_stop
* Makefile.am:
* Makefile.mingw:
* README.mingw:
* config.h.mingw:
* configure.in:
* gcompris-installer.nsi.in:
* src/boards/chess.c: (gnuchess_died), (start_board), (end_board),
(chess_create_item), (engine_local_destroy), (engine_local_cb),
(engine_local_err_cb), (start_child), (write_child):
* src/boards/click_on_letter.c: (sounds_are_fine):
* src/boards/memory.c: (start_board):
* src/boards/menu2.c: (menu_start), (create_panel),
(display_section), (display_board_icon), (next_spot),
(menu_create_item), (item_event), (set_content), (get_ratio),
(create_top), (display_welcome):
* src/boards/planegame.c: (key_press), (planegame_next_level),
(planegame_cloud_colision), (planegame_move_item),
(planegame_destroy_items), (planegame_destroy_all_items),
(planegame_create_item), (planegame_add_new_item), (item_event):
* src/boards/py-gcompris-board.c: (pyGcomprisBoardType_getattr),
(pyGcomprisBoardType_setattr):
* src/boards/shapegame.c: (item_event):
* src/boards/submarine.c: (quit_after_delay):
* src/gcompris/about.c: (gc_about_start), (gc_about_stop):
* src/gcompris/bar.c: (item_event_bar):
* src/gcompris/board.c: (init_plugins), (gc_board_check_file),
(gc_board_play), (gc_board_pause), (gc_board_stop),
(get_board_playing), (board_run_next_end), (board_run_next):
* src/gcompris/board.h:
* src/gcompris/bonus.c: (gc_bonus_end_display), (gc_bonus_display),
(end_bonus):
* src/gcompris/config.c: (gc_config_start), (gc_config_stop):
* src/gcompris/dialog.c: (gc_dialog), (item_event_ok):
* src/gcompris/file_selector.c: (gc_selector_file_stop),
(display_file_selector):
* src/gcompris/gcompris.c: (board_widget_key_press_callback),
(setup_window), (gc_board_end), (cleanup):
* src/gcompris/gcompris_confirm.c: (gc_confirm_box_stop),
(display_confirm):
* src/gcompris/help.c: (gc_help_start), (gc_help_stop):
* src/gcompris/images_selector.c: (gc_selector_images_start),
(gc_selector_images_stop):
* src/gcompris/menu.c: (_add_xml_to_data), (_read_xml_file),
(gc_menu_section_get), (gc_menu_has_activity), (gc_menu_getlist),
(gc_menu_load_dir), (gc_menu_load):
2006-09-17 Bruno coudoin <bruno.coudoin@free.fr> 2006-09-17 Bruno coudoin <bruno.coudoin@free.fr>
- Minor resizing of some icons do make them appear smother - Minor resizing of some icons do make them appear smother
......
...@@ -30,7 +30,7 @@ EXTRA_DIST = \ ...@@ -30,7 +30,7 @@ EXTRA_DIST = \
intltool-update.in \ intltool-update.in \
gnome2-macros \ gnome2-macros \
README.mingw README.translators README.windows \ README.mingw README.translators README.windows \
config.h.mingw.in Makefile.mingw global_win32.mak gcompris.ico gcompris-uninstall.ico \ config.h.mingw Makefile.mingw global_win32.mak gcompris.ico gcompris-uninstal.ico \
gcompris-installer.nsi gcompris-installer.nsi
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Description: Top Makefile for win32 (mingw) port of GCompris # Description: Top Makefile for win32 (mingw) port of GCompris
# #
VERSION = "8.0BETA5" VERSION = "8.0BETA6"
pkgdatadir = gcompris pkgdatadir = gcompris
......
...@@ -64,6 +64,8 @@ GNUCHESS_TOP := /gnuchess ...@@ -64,6 +64,8 @@ GNUCHESS_TOP := /gnuchess
* Now on the windows system: * Now on the windows system:
* Get a tarball or CVS snapshot of gcompris. * Get a tarball or CVS snapshot of gcompris.
* untar the gcompris-win-prepack.tar.gz in it * untar the gcompris-win-prepack.tar.gz in it
* Manual fix draw.xml to use draw instead of python
* Manual fix, replace chess.c by chess.c.windows
* run: make -f Makefile.mingw from gcompris's top-level directory. This will take a long time. * run: make -f Makefile.mingw from gcompris's top-level directory. This will take a long time.
* run: make -f Makefile.mingw prepack to include all necessary libraries in the installer directory * run: make -f Makefile.mingw prepack to include all necessary libraries in the installer directory
* run: make -f Makefile.mingw install to include the generated code in the installer directory * run: make -f Makefile.mingw install to include the generated code in the installer directory
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* config.h.in. Generated from configure.in by autoheader. */ /* config.h.in. Generated from configure.in by autoheader. */
/* Version number of package */ /* Version number of package */
#define VERSION "8.0BETA5" #define VERSION "8.0BETA6"
/* Supported languages */ /* Supported languages */
#define ALL_LINGUAS "am ar az bg ca cs da de el en_CA en_GB es et fi fr ga gu he hi hr hu it lt mk ml ms nl nb nn pa pl pt pt_BR ro ru sk sl sq sr sr@Latn sv tr wa zh_CN" #define ALL_LINGUAS "am ar az bg ca cs da de el en_CA en_GB es et fi fr ga gu he hi hr hu it lt mk ml ms nl nb nn pa pl pt pt_BR ro ru sk sl sq sr sr@Latn sv tr wa zh_CN"
......
...@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. ...@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/gcompris/gcompris.c) AC_INIT(src/gcompris/gcompris.c)
AC_CANONICAL_TARGET AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(gcompris, 8.0BETA5) AM_INIT_AUTOMAKE(gcompris, 8.0BETA6)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
......
...@@ -22,6 +22,8 @@ Name $name ...@@ -22,6 +22,8 @@ Name $name
OutFile "gcompris-${GCOMPRIS_VERSION}.exe" OutFile "gcompris-${GCOMPRIS_VERSION}.exe"
UninstallIcon ".\gcompris-uninstal.ico"
SetCompressor lzma SetCompressor lzma
ShowInstDetails show ShowInstDetails show
ShowUninstDetails show ShowUninstDetails show
...@@ -49,7 +51,7 @@ SetDateSave on ...@@ -49,7 +51,7 @@ SetDateSave on
;Modern UI Configuration ;Modern UI Configuration
!define MUI_ICON ".\gcompris.ico" !define MUI_ICON ".\gcompris.ico"
!define MUI_UNICON ".\gcompris-uninstall.ico" !define MUI_UNICON ".\gcompris-uninstal.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP ".\nsis\gcompris-intro.bmp" !define MUI_WELCOMEFINISHPAGE_BITMAP ".\nsis\gcompris-intro.bmp"
!define MUI_HEADERIMAGE !define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP ".\nsis\gcompris-header.bmp" !define MUI_HEADERIMAGE_BITMAP ".\nsis\gcompris-header.bmp"
...@@ -69,7 +71,7 @@ SetDateSave on ...@@ -69,7 +71,7 @@ SetDateSave on
;-------------------------------- ;--------------------------------
;Pages ;Pages
!insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "./COPYING" !insertmacro MUI_PAGE_LICENSE "./COPYING"
!insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_COMPONENTS
...@@ -87,7 +89,7 @@ SetDateSave on ...@@ -87,7 +89,7 @@ SetDateSave on
;-------------------------------- ;--------------------------------
;Languages ;Languages
;; English goes first because its the default. The rest are ;; English goes first because its the default. The rest are
;; in alphabetical order (at least the strings actually displayed ;; in alphabetical order (at least the strings actually displayed
;; will be). ;; will be).
...@@ -163,7 +165,7 @@ SetDateSave on ...@@ -163,7 +165,7 @@ SetDateSave on
; Only need this if using bzip2 compression ; Only need this if using bzip2 compression
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
!insertmacro MUI_RESERVEFILE_LANGDLL !insertmacro MUI_RESERVEFILE_LANGDLL
ReserveFile "${NSISDIR}\Plugins\UserInfo.dll" ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
...@@ -208,7 +210,7 @@ Section -SecUninstallOldGcompris ...@@ -208,7 +210,7 @@ Section -SecUninstallOldGcompris
; If previous version exists .. remove ; If previous version exists .. remove
try_uninstall: try_uninstall:
StrCmp $R1 "" done StrCmp $R1 "" done
; Version key started with 0.60a3. Prior versions can't be ; Version key started with 0.60a3. Prior versions can't be
; automaticlly uninstalled. ; automaticlly uninstalled.
StrCmp $R2 "" uninstall_problem StrCmp $R2 "" uninstall_problem
; Check if we have uninstall string.. ; Check if we have uninstall string..
...@@ -234,7 +236,7 @@ Section -SecUninstallOldGcompris ...@@ -234,7 +236,7 @@ Section -SecUninstallOldGcompris
uninstall_problem: uninstall_problem:
; In this case just wipe out previous Gcompris install dir.. ; In this case just wipe out previous Gcompris install dir..
; We get here because versions 0.60a1 and 0.60a2 don't have versions set in the registry ; We get here because versions 0.60a1 and 0.60a2 don't have versions set in the registry
; and versions 0.60 and lower did not correctly set the uninstall reg string ; and versions 0.60 and lower did not correctly set the uninstall reg string
; (the string was set in quotes) ; (the string was set in quotes)
IfSilent do_wipeout IfSilent do_wipeout
MessageBox MB_YESNO $(GCOMPRIS_PROMPT_WIPEOUT) IDYES do_wipeout IDNO cancel_install MessageBox MB_YESNO $(GCOMPRIS_PROMPT_WIPEOUT) IDYES do_wipeout IDNO cancel_install
...@@ -646,7 +648,7 @@ Function un.onInit ...@@ -646,7 +648,7 @@ Function un.onInit
; Get stored language prefrence ; Get stored language prefrence
ReadRegStr $LANGUAGE HKCU ${GCOMPRIS_REG_KEY} "${GCOMPRIS_REG_LANG}" ReadRegStr $LANGUAGE HKCU ${GCOMPRIS_REG_KEY} "${GCOMPRIS_REG_LANG}"
FunctionEnd FunctionEnd
...@@ -654,42 +656,42 @@ FunctionEnd ...@@ -654,42 +656,42 @@ FunctionEnd
; input, none ; input, none
; output, top of stack (replaces, with e.g. whatever) ; output, top of stack (replaces, with e.g. whatever)
; modifies no other variables. ; modifies no other variables.
Function GetParameters Function GetParameters
Push $R0 Push $R0
Push $R1 Push $R1
Push $R2 Push $R2
Push $R3 Push $R3
StrCpy $R2 1 StrCpy $R2 1
StrLen $R3 $CMDLINE StrLen $R3 $CMDLINE
;Check for quote or space ;Check for quote or space
StrCpy $R0 $CMDLINE $R2 StrCpy $R0 $CMDLINE $R2
StrCmp $R0 '"' 0 +3 StrCmp $R0 '"' 0 +3
StrCpy $R1 '"' StrCpy $R1 '"'
Goto loop Goto loop
StrCpy $R1 " " StrCpy $R1 " "
loop: loop:
IntOp $R2 $R2 + 1 IntOp $R2 $R2 + 1
StrCpy $R0 $CMDLINE 1 $R2 StrCpy $R0 $CMDLINE 1 $R2
StrCmp $R0 $R1 get StrCmp $R0 $R1 get
StrCmp $R2 $R3 get StrCmp $R2 $R3 get
Goto loop Goto loop
get: get:
IntOp $R2 $R2 + 1 IntOp $R2 $R2 + 1
StrCpy $R0 $CMDLINE 1 $R2 StrCpy $R0 $CMDLINE 1 $R2
StrCmp $R0 " " get StrCmp $R0 " " get
StrCpy $R0 $CMDLINE "" $R2 StrCpy $R0 $CMDLINE "" $R2
Pop $R3 Pop $R3
Pop $R2 Pop $R2
Pop $R1 Pop $R1
Exch $R0 Exch $R0
FunctionEnd FunctionEnd
; StrStr ; StrStr
...@@ -836,7 +838,7 @@ Function GetWindowsVersion ...@@ -836,7 +838,7 @@ Function GetWindowsVersion
lbl_error: lbl_error:
Strcpy $R0 '' Strcpy $R0 ''
lbl_done: lbl_done:
Pop $R1 Pop $R1
Exch $R0 Exch $R0
FunctionEnd FunctionEnd
......
...@@ -179,10 +179,8 @@ static void pause_board (gboolean pause) ...@@ -179,10 +179,8 @@ static void pause_board (gboolean pause)
void gnuchess_died(int signum) void gnuchess_died(int signum)
{ {
if(signum == SIGTRAP) gnuchess_pid = 0;
{ gc_dialog(_("Error: The external program gnuchess died unexpectingly"), gc_board_stop);
gc_dialog(_("Error: The external program gnuchess died unexpectingly"), gc_board_end);
}
} }
/* /*
...@@ -190,12 +188,17 @@ void gnuchess_died(int signum) ...@@ -190,12 +188,17 @@ void gnuchess_died(int signum)
static void start_board (GcomprisBoard *agcomprisBoard) static void start_board (GcomprisBoard *agcomprisBoard)
{ {
signal(SIGTRAP, gnuchess_died); gnuchess_pid = 0;
#ifndef WIN32
if (!g_file_test (GNUCHESS, G_FILE_TEST_EXISTS)) {
gc_dialog(_("Error: The external program gnuchess is mandatory\nto play chess in gcompris.\nFind this program on http://www.rpmfind.net or in your\nGNU/Linux distribution\nAnd check it is located here: "GNUCHESS), gc_board_end);
#ifndef WIN32
signal(SIGTRAP, gnuchess_died);
signal(SIGPIPE, gnuchess_died);
if (!g_file_test (GNUCHESS, G_FILE_TEST_EXISTS))
{
gc_dialog(_("Error: The external program gnuchess is mandatory\nto play chess in gcompris.\n"
"Find this program on http://www.rpmfind.net or in your\nGNU/Linux distribution\n"
"And check it is located here: "GNUCHESS),
gc_board_stop);
return; return;
} }
#endif #endif
...@@ -232,12 +235,15 @@ static void start_board (GcomprisBoard *agcomprisBoard) ...@@ -232,12 +235,15 @@ static void start_board (GcomprisBoard *agcomprisBoard)
} }
if(start_child (GNUCHESS, &read_chan, if(start_child (GNUCHESS, &read_chan,
&write_chan, &gnuchess_pid)==FALSE) { &write_chan, &gnuchess_pid)==FALSE)
gc_dialog(_("Error: The external program gnuchess is mandatory\nto play chess in gcompris.\nFind this program on http://www.rpmfind.net or in your\nGNU/Linux distribution\nAnd check it is in "GNUCHESS), gc_board_end); {
return; gc_dialog(_("Error: The external program gnuchess is mandatory\n"
} "to play chess in gcompris.\n"
"First install it, and check it is in "GNUCHESS), gc_board_stop);
return;
}
read_cb = g_io_add_watch (read_chan, G_IO_IN, read_cb = g_io_add_watch (read_chan, G_IO_IN|G_IO_PRI,
engine_local_cb, NULL); engine_local_cb, NULL);
err_cb = g_io_add_watch (read_chan, G_IO_HUP, err_cb = g_io_add_watch (read_chan, G_IO_HUP,
engine_local_err_cb, NULL); engine_local_err_cb, NULL);
...@@ -248,17 +254,23 @@ static void start_board (GcomprisBoard *agcomprisBoard) ...@@ -248,17 +254,23 @@ static void start_board (GcomprisBoard *agcomprisBoard)
write_child (write_chan, "easy\n"); write_child (write_chan, "easy\n");
write_child (write_chan, "level 100 1 0\n"); write_child (write_chan, "level 100 1 0\n");
write_child (write_chan, "depth 1\n"); write_child (write_chan, "depth 1\n");
write_child (write_chan, "time 500\n");
chess_next_level(); chess_next_level();
gamewon = FALSE; gamewon = FALSE;
pause_board(FALSE); pause_board(FALSE);
} }
} }
/* ======================================= */ /* ======================================= */
static void end_board () static void end_board ()
{ {
#ifndef WIN32
signal(SIGTRAP, NULL);
signal(SIGPIPE, NULL);
#endif
if(gcomprisBoard!=NULL) if(gcomprisBoard!=NULL)
{ {
pause_board(TRUE); pause_board(TRUE);
...@@ -386,7 +398,8 @@ static void chess_destroy_all_items() ...@@ -386,7 +398,8 @@ static void chess_destroy_all_items()
} }
/* ==================================== */ /* ==================================== */
static GnomeCanvasItem *chess_create_item(GnomeCanvasGroup *parent) static GnomeCanvasItem *
chess_create_item(GnomeCanvasGroup *parent)
{ {
guint color; guint color;
GnomeCanvasItem *item = NULL; GnomeCanvasItem *item = NULL;
...@@ -956,6 +969,9 @@ static void ...@@ -956,6 +969,9 @@ static void
engine_local_destroy (GPid gnuchess_pid) engine_local_destroy (GPid gnuchess_pid)
{ {
if(!gnuchess_pid)
return;
g_warning("engine_local_destroy () \n"); g_warning("engine_local_destroy () \n");
write_child (write_chan, "quit\n"); write_child (write_chan, "quit\n");
...@@ -972,26 +988,48 @@ engine_local_destroy (GPid gnuchess_pid) ...@@ -972,26 +988,48 @@ engine_local_destroy (GPid gnuchess_pid)
g_spawn_close_pid(gnuchess_pid); g_spawn_close_pid(gnuchess_pid);
} }
/** We got data back from gnuchess, we parse them here
*
*/
static gboolean static gboolean
engine_local_cb (GIOChannel *source, engine_local_cb (GIOChannel *source,
GIOCondition condition, GIOCondition condition,
gpointer data) gpointer data)
{ {
static char buf[1024]; gchar buf[1000];
static char *b=buf; char *b=buf;
GError *err = NULL;
char *p,*q; char *p,*q;
gsize len; gsize len = 0;
GIOStatus status; GIOStatus status = G_IO_STATUS_NORMAL;
g_warning("engine_local_cb");
status = g_io_channel_read_chars(source,
buf,
1000,
&len,
&err);
g_warning("g_io_channel_read_line len=%d", len);
if(status == G_IO_STATUS_ERROR)
{
g_warning("g_io_channel_read_chars error=%s",
err->message);
/* FIXME: Not sure what to do */
return FALSE;
}
status = g_io_channel_read_chars (read_chan, b, sizeof (buf) - 1 - (b - buf), &len, NULL);
if(status != G_IO_STATUS_NORMAL) if(status != G_IO_STATUS_NORMAL)
{ {
g_warning("g_io_channel_read_chars status=%d\n", status); g_warning("g_io_channel_read_chars error=%d",
status);
/* FIXME: Not sure what to do */ /* FIXME: Not sure what to do */
return FALSE; return FALSE;
} }
g_warning("engine_local_cb read=%s\n", buf);
if (len > 0) { if (len > 0) {
b[len] = 0; b[len] = 0;
b += len; b += len;
...@@ -1038,7 +1076,7 @@ engine_local_cb (GIOChannel *source, ...@@ -1038,7 +1076,7 @@ engine_local_cb (GIOChannel *source,
Square from, to; Square from, to;
p = strstr (buf, ":"); p = strstr (buf, ":");
printf("computer moves to %s\n", p+1); g_warning("computer moves to %s\n", p+1);
if (san_to_move (position, p+1, &from, &to)) if (san_to_move (position, p+1, &from, &to))
ascii_to_move (position, p+1, &from, &to); ascii_to_move (position, p+1, &from, &to);
...@@ -1092,8 +1130,8 @@ engine_local_err_cb (GIOChannel *source, ...@@ -1092,8 +1130,8 @@ engine_local_err_cb (GIOChannel *source,
GIOCondition condition, GIOCondition condition,
gpointer data) gpointer data)
{ {
g_error ("Local Engine connection died"); gnuchess_pid = 0;
gc_dialog(_("Error: The external program gnuchess died unexpectingly"), gc_board_stop);
return FALSE; return FALSE;
} }
...@@ -1111,7 +1149,7 @@ start_child (char *cmd, ...@@ -1111,7 +1149,7 @@ start_child (char *cmd,
gint Child_In, Child_Out, Child_Err; gint Child_In, Child_Out, Child_Err;
GError *gerror = NULL; GError *gerror = NULL;
gchar *Child_Argv[]={ cmd, NULL }; gchar *Child_Argv[]={ cmd, "-e", NULL };
g_warning("Ready to start child"); g_warning("Ready to start child");
...@@ -1136,42 +1174,18 @@ start_child (char *cmd, ...@@ -1136,42 +1174,18 @@ start_child (char *cmd,
if(g_io_channel_set_encoding(*write_chan, NULL, NULL) != G_IO_STATUS_NORMAL) if(g_io_channel_set_encoding(*write_chan, NULL, NULL) != G_IO_STATUS_NORMAL)
g_warning("Failed to set NULL encoding"); g_warning("Failed to set NULL encoding");
if(g_io_channel_set_flags (*read_chan, G_IO_FLAG_SET_MASK, NULL) != G_IO_STATUS_NORMAL) if(g_io_channel_set_flags (*read_chan, G_IO_FLAG_NONBLOCK, NULL) != G_IO_STATUS_NORMAL)
g_warning("Failed to set NON BLOCKING IO"); g_warning("Failed to set NON BLOCKING IO");
if(g_io_channel_set_flags (*write_chan, G_IO_FLAG_SET_MASK, NULL) != G_IO_STATUS_NORMAL) if(g_io_channel_set_flags (*write_chan, G_IO_FLAG_NONBLOCK, NULL) != G_IO_STATUS_NORMAL)
g_warning("Failed to set NON BLOCKING IO"); g_warning("Failed to set NON BLOCKING IO");
return(TRUE); return(TRUE);
} }
static void /** Write a command to the gnuchess backend
write_child (GIOChannel *write_chan, char *format, ...) *
{
GIOError err;
va_list ap;
char *buf;
gsize len;
va_start (ap, format);
buf = g_strdup_vprintf (format, ap);
err = g_io_channel_write (write_chan, buf, strlen (buf), &len);
if (err != G_IO_ERROR_NONE)
g_warning ("Writing to child process failed");
else
g_warning ("Wrote '%s' to gnuchess", buf);
va_end (ap);
g_free (buf);
}
/* FIXME: The new API bellow should be use but for an unknown reason it doesn't work,
* Not all data are read back using this method
*/ */
/*
static void static void
write_child (GIOChannel *write_chan, char *format, ...) write_child (GIOChannel *write_chan, char *format, ...)
{ {
...@@ -1179,19 +1193,27 @@ write_child (GIOChannel *write_chan, char *format, ...) ...@@ -1179,19 +1193,27 @@ write_child (GIOChannel *write_chan, char *format, ...)
va_list ap; va_list ap;
gchar *buf; gchar *buf;
gsize