Commit 90cd3015 authored by Bruno Coudoin's avatar Bruno Coudoin

added documentation fixed 1 missing pixel border removed and replaced by

* boards/redraw.xml.in: added documentation
* boards/skins/default/gcompris-shapebg.jpg: fixed 1 missing pixel border
* boards/traffic/TrafficData: removed and replaced by traffic.h
* configure.in: replaced the dependancy of gcompris from gnome to gtk
marked to release 5.0
* docs/fr/gcompris.texi: fixed doc nodes
* gcompris.spec.in: fixed for info file distribution. better use of % directives
* po/POTFILES.in: added redraw.py
* src/boards/Makefile.am: added trafic.h
* src/boards/advanced_colors.c: (init_xml), (read_xml_file): gtk port
* src/boards/chess.c: (start_board), (chess_create_item),
(start_child): fixed error message and process to use GNUCHESS env var
* src/boards/clickgame.c: (load_random_pixmap): use g_file_test instead of g_file_exists
* src/boards/imageid.c: (init_xml), (read_xml_file): use g_file_test instead of g_file_exists
* src/boards/menu.c: (menu_create_item): use g_file_test instead of g_file_exists
* src/boards/missingletter.c: (init_xml), (read_xml_file): use g_file_test instead of g_file_exists
* src/boards/py-mod-sound.c: removed gcompris_play_sound (gnome dependant)
* src/boards/python/redraw.py: added i18n (don't work), removed editable flag
* src/boards/read_colors.c: (init_xml), (read_xml_file): use g_file_test instead of g_file_exits
* src/boards/reading.c: added stdio.h
* src/boards/traffic.c: (load_level), (cars_from_strv): modified to use a .h instead of a file for data
* src/boards/traffic.h: created with data from boards/traffic/TrafficData
* src/boards/wordsgame.c: added stdio.h
* src/gcompris/Makefile.am: gtk port
* src/gcompris/about.c: (item_event_ok): commented out gnome_url_show. Still Need a replacement
* src/gcompris/callbacks.c: (on_quit1_activate): implemeted quit CB, cleanup of unneeded funtions
* src/gcompris/config.c: (item_event_ok): gtk port
* src/gcompris/gcompris-edit.c: (quit_cb), (main): uses gcompris_write_boards_status now. Quit CB.
* src/gcompris/gcompris.c: (init_background),
(gcompris_set_cursor), (setup_window), (gcompris_exit),
(gcompris_init): gtk port, params reading rewrite, main loop moved from gnome to gtk
* src/gcompris/gcompris.h: added missing include due to the remove of gnome
* src/gcompris/pluginenum.c: added stdio.h
* src/gcompris/properties.c: (scan_get_int), (scan_get_string),
(gcompris_properties_new), (gcompris_properties_save),
(boards_write), (gcompris_write_boards_status),
(read_boards_status), (gcompris_properties_enable_board),
(gcompris_properties_disable_board): complete rewrite with the glib scanner.
* src/gcompris/properties.h: removed unused gcompris_properties_copy. added enum for properties
added gcompris_write_boards_status
* src/gcompris/soundutil.c: (gcompris_play_ogg_list):  removed gcompris_play_sound (gnome dependant)
* src/gcompris/soundutil.h:  removed gcompris_play_sound (gnome dependant)
parent 59885e7e
2003-12-09 Bruno coudoin <bruno.coudoin@free.fr>
* boards/redraw.xml.in: added documentation
* boards/skins/default/gcompris-shapebg.jpg: fixed 1 missing pixel border
* boards/traffic/TrafficData: removed and replaced by traffic.h
* configure.in: replaced the dependancy of gcompris from gnome to gtk
marked to release 5.0
* docs/fr/gcompris.texi: fixed doc nodes
* gcompris.spec.in: fixed for info file distribution. better use of % directives
* po/POTFILES.in: added redraw.py
* src/boards/Makefile.am: added trafic.h
* src/boards/advanced_colors.c: (init_xml), (read_xml_file): gtk port
* src/boards/chess.c: (start_board), (chess_create_item),
(start_child): fixed error message and process to use GNUCHESS env var
* src/boards/clickgame.c: (load_random_pixmap): use g_file_test instead of g_file_exists
* src/boards/imageid.c: (init_xml), (read_xml_file): use g_file_test instead of g_file_exists
* src/boards/menu.c: (menu_create_item): use g_file_test instead of g_file_exists
* src/boards/missingletter.c: (init_xml), (read_xml_file): use g_file_test instead of g_file_exists
* src/boards/py-mod-sound.c: removed gcompris_play_sound (gnome dependant)
* src/boards/python/redraw.py: added i18n (don't work), removed editable flag
* src/boards/read_colors.c: (init_xml), (read_xml_file): use g_file_test instead of g_file_exits
* src/boards/reading.c: added stdio.h
* src/boards/traffic.c: (load_level), (cars_from_strv): modified to use a .h instead of a file for data
* src/boards/traffic.h: created with data from boards/traffic/TrafficData
* src/boards/wordsgame.c: added stdio.h
* src/gcompris/Makefile.am: gtk port
* src/gcompris/about.c: (item_event_ok): commented out gnome_url_show. Still Need a replacement
* src/gcompris/callbacks.c: (on_quit1_activate): implemeted quit CB, cleanup of unneeded funtions
* src/gcompris/config.c: (item_event_ok): gtk port
* src/gcompris/gcompris-edit.c: (quit_cb), (main): uses gcompris_write_boards_status now. Quit CB.
* src/gcompris/gcompris.c: (init_background),
(gcompris_set_cursor), (setup_window), (gcompris_exit),
(gcompris_init): gtk port, params reading rewrite, main loop moved from gnome to gtk
* src/gcompris/gcompris.h: added missing include due to the remove of gnome
* src/gcompris/pluginenum.c: added stdio.h
* src/gcompris/properties.c: (scan_get_int), (scan_get_string),
(gcompris_properties_new), (gcompris_properties_save),
(boards_write), (gcompris_write_boards_status),
(read_boards_status), (gcompris_properties_enable_board),
(gcompris_properties_disable_board): complete rewrite with the glib scanner.
* src/gcompris/properties.h: removed unused gcompris_properties_copy. added enum for properties
added gcompris_write_boards_status
* src/gcompris/soundutil.c: (gcompris_play_ogg_list): removed gcompris_play_sound (gnome dependant)
* src/gcompris/soundutil.h: removed gcompris_play_sound (gnome dependant)
2003-12-06 Bruno coudoin <bruno.coudoin@free.fr>
* src/gcompris/bonus.c: now hide the bar.
......
......@@ -11,7 +11,13 @@
<_title>Redraw the given item</_title>
<_description></_description>
<_prerequisite></_prerequisite>
<_goal></_goal>
<_manual></_manual>
<_goal>At each level, a drawing is displayed in the right area.
You must redraw it in the left area.</_goal>
<_manual>First you must select the proper tool in the tool bar.
Then, you must drag the mouse to create objects.
When you are done, click on the OK button, you will be told were the
errors are with little red cross.
The order of objects (above/under) is not important but take care
not to have unwanted object under others.</_manual>
</Board>
</GCompris>
# Copyright (C) 2002 Bruno Coudoin
#
# The format and the dataset for the traffic game in gcompris
# is taken from from
# http://www.javascript-games.org/puzzle/rushhour/
#
# [LevelX]
# CardY=string describing card 1
# CardY=string describing card 2
# ...
# Where X is the Gcompris Level (in the control bar)
# Where Y is the sublevel.
#
# This is followed by a comma separated list defining the cars on the
# grid. So the string looks as follows:
#
# 'ID''X''Y'
#
# - 'ID' is one char in the range A-R and X
# A-N Specify a different car color of size 2
# O-R Specify a different car color of size 3
# X Always Red, the goal car of size 2
#
# - 'X' xpos numbers between
# 1 to 6 for Vertical car
# A to F for Horizontal car
#
# - 'Y' ypos numbers between
# 1 to 6 for Horizontal car
# A to F for Vertical car
#
[Level1]
Card1=XB3,AA1,B5A,CE5,O1F,P2A,Q2D,RC6
Card2=XA3,A1A,B2D,C3E,D5C,EE5,FA6,GD6,OD1,P2F,QA4
Card3=XB3,AB4,B5B,CC6,O3D,P4F
Card4=XB3,A4C,B5F,O1A,P1D,QD4,RC6
Card5=XB3,AA1,B1F,D5A,EE5,FE6,G3F,O1D,P2A,Q2E,RB4
[Level2]
Card1=XB3,AA1,B1D,CA2,DA4,E4C,F5A,O2E,P2F,Q3D,RD6
Card2=XB3,A1B,BC1,C1E,D1F,E2D,F3F,IC4,H5D
Card3=XA3,AD1,BC2,C2E,D3C,E3D,FA4,GE4,HA5,I5C,KA6,O1F,PD5,QD6
Card4=XA3,A1B,BC1,CE1,D2D,EE2,F3F,G5C,H5F,O3E,P4A,QB4
Card5=XB3,AA1,B1C,CE1,DA2,E5D,FE5,GA6,HE6,O2F,P3A,QB4
[Level3]
Card1=XB3,AB1,B4C,E5F,O1A,P1D,QD4,RC6
Card2=XA3,A1A,BB1,C5E,O1F,P2C,QD4,RA6
Card3=XD3,AA1,BC1,C1E,D2C,E3B,FD4,G5D,HE5,IB6,KE6,O2F,P4A
Card4=XC3,AA1,B1C,CE2,D3A,E3B,F3E,G3F,HC4,I5C,JE5,KA6
Card5=XC3,AB1,BD1,CA2,DC2,E4C,F4D,GE5,HB6,ID6,O2E,P2F,Q3A,R3B
[Level4]
Card1=XD3,AA1,BC1,C1E,D2A,EC2,F3B,GA6,O1F,P3C,QD4
Card2=XA3,A1A,BC2,CE2,D3C,EA4,F5E,G5F,OB1,P4D,QA5,RA6
Card3=XB3,AA1,B1C,CA2,DB5,O1D,P3A,QB4,RA6
Card4=XC3,A1C,BD1,D3B,EC4,F4E,J2E,OB5
Card5=XA3,A1A,BB2,C2D,D3C,E5C,FD5,OD1,P3F,QD6
[Level5]
Card1=XB3,AA1,B1C,O1D,P2A,QB4,RD6
Card2=XB3,A1C,B2A,CE2,D4B,EE4,F5A,GC5,H5F,OD1,P2D,QB6
Card3=XD3,A2C,BD2,C4C,D4D,EE4,FE5,OC1,P1F,QC6
Card4=XC3,A1C,BD1,C2B,D3A,E3E,FB4,G5E,HA6,OA5
Card5=XB3,AA1,B1C,CE1,DA2,E3E,F5B,G5D,HE5,IE6,O2F,P3A,QB4
[Level6]
Card1=XB3,A1B,B2A,C2D,D3F,E4A,F5C,G5F,HD6,OD1,P2E,RB4
Card2=XA3,A1A,BB1,CB2,D3C,ED4,F5C,O1D,P3F,RD6
Card3=XA3,A1D,BE2,C4A,D4B,ED4,FA6,GC6,OA1,P2C,Q4F,RC5
Card4=XA3,A2C,B3F,C4A,DB4,ED4,FB5,G5D,H5F,OA1,P1E,RA6
Card5=XB3,A1C,B2D,CA4,DC4,EA6,FC6,O1A,PD1,Q4F
[Level7]
Card1=XB3,AA1,B2D,CE2,D3A,ED4,FA5,OD1,P3F,Q4C,RD6
Card2=XA3,AA1,B1D,CE1,D4A,EB4,FD4,HA6,K5D,O1C,P4F
Card3=XA3,A1B,BE1,DB4,ED4,FB5,G5D,H5E,I4A,P4F,QA6,R1C
Card4=XA3,A1A,B2D,C3E,D4D,E5C,FE5,HD6,IA6,P2F,QA4,RD1
Card5=XA3,AD1,B2D,DB5,E5D,F5E,GA6,K4A,O1C,P1F,QB4
[Level8]
Card1=XC3,AE1,B2B,CC2,D4D,E5C,FE5,GA6,O1A,PB1,Q2F,RA4
Card2=XB3,AA1,B1C,CE1,DA2,E5D,FE5,GA6,HE6,O2E,P2F,Q3A,RB4
Card3=XA3,A1A,BB2,C2D,D3C,ED4,F5C,GD5,OD1,QD6,R3F
Card4=XA3,A1C,B2D,C3C,DA4,ED4,F5A,G5B,HC5,IC6,OD1,R3F
Card5=XD3,AB1,B1E,C2B,D2C,E4D,F5C,GE5,HA6,ID6,O1A,P2F,QA4
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/gcompris/gcompris.c)
AM_INIT_AUTOMAKE(gcompris, 4.2)
AM_INIT_AUTOMAKE(gcompris, 5.0)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_ISC_POSIX
LIBGNOME_REQUIRED=1.96.0
LIBGNOMEUI_REQUIRED=1.96.0
GTK_REQUIRED=2.0.3
GDK_PIXBUF_REQUIRED=2.0.6
LIBGNOMECANVAS_REQUIRED=2.0.2
PKG_CHECK_MODULES(GCOMPRIS, libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED libgnomecanvas-2.0 >= $LIBGNOMECANVAS_REQUIRED gthread-2.0 libassetml)
PKG_CHECK_MODULES(GCOMPRIS, gtk+-2.0 >= $GTK_REQUIRED gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED libgnomecanvas-2.0 >= $LIBGNOMECANVAS_REQUIRED gthread-2.0 libassetml)
AC_SUBST(GCOMPRIS_CFLAGS)
AC_SUBST(GCOMPRIS_LIBS)
dnl gcompris-edit still require gnome
GCOMPRIS_EDIT_CFLAGS=
GCOMPRIS_EDIT_LIBS=
dnl By default, build gcompris-edit
GCOMPRIS_EDIT=yes
build_gcompris_edit=yes
AC_ARG_WITH(editor,
AC_HELP_STRING(
[--with-editor],
[Tell configure to compile gcompris-edit (it requires gnome)]),
[GCOMPRIS_EDIT=$withval] )
if test x$GCOMPRIS_EDIT = xno; then
build_gcompris_edit=no
fi
dnl Finally output the required python variables and automake defines.
AM_CONDITIONAL(GCOMPRIS_EDIT, test x$build_gcompris_edit = xyes)
if test x$build_gcompris_edit = xno; then
AC_MSG_NOTICE([gcompris-edit build is disabled.])
else
dnl gcompris-edit is requested, so check for gnome
LIBGNOME_REQUIRED=1.96.0
LIBGNOMEUI_REQUIRED=1.96.0
PKG_CHECK_MODULES(GCOMPRIS_EDIT, libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED)
AC_SUBST(GCOMPRIS_EDIT_CFLAGS)
AC_SUBST(GCOMPRIS_EDIT_LIBS)
fi
dnl For embedded ogg player
dnl FIXME XIPH prefix are the one needed on Mandrake ?
XIPH_PATH_OGG
......@@ -45,6 +77,10 @@ AC_SUBST(XML_LIBS)
dnl glib-genmarshal
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
dnl popt
AC_CHECK_LIB(popt, poptDupArgv,,
AC_MSG_ERROR([You must have popt 1.5 or newer to compile gcompris.]))
AM_ICONV
dnl Add the languages which your application supports here.
......@@ -337,6 +373,7 @@ echo ""
echo configure complete,
echo with options:
echo python plugins = $build_python_plugin
echo gcompris edit = $build_gcompris_edit
echo gcompris will be installed in ${prefix}
echo to compile and install in in another directory
echo type sh configure --prefix=/usr
......
......@@ -55,7 +55,7 @@ Documentation License".
@menu
* Introduction::
* Manuel utilisateur::
* Notes sur l'internationalisation::
* Internationalisation::
* Guide pour les développeurs::
* GNU Free Documentation License::
* Concept Index::
......@@ -74,7 +74,7 @@ Gcompris fait parti du projet GNU.
@cindex Objectif de Gcompris
@node Manuel utilisateur, Notes sur l'internationalisation, Introduction, Top
@node Manuel utilisateur, Internationalisation, Introduction, Top
@chapter Manuel utilisateur
@section Contrôles
Tous les contôles sont concus pour être simple d'utilisation pour les plus jeunes. Pour cette raison, bien que gcompris utilise les librairies gnomes, il n'en suis pas les standards.
......@@ -95,7 +95,7 @@ Chaque icone repr
@dfn{Zone de description des activités}
Affichage d'une description de l'activité mise en surbrillance.
Les descriptions sont internationalisée, c'est à dire traduites dans le language cible sélectionné dans gcompris (Voir @ref{Notes sur l'internationalisation} pour plus d'information sur l'internationalisation).
Les descriptions sont internationalisée, c'est à dire traduites dans le language cible sélectionné dans gcompris (Voir @ref{Internationalisation} pour plus d'information sur l'internationalisation).
@item
Barre de contrôle :
......@@ -150,8 +150,8 @@ Tout simplement dans le menu de d
@subsection Terminer une activité
Dans la barre, selectionner le boutton 'Retour'
@node Notes sur l'internationalisation, Guide pour les développeurs, Manuel utilisateur, Top
@chapter Notes sur l'internationalisation
@node Internationalisation, Guide pour les développeurs, Manuel utilisateur, Top
@chapter Internationalisation
@section Ma langue est-elle supportée ?
Gcompris est internationalisé et supporte déjà plusieurs langues.
......@@ -177,7 +177,7 @@ Pour v
Ensuite, envoyer la traduction au mainteneur de gcompris. Il/Elle l'incluera dans la prochaine version officielle.
@node Guide pour les développeurs, GNU Free Documentation License, Notes sur l'internationalisation, Top
@node Guide pour les développeurs, GNU Free Documentation License, Internationalisation, Top
@chapter Guide pour les développeurs
@section Pourquoi ajouter vos activités dans gcompris
Si vous avez une idée de tableau que vous aimeriez proposer aux enfants, vous pouvez faire un nouveau projet, appellons le gIdea. si vous commencez à partir de zero, il vous faudra tout implémenter, menu, bare de contôle, gestion des retours utilisateur, mécanismes d'aides, gestion du projet su le Web, ...
......
%define ver @VERSION@
%define name gcompris
%define version @VERSION@
%define RELEASE 1
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
%define prefix /usr
%define canvaspackage %(if rpm -q redhat-release &> /dev/null; then echo gdk-pixbuf-gnome; elif rpm -q mandrake-release &> /dev/null; then echo gdk-pixbuf-gnomecanvas; else echo; fi)
Summary: Educational suite for kids 3-10 years old
Name: gcompris
Version: %ver
Name: %name
Version: %version
Release: %rel
Copyright: GPL
Group: Amusements/Games
Group: Games/Other
Source: ftp://gcompris.sourceforge.net/gcompris-%{PACKAGE_VERSION}.tar.gz
BuildRoot: /var/tmp/gcompris-%{PACKAGE_VERSION}-root
URL: http://ofset.sf.net/gcompris
Docdir: %{prefix}/share/doc/gcompris-%{PACKAGE_VERSION}
BuildRoot: %_tmppath/%name-%version-buildroot
Buildrequires: gnuchess libogg-devel
Buildrequires: libxml2-devel libgnomeui2-devel
Buildrequires: libvorbis-devel libao-devel
Buildrequires: liblinc-devel
Buildrequires: texinfo libassetml-devel
# (misc) needed for python support
Buildrequires: gnome-python python-devel pygtk2.0-devel
Requires: gnome-libs libxml2 gdk-pixbuf %canvaspackage
Requires: gnuchess >= 5.02
Requires: libassetml @REQUIRE_PYTHON@
Requires: assetml-flags
Packager: Bruno Coudoin <bcoudoin.coudoin@free.fr>
URL: http://ofset.sf.net/gcompris
%description
GCompris / I Have Understood is an educationnal game for children starting at 3.
......@@ -238,34 +245,42 @@ Contains png 60x40 country flags and an assetml description file
%ifarch alpha
MYARCH_FLAGS="--host=alpha-redhat-linux"
%endif
%configure
CFLAGS="$RPM_OPT_FLAGS" ./configure --quiet $MYARCH_FLAGS --prefix=%{prefix} \
--localstatedir=/var/lib
%make
if [ "$SMP" != "" ]; then
make -j$SMP MAKE="make -j$SMP"
else
make
fi
%install
rm -rf $RPM_BUILD_ROOT
%makeinstall_std
make prefix=$RPM_BUILD_ROOT%{prefix} install >install.log 2>&1
%clean
rm -rf $RPM_BUILD_ROOT
%post
%update_menus
%_install_info %{name}.info
%postun
%clean_menus
%preun
%_remove_install_info %{name}.info
%files
%defattr(-, root, root)
%doc ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS README TODO THANKS
%attr(-, root, games) %{prefix}/bin/*
%{prefix}/lib/gcompris
%{_menudir}/*
%doc AUTHORS COPYING ChangeLog NEWS README
%_bindir/*
%dir %_libdir/%{name}/
%_libdir/%{name}/*
%_menudir/*
%dir %{prefix}/share/gcompris
%dir %{prefix}/share/gcompris/boards
%dir %{prefix}/share/gcompris/boards/skins
......@@ -280,7 +295,7 @@ rm -rf $RPM_BUILD_ROOT
%{prefix}/share/gnome/help/*
%{prefix}/share/locale/*/*/*
%{prefix}/share/pixmaps/*.png
%{prefix}/info/*
%_infodir/*
%files -n assetml-voices-alphabet-de
%defattr(-, root, root)
......
......@@ -150,6 +150,7 @@ src/boards/money.c
src/boards/paratrooper.c
src/boards/planegame.c
src/boards/python.c
src/boards/python/redraw.py
src/boards/railroad.c
src/boards/read_colors.c
src/boards/reading.c
......
......@@ -197,7 +197,7 @@ libmoney_la_SOURCES = money.c money_widget.c money_widget.h
libtraffic_la_LDFLAGS = -module -avoid-version
libtraffic_la_LIBADD =
libtraffic_la_SOURCES = traffic.c
libtraffic_la_SOURCES = traffic.c traffic.h
libmachpuzzle_la_LDFLAGS = -module -avoid-version
libmachpuzzle_la_LIBADD =
......
......@@ -446,7 +446,7 @@ static void init_xml()
gcomprisBoard->level);
printf("filename = %s %s %s\n", filename,PACKAGE_DATA_DIR,gcomprisBoard->boarddir);
assert(g_file_exists(filename));
assert(g_file_test(filename, G_FILE_TEST_EXISTS));
assert(read_xml_file(filename)== TRUE);
g_free(filename);
#ifdef DEBUG
......@@ -533,7 +533,7 @@ static gboolean read_xml_file(char *fname)
g_return_val_if_fail(fname!=NULL,FALSE);
/* if the file doesn't exist */
if(!g_file_exists(fname))
if(!g_file_test(fname, G_FILE_TEST_EXISTS))
{
g_warning(_("Couldn't find file %s !"), fname);
return FALSE;
......
......@@ -186,14 +186,14 @@ static void pause_board (gboolean pause)
static void start_board (GcomprisBoard *agcomprisBoard)
{
if (g_file_exists ("/usr/bin/gnuchessx")) {
if (g_file_test ("/usr/bin/gnuchessx", G_FILE_TEST_EXISTS)) {
gcompris_dialog(_("Error: /usr/bin/gnuchessx is installed\nwhich means you run an old version\nof gnuchess.\nPlease upgrade to gnuchess 5 or above."), gcompris_end_board);
return;
}
if (!g_file_exists (GNUCHESS)) {
if (!g_file_test (GNUCHESS, G_FILE_TEST_EXISTS)) {
gcompris_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), gcompris_end_board);
......@@ -235,7 +235,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
gcompris_bar_set(0);
}
start_child ("gnuchess", param, &read_chan,
start_child (GNUCHESS, param, &read_chan,
&write_chan, &childpid);
read_cb = g_io_add_watch (read_chan, G_IO_IN,
......@@ -532,7 +532,7 @@ static GnomeCanvasItem *chess_create_item(GnomeCanvasGroup *parent)
}
}
/* Quit the gnuchessx edit mode */
/* Quit the gnuchess edit mode */
write_child (write_chan, " w KQkq\n");
display_white_turn(TRUE);
......@@ -1158,7 +1158,7 @@ start_child (char *cmd,
if (execvp (cmd, arg) < 0)
{
g_warning("In order to play chess, you need to have gnuchess package installed with gnuchessx in the path");
g_warning("In order to play chess, you need to have gnuchess installed as " GNUCHESS);
perror (cmd);
}
_exit (1);
......
/* gcompris - clickgame.c
*
* Time-stamp: <2003/10/12 22:49:24 bcoudoin>
* Time-stamp: <2003/12/06 04:19:19 bcoudoin>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -23,6 +23,7 @@
# include <sys/types.h>
#endif
#include <dirent.h>
#include <string.h>
#include "gcompris/gcompris.h"
#include "gcompris/pixbuf_util.h"
......@@ -725,7 +726,7 @@ static void load_random_pixmap()
filename = g_strdup_printf("%s/%s", PACKAGE_DATA_DIR, str);
if (!g_file_exists (filename))
if (!g_file_test (filename, G_FILE_TEST_EXISTS))
{
cont = FALSE;
}
......
......@@ -481,7 +481,7 @@ static void init_xml()
filename = g_strdup_printf("%s/%s/board1.xml", PACKAGE_DATA_DIR, gcomprisBoard->boarddir);
printf("filename = %s %s %s\n", filename,PACKAGE_DATA_DIR,gcomprisBoard->boarddir);
assert(g_file_exists(filename));
assert(g_file_test(filename, G_FILE_TEST_EXISTS));
assert(read_xml_file(filename)== TRUE);
g_free(filename);
#ifdef DEBUG
......@@ -575,7 +575,7 @@ static gboolean read_xml_file(char *fname)
g_return_val_if_fail(fname!=NULL,FALSE);
/* if the file doesn't exist */
if(!g_file_exists(fname))
if(!g_file_test(fname, G_FILE_TEST_EXISTS))
{
g_warning(_("Couldn't find file %s !"), fname);
return FALSE;
......
/* gcompris - menu.c
*
* Time-stamp: <2003/11/04 22:22:04 bcoudoin>
* Time-stamp: <2003/12/06 04:20:06 bcoudoin>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -356,7 +356,7 @@ static GnomeCanvasItem *menu_create_item(GnomeCanvasGroup *parent, GcomprisBoard
g_warning("Checking mandatory_sound_file %s\n", soundfile);
}
if (!g_file_exists (soundfile) || !gcompris_get_properties()->audio_works)
if (!g_file_test (soundfile, G_FILE_TEST_EXISTS) || !gcompris_get_properties()->audio_works)
{
pixmap = gcompris_load_skin_pixmap("voice_bad.png");
}
......
......@@ -498,7 +498,7 @@ static void init_xml()
{
char *filename;
filename = g_strdup_printf("%s/%s/board1.xml", PACKAGE_DATA_DIR, gcomprisBoard->boarddir);
assert(g_file_exists(filename));
assert(g_file_test(filename, G_FILE_TEST_EXISTS));
assert(read_xml_file(filename)== TRUE);
g_free(filename);
dump_xml();
......@@ -582,7 +582,7 @@ static gboolean read_xml_file(char *fname)
g_return_val_if_fail(fname!=NULL,FALSE);
/* if the file doesn't exist */
if(!g_file_exists(fname))
if(!g_file_test(fname, G_FILE_TEST_EXISTS))
{
g_warning(_("Couldn't find file %s !"), fname);
return FALSE;
......
......@@ -10,25 +10,6 @@
* "*" C function.
*/
/* void gcompris_play_sound (const char *soundlistfile, const char *which); */
static PyObject*
py_gcompris_play_sound(PyObject* self, PyObject* args)
{
gchar* soundlistfile;
gchar* which;
/* Parse arguments */
if(!PyArg_ParseTuple(args, "ss:gcompris_play_sound", &soundlistfile, &which))
return NULL;
/* Call the corresponding C function */
gcompris_play_sound(soundlistfile, which);
/* Create and return the result */
Py_INCREF(Py_None);
return Py_None;
}
/*void gcompris_play_ogg_list( GList* files ); */
static PyObject*
py_gcompris_play_ogg_list(PyObject* self, PyObject* args)
......@@ -81,7 +62,6 @@ py_gcompris_play_ogg(PyObject* self, PyObject* args)
}
static PyMethodDef PythonGcomprisSoundModule[] = {
{ "play", py_gcompris_play_sound, METH_VARARGS, "gcompris_play_sound" },
{ "play_ogg_list", py_gcompris_play_ogg_list, METH_VARARGS, "gcompris_play_ogg_list" },
{ "play_ogg", py_gcompris_play_ogg, METH_VARARGS, "gcompris_play_ogg" },
{ NULL, NULL, 0, NULL}
......
......@@ -18,7 +18,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
from gettext import gettext as _
# PythonTest Board module
import gnome
import gnome.canvas
......@@ -34,6 +34,7 @@ class Gcompris_redraw:
def __init__(self, gcomprisBoard):
bindtextdomain("gcompris")
self.gcomprisBoard = gcomprisBoard
# TOOL SELECTION
......@@ -86,8 +87,8 @@ class Gcompris_redraw:
# the data for the form (in the console). Then copy the data in the list at the end of
# this file in init_item_list
# Set self.editing_mode = None to forbid drawing in the right area
# self.editing_mode = None
self.editing_mode = 1
self.editing_mode = None
#self.editing_mode = 1
def start(self):
......@@ -310,7 +311,7 @@ class Gcompris_redraw:
self.root_targetitem.add(
gnome.canvas.CanvasText,
text="Level " + str(self.gcomprisBoard.sublevel) + "/"
text=_("Level") + " " + str(self.gcomprisBoard.sublevel) + "/"
+ str(self.gcomprisBoard.number_of_sublevel),
font=gcompris.skin.get_font("gcompris/content"),
x=gcompris.BOARD_WIDTH - 10 + 1,
......@@ -320,7 +321,7 @@ class Gcompris_redraw:
)
self.root_targetitem.add(
gnome.canvas.CanvasText,
text="Level " + str(self.gcomprisBoard.sublevel) + "/"
text=_("Level") + " " + str(self.gcomprisBoard.sublevel) + "/"
+ str(self.gcomprisBoard.number_of_sublevel),
font=gcompris.skin.get_font("gcompris/content"),
x=gcompris.BOARD_WIDTH - 10,
......@@ -512,6 +513,8 @@ class Gcompris_redraw:
# Can specify the item type to draw via a real GTK type or a TOOL string
if(i.has_key('type')):
item = self.root_targetitem.add ( i['type'] )
item.connect("event", self.target_item_event)
elif(i.has_key('tool')):
if(i['tool'] == "RECT"):
item = self.root_targetitem.add ( gnome.canvas.CanvasRect )
......@@ -525,6 +528,7 @@ class Gcompris_redraw:
item = self.root_targetitem.add ( gnome.canvas.CanvasLine )
else:
print ("ERROR: incorrect type in draw_image_target", i)
item.connect("event", self.target_item_event)
for k, v in i.items():
if k == 'fill_color' :
......@@ -808,10 +812,10 @@ class Gcompris_redraw:
self.coorditem_shadow.set(text="")
else:
self.coorditem.set(
text="Coordinate = (" + str(x) + "/" + str(y) + ")"
text=_("Coordinate") + " = (" + str(x) + "/" + str(y) + ")"
)
self.coorditem_shadow.set(
text="Coordinate = (" + str(x) + "/" + str(y) + ")"
text=_("Coordinate") + " = (" + str(x) + "/" + str(y) + ")"
)
......
......@@ -407,7 +407,7 @@ static void init_xml()
filename = g_strdup_printf("%s/%s/board1.xml", PACKAGE_DATA_DIR, gcomprisBoard->boarddir);
printf("filename = %s %s %s\n", filename,PACKAGE_DATA_DIR,gcomprisBoard->boarddir);
assert(g_file_exists(filename));
assert(g_file_test(filename, G_FILE_TEST_EXISTS));
assert(read_xml_file(filename)== TRUE);
g_free(filename);
#ifdef DEBUG
......@@ -492,7 +492,7 @@ static gboolean read_xml_file(char *fname)
g_return_val_if_fail(fname!=NULL,FALSE);
/* if the file doesn't exist */
if(!g_file_exists(fname))
if(!g_file_test(fname, G_FILE_TEST_EXISTS))
{
g_warning(_("Couldn't find file %s !"), fname);
return FALSE;
......
......@@ -22,6 +22,7 @@
// FIXME: Cleanup of LettersItem created struct is not done
#include <errno.h>
#include <stdio.h>
#include "gcompris/gcompris.h"
......
......@@ -24,6 +24,8 @@
#include <math.h>
#include <assert.h>
#include "traffic.h"
#include "gcompris/gcompris.h"
#define SOUNDLISTFILE PACKAGE
......@@ -85,7 +87,7 @@ static jam current_card ={0,0,0,NULL};
static void draw_border(GnomeCanvasGroup *rootBorder);
static void draw_grid (GnomeCanvasGroup *rootBorder);
static gint cars_from_strv(char **strv);
static gint cars_from_strv(char *strv);
static void load_error(void);
static void load_not_found(void);
......@@ -606,33 +608,17 @@ static int car_cb(GnomeCanvasItem *item, GdkEvent *event, car *thiscar)
/* From jam.c */
#define strip_spaces(string) g_strjoinv("",g_strsplit((string)," ",0))
gboolean load_level(guint level, guint card)
gboolean load_level(guint level, guint sublevel)
{
char **car_strv=NULL;
char *data_file;
int dummy;
char *car_strv=NULL;
current_card.level = level;
current_card.card = card;
current_card.card = sublevel;
data_file = g_strdup_printf("%s/traffic/%s",PACKAGE_DATA_DIR, DATAFILE);
if (!g_file_test ((data_file), G_FILE_TEST_EXISTS)) {
g_error (_("Couldn't find file %s !"), data_file);
}
car_strv = DataList[(level-1) * gcomprisBoard->number_of_sublevel + (sublevel-1)];
gnome_config_push_prefix(g_strconcat("=", data_file, "=",
g_strdup_printf("/Level%d",level), "/",
NULL));
gnome_config_get_vector(g_strdup_printf("Card%d",card),
&dummy, &car_strv);
gnome_config_pop_prefix();
if (!car_strv) { load_not_found(); return FALSE; }
current_card.num_cars = cars_from_strv(car_strv);
current_card.num_cars = cars_from_strv(&car_strv[0]);
if(current_card.num_cars == -1)
g_error("In loading dataset for traffic activity");
......@@ -645,7 +631,7 @@ gboolean load_level(guint level, guint card)
* I took the formatting from
* http://www.javascript-games.org/puzzle/rushhour/
*/
gint cars_from_strv(char **strv)
gint cars_from_strv(char *strv)
{
car *ccar;
char x,y,id;
......@@ -663,18 +649,18 @@ gint cars_from_strv(char **strv)
number_of_cars++;
if (sscanf(*strv,"%c%c%c",
if (sscanf(strv,"%c%c%c",
&id,&x,&y)!=3) {
return -1;
}
/* Point to the next car */
*strv += 3;
strv += 3;
if(*strv[0] != ',')
if(strv[0] != ',')
more_car = FALSE;
*strv += 1;
strv += 1;
if (id == 'O' || id == 'P' || id == 'Q' || id == 'R') ccar->size = 3;
else ccar->size = 2;
......