Back to index

gcompris  8.2.2
Classes | Functions | Variables
py-mod-gcompris.c File Reference
#include <Python.h>
#include <pygobject.h>
#include "gcompris/gcompris.h"
#include "py-mod-gcompris.h"
#include "py-gcompris-board.h"
#include "py-gcompris-properties.h"
#include "py-gcompris-profile.h"
#include "py-gcompris-wordlist.h"
#include "py-mod-bonus.h"
#include "py-mod-score.h"
#include "py-mod-skin.h"
#include "py-mod-sound.h"
#include "py-mod-timer.h"
#include "py-mod-utils.h"
#include "py-mod-anim.h"
#include "py-mod-admin.h"

Go to the source code of this file.

Classes

struct  _PyGChildData
struct  _PyGChildSetupData

Functions

void initgnomecanvas (void)
void pair_in_dict (gpointer key, gpointer value, gpointer dict)
PyObject * hash_to_dict (GHashTable *table)
static PyObject * py_gc_board_end (PyObject *self, PyObject *args)
static PyObject * py_gc_bar_start (PyObject *self, PyObject *args)
static PyObject * py_gc_set_background (PyObject *self, PyObject *args)
static PyObject * py_gc_bar_set_level (PyObject *self, PyObject *args)
static PyObject * py_gc_bar_set_repeat_icon (PyObject *self, PyObject *args)
static PyObject * py_gc_bar_set (PyObject *self, PyObject *args)
static PyObject * py_gc_bar_hide (PyObject *self, PyObject *args)
static PyObject * py_gc_get_canvas (PyObject *self, PyObject *args)
static PyObject * py_gc_get_window (PyObject *self, PyObject *args)
static PyObject * py_gc_locale_get (PyObject *self, PyObject *args)
static PyObject * py_gc_locale_set (PyObject *self, PyObject *args)
static PyObject * py_gc_locale_get_user_default (PyObject *self, PyObject *args)
static PyObject * py_gc_cursor_set (PyObject *self, PyObject *args)
void pyImageSelectorCallBack (gchar *image)
static PyObject * py_gc_selector_images_start (PyObject *self, PyObject *args)
static PyObject * py_gc_log_set_comment (PyObject *self, PyObject *args)
static PyObject * py_gc_log_end (PyObject *self, PyObject *args)
static PyObject * py_gc_selector_images_stop (PyObject *self, PyObject *args)
void pyFileSelectorCallBack (gchar *file, char *file_type)
static PyObject * py_gc_selector_file_load (PyObject *self, PyObject *args)
static PyObject * py_gc_selector_file_save (PyObject *self, PyObject *args)
static PyObject * py_gc_selector_file_stop (PyObject *self, PyObject *args)
static PyObject * py_gc_db_get_filename (PyObject *self, PyObject *args)
static PyObject * py_gc_prop_get (PyObject *self, PyObject *args)
static PyObject * py_gc_menu_section_get (PyObject *self, PyObject *args)
static void child_watch_func (GPid pid, gint status, gpointer data)
static void child_watch_dnotify (gpointer data)
static PyObject * py_gcompris_child_watch_add (PyObject *unused, PyObject *args, PyObject *kwargs)
static void _pyg_spawn_async_callback (gpointer user_data)
static PyObject * py_gcompris_spawn_async (PyObject *unused, PyObject *args, PyObject *kwargs)
static PyObject * py_gc_db_get_board_conf (PyObject *self, PyObject *args)
static PyObject * py_gc_db_get_conf (PyObject *self, PyObject *args)
static PyObject * py_gc_profile_get_current (PyObject *self, PyObject *args)
static PyObject * py_gc_profile_get_current_user (PyObject *self, PyObject *args)
static PyObject * py_gc_db_set_board_conf (PyObject *self, PyObject *args)
static void pyGcomprisConfCallback (GHashTable *table)
static PyObject * py_gc_board_config_window_display (PyObject *self, PyObject *args)
static PyObject * py_gc_board_config_boolean_box (PyObject *self, PyObject *args)
static PyObject * py_gc_board_config_combo_box (PyObject *self, PyObject *args)
void pair_object_in_dict (gpointer key, gpointer value, gpointer dict)
PyObject * hash_object_to_dict (GHashTable *table)
static PyObject * py_gc_board_config_radio_buttons (PyObject *self, PyObject *args)
static PyObject * py_gc_board_config_spin_int (PyObject *self, PyObject *args)
static PyObject * py_gc_board_conf_separator (PyObject *self, PyObject *args)
static PyObject * py_gc_board_config_combo_locales (PyObject *self, PyObject *args)
static PyObject * py_gc_locale_gets_list (PyObject *self, PyObject *args)
static PyObject * py_gc_board_config_combo_locales_asset (PyObject *self, PyObject *args)
static PyObject * py_gc_locale_gets_asset_list (PyObject *self, PyObject *args)
static PyObject * py_gcompris_gettext (PyObject *self, PyObject *args)
static PyObject * py_gc_locale_change (PyObject *self, PyObject *args)
static PyObject * py_gc_locale_reset (PyObject *self, PyObject *args)
static gboolean pyGcomprisTextCallback (gchar *key, gchar *text, GtkLabel *label)
static PyObject * py_gc_board_config_textview (PyObject *self, PyObject *args)
static PyObject * py_gc_prop_user_dirname_get (PyObject *self, PyObject *args)
static PyObject * py_gc_prop_board_dirname_get (PyObject *self, PyObject *args)
static PyObject * py_gc_prop_current_user_dirname_get (PyObject *self, PyObject *args)
static PyObject * py_gc_prop_current_board_dirname_get (PyObject *self, PyObject *args)
static PyObject * py_gcompris_wordlist_get_from_file (PyObject *self, PyObject *args)
static PyObject * py_gc_im_reset (PyObject *self, PyObject *args)
void python_gcompris_module_init (void)

Variables

static PyObject * pyImageSelectorCallBackFunc = NULL
static PyObject * pyFileSelectorCallBackFunc = NULL
static PyObject * pyGcomprisConfCallbackFunc = NULL
static GHashTable * text_callbacks = NULL
static PyMethodDef PythonGcomprisModule []

Class Documentation

struct _PyGChildData

Definition at line 630 of file py-mod-gcompris.c.

Class Members
PyObject * data
PyObject * func
struct _PyGChildSetupData

Definition at line 698 of file py-mod-gcompris.c.

Class Members
PyObject * data
PyObject * func

Function Documentation

static void _pyg_spawn_async_callback ( gpointer  user_data) [static]

Definition at line 704 of file py-mod-gcompris.c.

{
    struct _PyGChildSetupData *data;
    PyObject *retval;
    PyGILState_STATE gil;

    data = (struct _PyGChildSetupData *) user_data;
    gil = pyg_gil_state_ensure();
    if (data->data)
        retval = PyObject_CallFunction(data->func, "O", data->data);
    else
        retval = PyObject_CallFunction(data->func, NULL);
    if (retval)
       Py_DECREF(retval);
    else
       PyErr_Print();
    Py_DECREF(data->func);
    Py_XDECREF(data->data);
    g_free(data);
    pyg_gil_state_release(gil);
}

Here is the caller graph for this function:

static void child_watch_dnotify ( gpointer  data) [static]

Definition at line 659 of file py-mod-gcompris.c.

{
    struct _PyGChildData *child_data = (struct _PyGChildData *) data;
    Py_DECREF(child_data->func);
    Py_XDECREF(child_data->data);
    g_free(child_data);
}

Here is the caller graph for this function:

static void child_watch_func ( GPid  pid,
gint  status,
gpointer  data 
) [static]

Definition at line 637 of file py-mod-gcompris.c.

{
    struct _PyGChildData *child_data = (struct _PyGChildData *) data;
    PyObject *retval;
    PyGILState_STATE gil;

    gil = pyg_gil_state_ensure();
    if (child_data->data)
        retval = PyObject_CallFunction(child_data->func, "iiO", pid, status,
                                       child_data->data);
    else
        retval = PyObject_CallFunction(child_data->func, "ii", pid, status);

    if (retval)
       Py_DECREF(retval);
    else
       PyErr_Print();

    pyg_gil_state_release(gil);
}

Here is the caller graph for this function:

PyObject* hash_object_to_dict ( GHashTable *  table)

Definition at line 1146 of file py-mod-gcompris.c.

{
  PyObject *pydict;

  pydict = PyDict_New();

  g_hash_table_foreach            (table,
                               pair_object_in_dict,
                                   (gpointer) pydict);

  Py_INCREF(pydict);
  return pydict;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PyObject* hash_to_dict ( GHashTable *  table)

Definition at line 70 of file py-mod-gcompris.c.

{
  PyObject *pydict;

  pydict = PyDict_New();

  g_hash_table_foreach            (table,
                               pair_in_dict,
                                   (gpointer) pydict);

  Py_INCREF(pydict);
  return pydict;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void initgnomecanvas ( void  )

Definition at line 67 of file canvasmodule.c.

{
    PyObject *m, *d;
       
    init_pygobject ();
    init_pygtk ();

    pyg_register_boxed_custom(GNOME_TYPE_CANVAS_POINTS,
                           gnomecanvaspoints_from_value,
                           gnomecanvaspoints_to_value);

    m = Py_InitModule ("gnomecanvas", pycanvas_functions);
    d = PyModule_GetDict (m);

      /* ArtPathcode */
#define add_item(short)\
    PyModule_AddIntConstant (m, #short, ART_##short)
    add_item(MOVETO);
    add_item(MOVETO_OPEN);
    add_item(CURVETO);
    add_item(LINETO);
#undef add_item
       
    pycanvas_register_classes (d);
    /* pycanvas_add_constants (d, "GNOME_CANVAS_"); */
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pair_in_dict ( gpointer  key,
gpointer  value,
gpointer  dict 
)

Definition at line 43 of file py-mod-gcompris.c.

{
  PyObject *pyValue;
  PyObject *pyKey;

  pyKey = PyString_FromString((gchar *)key);
  Py_INCREF(pyKey);


  /* key cannot be NULL. But value can */
  if (value==NULL){
    Py_INCREF(Py_None);
    pyValue = Py_None;
  } else {
    pyValue = PyString_FromString((gchar *)value);
    Py_INCREF(pyValue);
  }

  PyDict_SetItem((PyObject *)dict, pyKey, pyValue);

  g_warning("Hash to dict: pass key %s and value %s",(gchar *)key, (gchar *)value );
}

Here is the caller graph for this function:

void pair_object_in_dict ( gpointer  key,
gpointer  value,
gpointer  dict 
)

Definition at line 1128 of file py-mod-gcompris.c.

{
  PyObject *pyValue;
  PyObject *pyKey;

  pyKey = PyString_FromString((gchar *)key);
  Py_INCREF(pyKey);

  pyValue = pygobject_new((GObject*) value);
  Py_INCREF(pyValue);

  PyDict_SetItem((PyObject *)dict, pyKey, pyValue);
}

Here is the caller graph for this function:

static PyObject* py_gc_bar_hide ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 218 of file py-mod-gcompris.c.

{
  gint values;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "i:gc_bar_hide", &values))
    return NULL;

  /* Call the corresponding C function */
  gc_bar_hide(values);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_bar_set ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 199 of file py-mod-gcompris.c.

{
  gint values;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "i:gc_bar_set", &values))
    return NULL;

  /* Call the corresponding C function */
  gc_bar_set(values);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_bar_set_level ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 155 of file py-mod-gcompris.c.

{
  PyObject* pyObject;
  pyGcomprisBoardObject* pyGcomprisBoard;
  GcomprisBoard* cGcomprisBoard;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "O:gc_bar_set_level", &pyObject))
    return NULL;
  pyGcomprisBoard = (pyGcomprisBoardObject*) pyObject;
  cGcomprisBoard = pyGcomprisBoard->cdata;

  /* Call the corresponding C function */
  gc_bar_set_level(cGcomprisBoard);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_bar_set_repeat_icon ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 178 of file py-mod-gcompris.c.

{
  PyObject* pyObject;
  GdkPixbuf* pixmap;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "O:gc_bar_set_repeat_icon", &pyObject))
    return NULL;
  pixmap = (GdkPixbuf*) pygobject_get(pyObject);

  /* Call the corresponding C function */
  gc_bar_set_repeat_icon(pixmap);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_bar_start ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 110 of file py-mod-gcompris.c.

{
  PyObject* pyCanvas;
  GnomeCanvas* canvas;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "O:gc_bar_start", &pyCanvas))
    return NULL;
  canvas = (GnomeCanvas*) pygobject_get(pyCanvas);

  /* Call the corresponding C function */
  gc_bar_start(canvas);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_board_conf_separator ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1228 of file py-mod-gcompris.c.

{
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_board_conf_separator"))
    return NULL;

  /* Create and return the result */
  return (PyObject *)pygobject_new((GObject*) gc_board_conf_separator());

}

Here is the call graph for this function:

static PyObject* py_gc_board_config_boolean_box ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1062 of file py-mod-gcompris.c.

{
  PyObject *py_bool;
  gchar *label;
  gchar *key;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "ssO:gc_board_config_boolean_box", &label, &key, &py_bool))
    return NULL;

  /* Call the corresponding C function */
  return (PyObject *)pygobject_new((GObject*) \
                                gc_board_config_boolean_box((const gchar *)label, key, PyObject_IsTrue(py_bool)));

}

Here is the call graph for this function:

static PyObject* py_gc_board_config_combo_box ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1080 of file py-mod-gcompris.c.

{
  PyObject *py_list;
  gchar *label;
  gchar *key;
  gchar *init;

  GList *list = NULL;

  int i, size;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "sOss:gc_board_config_combo_box", &label, &py_list, &key, &init))
    return NULL;

  if (!PyList_Check(py_list)){
    PyErr_SetString(PyExc_TypeError,
                    "gc_board_config_combo_box second argument must be a list");
    return NULL;
  }

  size = PyList_Size (py_list);

  for (i=0; i < size; i ++)
    list = g_list_append( list,
                       PyString_AsString( PyList_GetItem( py_list, i)));

  /* Call the corresponding C function */
  return (PyObject *)pygobject_new((GObject*) \
                                gc_board_config_combo_box((const gchar *)label,
                                                 list,
                                                 key,
                                                 init));
}

Here is the call graph for this function:

static PyObject* py_gc_board_config_combo_locales ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1241 of file py-mod-gcompris.c.

{
  gchar *init;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "s:gc_board_config_combo_locales", &init))
    return NULL;

  return (PyObject *)pygobject_new((GObject*) \
                               gc_board_config_combo_locales( init));
}

Here is the call graph for this function:

static PyObject* py_gc_board_config_combo_locales_asset ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1279 of file py-mod-gcompris.c.

{
  gchar *init;
  gchar *label;
  gchar *file;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "ssz:gc_board_config_combo_locales",
                     &label,
                     &init,
                     &file))
    return NULL;

  return (PyObject *)pygobject_new((GObject*) \
                               gc_board_config_combo_locales_asset( label, init, file ));
}

Here is the call graph for this function:

static PyObject* py_gc_board_config_radio_buttons ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1162 of file py-mod-gcompris.c.

{
  PyObject *py_dict;
  GHashTable *buttons_label, *result;
  gchar *label;
  gchar *key;
  gchar *init;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "ssOs:gc_board_config_radio_buttons", &label, &key, &py_dict, &init))
    return NULL;

  if (!PyDict_Check(py_dict)){
    PyErr_SetString(PyExc_TypeError,
                    "gc_board_config_radio_buttons second argument must be a dict");
    return NULL;
  }

  PyObject *pykey, *pyvalue;
  int pos = 0;

  buttons_label = g_hash_table_new_full (g_str_hash,
                                g_str_equal,
                                g_free,
                                g_free);

  while (PyDict_Next(py_dict, &pos, &pykey, &pyvalue)) {
    g_hash_table_replace (buttons_label,
                       g_strdup(PyString_AsString(pykey)),
                       g_strdup(PyString_AsString(pyvalue)));
  }

  result = gc_board_config_radio_buttons(label,
                              key,
                              buttons_label,
                              init);

  g_hash_table_destroy(buttons_label);

  return hash_object_to_dict(result);
}

Here is the call graph for this function:

static PyObject* py_gc_board_config_spin_int ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1205 of file py-mod-gcompris.c.

{
  gchar *label;
  gchar *key;
  gint min, max, step, init;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "ssiiii:gc_board_config_radio_buttons", &label, &key, &min, &max, &step, &init))
    return NULL;

  return (PyObject *)pygobject_new((GObject*) \
                               gc_board_config_spin_int((const gchar *)label,
                                               key,
                                               min,
                                               max,
                                               step,
                                               init));

}

Here is the call graph for this function:

static PyObject* py_gc_board_config_textview ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1412 of file py-mod-gcompris.c.

                                                           {
  PyObject* pyCallback;
  gchar *label;
  gchar *key;
  gchar *desc = NULL;
  gchar *init_text = NULL;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args,
                     "sszzO:gc_board_config_window_display",
                     &label,
                     &key,
                     &desc,
                     &init_text,
                     &pyCallback))
    return NULL;
  if(!PyCallable_Check(pyCallback))
    {
      PyErr_SetString(PyExc_TypeError,
                    "gc_board_config_textview 5th argument must be callable");
      return NULL;
    }

  if (!text_callbacks)
    text_callbacks = g_hash_table_new ( g_str_hash, g_str_equal);

  g_hash_table_replace (text_callbacks, key, pyCallback);

  Py_INCREF(pyCallback);

  return (PyObject *) \
             pygobject_new((GObject*) \
                        gc_board_config_textview( label,
                                         key,
                                         desc,
                                         init_text,
                                         (GcomprisTextCallback )pyGcomprisTextCallback));

}

Here is the call graph for this function:

static PyObject* py_gc_board_config_window_display ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1027 of file py-mod-gcompris.c.

                                                                 {
  PyObject* pyCallback;
  gchar *label;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args,
                     "sO:gc_board_config_window_display",
                     &label,
                     &pyCallback))
    return NULL;
  if(!PyCallable_Check(pyCallback))
    {
      PyErr_SetString(PyExc_TypeError,
                    "gc_board_config_window_display second argument must be callable");
      return NULL;
    }

  //if (pyGcomprisConfCallbackFunc)
  //  Py_DECREF(pyGcomprisConfCallbackFunc);

  pyGcomprisConfCallbackFunc = pyCallback;

  Py_INCREF(pyGcomprisConfCallbackFunc);


  return (PyObject *) \
             pygobject_new((GObject*) \
                        gc_board_config_window_display( label,
                                                   (GcomprisConfCallback )pyGcomprisConfCallback));

}

Here is the call graph for this function:

static PyObject* py_gc_board_end ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 93 of file py-mod-gcompris.c.

{
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_board_end"))
    return NULL;

  /* Call the corresponding C function */
  gc_board_end();

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_cursor_set ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 322 of file py-mod-gcompris.c.

{
  guint cursor;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "i:gc_cursor_set",&cursor))
    return NULL;

  /* Call the corresponding C function */
  gc_cursor_set(cursor);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_db_get_board_conf ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 872 of file py-mod-gcompris.c.

{
  PyObject *pydict;
  GHashTable *table;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gcompris.get_board_conf"))
    return NULL;

  /* Call the corresponding C function */

  table = gc_db_get_board_conf();

  pydict = hash_to_dict(table);

  g_hash_table_destroy(table);

  return pydict;;
}

Here is the call graph for this function:

static PyObject* py_gc_db_get_conf ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 893 of file py-mod-gcompris.c.

{
  PyObject *pydict;
  GHashTable *table;

  PyObject* pyBoard;
  PyObject* pyProfile;
  pyGcomprisBoardObject* pyGcomprisBoard;
  GcomprisBoard* cGcomprisBoard;
  pyGcomprisProfileObject* pyGcomprisProfile;
  GcomprisProfile* cGcomprisProfile;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "OO:gcompris.get_conf", &pyProfile ,&pyBoard))
    return NULL;

  pyGcomprisBoard = (pyGcomprisBoardObject *) pyBoard;
  pyGcomprisProfile = (pyGcomprisProfileObject *) pyProfile;

  cGcomprisProfile = pyGcomprisProfile->cdata;
  cGcomprisBoard = pyGcomprisBoard->cdata;

  /* Call the corresponding C function */
  table = gc_db_get_conf(cGcomprisProfile, cGcomprisBoard);

  pydict = hash_to_dict(table);

  g_hash_table_destroy(table);

  return pydict;;
}

Here is the call graph for this function:

static PyObject* py_gc_db_get_filename ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 576 of file py-mod-gcompris.c.

{
  gchar* result;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_db_get_filename"))
    return NULL;

  /* Call the corresponding C function */
  result = (gchar*)gc_db_get_filename();

  /* Create and return the result */
  return Py_BuildValue("s", result);
}

Here is the call graph for this function:

static PyObject* py_gc_db_set_board_conf ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 961 of file py-mod-gcompris.c.

{
  PyObject* pyBoard;
  PyObject* pyProfile;
  pyGcomprisBoardObject* pyGcomprisBoard;
  GcomprisBoard* cGcomprisBoard;
  pyGcomprisProfileObject* pyGcomprisProfile;
  GcomprisProfile* cGcomprisProfile;
  char *key;
  char *value;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "OOss:gcompris.set_board_conf",
                     &pyProfile, &pyBoard,
                     &key, &value))
    return NULL;

  pyGcomprisBoard = (pyGcomprisBoardObject *) pyBoard;
  pyGcomprisProfile = (pyGcomprisProfileObject *) pyProfile;

  cGcomprisProfile = pyGcomprisProfile->cdata;
  cGcomprisBoard = pyGcomprisBoard->cdata;

  /* Call the corresponding C function */
  gc_db_set_board_conf(cGcomprisProfile, cGcomprisBoard, key, value);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_get_canvas ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 236 of file py-mod-gcompris.c.

{
  GnomeCanvas* result;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_get_canvas"))
    return NULL;

  /* Call the corresponding C function */
  result = gc_get_canvas();

  /* Create and return the result */
  return (PyObject*) pygobject_new((GObject*) result);
}

Here is the call graph for this function:

static PyObject* py_gc_get_window ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 253 of file py-mod-gcompris.c.

{
  GtkWidget* result;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_get_window"))
    return NULL;

  /* Call the corresponding C function */
  result = gc_get_window();

  /* Create and return the result */
  return (PyObject*)pygobject_new((GObject*)result);
}

Here is the call graph for this function:

static PyObject* py_gc_im_reset ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1537 of file py-mod-gcompris.c.

{

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gcompris.im_reset"))
    return NULL;

  /* Call the corresponding C function */
  gc_im_reset ();

  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_locale_change ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1340 of file py-mod-gcompris.c.

{
  gchar *locale;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "s:gc_locale_change", &locale))
    return NULL;

  /* Call the corresponding C function */
  gc_locale_set(locale);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_locale_get ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 270 of file py-mod-gcompris.c.

{
  gchar* result;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_locale_get"))
    return NULL;

  /* Call the corresponding C function */
  result = (gchar*)gc_locale_get();

  /* Create and return the result */
  return Py_BuildValue("s", result);
}

Here is the call graph for this function:

static PyObject* py_gc_locale_get_user_default ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 305 of file py-mod-gcompris.c.

{
  char* result;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_locale_get_user_default"))
    return NULL;

  /* Call the corresponding C function */
  result = gc_locale_get_user_default();

  /* Create and return the result */
  return Py_BuildValue("s", result);
}

Here is the call graph for this function:

static PyObject* py_gc_locale_gets_asset_list ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1298 of file py-mod-gcompris.c.

{
  PyObject *pylist;
  GList *result, *list ;
  gchar *file;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "z:gcompris.get_locales_asset_list",
                     &file))
    return NULL;

  /* Call the corresponding C function */
  result = gc_locale_gets_asset_list(file);

  pylist = PyList_New(0);

  for (list = result; list != NULL; list = list->next){
    PyList_Append( pylist, PyString_FromString(list->data));
  }

  Py_INCREF(pylist);
  return pylist;
}

Here is the call graph for this function:

static PyObject* py_gc_locale_gets_list ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1255 of file py-mod-gcompris.c.

{
  PyObject *pylist;
  GList *result, *list ;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gcompris.get_locales_list"))
    return NULL;

  /* Call the corresponding C function */
  result = gc_locale_gets_list();

  pylist = PyList_New(0);

  for (list = result; list != NULL; list = list->next){
    PyList_Append( pylist, PyString_FromString(list->data));
  }

  Py_INCREF(pylist);
  return pylist;
}

Here is the call graph for this function:

static PyObject* py_gc_locale_reset ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1359 of file py-mod-gcompris.c.

{
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_locale_reset"))
    return NULL;

  /* Call the corresponding C function */
  gc_locale_reset();

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_locale_set ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 287 of file py-mod-gcompris.c.

{
  gchar* locale;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "s:gc_locale_set", &locale))
    return NULL;

  /* Call the corresponding C function */
  gc_locale_set(locale);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_log_end ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 421 of file py-mod-gcompris.c.

{
  PyObject* pyGcomprisBoard;
  GcomprisBoard* cGcomprisBoard;
  gchar* status;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args,
                     "Os:gc_log_end",
                     &pyGcomprisBoard,
                     &status))
    return NULL;
  cGcomprisBoard = ((pyGcomprisBoardObject*) pyGcomprisBoard)->cdata;

  /* Call the corresponding C function */
  gc_log_end(cGcomprisBoard,
                 status);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_log_set_comment ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 393 of file py-mod-gcompris.c.

{
  PyObject* pyGcomprisBoard;
  GcomprisBoard* cGcomprisBoard;
  gchar* expected;
  gchar* got;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args,
                     "Os:gc_log_set_comment",
                     &pyGcomprisBoard,
                     &expected,
                     &got))
    return NULL;
  cGcomprisBoard = ((pyGcomprisBoardObject*) pyGcomprisBoard)->cdata;

  /* Call the corresponding C function */
  gc_log_set_comment(cGcomprisBoard,
                        expected, got);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_menu_section_get ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 609 of file py-mod-gcompris.c.

{
  GcomprisBoard* result;
  gchar *section;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "s:gc_menu_section_get", &section))
    return NULL;

  /* Call the corresponding C function */
  result = gc_menu_section_get(section);

  /* Create and return the result */
  return gcompris_new_pyGcomprisBoardObject(result);
}

Here is the call graph for this function:

static PyObject* py_gc_profile_get_current ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 928 of file py-mod-gcompris.c.

{
  GcomprisProfile* result;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_profile_get_current"))
    return NULL;

  /* Call the corresponding C function */
  result = gc_profile_get_current();

  /* Create and return the result */
  return gcompris_new_pyGcomprisProfileObject(result);
}

Here is the call graph for this function:

static PyObject* py_gc_profile_get_current_user ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 945 of file py-mod-gcompris.c.

{
  GcomprisUser* result;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_profile_get_current_user"))
    return NULL;

  /* Call the corresponding C function */
  result = gc_profile_get_current_user();

  /* Create and return the result */
  return gcompris_new_pyGcomprisUserObject(result);
}

Here is the call graph for this function:

static PyObject* py_gc_prop_board_dirname_get ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1474 of file py-mod-gcompris.c.

{
  PyObject* pyBoard;
  pyGcomprisBoardObject* pyGcomprisBoard;
  GcomprisBoard* cGcomprisBoard;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "O:gcompris.get_board_dirname", &pyBoard))
    return NULL;

  pyGcomprisBoard = (pyGcomprisBoardObject *) pyBoard;

  cGcomprisBoard = pyGcomprisBoard->cdata;

  /* Call the corresponding C function */
  return PyString_FromString(gc_prop_board_dirname_get(cGcomprisBoard));

}

Here is the call graph for this function:

static PyObject* py_gc_prop_current_board_dirname_get ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1506 of file py-mod-gcompris.c.

{
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gcompris.get_current_board_dirname"))
    return NULL;

  /* Call the corresponding C function */
  return PyString_FromString(gc_prop_current_board_dirname_get());

}

Here is the call graph for this function:

static PyObject* py_gc_prop_current_user_dirname_get ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1494 of file py-mod-gcompris.c.

{
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gcompris.get_current_user_dirname"))
    return NULL;

  /* Call the corresponding C function */
  return PyString_FromString(gc_prop_current_user_dirname_get());

}

Here is the call graph for this function:

static PyObject* py_gc_prop_get ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 593 of file py-mod-gcompris.c.

{
  GcomprisProperties* result;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_prop_get"))
    return NULL;

  /* Call the corresponding C function */
  result = gc_prop_get();

  /* Create and return the result */
  return gcompris_new_pyGcomprisPropertiesObject(result);
}

Here is the call graph for this function:

static PyObject* py_gc_prop_user_dirname_get ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1454 of file py-mod-gcompris.c.

{
  PyObject* pyUser;
  pyGcomprisUserObject* pyGcomprisUser;
  GcomprisUser* cGcomprisUser;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "O:gcompris.get_user_dirname", &pyUser))
    return NULL;

  pyGcomprisUser = (pyGcomprisUserObject *) pyUser;

  cGcomprisUser = pyGcomprisUser->cdata;

  /* Call the corresponding C function */
  return PyString_FromString(gc_prop_user_dirname_get(cGcomprisUser));

}

Here is the call graph for this function:

static PyObject* py_gc_selector_file_load ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 490 of file py-mod-gcompris.c.

                                                        {
  PyObject* pyGcomprisBoard;
  GcomprisBoard* cGcomprisBoard;
  PyObject* pyCallback;
  gchar* rootdir;
  gchar* file_types;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args,
                     "OssO:gc_selector_file_load",
                     &pyGcomprisBoard,
                     &rootdir,
                     &file_types,
                     &pyCallback))
    return NULL;
  if(!PyCallable_Check(pyCallback)) return NULL;
  cGcomprisBoard = ((pyGcomprisBoardObject*) pyGcomprisBoard)->cdata;

  /* Call the corresponding C function */
  pyFileSelectorCallBackFunc = pyCallback;
  gc_selector_file_load(cGcomprisBoard,
                              rootdir,
                           file_types,
                              pyFileSelectorCallBack);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_selector_file_save ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 527 of file py-mod-gcompris.c.

                                                        {
  PyObject* pyGcomprisBoard;
  GcomprisBoard* cGcomprisBoard;
  PyObject* pyCallback;
  gchar* rootdir;
  char* file_types;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args,
                     "OssO:gc_selector_file_save",
                     &pyGcomprisBoard,
                     &rootdir,
                     &file_types,
                     &pyCallback))
    return NULL;
  if(!PyCallable_Check(pyCallback)) return NULL;
  cGcomprisBoard = ((pyGcomprisBoardObject*) pyGcomprisBoard)->cdata;

  /* Call the corresponding C function */
  pyFileSelectorCallBackFunc = pyCallback;
  gc_selector_file_save(cGcomprisBoard,
                              rootdir,
                           file_types,
                              pyFileSelectorCallBack);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_selector_file_stop ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 560 of file py-mod-gcompris.c.

{
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_selector_file_stop"))
    return NULL;

  /* Call the corresponding C function */
  gc_selector_file_stop();

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_selector_images_start ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 362 of file py-mod-gcompris.c.

{
  PyObject* pyGcomprisBoard;
  GcomprisBoard* cGcomprisBoard;
  PyObject* pyCallback;
  gchar* dataset;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args,
                     "OsO:gc_selector_images_start",
                     &pyGcomprisBoard,
                     &dataset,
                     &pyCallback))
    return NULL;
  if(!PyCallable_Check(pyCallback)) return NULL;
  cGcomprisBoard = ((pyGcomprisBoardObject*) pyGcomprisBoard)->cdata;

  /* Call the corresponding C function */
  pyImageSelectorCallBackFunc = pyCallback;
  gc_selector_images_start(cGcomprisBoard,
                             dataset,
                             pyImageSelectorCallBack);

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_selector_images_stop ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 447 of file py-mod-gcompris.c.

{
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, ":gc_selector_images_stop"))
    return NULL;

  /* Call the corresponding C function */
  gc_selector_images_stop();

  /* Create and return the result */
  Py_INCREF(Py_None);
  return Py_None;
}

Here is the call graph for this function:

static PyObject* py_gc_set_background ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 131 of file py-mod-gcompris.c.

{
  PyObject* pyCanvasGroup;
  GnomeCanvasGroup* canvasGroup;
  gchar* file;
  PyObject* pyResult;
  GnomeCanvasItem* result;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "Os:gc_set_background", &pyCanvasGroup, &file))
    return NULL;
  canvasGroup = (GnomeCanvasGroup*) pygobject_get(pyCanvasGroup);

  /* Call the corresponding C function */
  result = gc_set_background(canvasGroup, file);

  /* Create and return the result */
  pyResult = pygobject_new((GObject*)result);
  return pyResult;
}

Here is the call graph for this function:

static PyObject* py_gcompris_child_watch_add ( PyObject *  unused,
PyObject *  args,
PyObject *  kwargs 
) [static]

Definition at line 669 of file py-mod-gcompris.c.

{
    static char *kwlist[] = { "pid", "function", "data", "priority", NULL };
    guint id;
    gint priority = G_PRIORITY_DEFAULT;
    int pid;
    PyObject *func, *user_data = NULL;
    struct _PyGChildData *child_data;

    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "iO|Oi:gcompris.child_watch_add", kwlist,
                                     &pid, &func, &user_data, &priority))
        return NULL;
    if (!PyCallable_Check(func)) {
        PyErr_SetString(PyExc_TypeError,
                        "gobject.child_watch_add: second argument must be callable");
        return NULL;
    }

    child_data = g_new(struct _PyGChildData, 1);
    child_data->func = func;
    child_data->data = user_data;
    Py_INCREF(child_data->func);
    if (child_data->data)
        Py_INCREF(child_data->data);
    id = g_child_watch_add_full(priority, pid, child_watch_func,
                                child_data, child_watch_dnotify);
    return PyInt_FromLong(id);
}

Here is the call graph for this function:

static PyObject* py_gcompris_gettext ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1325 of file py-mod-gcompris.c.

{
  gchar *text;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "s:gcompris_gettext", &text))
    return NULL;

  return PyString_FromString(_(text));
}
static PyObject* py_gcompris_spawn_async ( PyObject *  unused,
PyObject *  args,
PyObject *  kwargs 
) [static]

Definition at line 727 of file py-mod-gcompris.c.

{
    static char *kwlist[] = { "argv", "envp", "working_directory", "flags",
                              "child_setup", "user_data", "standard_input",
                              "standard_output", "standard_error", NULL };
    PyObject *pyargv, *pyenvp = NULL;
    char **argv, **envp = NULL;
    PyObject *func = NULL, *user_data = NULL;
    char *working_directory = NULL;
    int flags = 0, _stdin = -1, _stdout = -1, _stderr = -1;
    PyObject *pystdin = NULL, *pystdout = NULL, *pystderr = NULL;
    gint *standard_input, *standard_output, *standard_error;
    struct _PyGChildSetupData *callback_data = NULL;
    GError *error = NULL;
    GPid child_pid = -1;
    int len, i;

    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|OsiOOOOO:gcompris.spawn_async",
                                     kwlist,
                                     &pyargv, &pyenvp, &working_directory, &flags,
                                     &func, &user_data,
                                     &pystdin, &pystdout, &pystderr))
        return NULL;

    if (pystdin && PyObject_IsTrue(pystdin))
        standard_input = &_stdin;
    else
        standard_input = NULL;

    if (pystdout && PyObject_IsTrue(pystdout))
        standard_output = &_stdout;
    else
        standard_output = NULL;

    if (pystderr && PyObject_IsTrue(pystderr))
        standard_error = &_stderr;
    else
        standard_error = NULL;

      /* parse argv */
    if (!PySequence_Check(pyargv)) {
        PyErr_SetString(PyExc_TypeError,
                        "gobject.spawn_async: first argument must be a sequence of strings");
        return NULL;
    }
    len = PySequence_Length(pyargv);
    argv = g_new0(char *, len + 1);
    for (i = 0; i < len; ++i) {
        PyObject *tmp = PySequence_ITEM(pyargv, i);
        if (!PyString_Check(tmp)) {
            PyErr_SetString(PyExc_TypeError,
                            "gobject.spawn_async: first argument must be a sequence of strings");
            g_free(argv);
            Py_XDECREF(tmp);
            return NULL;
        }
        argv[i] = PyString_AsString(tmp);
        Py_DECREF(tmp);
    }

      /* parse envp */
    if (pyenvp) {
        if (!PySequence_Check(pyenvp)) {
            PyErr_SetString(PyExc_TypeError,
                            "gobject.spawn_async: second argument must be a sequence of strings");
            g_free(argv);
            return NULL;
        }
        len = PySequence_Length(pyenvp);
        envp = g_new0(char *, len + 1);
        for (i = 0; i < len; ++i) {
            PyObject *tmp = PySequence_ITEM(pyenvp, i);
            if (!PyString_Check(tmp)) {
                PyErr_SetString(PyExc_TypeError,
                                "gobject.spawn_async: second argument must be a sequence of strings");
                g_free(envp);
                Py_XDECREF(tmp);
                return NULL;
            }
            envp[i] = PyString_AsString(tmp);
            Py_DECREF(tmp);
        }
    }

    if (func) {
        callback_data = g_new(struct _PyGChildSetupData, 1);
        callback_data->func = func;
        callback_data->data = user_data;
        Py_INCREF(callback_data->func);
        if (callback_data->data)
            Py_INCREF(callback_data->data);
    }

    if (!g_spawn_async_with_pipes(working_directory, argv, envp, flags,
                                  func? _pyg_spawn_async_callback : NULL,
                                  callback_data, &child_pid,
                                  standard_input,
                                  standard_output,
                                  standard_error,
                                  &error))
    {
        g_free(argv);
        if (envp) g_free(envp);
        if (callback_data) {
            Py_DECREF(callback_data->func);
            Py_XDECREF(callback_data->data);
            g_free(callback_data);
        }
        pyg_error_check(&error);
        return NULL;
    }
    g_free(argv);
    if (envp) g_free(envp);

    if (standard_input)
        pystdin = PyInt_FromLong(*standard_input);
    else {
        Py_INCREF(Py_None);
        pystdin = Py_None;
    }

    if (standard_output)
        pystdout = PyInt_FromLong(*standard_output);
    else {
        Py_INCREF(Py_None);
        pystdout = Py_None;
    }

    if (standard_error)
        pystderr = PyInt_FromLong(*standard_error);
    else {
        Py_INCREF(Py_None);
        pystderr = Py_None;
    }

    return Py_BuildValue("iNNN", child_pid, pystdin, pystdout, pystderr);
}

Here is the call graph for this function:

static PyObject* py_gcompris_wordlist_get_from_file ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 1518 of file py-mod-gcompris.c.

{
  GcomprisWordlist *result;
  gchar *filename;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "s:gcompris.get_wordlist", &filename))
    return NULL;

  /* Call the corresponding C function */
  result = gc_wordlist_get_from_file (filename);
  if (result)
    return gcompris_new_pyGcomprisWordlistObject(result);
  else {
    Py_INCREF(Py_None);
    return Py_None;
  }
}

Here is the call graph for this function:

void pyFileSelectorCallBack ( gchar *  file,
char *  file_type 
)

Definition at line 465 of file py-mod-gcompris.c.

                                                         {
  PyObject* args;
  PyObject* result;
  if(pyFileSelectorCallBackFunc==NULL) return;

  /* Build arguments */
  args  = PyTuple_New(2);
  PyTuple_SetItem(args, 0, Py_BuildValue("s", file));
  PyTuple_SetItem(args, 1, Py_BuildValue("s", file_type));
  result = PyObject_CallObject(pyFileSelectorCallBackFunc, args);
  if(result==NULL){
    PyErr_Print();
  } else {
    Py_DECREF(result);
  }

}

Here is the caller graph for this function:

static void pyGcomprisConfCallback ( GHashTable *  table) [static]

Definition at line 996 of file py-mod-gcompris.c.

                                                     {
  PyObject* result;

  PyGILState_STATE gil;


  if(pyGcomprisConfCallbackFunc==NULL) return;

  gil = pyg_gil_state_ensure();

  if (table)
    result = PyObject_CallFunction(pyGcomprisConfCallbackFunc, "O", hash_to_dict(table));
  else
    result = PyObject_CallFunction(pyGcomprisConfCallbackFunc, "O", Py_None);

  // This callback can be called multiple time ? not now

  Py_DECREF(pyGcomprisConfCallbackFunc);

  if(result==NULL){
    PyErr_Print();
  } else {
    Py_DECREF(result);
  }

  pyg_gil_state_release(gil);

}

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean pyGcomprisTextCallback ( gchar *  key,
gchar *  text,
GtkLabel *  label 
) [static]

Definition at line 1377 of file py-mod-gcompris.c.

                                                                                {
  PyObject* result;
  gboolean validate;

  PyGILState_STATE gil;

  PyObject* pyGcomprisTextCallbackFunc = g_hash_table_lookup( text_callbacks, key);

  if(pyGcomprisTextCallbackFunc==NULL) return FALSE;

  gil = pyg_gil_state_ensure();

  result = PyObject_CallFunction(pyGcomprisTextCallbackFunc, "ssO", key, text,(PyObject *)pygobject_new((GObject*) label ));

  //Py_DECREF(pyGcomprisTextCallbackFunc);

  if (PyObject_IsTrue(result))
    validate = TRUE;
  else
    validate = FALSE;

  if(result==NULL){
    PyErr_Print();
  } else {
    Py_DECREF(result);
  }

  pyg_gil_state_release(gil);

  return validate;

}

Here is the caller graph for this function:

void pyImageSelectorCallBack ( gchar *  image)

Definition at line 341 of file py-mod-gcompris.c.

                                          {
  PyObject* args;
  PyObject* result;
  if(pyImageSelectorCallBackFunc==NULL) return;

  /* Build arguments */
  args = PyTuple_New(1);
  PyTuple_SetItem(args, 0, Py_BuildValue("s", image));
  result = PyObject_CallObject(pyImageSelectorCallBackFunc, args);
  if(result==NULL){
    PyErr_Print();
  } else {
    Py_DECREF(result);
  }
}

Here is the caller graph for this function:

void python_gcompris_module_init ( void  )

Definition at line 1614 of file py-mod-gcompris.c.

{
  PyObject* gcomprisModule;

  gcomprisModule = Py_InitModule("_gcompris", PythonGcomprisModule);

  /* Misc constants */
  PyModule_AddIntConstant(gcomprisModule, "BOARD_HEIGHT", BOARDHEIGHT );
  PyModule_AddIntConstant(gcomprisModule, "BOARD_WIDTH",  BOARDWIDTH);
  PyModule_AddIntConstant(gcomprisModule, "BAR_HEIGHT",   BARHEIGHT);
  PyModule_AddStringConstant(gcomprisModule, "DEFAULT_SKIN", DEFAULT_SKIN);

  /* The GComprisBarFlags enum constants */
  PyModule_AddIntConstant(gcomprisModule, "BAR_LEVEL",       GC_BAR_LEVEL);
  PyModule_AddIntConstant(gcomprisModule, "BAR_OK",          GC_BAR_OK);
  PyModule_AddIntConstant(gcomprisModule, "BAR_REPEAT",      GC_BAR_REPEAT);
  PyModule_AddIntConstant(gcomprisModule, "BAR_REPEAT_ICON", GC_BAR_REPEAT_ICON);
  PyModule_AddIntConstant(gcomprisModule, "BAR_CONFIG",      GC_BAR_CONFIG);
  PyModule_AddIntConstant(gcomprisModule, "BAR_ABOUT",       GC_BAR_ABOUT);

  /* Colors constants */
  PyModule_AddIntConstant(gcomprisModule, "COLOR_TITLE",       COLOR_TITLE);
  PyModule_AddIntConstant(gcomprisModule, "COLOR_TEXT_BUTTON", COLOR_TEXT_BUTTON);
  PyModule_AddIntConstant(gcomprisModule, "COLOR_CONTENT",     COLOR_CONTENT);
  PyModule_AddIntConstant(gcomprisModule, "COLOR_SUBTITLE",    COLOR_SUBTITLE);

  /* Fonts constants */
  PyModule_AddStringConstant(gcomprisModule, "FONT_TITLE",             FONT_TITLE);
  PyModule_AddStringConstant(gcomprisModule, "FONT_TITLE_FALLBACK",    FONT_TITLE_FALLBACK);
  PyModule_AddStringConstant(gcomprisModule, "FONT_SUBTITLE",          FONT_SUBTITLE);
  PyModule_AddStringConstant(gcomprisModule, "FONT_SUBTITLE_FALLBACK", FONT_SUBTITLE_FALLBACK);
  PyModule_AddStringConstant(gcomprisModule, "FONT_CONTENT",           FONT_CONTENT);
  PyModule_AddStringConstant(gcomprisModule, "FONT_CONTENT_FALLBACK",  FONT_CONTENT_FALLBACK);

  /* Fonts board constants */
  PyModule_AddStringConstant(gcomprisModule, "FONT_BOARD_TINY",       FONT_BOARD_TINY);
  PyModule_AddStringConstant(gcomprisModule, "FONT_BOARD_SMALL",      FONT_BOARD_SMALL);
  PyModule_AddStringConstant(gcomprisModule, "FONT_BOARD_MEDIUM",     FONT_BOARD_MEDIUM);
  PyModule_AddStringConstant(gcomprisModule, "FONT_BOARD_BIG",        FONT_BOARD_BIG);
  PyModule_AddStringConstant(gcomprisModule, "FONT_BOARD_BIG_BOLD",   FONT_BOARD_BIG_BOLD);
  PyModule_AddStringConstant(gcomprisModule, "FONT_BOARD_FIXED",      FONT_BOARD_FIXED);
  PyModule_AddStringConstant(gcomprisModule, "FONT_BOARD_TITLE",      FONT_BOARD_TITLE);
  PyModule_AddStringConstant(gcomprisModule, "FONT_BOARD_TITLE_BOLD", FONT_BOARD_TITLE_BOLD);
  PyModule_AddStringConstant(gcomprisModule, "FONT_BOARD_HUGE",       FONT_BOARD_HUGE);
  PyModule_AddStringConstant(gcomprisModule, "FONT_BOARD_HUGE_BOLD",  FONT_BOARD_HUGE_BOLD);

  /* Cursors constants */
  PyModule_AddIntConstant(gcomprisModule, "CURSOR_FIRST_CUSTOM",  GCOMPRIS_FIRST_CUSTOM_CURSOR);
  PyModule_AddIntConstant(gcomprisModule, "CURSOR_BIG_RED_ARROW", GCOMPRIS_BIG_RED_ARROW_CURSOR);
  PyModule_AddIntConstant(gcomprisModule, "CURSOR_BIRD",          GCOMPRIS_BIRD_CURSOR);
  PyModule_AddIntConstant(gcomprisModule, "CURSOR_LINE",          GCOMPRIS_LINE_CURSOR);
  PyModule_AddIntConstant(gcomprisModule, "CURSOR_FILLRECT",      GCOMPRIS_FILLRECT_CURSOR);
  PyModule_AddIntConstant(gcomprisModule, "CURSOR_RECT",          GCOMPRIS_RECT_CURSOR);
  PyModule_AddIntConstant(gcomprisModule, "CURSOR_FILLCIRCLE",    GCOMPRIS_FILLCIRCLE_CURSOR);
  PyModule_AddIntConstant(gcomprisModule, "CURSOR_CIRCLE",        GCOMPRIS_CIRCLE_CURSOR);
  PyModule_AddIntConstant(gcomprisModule, "CURSOR_DEL",           GCOMPRIS_DEL_CURSOR);
  PyModule_AddIntConstant(gcomprisModule, "CURSOR_FILL",          GCOMPRIS_FILL_CURSOR);
  PyModule_AddIntConstant(gcomprisModule, "CURSOR_SELECT",        GCOMPRIS_SELECT_CURSOR);
  PyModule_AddIntConstant(gcomprisModule, "CURSOR_DEFAULT",       GCOMPRIS_DEFAULT_CURSOR);

  /* Some non gcompris.h constants. */
  GcomprisProperties *properties = gc_prop_get();
  PyModule_AddStringConstant(gcomprisModule, "DATA_DIR", properties->package_data_dir);
  PyModule_AddStringConstant(gcomprisModule, "PYTHON_PLUGIN_DIR", properties->package_python_plugin_dir);

  /* GetText constants. */
  PyModule_AddStringConstant(gcomprisModule, "GETTEXT_PACKAGE", GETTEXT_PACKAGE);
  PyModule_AddStringConstant(gcomprisModule, "PACKAGE_LOCALE_DIR",  PACKAGE_LOCALE_DIR);


  /* Initialize the sub modules */
  initgnomecanvas();
  python_gcompris_bonus_module_init();
  python_gc_score_module_init();
  python_gc_skin_module_init();
  python_gcompris_sound_module_init();
  python_gc_timer_module_init();
  python_gcompris_utils_module_init();
  python_gcompris_anim_module_init();
  python_gcompris_admin_module_init();
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

PyObject* pyFileSelectorCallBackFunc = NULL [static]

Definition at line 463 of file py-mod-gcompris.c.

PyObject* pyGcomprisConfCallbackFunc = NULL [static]

Definition at line 994 of file py-mod-gcompris.c.

PyObject* pyImageSelectorCallBackFunc = NULL [static]

Definition at line 339 of file py-mod-gcompris.c.

PyMethodDef PythonGcomprisModule[] [static]

Definition at line 1555 of file py-mod-gcompris.c.

GHashTable* text_callbacks = NULL [static]

Definition at line 1375 of file py-mod-gcompris.c.