Back to index

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

Go to the source code of this file.

Functions

static PyObject * py_gc_bonus_display (PyObject *self, PyObject *args)
static PyObject * py_gcompris_gc_bonus_end_display (PyObject *self, PyObject *args)
void python_gcompris_bonus_module_init (void)

Variables

static PyMethodDef PythonGcomprisBonusModule []

Function Documentation

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

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

{
  int gamewon;
  int bonus_id;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "ii:gc_bonus_display", &gamewon, &bonus_id))
    return NULL;

  /* Call the corresponding C function */
  gc_bonus_display(gamewon, bonus_id);

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

Here is the call graph for this function:

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

Definition at line 33 of file py-mod-bonus.c.

{
  int type;
  /* Parse arguments */
  if(!PyArg_ParseTuple(args, "i:gc_bonus_end_display", &type))
    return NULL;

  /* Call the corresponding C function */
  gc_bonus_end_display(type);

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

Here is the call graph for this function:

Definition at line 55 of file py-mod-bonus.c.

{
  PyObject* module;
  module = Py_InitModule("_gcompris_bonus", PythonGcomprisBonusModule);

  /* Misc constants */
  PyModule_AddIntConstant(module, "TIME_CLICK_TO", TIME_CLICK_TO_BONUS );

  /* BonusList constants */
  PyModule_AddIntConstant(module, "RANDOM", BONUS_RANDOM );
  PyModule_AddIntConstant(module, "SMILEY", BONUS_SMILEY );
  PyModule_AddIntConstant(module, "FLOWER", BONUS_FLOWER );
  PyModule_AddIntConstant(module, "TUX",    BONUS_TUX );
  PyModule_AddIntConstant(module, "GNU",    BONUS_GNU );

  /* BonusFinishedList constants */
  PyModule_AddIntConstant(module, "FINISHED_RANDOM", BOARD_FINISHED_RANDOM );
  PyModule_AddIntConstant(module, "FINISHED_TUXPLANE", BOARD_FINISHED_TUXPLANE );
  PyModule_AddIntConstant(module, "FINISHED_TUXLOCO", BOARD_FINISHED_TUXLOCO );
  PyModule_AddIntConstant(module, "FINISHED_TOOMANYERRORS", BOARD_FINISHED_TOOMANYERRORS );

  /* BonusStatusList constants */
  PyModule_AddIntConstant(module, "LOOSE", BOARD_LOOSE );
  PyModule_AddIntConstant(module, "WIN",   BOARD_WIN );
  PyModule_AddIntConstant(module, "DRAW",  BOARD_DRAW );
}

Here is the caller graph for this function:


Variable Documentation

PyMethodDef PythonGcomprisBonusModule[] [static]
Initial value:
 {
  { "display",  py_gc_bonus_display, METH_VARARGS, "gc_bonus_display" },
  { "board_finished",  py_gcompris_gc_bonus_end_display, METH_VARARGS, "gc_bonus_end_display" },
  { NULL, NULL, 0, NULL}
}

Definition at line 49 of file py-mod-bonus.c.