Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Samyn <osamyn@src.gnome.org>2004-01-21 00:40:37 (GMT)
committer Olivier Samyn <osamyn@src.gnome.org>2004-01-21 00:40:37 (GMT)
commit32110766612a390340302b7835d71f1c616e2fbd (patch)
tree381db1317c476063f6db2e2a63f584d85d8e961b /src
parent6cf4721c29f260c1a8f965f3394c79f27771c046 (diff)
Wrapped some new functions into the python plugin.
Updated the docs.
Diffstat (limited to 'src')
-rw-r--r--src/boards/py-mod-gcompris.c95
-rw-r--r--src/boards/py-mod-utils.c96
2 files changed, 191 insertions, 0 deletions
diff --git a/src/boards/py-mod-gcompris.c b/src/boards/py-mod-gcompris.c
index a19dd6d..28d2027 100644
--- a/src/boards/py-mod-gcompris.c
+++ b/src/boards/py-mod-gcompris.c
@@ -103,6 +103,28 @@ py_gcompris_bar_set_level(PyObject* self, PyObject* args)
}
+/* void gcompris_bar_set_repeat_icon (GdkPixbuf *pixmap); */
+static PyObject*
+py_gcompris_bar_set_repeat_icon(PyObject* self, PyObject* args)
+{
+ PyObject* pyObject;
+ GdkPixbuf* pixmap;
+ GcomprisBoard* cGcomprisBoard;
+
+ /* Parse arguments */
+ if(!PyArg_ParseTuple(args, "O:gcompris_bar_set_repeat_icon", &pyObject))
+ return NULL;
+ pixmap = (GdkPixbuf*) pygobject_get(pixmap);
+
+ /* Call the corresponding C function */
+ gcompris_bar_set_repeat_icon(pixmap);
+
+ /* Create and return the result */
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
/* void gcompris_bar_set (const GComprisBarFlags flags); */
static PyObject*
py_gcompris_bar_set(PyObject* self, PyObject* args)
@@ -276,6 +298,23 @@ py_gcompris_set_locale(PyObject* self, PyObject* args)
}
+/* char *gcompris_get_user_default_locale(void) */
+static PyObject*
+py_gcompris_get_user_default_locale(PyObject* self, PyObject* args)
+{
+ char* result;
+ /* Parse arguments */
+ if(!PyArg_ParseTuple(args, ":gcompris_get_user_default_locale"))
+ return NULL;
+
+ /* Call the corresponding C function */
+ result = gcompris_get_user_default_locale();
+
+ /* Create and return the result */
+ return Py_BuildValue("s", result);
+}
+
+
/* void gcompris_set_cursor(guint gdk_cursor_type); */
static PyObject*
py_gcompris_set_cursor(PyObject* self, PyObject* args)
@@ -347,6 +386,58 @@ py_gcompris_images_selector_start(PyObject* self, PyObject* args)
}
+/* void gcompris_log_set_reason (GcomprisBoard *gcomprisBoard, gchar *comment); */
+static PyObject*
+py_gcompris_log_set_reason(PyObject* self, PyObject* args)
+{
+ PyObject* pyGcomprisBoard;
+ GcomprisBoard* cGcomprisBoard;
+ gchar* comment;
+
+ /* Parse arguments */
+ if(!PyArg_ParseTuple(args,
+ "Os:gcompris_log_set_reason",
+ &pyGcomprisBoard,
+ &comment))
+ return NULL;
+ cGcomprisBoard = ((pyGcomprisBoardObject*) pyGcomprisBoard)->cdata;
+
+ /* Call the corresponding C function */
+ gcompris_log_set_reason(cGcomprisBoard,
+ comment);
+
+ /* Create and return the result */
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+/* void gcompris_log_end (GcomprisBoard *gcomprisBoard, gchar *status); */
+static PyObject*
+py_gcompris_log_end(PyObject* self, PyObject* args)
+{
+ PyObject* pyGcomprisBoard;
+ GcomprisBoard* cGcomprisBoard;
+ gchar* status;
+
+ /* Parse arguments */
+ if(!PyArg_ParseTuple(args,
+ "Os:gcompris_log_end",
+ &pyGcomprisBoard,
+ &status))
+ return NULL;
+ cGcomprisBoard = ((pyGcomprisBoardObject*) pyGcomprisBoard)->cdata;
+
+ /* Call the corresponding C function */
+ gcompris_log_end(cGcomprisBoard,
+ status);
+
+ /* Create and return the result */
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
/* void gcompris_images_selector_stop (void); */
static PyObject*
py_gcompris_images_selector_stop(PyObject* self, PyObject* args)
@@ -386,6 +477,7 @@ static PyMethodDef PythonGcomprisModule[] = {
{ "bar_start", py_gcompris_bar_start, METH_VARARGS, "gcompris_bar_start" },
{ "set_background", py_gcompris_set_background, METH_VARARGS, "gcompris_set_background" },
{ "bar_set_level", py_gcompris_bar_set_level, METH_VARARGS, "gcompris_bar_set_level" },
+ { "bar_set_repeat_icon", py_gcompris_bar_set_repeat_icon, METH_VARARGS, "gcompris_bar_set_repeat_icon" },
{ "bar_set", py_gcompris_bar_set, METH_VARARGS, "gcompris_bar_set" },
{ "bar_hide", py_gcompris_bar_hide, METH_VARARGS, "gcompris_bar_hide" },
{ "board_has_help", py_gcompris_board_has_help, METH_VARARGS, "gcompris_board_has_help" },
@@ -394,6 +486,7 @@ static PyMethodDef PythonGcomprisModule[] = {
{ "get_canvas", py_gcompris_get_canvas, METH_VARARGS, "gcompris_get_canvas" },
{ "get_window", py_gcompris_get_window, METH_VARARGS, "gcompris_get_window" },
{ "get_locale", py_gcompris_get_locale, METH_VARARGS, "gcompris_get_locale" },
+ { "get_user_default_locale", py_gcompris_get_user_default_locale, METH_VARARGS, "gcompris_get_user_default_locale" },
{ "set_locale", py_gcompris_set_locale, METH_VARARGS, "gcompris_set_locale" },
{ "set_cursor", py_gcompris_set_cursor, METH_VARARGS, "gcompris_set_cursor" },
{ "images_selector_start", py_gcompris_images_selector_start,
@@ -401,6 +494,8 @@ static PyMethodDef PythonGcomprisModule[] = {
{ "images_selector_stop", py_gcompris_images_selector_stop,
METH_VARARGS, "gcompris_images_selector_stop" },
{ "exit", py_gcompris_exit, METH_VARARGS, "gcompris_exit" },
+ { "log_set_reason", py_gcompris_log_set_reason, METH_VARARGS, "gcompris_log_set_reason" },
+ { "log_end", py_gcompris_log_end, METH_VARARGS, "gcompris_log_end" },
{ NULL, NULL, 0, NULL}
};
diff --git a/src/boards/py-mod-utils.c b/src/boards/py-mod-utils.c
index c5c3023..abc77dd 100644
--- a/src/boards/py-mod-utils.c
+++ b/src/boards/py-mod-utils.c
@@ -145,6 +145,28 @@ py_gcompris_item_rotate(PyObject* self, PyObject* args)
}
+/* void item_rotate_relative(GnomeCanvasItem *item, double angle); */
+static PyObject*
+py_gcompris_item_rotate_relative(PyObject* self, PyObject* args)
+{
+ PyObject* pyitem;
+ GnomeCanvasItem* item;
+ double angle;
+
+ /* Parse arguments */
+ if(!PyArg_ParseTuple(args, "Od:gcompris_item_rotate_relative", &pyitem, &angle))
+ return NULL;
+ item = (GnomeCanvasItem*) pygobject_get(pyitem);
+
+ /* Call the corresponding C function */
+ item_rotate_relative(item, angle);
+
+ /* Create and return the result */
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
/* void item_rotate_with_center(GnomeCanvasItem *item, double angle, int x, int y); */
static PyObject*
py_gcompris_item_rotate_with_center(PyObject* self, PyObject* args)
@@ -168,6 +190,29 @@ py_gcompris_item_rotate_with_center(PyObject* self, PyObject* args)
}
+/* void item_rotate_relative_with_center(GnomeCanvasItem *item, double angle, int x, int y); */
+static PyObject*
+py_gcompris_item_rotate_relative_with_center(PyObject* self, PyObject* args)
+{
+ PyObject* pyitem;
+ GnomeCanvasItem* item;
+ double angle;
+ int x,y;
+
+ /* Parse arguments */
+ if(!PyArg_ParseTuple(args, "Odii:gcompris_item_rotate_relative_with_center", &pyitem, &angle, &x, &y))
+ return NULL;
+ item = (GnomeCanvasItem*) pygobject_get(pyitem);
+
+ /* Call the corresponding C function */
+ item_rotate_relative_with_center(item, angle, x, y);
+
+ /* Create and return the result */
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
/* Dialog callback wrapper */
static PyObject* pyDialogBoxCallBackFunc = NULL;
@@ -207,6 +252,52 @@ py_gcompris_dialog(PyObject* self, PyObject* args)
}
+/* GdkPixbuf *gcompris_load_pixmap_asset(gchar *dataset, gchar* categories, */
+/* gchar* mimetype, gchar* name); */
+static PyObject*
+py_gcompris_load_pixmap_asset(PyObject* self, PyObject* args)
+{
+ gchar* dataset;
+ gchar* categories;
+ gchar* mimetype;
+ gchar* name;
+ GdkPixbuf* result;
+
+ /* Parse arguments */
+ if(!PyArg_ParseTuple(args, "ssss:gcompris_load_pixmap_asset", &dataset, &categories, &mimetype, &name))
+ return NULL;
+
+ /* Call the corresponding C function */
+ result = gcompris_load_pixmap_asset(dataset, categories, mimetype, name);
+
+ /* Create and return the result */
+ return(PyObject*)pygobject_new((GObject*) result);
+}
+
+
+/* gchar *gcompris_get_asset_file(gchar *dataset, gchar* categories, */
+/* gchar* mimetype, gchar* file); */
+static PyObject*
+py_gcompris_get_asset_file(PyObject* self, PyObject* args)
+{
+ gchar* dataset;
+ gchar* categories;
+ gchar* mimetype;
+ gchar* name;
+ gchar* result;
+
+ /* Parse arguments */
+ if(!PyArg_ParseTuple(args, "ssss:gcompris_get_asset_file", &dataset, &categories, &mimetype, &name))
+ return NULL;
+
+ /* Call the corresponding C function */
+ result = gcompris_get_asset_file(dataset, categories, mimetype, name);
+
+ /* Create and return the result */
+ return Py_BuildValue("s", result);
+}
+
+
static PyMethodDef PythonGcomprisUtilsModule[] = {
{ "load_number_pixmap", py_gcompris_load_number_pixmap, METH_VARARGS, "gcompris_load_number_pixmap" },
{ "load_pixmap", py_gcompris_load_pixmap, METH_VARARGS, "gcompris_load_pixmap" },
@@ -214,9 +305,14 @@ static PyMethodDef PythonGcomprisUtilsModule[] = {
{ "item_event_focus", py_gcompris_item_event_focus, METH_VARARGS, "gcompris_item_event_focus" },
{ "item_absolute_move", py_gcompris_item_absolute_move, METH_VARARGS, "item_absolute_move" },
{ "item_rotate", py_gcompris_item_rotate, METH_VARARGS, "item_rotate" },
+ { "item_rotate_relative", py_gcompris_item_rotate_relative, METH_VARARGS, "item_rotate_relative" },
+ { "item_rotate_relative_with_center", py_gcompris_item_rotate_relative_with_center, METH_VARARGS,
+ "item_rotate_relative_with_center" },
{ "item_rotate_with_center", py_gcompris_item_rotate_with_center, METH_VARARGS,
"item_rotate_with_center" },
{ "dialog", py_gcompris_dialog, METH_VARARGS, "gcompris_dialog" },
+ { "load_pixmap_asset", py_gcompris_load_pixmap_asset, METH_VARARGS, "gcompris_load_pixmap_asset" },
+ { "get_asset_file", py_gcompris_get_asset_file, METH_VARARGS, "gcompris_get_asset_file" },
{ NULL, NULL, 0, NULL}
};