Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog17
-rw-r--r--Makefile.am2
-rw-r--r--README.mingw12
-rw-r--r--README.windows5
-rwxr-xr-xconfig.h.windows134
-rw-r--r--configure.in2
-rw-r--r--src/boards/Makefile.am2
-rw-r--r--src/gcompris/assetml.c7
-rw-r--r--src/gcompris/board.c189
-rw-r--r--src/gcompris/gameutil.c6
-rw-r--r--src/gcompris/gcompris-board.h6
-rw-r--r--src/gcompris/gcompris.c38
12 files changed, 399 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index d9a60e3..1e7b7ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2004-06-18 Bruno coudoin <bruno.coudoin@free.fr>
+
+ * Makefile.am: added config.h.windows
+ * README.mingw: added more specific informations
+ * README.windows: fixed project link
+ * config.h.windows: create. use it to compile on mingw
+ * configure.in: changed to release 6.1
+ * src/boards/Makefile.am: added boards2static.pl utility for mingw
+ * src/gcompris/assetml.c: (assetml_get_locale): replaced getenv by g_getenv
+ * src/gcompris/board.c: (init_plugins), (board_check_file): merged mingw version and linux version
+ * src/gcompris/gameutil.c: (gcompris_read_xml_file),
+ (gcompris_load_menus): fixed bugs in which you cannot go back to upper menu if you enter
+ the configuration dialog while you are in a submenu.
+ * src/gcompris/gcompris-board.h: reindent
+ * src/gcompris/gcompris.c: (setup_window), (gcompris_init): implemented the grace period stuff for
+ mingw
+
2004-06-15 Bruno coudoin <bruno.coudoin@free.fr>
* src/boards/boards2static.pl: created. Allow to transform the boards to static notation used in the
diff --git a/Makefile.am b/Makefile.am
index fb97c23..5f11c90 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,7 +23,7 @@ EXTRA_DIST = \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
- README.mingw
+ README.mingw config.h.windows
distcore = $(PACKAGE)-core-$(VERSION)
diff --git a/README.mingw b/README.mingw
index 94b96c7..1112831 100644
--- a/README.mingw
+++ b/README.mingw
@@ -59,7 +59,19 @@ hierarchy make sure to tweak your .profile.
========================
* Get a tarball or CVS snapshot of gcompris.
* run ./autogen.sh from gcompris's top-level directory. This will take a long time.
+* copy the provided config.h.windows to config.h
+* convert all src/boards/*.c files from dynamic plugin naming to static plugin using
+ the provided tool src/boards/boards2static.pl. To do this:
+ cd src/boards/
+ mkdir static
+ ./boards2static.pl
+ mv static/*.c .
+* Go back to the top-level directory
* *drum roll...* make!
+* edit the Makefile manualy to add includes and library dependancies when missing
+* copy the share directory that is created at the gcompris binary installation in
+ src/gcompris in order to have src/gcompris/share
+* run ./gcompris.exe
APPENDIX: MY .profile
=====================
diff --git a/README.windows b/README.windows
index 49103cb..b0bd1ec 100644
--- a/README.windows
+++ b/README.windows
@@ -1,9 +1,6 @@
- http://ofset.sf.net/gcompris
+ http://www.ofset.org/gcompris
has a full list of changes since the previous release.
- On Windows, Gcompris requires GTK, which can be found
- at <http://www.dropline.net/gtk/>.
-
Information on building gcompris on Windows can be found in README.mingw.
diff --git a/config.h.windows b/config.h.windows
new file mode 100755
index 0000000..b502e2a
--- /dev/null
+++ b/config.h.windows
@@ -0,0 +1,134 @@
+/* config.h. Generated by configure. */
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Supported languages */
+#define ALL_LINGUAS "am ar az ca cs de el en_CA en_GB es fi fr he hi hr hu it lt mk ml ms nl no pl pt pt_BR ro ru sk sl sr sr@Latn sv tr"
+
+/* Global assetml directory */
+#define ASSETML_DIR "share/assetml"
+
+/* "Enable debug messages." */
+/* #undef DEBUG */
+
+/* always defined to indicate that i18n is enabled */
+/* #undef ENABLE_NLS */
+
+/* Gettext package name */
+#define GETTEXT_PACKAGE "gcompris"
+
+/* Gnome icons directory */
+#define GNOME_ICONDIR "share/pixmaps"
+
+/* Defines where GNU Chess resides on the system */
+#define GNUCHESS "/usr/bin/gnuchess"
+
+/* Define to 1 if you have the `bind_textdomain_codeset' function. */
+/* #undef HAVE_BIND_TEXTDOMAIN_CODESET */
+
+/* Define to 1 if you have the `dcgettext' function. */
+/* #undef HAVE_DCGETTEXT */
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#define HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define to 1 if you have the `dlopen' function. */
+/* #undef HAVE_DLOPEN */
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+/* #undef HAVE_GETTEXT */
+
+/* Define if you have the iconv() function. */
+#define HAVE_ICONV 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+/* #undef HAVE_LC_MESSAGES */
+
+/* Define to 1 if you have the `popt' library (-lpopt). */
+/* #undef HAVE_LIBPOPT */
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define as const if the declaration of iconv() needs const. */
+#define ICONV_CONST const
+
+/* Name of package */
+#define PACKAGE "gcompris"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Gcompris data directory */
+#define PACKAGE_DATA_DIR "share/gcompris/boards"
+
+/* Gcompris help directory */
+#define PACKAGE_HELP_DIR "/usr/local//gnome/help/gcompris"
+
+/* Gcompris locale directory */
+#define PACKAGE_LOCALE_DIR "share/locale"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
+
+/* Gcompris sounds directory */
+#define PACKAGE_SOUNDS_DIR "share/gcompris/boards/sounds"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+
+/* Gcompris plugins directory */
+#define PLUGIN_DIR "/usr/local/lib/gcompris"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "6.1"
diff --git a/configure.in b/configure.in
index 62447b4..3cf6fe0 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/gcompris/gcompris.c)
-AM_INIT_AUTOMAKE(gcompris, 6.0)
+AM_INIT_AUTOMAKE(gcompris, 6.1)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
diff --git a/src/boards/Makefile.am b/src/boards/Makefile.am
index 3f3857d..b84f7ef 100644
--- a/src/boards/Makefile.am
+++ b/src/boards/Makefile.am
@@ -229,5 +229,5 @@ libpython_la_SOURCES = python.c \
py-mod-skin.c py-mod-skin.h
-EXTRA_DIST = README
+EXTRA_DIST = README boards2static.pl
diff --git a/src/gcompris/assetml.c b/src/gcompris/assetml.c
index da39f3e..12dade4 100644
--- a/src/gcompris/assetml.c
+++ b/src/gcompris/assetml.c
@@ -50,9 +50,12 @@ gchar *assetml_get_locale()
{
char *locale;
- locale = getenv("LC_ALL");
+ locale = g_getenv("LC_ALL");
if(locale == NULL)
- locale = getenv("LANG");
+ locale = g_getenv("LC_MESSAGES");
+ if(locale == NULL)
+ locale = g_getenv("LANG");
+
if(locale!=NULL)
return(locale);
diff --git a/src/gcompris/board.c b/src/gcompris/board.c
index 06301c7..ec73f98 100644
--- a/src/gcompris/board.c
+++ b/src/gcompris/board.c
@@ -21,6 +21,107 @@
static struct BoardPluginData *bp_data;
+#if defined _WIN32 || defined __WIN32__
+# undef WIN32 /* avoid warning on mingw32 */
+# define WIN32
+#endif
+
+
+#ifdef WIN32
+extern gboolean grace_period;
+extern BoardPlugin advanced_colors_menu_bp;
+extern BoardPlugin algebra_menu_bp;
+extern BoardPlugin algebra_guesscount_menu_bp;
+extern BoardPlugin canal_lock_menu_bp;
+extern BoardPlugin clickgame_menu_bp;
+extern BoardPlugin click_on_letter_menu_bp;
+extern BoardPlugin clockgame_menu_bp;
+extern BoardPlugin colors_menu_bp;
+extern BoardPlugin draw_menu_bp;
+extern BoardPlugin enumerate_menu_bp;
+extern BoardPlugin erase_menu_bp;
+extern BoardPlugin fifteen_menu_bp;
+extern BoardPlugin gletters_menu_bp;
+extern BoardPlugin hanoi_menu_bp;
+extern BoardPlugin imageid_menu_bp;
+extern BoardPlugin leftright_menu_bp;
+extern BoardPlugin machpuzzle_menu_bp;
+extern BoardPlugin maze_menu_bp;
+extern BoardPlugin memory_menu_bp;
+extern BoardPlugin menu_menu_bp;
+extern BoardPlugin missingletter_menu_bp;
+extern BoardPlugin money_menu_bp;
+extern BoardPlugin paratrooper_menu_bp;
+extern BoardPlugin planegame_menu_bp;
+extern BoardPlugin railroad_menu_bp;
+extern BoardPlugin read_colors_menu_bp;
+extern BoardPlugin reading_menu_bp;
+extern BoardPlugin reversecount_menu_bp;
+extern BoardPlugin shapegame_menu_bp;
+extern BoardPlugin smallnumbers_menu_bp;
+extern BoardPlugin submarine_menu_bp;
+extern BoardPlugin superbrain_menu_bp;
+extern BoardPlugin target_menu_bp;
+extern BoardPlugin traffic_menu_bp;
+extern BoardPlugin wordsgame_menu_bp;
+
+static BoardPlugin *static_boards_demo[] = {
+ &algebra_menu_bp,
+ &click_on_letter_menu_bp,
+ &colors_menu_bp,
+ &clickgame_menu_bp,
+ &draw_menu_bp,
+ &enumerate_menu_bp,
+ &erase_menu_bp,
+ &gletters_menu_bp,
+ &hanoi_menu_bp,
+ &menu_menu_bp,
+ &reading_menu_bp,
+ &submarine_menu_bp,
+ &superbrain_menu_bp,
+ &target_menu_bp,
+};
+
+static BoardPlugin *static_boards[] = {
+ &advanced_colors_menu_bp,
+ &algebra_guesscount_menu_bp,
+ &imageid_menu_bp,
+ &leftright_menu_bp,
+ &machpuzzle_menu_bp,
+ &maze_menu_bp,
+ &memory_menu_bp,
+ &missingletter_menu_bp,
+ &money_menu_bp,
+ &paratrooper_menu_bp,
+ &planegame_menu_bp,
+ &read_colors_menu_bp,
+ &reversecount_menu_bp,
+ &shapegame_menu_bp,
+ &smallnumbers_menu_bp,
+ &traffic_menu_bp,
+ &wordsgame_menu_bp,
+ &fifteen_menu_bp,
+ &algebra_menu_bp,
+ &click_on_letter_menu_bp,
+ &colors_menu_bp,
+ &canal_lock_menu_bp,
+ &clickgame_menu_bp,
+ &clockgame_menu_bp,
+ &draw_menu_bp,
+ &enumerate_menu_bp,
+ &erase_menu_bp,
+ &gletters_menu_bp,
+ &hanoi_menu_bp,
+ &menu_menu_bp,
+ &railroad_menu_bp,
+ &reading_menu_bp,
+ &submarine_menu_bp,
+ &superbrain_menu_bp,
+ &target_menu_bp,
+ NULL
+};
+#endif
+
/*
* The directory in which we will search for plugins
* (In that order)
@@ -32,7 +133,35 @@ static gchar *plugin_paths[] = {
NULL
};
+#ifdef WIN32
+void init_plugins(void)
+{
+ guint i=0;
+ BoardPlugin **boards_list = NULL;
+ printf(">init_plugins\n");
+ /* First make sure the module loading is supported on this platform */
+ if (!g_module_supported())
+ g_error("Dynamic module loading is not supported. gcompris cannot work.\n");
+
+ bp_data = g_malloc0(sizeof (struct BoardPluginData));
+
+ while(static_boards[i++] != NULL) {
+ /* If this plugin defines an initialisation entry point, call it */
+ BoardPlugin *bp;
+
+ /* Get the BoardPlugin Info */
+ bp = (BoardPlugin *) static_boards[i-1];
+
+ printf("Initializing plugin %s\n", bp->name);
+ if(bp->init != NULL) {
+ bp->init();
+ }
+ }
+
+ printf("<init_plugins\n");
+}
+#else
void init_plugins(void)
{
@@ -43,6 +172,7 @@ void init_plugins(void)
bp_data = g_malloc0(sizeof (struct BoardPluginData));
}
+#endif
BoardPlugin *get_current_board_plugin(void)
{
@@ -59,6 +189,64 @@ void set_current_gcompris_board(GcomprisBoard * gcomprisBoard)
bp_data->current_gcompris_board = gcomprisBoard;
}
+#ifdef WIN32
+gboolean board_check_file(GcomprisBoard *gcomprisBoard)
+{
+ GcomprisProperties *properties = gcompris_get_properties();
+ BoardPlugin *bp;
+ guint i=0;
+
+ g_assert(gcomprisBoard!=NULL);
+ g_assert(properties->key!=NULL);
+
+ /* Check Already loaded */
+ if(gcomprisBoard->plugin!=NULL) {
+ return TRUE;
+ }
+
+ if(strncmp(properties->key, "thanks_for_your_help", 20)==0 || grace_period==TRUE) {
+ while(static_boards[i++] != NULL) {
+
+ BoardPlugin *bp;
+
+ /* Get the BoardPlugin Info */
+ bp = (BoardPlugin *) static_boards[i-1];
+
+ if(bp->is_our_board(gcomprisBoard)) {
+ /* Great, we found our plugin */
+ g_warning("We found the correct plugin for board %s (type=%s)\n", gcomprisBoard->name, gcomprisBoard->type);
+
+ gcomprisBoard->plugin = bp;
+
+ return TRUE;
+ }
+ }
+ } else {
+ while(static_boards_demo[i++] != NULL) {
+
+ BoardPlugin *bp;
+
+ /* Get the BoardPlugin Info */
+ bp = (BoardPlugin *) static_boards_demo[i-1];
+
+ if(bp->is_our_board(gcomprisBoard)) {
+ /* Great, we found our plugin */
+ g_warning("We found the correct plugin for board %s (type=%s)\n", gcomprisBoard->name, gcomprisBoard->type);
+
+ gcomprisBoard->plugin = bp;
+
+ return TRUE;
+ }
+ }
+ }
+
+
+ g_warning("No plugin library found for board type '%s', requested by '%s'",
+ gcomprisBoard->type, gcomprisBoard->filename);
+
+ return FALSE;
+}
+#else
gboolean board_check_file(GcomprisBoard *gcomprisBoard)
{
BoardPlugin *bp;
@@ -135,6 +323,7 @@ gboolean board_check_file(GcomprisBoard *gcomprisBoard)
return FALSE;
}
+#endif
void board_play(GcomprisBoard *gcomprisBoard)
{
diff --git a/src/gcompris/gameutil.c b/src/gcompris/gameutil.c
index 120c17d..8e134f7 100644
--- a/src/gcompris/gameutil.c
+++ b/src/gcompris/gameutil.c
@@ -1,6 +1,6 @@
/* gcompris - gameutil.c
*
- * Time-stamp: <2004/06/05 22:55:17 bcoudoin>
+ * Time-stamp: <2004/06/18 00:28:51 bcoudoin>
*
* Copyright (C) 2000 Bruno Coudoin
*
@@ -552,7 +552,6 @@ GcomprisBoard *gcompris_read_xml_file(GcomprisBoard *gcomprisBoard, char *fname)
gcomprisBoard->filename=filename;
gcomprisBoard->board_ready=FALSE;
gcomprisBoard->canvas=canvas;
- gcomprisBoard->previous_board=NULL;
gcomprisBoard->gmodule = NULL;
gcomprisBoard->gmodule_file = NULL;
@@ -564,7 +563,7 @@ GcomprisBoard *gcompris_read_xml_file(GcomprisBoard *gcomprisBoard, char *fname)
return gcomprisBoard;
}
-/* Return the boards with the given section
+/* Return the first board with the given section
*/
GcomprisBoard *gcompris_get_board_from_section(gchar *section)
{
@@ -682,6 +681,7 @@ void gcompris_load_menus()
/* the locale data */
/* And we don't want in this case to loose the current plugin */
gcomprisBoard->plugin=NULL;
+ gcomprisBoard->previous_board=NULL;
boards_list = g_list_append(boards_list, gcompris_read_xml_file(gcomprisBoard,
filename));
diff --git a/src/gcompris/gcompris-board.h b/src/gcompris/gcompris-board.h
index 2620be6..5c9d876 100644
--- a/src/gcompris/gcompris-board.h
+++ b/src/gcompris/gcompris-board.h
@@ -1,6 +1,6 @@
/* gcompris - gcompris-board.h
*
- * Time-stamp: <2004/03/07 19:39:56 bcoudoin>
+ * Time-stamp: <2004/06/18 00:26:05 bcoudoin>
*
* Copyright (C) 2000 Bruno Coudoin
*
@@ -66,8 +66,8 @@ struct _GcomprisBoard
BoardPlugin *plugin;
/* The gmodule pointers */
- GModule *gmodule;
- gchar *gmodule_file;
+ GModule *gmodule;
+ gchar *gmodule_file;
/* Pointors to the previous board to start when this one ends */
diff --git a/src/gcompris/gcompris.c b/src/gcompris/gcompris.c
index 464b252..9ff8425 100644
--- a/src/gcompris/gcompris.c
+++ b/src/gcompris/gcompris.c
@@ -1,6 +1,6 @@
/* gcompris - gcompris.c
*
- * Time-stamp: <2004/06/07 23:47:16 bcoudoin>
+ * Time-stamp: <2004/06/16 23:53:29 bcoudoin>
*
* Copyright (C) 2000-2003 Bruno Coudoin
*
@@ -22,6 +22,11 @@
#include <signal.h>
#include <popt.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <time.h>
+
#include "gcompris.h"
#include <locale.h>
@@ -38,6 +43,8 @@ GnomeCanvas *canvas;
GnomeCanvas *canvas_bar;
GnomeCanvas *canvas_bg;
+gboolean grace_period = FALSE;
+
//static gint pause_board_cb (GtkWidget *widget, gpointer data);
static void quit_cb (GtkWidget *widget, gpointer data);
static gint board_widget_key_press_callback (GtkWidget *widget,
@@ -491,9 +498,23 @@ static void setup_window ()
init_background();
#ifdef WIN32
- if(strncmp(properties->key, "thanks_for_your_help", 20)!=0) {
- board_pause();
- gcompris_dialog(_("GCompris is free software released under the GPL License. In order to support the development, the Windows version provides only 12 of the 45 activities. You can get the full version for a small fee at\nhttp://www.ofset.org/order/gcompris\nThe Linux version does not have this restriction. Note that gcompris is being developped to free schools from monopolistic software vendors. If you also believe that we should teach freedom to kids, please consider using GNU/Linux. Get more information on\nhttp://www.fsf.org/philosophy"), NULL);
+ {
+ time_t ctime;
+ gchar *prog;
+ struct stat buf;
+
+ ctime = time(NULL);
+ prog = g_find_program_in_path("gcompris");
+ if(stat(prog, &buf)==0) {
+ if(difftime(ctime, buf.st_mtime)<2592000) {
+ grace_period = 1;
+ return;
+ }
+ }
+ if(strncmp(properties->key, "thanks_for_your_help", 20)!=0) {
+ board_pause();
+ gcompris_dialog(_("GCompris is free software released under the GPL License. In order to support the development, the Windows version provides only 12 of the 45 activities. You can get the full version for a small fee at\nhttp://www.ofset.org/order/gcompris\nThe Linux version does not have this restriction. Note that gcompris is being developped to free schools from monopolistic software vendors. If you also believe that we should teach freedom to kids, please consider using GNU/Linux. Get more information on\nhttp://www.fsf.org/philosophy"), NULL);
+ }
}
#endif
}
@@ -660,12 +681,17 @@ gcompris_init (int argc, char *argv[])
/* Save the default locale */
#if defined WIN32
gcompris_user_default_locale = g_win32_getlocale();
+ // Set the user's choice locale
+ if(properties->locale[0]=='\0') {
+ gcompris_set_locale(gcompris_user_default_locale);
+ } else {
+ gcompris_set_locale(properties->locale);
+ }
#else
gcompris_user_default_locale = g_strdup(setlocale(LC_MESSAGES, NULL));
-#endif
-
// Set the user's choice locale
gcompris_set_locale(properties->locale);
+#endif
/*------------------------------------------------------------*/
if (popt_version)