diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/boards/Makefile.mingw | 2 | ||||
-rw-r--r-- | src/boards/py-mod-skin.c | 23 | ||||
-rw-r--r-- | src/boards/py-mod-utils.c | 9 | ||||
-rw-r--r-- | src/boards/python/electric.py | 5 | ||||
-rw-r--r-- | src/gcompris/gcompris.c | 3 |
5 files changed, 31 insertions, 11 deletions
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) { |