Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog18
-rw-r--r--Makefile.mingw23
-rw-r--r--config.h.mingw2
-rw-r--r--configure.in2
-rw-r--r--src/boards/Makefile.mingw2
-rw-r--r--src/boards/py-mod-skin.c23
-rw-r--r--src/boards/py-mod-utils.c9
-rw-r--r--src/boards/python/electric.py5
-rw-r--r--src/gcompris/gcompris.c3
9 files changed, 63 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 3387c99..7c921d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2006-10-14 Bruno coudoin <bruno.coudoin@free.fr>
+
+ - Fixed a major memory leak in python bindings. all image loading was leaking.
+ - Now electricity works on windows.
+ - On windows disable the colored cursor. Need to use the new GTK API, maybe
+ it would work on windows with it. With the new api, we can provide png files
+ as cursor which would be better for skins as well.
+
+ * Makefile.mingw:
+ * config.h.mingw:
+ * configure.in:
+ * src/boards/Makefile.mingw:
+ * src/boards/py-mod-skin.c: (py_gc_skin_image_get),
+ (py_gc_skin_pixmap_load):
+ * src/boards/py-mod-utils.c: (py_gc_pixmap_load):
+ * src/boards/python/electric.py:
+ * src/gcompris/gcompris.c: (gc_init):
+
2006-10-13 Bruno coudoin <bruno.coudoin@free.fr>
* src/boards/Makefile.mingw: update for windows python support
diff --git a/Makefile.mingw b/Makefile.mingw
index 8af86ce..48f8077 100644
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -4,7 +4,7 @@
# Description: Top Makefile for win32 (mingw) port of GCompris
#
-VERSION = "8.0BETA6"
+VERSION = "8.0"
pkgdatadir = gcompris
@@ -13,20 +13,19 @@ GCOMPRIS_BOARDS = ./src/boards
GCOMPRIS_INSTALL_DIR = ./win32-install-dir
GTK_TOP := /gtk
-GLIB_TOP := /glib
GNUWIN32_TOP := /gnuwin32
LIBXML2_TOP := /libxml2
SDL_TOP := /sdl
CANVAS_TOP := /gnomecanvas
-CAIRO_TOP := /cairo
GNUCHESS_TOP := /gnuchess
-PYTHON_TOP := /c/Python24
+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 \
+ $(GNUCAP_TOP)/src/MSW/gnucap.exe \
$(GTK_TOP)/bin/gspawn-win32-helper.exe \
$(GNUCHESS_TOP)/bin/gnuchess.exe \
$(GNUWIN32_TOP)/bin/popt1.dll \
@@ -43,7 +42,7 @@ NEEDED_DLLS = $(GNUCHESS_TOP)/bin/pthreadGC.dll \
$(GTK_TOP)/bin/libart_lgpl_2-2.dll \
$(GTK_TOP)/bin/libgdk-win32-2.0-0.dll \
$(GTK_TOP)/bin/libgdk_pixbuf-2.0-0.dll \
- $(GLIB_TOP)/bin/libglib-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/libpango-1.0-0.dll \
@@ -60,9 +59,8 @@ NEEDED_DLLS = $(GNUCHESS_TOP)/bin/pthreadGC.dll \
$(GTK_TOP)/bin/intl.dll \
$(GTK_TOP)/bin/libpng13.dll \
$(GTK_TOP)/bin/jpeg62.dll \
- $(GTK_TOP)/bin/libpangocairo-1.0-0.dll \
- $(CAIRO_TOP/bin/libcairo-2.dll \
- /c/WINDOWS/system32/python24.dll
+ $(GTK_TOP)/bin/libcairo-2.dll \
+ $(GTK_TOP)/bin/libpangocairo-1.0-0.dll
NEEDED_FILES = README \
COPYING \
@@ -82,6 +80,11 @@ install: all
mkdir -p $(GCOMPRIS_INSTALL_DIR)/share
$(MAKE) -C $(GCOMPRIS_BOARDS) -f Makefile.mingw install
$(MAKE) -C $(GCOMPRIS_SRC) -f Makefile.mingw install
+ mkdir -p $(GCOMPRIS_INSTALL_DIR)/share/gcompris
+ 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*
# Copy mandratory files for the package in the package directory
prepack:
@@ -111,7 +114,7 @@ clean:
#
prep:
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 --exclude "*.assetml" * | ( cd ../$(GCOMPRIS_INSTALL_DIR)/share/$(pkgdatadir)/boards ; tar xf -) ; cd .. ;
+ 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 "-------------------------------------------------------------------------------"
@echo " WARNING: MAKE SURE TO HAVE RUN A MAKE INSTALL OF GCOMPRIS IN /USR/LOCAL FIRST"
@echo "-------------------------------------------------------------------------------"
@@ -119,8 +122,6 @@ prep:
cp -r /usr/local/share/locale/* $(GCOMPRIS_INSTALL_DIR)/share/locale/
@echo "Remove other .mo file not from gcompris"
find ./win32-install-dir/share/locale/ -name \*.mo | grep -v gcompris.mo | xargs rm -f
- @echo "Grab installed assetml files"
- cp -r /usr/local/share/assetml $(GCOMPRIS_INSTALL_DIR)/share/
@echo "Copy pixmap"
mkdir $(GCOMPRIS_INSTALL_DIR)/share/pixmaps
cp gcompris.png $(GCOMPRIS_INSTALL_DIR)/share/pixmaps
diff --git a/config.h.mingw b/config.h.mingw
index 3674dc9..0921b89 100644
--- a/config.h.mingw
+++ b/config.h.mingw
@@ -2,7 +2,7 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Version number of package */
-#define VERSION "8.0BETA6"
+#define VERSION "8.0"
/* 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"
diff --git a/configure.in b/configure.in
index f408661..0fc63f5 100644
--- a/configure.in
+++ b/configure.in
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/gcompris/gcompris.c)
AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE(gcompris, 8.0BETA6)
+AM_INIT_AUTOMAKE(gcompris, 8.0)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
diff --git a/src/boards/Makefile.mingw b/src/boards/Makefile.mingw
index a2533b9..c002136 100644
--- a/src/boards/Makefile.mingw
+++ b/src/boards/Makefile.mingw
@@ -93,7 +93,7 @@ LIBS = -lgtk-win32-2.0 \
-lintl \
-lws2_32 \
-lpython24 \
- -lpython
+ -lpython \
libgcompris-1.la
##
diff --git a/src/boards/py-mod-skin.c b/src/boards/py-mod-skin.c
index 6ec0179..3bf4c45 100644
--- a/src/boards/py-mod-skin.c
+++ b/src/boards/py-mod-skin.c
@@ -16,6 +16,7 @@ py_gc_skin_image_get(PyObject* self, PyObject* args)
{
gchar* imagename;
gchar* result;
+ PyObject* pyresult;
/* Parse arguments */
if(!PyArg_ParseTuple(args, "s:gc_skin_image_get", &imagename))
return NULL;
@@ -24,7 +25,11 @@ py_gc_skin_image_get(PyObject* self, PyObject* args)
result = gc_skin_image_get(imagename);
/* Create and return the result */
- return Py_BuildValue("s", result);
+ pyresult = Py_BuildValue("s", result);
+
+ g_free(result);
+
+ return(pyresult);
}
@@ -34,6 +39,8 @@ py_gc_skin_pixmap_load(PyObject* self, PyObject* args)
{
char* pixmapfile;
GdkPixbuf* result;
+ PyObject* pyresult;
+
/* Parse arguments */
if(!PyArg_ParseTuple(args, "s:gc_skin_pixmap_load", &pixmapfile))
return NULL;
@@ -42,7 +49,11 @@ py_gc_skin_pixmap_load(PyObject* self, PyObject* args)
result = gc_skin_pixmap_load(pixmapfile);
/* Create and return the result */
- return (PyObject*) pygobject_new((GObject*) result);
+ pyresult = (PyObject*) pygobject_new((GObject*) result);
+
+ gdk_pixbuf_unref(result);
+
+ return(pyresult);
}
@@ -127,13 +138,13 @@ py_gc_skin_get_font(PyObject* self, PyObject* args)
static PyMethodDef PythonGcomprisSkinModule[] = {
{ "image_to_skin", py_gc_skin_image_get, METH_VARARGS, "gc_skin_image_get" },
{ "load_pixmap", py_gc_skin_pixmap_load, METH_VARARGS, "gc_skin_pixmap_load" },
- { "get_color_default", py_gc_skin_get_color_default, METH_VARARGS,
+ { "get_color_default", py_gc_skin_get_color_default, METH_VARARGS,
"gc_skin_get_color_default" },
- { "get_font_default", py_gc_skin_get_font_default, METH_VARARGS,
+ { "get_font_default", py_gc_skin_get_font_default, METH_VARARGS,
"gc_skin_get_font_default" },
- { "get_color", py_gc_skin_get_color, METH_VARARGS,
+ { "get_color", py_gc_skin_get_color, METH_VARARGS,
"gc_skin_get_color" },
- { "get_font", py_gc_skin_get_font, METH_VARARGS,
+ { "get_font", py_gc_skin_get_font, METH_VARARGS,
"gc_skin_get_font" },
{ NULL, NULL, 0, NULL}
};
diff --git a/src/boards/py-mod-utils.c b/src/boards/py-mod-utils.c
index c51310f..fb92899 100644
--- a/src/boards/py-mod-utils.c
+++ b/src/boards/py-mod-utils.c
@@ -16,6 +16,8 @@ py_gc_pixmap_load(PyObject* self, PyObject* args)
{
char* pixmapfile;
GdkPixbuf* result;
+ PyObject* pyresult;
+
/* Parse arguments */
if(!PyArg_ParseTuple(args, "s:gc_pixmap_load", &pixmapfile))
@@ -25,7 +27,12 @@ py_gc_pixmap_load(PyObject* self, PyObject* args)
result = gc_pixmap_load(pixmapfile);
/* Create and return the result */
- return (PyObject*) pygobject_new((GObject*) result);
+ pyresult = (PyObject*) pygobject_new((GObject*) result);
+
+ gdk_pixbuf_unref(result);
+
+ return(pyresult);
+
}
diff --git a/src/boards/python/electric.py b/src/boards/python/electric.py
index a40fdc0..9e92e2e 100644
--- a/src/boards/python/electric.py
+++ b/src/boards/python/electric.py
@@ -83,10 +83,9 @@ class Gcompris_electric:
#
# Check gnucap is installed and save it's path in self.gnucap_binary
#
- wingnucap = os.path.join(os.getcwd(), "/gnucap.exe")
for binary in ("/usr/bin/gnucap",
"/usr/local/bin/gnucap",
- wingnucap):
+ "gnucap.exe"):
if(os.path.exists(binary)):
self.gnucap_binary = binary
break
@@ -376,7 +375,7 @@ class Gcompris_electric:
# Close it to check errors
results = output.close()
if results:
- print('Failed to run gnugap with error ', os.WEXITSTATUS(results))
+ print('Failed to run gnugap with error ', results)
self.gnucap_timer = 0
return
diff --git a/src/gcompris/gcompris.c b/src/gcompris/gcompris.c
index 1d5c28d..fefa387 100644
--- a/src/gcompris/gcompris.c
+++ b/src/gcompris/gcompris.c
@@ -1440,6 +1440,9 @@ gc_init (int argc, char *argv[])
g_warning("Default gnome cursor enabled");
properties->defaultcursor = GDK_LEFT_PTR;
}
+#ifdef WIN32
+ properties->defaultcursor = GDK_LEFT_PTR;
+#endif
if (popt_aalias)
{