Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Coudoin <bcoudoin@src.gnome.org>2006-10-19 22:54:25 (GMT)
committer Bruno Coudoin <bcoudoin@src.gnome.org>2006-10-19 22:54:25 (GMT)
commitc3f940da2028908c73c00beda4eb975ef394090c (patch)
tree469c07352aefbb2ce065ca93d76ce931b7541522
parentd0895b584a0c59677e31e7609cb9ba5b714dc3cd (diff)
- Unexistant font on windows in gartoon/skin.xml makes it unstable.
- cleanup, removed uneeded #if defined _WIN32 - in menu.c, removed a free of the plugin that was not correct. there is a leak but it cannot be fixed this way, we need to ref_count the plugins - fixed config.c to make skin selection work again.
-rw-r--r--ChangeLog23
-rw-r--r--boards/skins/gartoon/skin.xml18
-rw-r--r--src/gcompris/about.c5
-rw-r--r--src/gcompris/board.c5
-rw-r--r--src/gcompris/config.c46
-rw-r--r--src/gcompris/gcompris.c9
-rw-r--r--src/gcompris/help.c5
-rw-r--r--src/gcompris/log.c5
-rw-r--r--src/gcompris/menu.c9
-rw-r--r--src/gcompris/plugin.h8
-rw-r--r--src/gcompris/properties.c5
-rw-r--r--src/gcompris/soundutil.c27
12 files changed, 74 insertions, 91 deletions
diff --git a/ChangeLog b/ChangeLog
index c23dcbd..f85930a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2006-10-20 Bruno coudoin <bruno.coudoin@free.fr>
+
+ - Unexistant font on windows in gartoon/skin.xml makes it unstable.
+ - cleanup, removed uneeded #if defined _WIN32
+ - in menu.c, removed a free of the plugin that was not correct.
+ there is a leak but it cannot be fixed this way, we need to ref_count
+ the plugins
+ - fixed config.c to make skin selection work again.
+
+ * boards/skins/gartoon/skin.xml:
+ * src/gcompris/about.c:
+ * src/gcompris/board.c:
+ * src/gcompris/config.c: (gc_config_start), (item_event_ok):
+ * src/gcompris/gcompris.c: (gc_init):
+ * src/gcompris/help.c:
+ * src/gcompris/log.c:
+ * src/gcompris/menu.c: (gc_menu_board_free):
+ * src/gcompris/plugin.h:
+ * src/gcompris/properties.c:
+ * src/gcompris/soundutil.c: (gc_sound_init), (scheduler_bgnd),
+ (thread_play_ogg), (gc_sound_play_ogg), (gc_sound_play_ogg_list),
+ (gc_sound_callback), (gc_sound_class_init):
+
2006-10-19 Bruno coudoin <bruno.coudoin@free.fr>
- There were a lot of bad formatted xml string in the menus for the help.
diff --git a/boards/skins/gartoon/skin.xml b/boards/skins/gartoon/skin.xml
index bc3e07c..ea0a016 100644
--- a/boards/skins/gartoon/skin.xml
+++ b/boards/skins/gartoon/skin.xml
@@ -30,22 +30,22 @@
<!-- Defines the gcompris boards fonts -->
<font id="gcompris/board/tiny" name="sans 10"/>
<font id="gcompris/board/small" name="sans 12"/>
- <font id="gcompris/board/medium" name="URW Chancery L Medium Italic 14" />
- <font id="gcompris/board/big" name="URW Chancery L Medium Italic 18" />
- <font id="gcompris/board/big bold" name="sans 17"/>
+ <font id="gcompris/board/medium" name="sans 14" />
+ <font id="gcompris/board/big" name="sans 18" />
+ <font id="gcompris/board/big bold" name="sans bold 17"/>
<font id="gcompris/board/fixed" name="sans 12"/>
<font id="gcompris/board/title" name="sans 20"/>
- <font id="gcompris/board/title bold" name="sans 21"/>
+ <font id="gcompris/board/title bold" name="sans bold 21"/>
<font id="gcompris/board/huge" name="sans 28"/>
- <font id="gcompris/board/huge bold" name="sans 29"/>
-
+ <font id="gcompris/board/huge bold" name="sans bold 29"/>
+
<color id="menu/text" rgba="0x597ad7FF"/>
<color id="menu/text_shadow" rgba="0x000000FF"/>
<!-- Here you may define some other properties that will -->
<!-- affect a particular game. -->
<!-- For example, in futur, the colors of the canal lock game will be -->
- <!-- customisable with some lines like: -->
+ <!-- customisable with some lines like: -->
<!-- <color id="canal_lock/canal color" rgba="0x0010FFFF"/>-->
<!-- <color id="canal_lock/lock color" rgba="0x8cc679FF"/>-->
<!-- <color id="canal_lock/lock color h" rgba="0x71A65FFF"/>-->
@@ -67,9 +67,9 @@
<color id="missingletter/question" rgba="0XFFFFFFFF"/>
<color id="maze/wall color" rgba="0x1a1109ff"/>
-
+
<color id="clockgame/text" rgba="0Xc20200FF"/>
-
+
</Skin>
</GCompris>
diff --git a/src/gcompris/about.c b/src/gcompris/about.c
index d24ca19..6162f57 100644
--- a/src/gcompris/about.c
+++ b/src/gcompris/about.c
@@ -27,11 +27,6 @@
#include "about.h"
#include <string.h>
-#if defined _WIN32 || defined __WIN32__
-# undef WIN32 /* avoid warning on mingw32 */
-# define WIN32
-#endif
-
static GnomeCanvasItem *rootitem = NULL;
static GnomeCanvasItem *plane_item = NULL;
static GdkPixbuf *pixmap_about = NULL;
diff --git a/src/gcompris/board.c b/src/gcompris/board.c
index 02715eb..67193f2 100644
--- a/src/gcompris/board.c
+++ b/src/gcompris/board.c
@@ -28,11 +28,6 @@ static struct BoardPluginData *bp_data;
static gboolean get_board_playing(void);
-#if defined _WIN32 || defined __WIN32__
-# undef WIN32 /* avoid warning on mingw32 */
-# define WIN32
-#endif
-
#ifdef WIN32
extern gchar *keycode[];
extern BoardPlugin * get_advanced_colors_bplugin_info();
diff --git a/src/gcompris/config.c b/src/gcompris/config.c
index 1f44bfe..ab9c4ea 100644
--- a/src/gcompris/config.c
+++ b/src/gcompris/config.c
@@ -30,11 +30,6 @@
#include "gcompris_config.h"
#include "locale.h"
-#if defined _WIN32 || defined __WIN32__
-# undef WIN32 /* avoid warning on mingw32 */
-# define WIN32
-#endif
-
static GnomeCanvasItem *rootitem = NULL;
static GnomeCanvasItem *item_locale_text = NULL;
static GnomeCanvasItem *item_locale_flag = NULL;
@@ -229,11 +224,11 @@ gc_config_start ()
/* Display a bad icon if this locale is not available */
pixmap = gc_skin_pixmap_load("mini_bad.png");
item_bad_flag = gnome_canvas_item_new (GNOME_CANVAS_GROUP(rootitem),
- gnome_canvas_pixbuf_get_type (),
- "pixbuf", pixmap,
- "x", (double) x_flag_start - 20,
- "y", (double) y_start - gdk_pixbuf_get_width(pixmap_checked)/2,
- NULL);
+ gnome_canvas_pixbuf_get_type (),
+ "pixbuf", pixmap,
+ "x", (double) x_flag_start - 20,
+ "y", (double) y_start - gdk_pixbuf_get_width(pixmap_checked)/2,
+ NULL);
gdk_pixbuf_unref(pixmap);
/*
@@ -438,14 +433,14 @@ gc_config_start ()
stars_group_y = y_start - 25;
item_filter_text = gnome_canvas_item_new (GNOME_CANVAS_GROUP(rootitem),
- gnome_canvas_text_get_type (),
- "markup", gettext(filtername[0]),
- "font", gc_skin_font_subtitle,
- "x", (double) x_text_start,
- "y", (double) y_start,
- "anchor", GTK_ANCHOR_WEST,
- "fill_color_rgba", gc_skin_color_content,
- NULL);
+ gnome_canvas_text_get_type (),
+ "markup", gettext(filtername[0]),
+ "font", gc_skin_font_subtitle,
+ "x", (double) x_text_start,
+ "y", (double) y_start,
+ "anchor", GTK_ANCHOR_WEST,
+ "fill_color_rgba", gc_skin_color_content,
+ NULL);
// OK
@@ -723,12 +718,11 @@ item_event_ok(GnomeCanvasItem *item, GdkEvent *event, gpointer data)
if(!strcmp((char *)data, "ok"))
{
/* Set the new locale in the properties */
- if (properties->locale != current_locale)
- {
- g_free(properties->locale);
- properties->locale = strdup(current_locale);
- }
- gc_prop_save(properties);
+ if (properties->locale != current_locale)
+ {
+ g_free(properties->locale);
+ properties->locale = strdup(current_locale);
+ }
if(current_locale[0] == '\0') {
/* Set the locale to the default user's locale */
@@ -736,7 +730,7 @@ item_event_ok(GnomeCanvasItem *item, GdkEvent *event, gpointer data)
} else {
gc_locale_set(current_locale);
}
- g_free(properties->skin);
+ g_free(properties->skin);
properties->skin = g_strdup((char *)g_list_nth_data(skinlist, skin_index));
gc_skin_load(properties->skin);
gc_config_stop();
@@ -744,6 +738,8 @@ item_event_ok(GnomeCanvasItem *item, GdkEvent *event, gpointer data)
if(properties->music || properties->fx) {
gc_sound_init();
}
+
+ gc_prop_save(properties);
}
else if(!strcmp((char *)data, "fullscreen"))
{
diff --git a/src/gcompris/gcompris.c b/src/gcompris/gcompris.c
index 8bafc6b..609bd92 100644
--- a/src/gcompris/gcompris.c
+++ b/src/gcompris/gcompris.c
@@ -44,11 +44,6 @@
#include <X11/extensions/xf86vmode.h>
#endif
-#if defined _WIN32 || defined __WIN32__
-# undef WIN32 /* avoid warning on mingw32 */
-# define WIN32
-#endif
-
static GtkWidget *window;
static GnomeCanvas *canvas;
static GnomeCanvas *canvas_bar;
@@ -1638,10 +1633,10 @@ gc_init (int argc, char *argv[])
if(popt_web_only) {
g_free(properties->package_data_dir);
- properties->package_data_dir = "";
+ properties->package_data_dir = g_strdup("");
g_free(properties->system_icon_dir);
- properties->system_icon_dir = "";
+ properties->system_icon_dir = g_strdup("");
}
if (popt_server){
diff --git a/src/gcompris/help.c b/src/gcompris/help.c
index 8b63f9c..213b98f 100644
--- a/src/gcompris/help.c
+++ b/src/gcompris/help.c
@@ -28,11 +28,6 @@
#include "gcompris.h"
#include "gc_core.h"
-#if defined _WIN32 || defined __WIN32__
-# undef WIN32 /* avoid warning on mingw32 */
-# define WIN32
-#endif
-
#define SOUNDLISTFILE PACKAGE
#define GAP_TO_BUTTON -20
diff --git a/src/gcompris/log.c b/src/gcompris/log.c
index c8ac305..0d96c02 100644
--- a/src/gcompris/log.c
+++ b/src/gcompris/log.c
@@ -41,11 +41,6 @@
#define KEYLOG_MAX 256
-#if defined _WIN32 || defined __WIN32__
-# undef WIN32 /* avoid warning on mingw32 */
-# define WIN32
-#endif
-
#ifdef WIN32
static gchar hostname[256]="unknown";
#else
diff --git a/src/gcompris/menu.c b/src/gcompris/menu.c
index 77f45a5..33ed419 100644
--- a/src/gcompris/menu.c
+++ b/src/gcompris/menu.c
@@ -654,11 +654,10 @@ void gc_menu_load()
void gc_menu_board_free(GcomprisBoard *board)
{
- if(strcmp(board->type,"shapegame")==0 ||
- strncmp(board->type, "python", 6)==0)
- {
- g_free(board->plugin);
- }
+#ifndef WIN32 /* Win32 plugins are static */
+ /* Need to reference cound plugins and free them once it's no more used */
+ // FIXME g_free(board->plugin);
+#endif
g_free(board->type);
g_free(board->board_dir);
g_free(board->mode);
diff --git a/src/gcompris/plugin.h b/src/gcompris/plugin.h
index bfed925..bca8b77 100644
--- a/src/gcompris/plugin.h
+++ b/src/gcompris/plugin.h
@@ -3,7 +3,7 @@
* Time-stamp: <2005/09/14 23:30:48 yves>
*
* Copyright (C) 2000 Bruno Coudoin
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -33,8 +33,8 @@ typedef void (*GcomprisInitBoard) (GcomprisBoard *gcomprisBoard);
typedef void (*GcomprisStartBoard) (GcomprisBoard *gcomprisBoard);
typedef void (*GcomprisPauseBoard) (gboolean pause);
typedef void (*GcomprisEndBoard) (void);
-typedef gint (*GcomprisKeyPress) (guint keyval,
- gchar *commited_str,
+typedef gint (*GcomprisKeyPress) (guint keyval,
+ gchar *commited_str,
gchar *preedit_str);
typedef void (*GcomprisOK) (void);
typedef void (*GcomprisSetLevel) (guint level);
@@ -57,7 +57,7 @@ typedef struct
void (*cleanup) (void); /* Called when gcompris exit */
void (*about) (void); /* Show the about box */
void (*configure) (void); /* Show the configuration dialog */
-
+
GcomprisStartBoard start_board;
GcomprisPauseBoard pause_board;
GcomprisEndBoard end_board;
diff --git a/src/gcompris/properties.c b/src/gcompris/properties.c
index 79e4551..5a8d2d6 100644
--- a/src/gcompris/properties.c
+++ b/src/gcompris/properties.c
@@ -29,11 +29,6 @@
/* This should be detected in the configure for good portability */
#define HAVE_SETENV 1
-#if defined _WIN32 || defined __WIN32__
-# undef WIN32 /* avoid warning on mingw32 */
-# define WIN32
-#endif
-
#ifdef WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
diff --git a/src/gcompris/soundutil.c b/src/gcompris/soundutil.c
index 0a72889..9892e03 100644
--- a/src/gcompris/soundutil.c
+++ b/src/gcompris/soundutil.c
@@ -32,11 +32,6 @@ static int sound_policy;
static gboolean is_playing;
static gboolean sound_closed = FALSE;
-#if defined _WIN32 || defined __WIN32__
-# undef WIN32 /* avoid warning on mingw32 */
-# define WIN32
-#endif
-
/* mutex */
GMutex *lock = NULL;
GMutex *lock_bg = NULL;
@@ -68,7 +63,7 @@ gc_sound_init()
gc_sound_controller = g_object_new (GCOMPRIS_SOUND_TYPE, NULL);
- g_signal_connect( gc_sound_controller,
+ g_signal_connect( gc_sound_controller,
"sound-played",
(GCallback) gc_sound_callback,
NULL);
@@ -188,13 +183,13 @@ scheduler_bgnd (gpointer user_data)
music_dir = g_strconcat(properties->package_data_dir, "/music/background", NULL);
dir = g_dir_open(music_dir, 0, NULL);
-
+
if (!dir) {
g_warning ("Couldn't open music dir: %s", music_dir);
g_free(music_dir);
return NULL;
}
-
+
/* Fill up the music list */
while((one_dirent = g_dir_read_name(dir)) != NULL) {
@@ -294,7 +289,7 @@ thread_play_ogg (gchar *file)
0 /* details */,
g_strdup(file));
g_warning(" sdlplayer_file(%s) ended.", absolute_file);
-
+
g_free(absolute_file);
return NULL;
@@ -350,7 +345,7 @@ gc_sound_play_ogg_cb(const gchar *file, GcomprisSoundCallback cb)
/* =====================================================================
* Play a list of OGG sound files. The list must be NULL terminated
- * This function wraps the var args into a GList and call the
+ * This function wraps the var args into a GList and call the
* gc_sound_play_ogg_list function to process the sounds.
======================================================================*/
void
@@ -375,12 +370,12 @@ gc_sound_play_ogg(const gchar *sound, ...)
va_end(ap);
gc_sound_play_ogg_list( list );
-
- g_list_free(list);
+
+ g_list_free(list);
}
/* =====================================================================
- * Play a list of OGG sound files.
+ * Play a list of OGG sound files.
* The given ogg files will be first tested as a locale dependant sound file:
* sounds/<current gcompris locale>/<sound>
* If it doesn't exists, then the test is done with a music file:
@@ -409,7 +404,7 @@ gc_sound_play_ogg_list( GList* files )
}
list = g_list_next(list);
}
-
+
g_mutex_unlock (lock);
// Tell the scheduler to check for new sounds to play
@@ -466,7 +461,7 @@ void gc_sound_callback(GcomprisSound *ctl, gchar *file, gpointer user_data)
if (!sound_callbacks)
return;
-
+
cb = g_hash_table_lookup (sound_callbacks, file);
if (cb){
@@ -510,7 +505,7 @@ gc_sound_class_init (gpointer g_class,
klass->sound_played = default_sound_played_signal_handler;
- klass->sound_played_signal_id =
+ klass->sound_played_signal_id =
g_signal_new ("sound-played",
G_TYPE_FROM_CLASS (g_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,