Commit 5caa0ca1 authored by Bruno Coudoin's avatar Bruno Coudoin

- 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.
parent 0b851fb5
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
......
......@@ -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
......
......@@ -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"
......
......@@ -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
......
......@@ -93,7 +93,7 @@ LIBS = -lgtk-win32-2.0 \
-lintl \
-lws2_32 \
-lpython24 \
-lpython
-lpython \
libgcompris-1.la
##
......
......@@ -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}
};
......
......@@ -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);
}
......
......@@ -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
......
......@@ -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)
{
......
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