Commit 8d5eabeb authored by Bruno Coudoin's avatar Bruno Coudoin

- Some fixed to compile and run 8.1 on windows.

parent 6470b304
2006-10-16 Bruno coudoin <bruno.coudoin@free.fr>
- Some fixed to compile and run 8.1 on windows.
* Makefile.mingw:
* config.h.mingw:
* src/boards/Makefile.mingw:
* src/gcompris/board.c: (gc_board_init), (gc_board_check_file):
* src/gcompris/gcompris.c: (display_activation_dialog),
(activation_enter_callback), (activation_done):
*** RELEASE 8.1 ***
2006-10-15 Bruno coudoin <bruno.coudoin@free.fr>
- Fixed a major crash case on images with a focus and a changing image
......
......@@ -4,7 +4,7 @@
# Description: Top Makefile for win32 (mingw) port of GCompris
#
VERSION = "8.0"
VERSION = "8.1"
pkgdatadir = gcompris
......@@ -18,48 +18,52 @@ LIBXML2_TOP := /libxml2
SDL_TOP := /sdl
CANVAS_TOP := /gnomecanvas
GNUCHESS_TOP := /gnuchess
GNUCAP_TOP := /gnucap
MAKENSIS := "/c/Program Files/NSIS/makensis.exe"
# These will be copied in the win32-install-dir ready to be packaged.
NEEDED_DLLS = $(GNUCHESS_TOP)/bin/pthreadGC.dll \
$(GNUCHESS_TOP)/bin/libreadline.dll \
$(GTK_TOP)/bin/gspawn-win32-helper.exe \
NEEDED_DLLS = $(CANVAS_TOP)/bin/libgnomecanvas-2-0.dll \
$(GNUCAP_TOP)/src/MSW/gnucap.exe \
$(GNUCHESS_TOP)/bin/gnuchess.exe \
$(GNUWIN32_TOP)/bin/popt1.dll \
$(GNUWIN32_TOP)/bin/libintl-2.dll \
$(GNUCHESS_TOP)/bin/libreadline.dll \
$(GNUWIN32_TOP)/bin/libiconv-2.dll \
$(CANVAS_TOP)/bin/libgnomecanvas-2-0.dll \
$(SDL_TOP)/bin/SDL.dll \
$(SDL_TOP)/bin/SDL_mixer.dll \
$(LIBXML2_TOP)/bin/libxml2.dll \
$(GNUWIN32_TOP)/bin/libintl-2.dll \
$(GNUWIN32_TOP)/bin/popt1.dll \
$(GTK_TOP)/bin/freetype6.dll \
$(GTK_TOP)/bin/intl.dll \
$(GTK_TOP)/bin/libart_lgpl_2-2.dll \
$(GTK_TOP)/bin/freetype6.dll \
$(GTK_TOP)/bin/gspawn-win32-helper.exe \
$(GTK_TOP)/bin/iconv.dll \
$(GTK_TOP)/bin/intl.dll \
$(GTK_TOP)/bin/intl.dll \
$(GTK_TOP)/bin/jpeg62.dll
$(GTK_TOP)/bin/libart_lgpl_2-2.dll \
$(GTK_TOP)/bin/libatk-1.0-0.dll \
$(GTK_TOP)/bin/libcairo-2.dll \
$(GTK_TOP)/bin/libfontconfig-1.dll \
$(GTK_TOP)/bin/libgdk-win32-2.0-0.dll \
$(GTK_TOP)/bin/libgdk_pixbuf-2.0-0.dll \
$(GTK_TOP)/bin/libglib-2.0-0.dll \
$(GTK_TOP)/bin/libgmodule-2.0-0.dll \
$(GTK_TOP)/bin/libgobject-2.0-0.dll \
$(GTK_TOP)/bin/libgthread-2.0-0.dll \
$(GTK_TOP)/bin/libgtk-win32-2.0-0.dll \
$(GTK_TOP)/bin/libpango-1.0-0.dll \
$(GTK_TOP)/bin/libpangowin32-1.0-0.dll \
$(GTK_TOP)/bin/libpangocairo-1.0-0.dll \
$(GTK_TOP)/bin/libpangoft2-1.0-0.dll \
$(GTK_TOP)/bin/libgtk-win32-2.0-0.dll \
$(GTK_TOP)/bin/libatk-1.0-0.dll \
$(GTK_TOP)/bin/libfontconfig-1.dll \
$(GTK_TOP)/bin/libpangowin32-1.0-0.dll \
$(GTK_TOP)/bin/libpng13.dll \
$(GTK_TOP)/bin/zlib1.dll \
$(GTK_TOP)/bin/libgthread-2.0-0.dll \
$(GTK_TOP)/expat/bin/xmlparse.dll \
$(GTK_TOP)/expat/bin/xmltok.dll \
$(GTK_TOP)/bin/iconv.dll \
$(GTK_TOP)/bin/intl.dll \
$(GTK_TOP)/bin/libpng12.dll \
$(GTK_TOP)/bin/jpeg62.dll
$(LIBXML2_TOP)/bin/libxml2.dll \
$(SDL_TOP)/bin/SDL.dll \
$(SDL_TOP)/bin/SDL_mixer.dll \
$(GNUCHESS_TOP)/bin/pthreadGC.dll
NEEDED_FILES = README \
COPYING \
README.mingw \
README.windows \
COPYING \
Changelog
......@@ -89,6 +93,10 @@ prepack:
cp -r $(GTK_TOP)/lib/locale $(GCOMPRIS_INSTALL_DIR)/lib
cp -r $(GTK_TOP)/lib/gtk-2.0 $(GCOMPRIS_INSTALL_DIR)/lib
cp -r $(GTK_TOP)/lib/pango $(GCOMPRIS_INSTALL_DIR)/lib
cp -r $(GCOMPRIS_BOARDS)/python $(GCOMPRIS_INSTALL_DIR)/share/gcompris
rm -f $(GCOMPRIS_INSTALL_DIR)/share/gcompris/python/Makefile*
rm -f $(GCOMPRIS_INSTALL_DIR)/share/gcompris/python/gcompris/Makefile*
rm -f $(GCOMPRIS_INSTALL_DIR)/share/gcompris/python/admin/Makefile*
installer:
......@@ -104,7 +112,6 @@ clean:
# Run this on Linux to prepare datadir for windows
#
prep:
mkdir $(GCOMPRIS_INSTALL_DIR)
mkdir -p $(GCOMPRIS_INSTALL_DIR)/share/$(pkgdatadir)/boards
cd boards ; tar cf - --exclude "Makefile.in" --exclude "*.in" --exclude "*~" --exclude "Makefile" --exclude "Makefile.am" --exclude CVS --exclude .xvpics * | ( cd ../$(GCOMPRIS_INSTALL_DIR)/share/$(pkgdatadir)/boards ; tar xf -) ; cd .. ;
@echo "-------------------------------------------------------------------------------"
......
......@@ -2,7 +2,7 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Version number of package */
#define VERSION "8.0"
#define VERSION "8.1"
/* 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"
......
......@@ -118,36 +118,24 @@ PYTHON_C_SRC = \
canvas.c \
canvasmodule.c \
py-gcompris-board.c \
py-gcompris-board.h \
py-gcompris-properties.c \
py-gcompris-properties.h \
py-gcompris-profile.c \
py-gcompris-profile.h \
py-gcompris-wordlist.c \
py-gcompris-wordlist.h \
py-gcompris-user.c \
py-gcompris-class.c \
py-gcompris-group.c \
py-mod-gcompris.c \
py-mod-gcompris.h \
py-mod-utils.c \
py-mod-utils.h \
py-mod-admin.c \
py-mod-admin.h \
py-mod-bonus.c \
py-mod-bonus.h \
py-mod-score.c \
py-mod-score.h \
py-mod-timer.c \
py-mod-timer.h \
py-mod-sound.c \
py-mod-sound.h \
py-mod-skin.c \
py-mod-skin.h \
py-mod-anim.c \
py-mod-anim.h
py-mod-anim.c
BOARDS_C_SRC = \
advanced_colors.c \
algebra.c \
algebra_guesscount.c \
awele.c awele_utils.c awele_alphaBeta.c \
......@@ -159,8 +147,8 @@ BOARDS_C_SRC = \
colors.c \
crane.c \
draw.c \
erase.c \
enumerate.c \
erase.c \
fifteen.c \
gletters.c \
gtans.c gtans_callbacks.c gtans_support.c gtans_interface.c \
......@@ -168,10 +156,9 @@ BOARDS_C_SRC = \
hanoi_real.c \
imageid.c \
leftright.c \
superbrain.c \
machpuzzle.c \
maze.c \
magic_hat.c \
maze.c \
memory.c \
menu2.c \
missingletter.c \
......@@ -180,16 +167,16 @@ BOARDS_C_SRC = \
paratrooper.c \
planegame.c \
railroad.c \
read_colors.c \
reading.c \
reversecount.c \
shapegame.c \
smallnumbers.c \
submarine.c \
superbrain.c \
target.c \
traffic.c \
wordsgame.c \
advanced_colors.c \
read_colors.c \
$(PYTHON_C_SRC)
......
......@@ -45,6 +45,7 @@ extern BoardPlugin * get_clickgame_bplugin_info();
extern BoardPlugin * get_click_on_letter_bplugin_info();
extern BoardPlugin * get_clockgame_bplugin_info();
extern BoardPlugin * get_colors_bplugin_info();
extern BoardPlugin * get_crane_bplugin_info();
extern BoardPlugin * get_draw_bplugin_info();
extern BoardPlugin * get_enumerate_bplugin_info();
extern BoardPlugin * get_erase_bplugin_info();
......@@ -92,8 +93,10 @@ void gc_board_init(void)
bp_data = g_malloc0(sizeof (struct BoardPluginData));
static_boards_demo[i++] = get_awele_bplugin_info();
static_boards_demo[i++] = get_canal_lock_bplugin_info();
static_boards_demo[i++] = get_click_on_letter_bplugin_info();
static_boards_demo[i++] = get_clickgame_bplugin_info();
static_boards_demo[i++] = get_clockgame_bplugin_info();
static_boards_demo[i++] = get_colors_bplugin_info();
static_boards_demo[i++] = get_crane_bplugin_info();
static_boards_demo[i++] = get_draw_bplugin_info();
......@@ -102,13 +105,14 @@ void gc_board_init(void)
static_boards_demo[i++] = get_gletters_bplugin_info();
static_boards_demo[i++] = get_gtans_bplugin_info();
static_boards_demo[i++] = get_hanoi_bplugin_info();
static_boards_demo[i++] = get_leftright_bplugin_info();
static_boards_demo[i++] = get_magic_hat_bplugin_info();
static_boards_demo[i++] = get_menu_bplugin_info();
static_boards_demo[i++] = get_money_bplugin_info();
static_boards_demo[i++] = get_reading_bplugin_info();
static_boards_demo[i++] = get_submarine_bplugin_info();
static_boards_demo[i++] = get_superbrain_bplugin_info();
static_boards_demo[i++] = get_target_bplugin_info();
static_boards_demo[i++] = get_python_bplugin_info();
static_boards_demo[i++] = NULL;
gc_board_number_in_demo = i - 2;
......@@ -223,45 +227,49 @@ gc_board_check_file(GcomprisBoard *gcomprisBoard)
while(keycode[i++])
{
if(strncmp(entry_text, keycode[i-1], 5) == 0)
if(strncmp(properties->key, keycode[i-1], 5) == 0)
{
key_is_valid = 1;
}
}
i = 0;
if(key_is_valid)
while(static_boards[i++] != NULL) {
{
while(static_boards[i++] != NULL) {
/* Get the BoardPlugin Info */
bp = (BoardPlugin *) static_boards[i-1];
/* 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);
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;
gcomprisBoard->plugin = bp;
return TRUE;
return TRUE;
}
}
}
} else {
while(static_boards_demo[i++] != NULL) {
else
{
while(static_boards_demo[i++] != NULL) {
/* Get the BoardPlugin Info */
bp = (BoardPlugin *) static_boards_demo[i-1];
/* 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",
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;
gcomprisBoard->plugin = bp;
return TRUE;
return TRUE;
}
}
}
}
g_warning("No plugin library found for board type '%s', requested by '%s'",
gcomprisBoard->type, gcomprisBoard->filename);
......
......@@ -806,6 +806,19 @@ display_activation_dialog()
{
int board_count = 0;
GList *list;
guint i=0;
guint key_is_valid = 0;
while(keycode[i++])
{
if(strncmp(properties->key, keycode[i-1], 5) == 0)
{
key_is_valid = 1;
}
}
if(key_is_valid)
return;
/* Count non menu boards */
for (list = gc_menu_get_boards(); list != NULL; list = list->next)
......@@ -817,43 +830,41 @@ display_activation_dialog()
board_count++;
}
if(strncmp(properties->key, "your_welcome", 12)!=0)
{
/* Entry area */
widget_activation_entry = (GtkEntry *)gtk_entry_new();
gtk_entry_set_max_length(widget_activation_entry, 5);
activation_item = \
gnome_canvas_item_new (gnome_canvas_root(canvas),
gnome_canvas_widget_get_type (),
"widget", GTK_WIDGET(widget_activation_entry),
"x", (double) BOARDWIDTH / 2 - 50,
"y", (double) BOARDHEIGHT - 60,
"width", 100.0,
"height", 30.0,
"anchor", GTK_ANCHOR_NW,
"size_pixels", FALSE,
NULL);
gtk_signal_connect(GTK_OBJECT(widget_activation_entry), "activate",
GTK_SIGNAL_FUNC(activation_enter_callback),
NULL);
gtk_widget_show(GTK_WIDGET(widget_activation_entry));
gtk_entry_set_text(GTK_ENTRY(widget_activation_entry), "CODE");
/* Entry area */
widget_activation_entry = (GtkEntry *)gtk_entry_new();
gtk_entry_set_max_length(widget_activation_entry, 5);
activation_item = \
gnome_canvas_item_new (gnome_canvas_root(canvas),
gnome_canvas_widget_get_type (),
"widget", GTK_WIDGET(widget_activation_entry),
"x", (double) BOARDWIDTH / 2 - 50,
"y", (double) BOARDHEIGHT - 60,
"width", 100.0,
"height", 30.0,
"anchor", GTK_ANCHOR_NW,
"size_pixels", FALSE,
NULL);
gtk_signal_connect(GTK_OBJECT(widget_activation_entry), "activate",
GTK_SIGNAL_FUNC(activation_enter_callback),
widget_activation_entry);
gtk_widget_show(GTK_WIDGET(widget_activation_entry));
gtk_entry_set_text(GTK_ENTRY(widget_activation_entry), "CODE");
char *msg = g_strdup_printf(_("GCompris is free software released under the GPL License. In order to support its development, the Windows version provides only %d of the %d activities. You can get the full version for a small fee at\n<http://gcompris.net>\nThe Linux version does not have this restriction. Note that GCompris is being developed to free schools from monopolistic software vendors. If you also believe that we should teach freedom to children, please consider using GNU/Linux. Get more information at FSF:\n<http://www.fsf.org/philosophy>"),
gc_board_number_in_demo, board_count);
gc_dialog(msg, activation_done);
g_free(msg);
}
gc_board_stop();
char *msg = g_strdup_printf(_("GCompris is free software released under the GPL License. In order to support its development, the Windows version provides only %d of the %d activities. You can get the full version for a small fee at\n<http://gcompris.net>\nThe Linux version does not have this restriction. Note that GCompris is being developed to free schools from monopolistic software vendors. If you also believe that we should teach freedom to children, please consider using GNU/Linux. Get more information at FSF:\n<http://www.fsf.org/philosophy>"),
gc_board_number_in_demo, board_count);
gc_dialog(msg, activation_done);
g_free(msg);
}
/* Check the activation code
*
*/
static void
activation_enter_callback( GtkWidget *widget,
GtkWidget *entry )
activation_enter_callback( GtkWidget *entry,
GtkWidget *notused )
{
gchar *entry_text;
......@@ -871,7 +882,6 @@ activation_enter_callback( GtkWidget *widget,
gc_prop_save(properties);
gc_menu_load();
gc_board_stop();
gtk_entry_set_text(GTK_ENTRY(entry), "GOOD");
return;
}
......@@ -887,9 +897,14 @@ activation_enter_callback( GtkWidget *widget,
static void
activation_done()
{
if(strcmp((char *)gtk_entry_get_text(GTK_ENTRY(widget_activation_entry)), "GOOD") == 0)
gc_board_play(properties->menu_board);
if ((strcmp((char *)gtk_entry_get_text(GTK_ENTRY(widget_activation_entry)), "CODE") != 0) &&
(strcmp((char *)gtk_entry_get_text(GTK_ENTRY(widget_activation_entry)), "GOOD") != 0) &&
(strcmp((char *)gtk_entry_get_text(GTK_ENTRY(widget_activation_entry)), "WRONG") != 0))
{
activation_enter_callback(widget_activation_entry, NULL);
}
gc_board_play(properties->menu_board);
gtk_object_destroy (GTK_OBJECT(activation_item));
}
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment