Back to index

gcompris  8.2.2
Functions | Variables
py-mod-score.c File Reference
#include <Python.h>
#include <pygobject.h>
#include "gcompris/gcompris.h"
#include "py-mod-utils.h"
#include "py-gcompris-board.h"

Go to the source code of this file.

Functions

static PyObject * py_gc_score_start (PyObject *self, PyObject *args)
static PyObject * py_gc_score_end (PyObject *self, PyObject *args)
static PyObject * py_gc_score_set (PyObject *self, PyObject *args)
void python_gc_score_module_init (void)

Variables

static PyMethodDef PythonGcomprisScoreModule []

Function Documentation

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

Definition at line 36 of file py-mod-score.c.

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

  /* Call the corresponding C function */
  gc_score_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_score_set ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 53 of file py-mod-score.c.

{
  guint value;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "i:gc_score_set", &value))
    return NULL;
  if(value<0) return NULL;

  /* Call the corresponding C function */
  gc_score_set(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_score_start ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 14 of file py-mod-score.c.

{
  int style;
  int x,y;
  guint max;

  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "iiii:gc_score_start", &style, &x, &y, &max))
    return NULL;
  if(max<0) return NULL;

  /* Call the corresponding C function */
  gc_score_start(style, x, y, max);

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

Here is the call graph for this function:

void python_gc_score_module_init ( void  )

Definition at line 78 of file py-mod-score.c.

{
  PyObject* module;
  module = Py_InitModule("_gcompris_score", PythonGcomprisScoreModule);

  /* Misc constants */
  PyModule_AddIntConstant(module, "STYLE_NOTE", SCORESTYLE_NOTE ); 
  PyModule_AddIntConstant(module, "STYLE_LIFE", SCORESTYLE_LIFE ); 
}

Here is the caller graph for this function:


Variable Documentation

PyMethodDef PythonGcomprisScoreModule[] [static]
Initial value:
 {
  { "start",  py_gc_score_start, METH_VARARGS, "gc_score_start" },
  { "end",  py_gc_score_end, METH_VARARGS, "gc_score_end" },
  { "set",  py_gc_score_set, METH_VARARGS, "gc_score_set" },
  { NULL, NULL, 0, NULL}
}

Definition at line 71 of file py-mod-score.c.