<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Python wrapper for Gcompris</title><meta name="generator" content="DocBook XSL Stylesheets V1.57.0"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" lang="en"><div class="titlepage"><div><h2 class="title"><a name="id2783186"></a>Python wrapper for Gcompris</h2></div><div><div class="author"><h3 class="author">Ir. Olivier Samyn</h3></div></div><div><div class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="2"><b>Revision History</b></th></tr><tr><td align="left">Revision 0.1</td><td align="left">February 2003</td></tr></table></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2841266">GcomprisBoard structure mapping </a></dt><dt><a href="#id2788464">gcompris.h functions and constants Mapping</a></dt><dd><dl><dt><a href="#id2788472">Functions mapping</a></dt><dt><a href="#id2787807">GComprisBarFlags enum mapping</a></dt><dt><a href="#id2787914">Misc constants mapping</a></dt><dt><a href="#id2787997">Colors constants mapping</a></dt><dt><a href="#id2788074">Fonts constants mapping</a></dt><dt><a href="#id2790868">Board font constants mapping</a></dt><dt><a href="#id2791000">Cursor constants mapping</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2841266"></a>GcomprisBoard structure mapping </h2></div></div><p>
An instance of this structure in Python will act like an instance of the C
one. Here a some Python call samples:
      </p><pre class="programlisting">
...
  gcomprisBoard.level = 1
  gcomprisBoard.maxlevel = 1
...
  gcompris.bar_start(gcomprisBoard.canvas)
...
</pre><p>
Here are the Python structure member name and type, and a note indicating if the
attribute is readeable and/or writable.
      </p><div class="informaltable"><table border="1"><colgroup><col><col><col><col></colgroup><thead><tr><th>Structure member</th><th>Type</th><th>Readable</th><th>Writable</th></tr></thead><tbody><tr><td>type</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>board_ready</td><td>boolean</td><td>Y</td><td>N</td></tr><tr><td>mode</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>name</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>title</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>description</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>icon_name</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>author</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>boarddir</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>filename</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>difficulty</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>mandatory_sound_file</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>section</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>menuposotion</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>prerequisite</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>goal</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>manual</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>credit</td><td>string</td><td>Y</td><td>N</td></tr><tr><td>width</td><td>int</td><td>Y</td><td>N</td></tr><tr><td>height</td><td>int</td><td>Y</td><td>N</td></tr><tr><td>canvas</td><td>gnome.canvas.Canvas</td><td>Y</td><td>N</td></tr><tr><td>previous_board</td><td>GcomprisBoard</td><td>Y</td><td>N</td></tr><tr><td>level</td><td>int</td><td>Y</td><td>Y</td></tr><tr><td>maxlevel</td><td>int</td><td>Y</td><td>Y</td></tr><tr><td>sublevel</td><td>int</td><td>Y</td><td>Y</td></tr><tr><td>number_of_sublevel</td><td>int</td><td>Y</td><td>Y</td></tr></tbody></table></div></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2788464"></a>gcompris.h functions and constants Mapping</h2></div></div><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2788472"></a>Functions mapping</h3></div></div><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Python function</th><th>C equivalent</th><th>Notes</th></tr></thead><tbody><tr><td>gcompris.end_board()</td><td>void gcompris_end_board(void)</td><td> </td></tr><tr><td>gcompris.bar_start(gnomeCanvas)</td><td>void gcompris_bar_start(GnomeCanvas *theCanvas)</td><td> </td></tr><tr><td>gcompris.set_background(gnomeCanvasGroup, file)</td><td>GnomeCanvasItem *gcompris_set_background(GnomeCanvasGroup *parent, gchar *file)</td><td>return a gnome.canvas.CanvasItem object</td></tr><tr><td>gcompris.bar_set_level(gcomprisBoard)</td><td>void gcompris_bar_set_level(GcomprisBoard *gcomprisBoard)</td><td> </td></tr><tr><td>gcompris.bar_set(flags)</td><td>void gcompris_bar_set(const GComprisBarFlags flags)</td><td> </td></tr><tr><td>gcompris.bar_hide(hide)</td><td>void gcompris_bar_hide(gboolean hide)</td><td> </td></tr><tr><td>gcompris.board_has_help(gcomprisBoard)</td><td>gboolean gcompris_board_has_help(GcomprisBoard *gcomprisBoard)</td><td>return a boolean</td></tr><tr><td>gcompris.help_start(gcomprisBoard)</td><td>void gcompris_help_start(GcomprisBoard *gcomprisBoard)</td><td> </td></tr><tr><td>gcompris.help_stop()</td><td>void gcompris_help_stop(void)</td><td> </td></tr><tr><td>gcompris.get_canvas()</td><td>GnomeCanvas* gcompris_get_canvas()</td><td>return a gnome.canvas.Canvas</td></tr><tr><td>gcompris.get_window()</td><td>GtkWidget* gcompris_get_window(void)</td><td>return a gtk.Widget</td></tr><tr><td>gcompris.get_locale()</td><td>gchar* gcompris_get_locale(void)</td><td>return a string</td></tr><tr><td>gcompris.set_locale(locale)</td><td>void gcompris_set_locale(gchar *locale)</td><td> </td></tr><tr><td>gcompris.set_cursor(cursor_type)</td><td>void gcompris_set_cursor(guint gdk_cursor_type)</td><td> </td></tr><tr><td>gcompris.images_selector_start(gcomprisBoard, dataset, callback)</td><td>void gcompris_images_selector_start (GcomprisBoard *gcomprisBoard, gchar *dataset, ImageSelectorCallBack imscb)</td><td>The callback must be a callable object</td></tr><tr><td>gcompris.images_selector_stop()</td><td>void gcompris_images_selector_stop(void)</td><td> </td></tr><tr><td>gcompris.exit()</td><td>void gcompris_exit(void)</td><td> </td></tr></tbody></table></div></div><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2787807"></a>GComprisBarFlags enum mapping</h3></div></div><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Python constant</th><th>C equivalent</th></tr></thead><tbody><tr><td>gcompris.BAR_LEVEL</td><td>GCOMPRIS_BAR_LEVEL</td></tr><tr><td>gcompris.BAR_OK</td><td>GCOMPRIS_BAR_OK</td></tr><tr><td>gcompris.BAR_REPEAT</td><td>GCOMPRIS_BAR_REPEAT</td></tr><tr><td>gcompris.BAR_CONFIG</td><td>GCOMPRIS_BAR_CONFIG</td></tr><tr><td>gcompris.BAR_ABOUT</td><td>GCOMPRIS_BAR_ABOUT</td></tr></tbody></table></div></div><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2787914"></a>Misc constants mapping</h3></div></div><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Python constant</th><th>C equivalent</th></tr></thead><tbody><tr><td>gcompris.BOARD_HEIGHT</td><td>BOARDHEIGHT</td></tr><tr><td>gcompris.BOARD_WIDTH</td><td>BOARDWIDTH</td></tr><tr><td>gcompris.BAR_HEIGHT</td><td>BAR_HEIGHT</td></tr><tr><td>gcompris.DEFAULT_SKIN</td><td>DEFAULT_SKIN</td></tr></tbody></table></div></div><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2787997"></a>Colors constants mapping</h3></div></div><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Python constant</th><th>C equivalent</th></tr></thead><tbody><tr><td>gcompris.COLOR_TITLE</td><td>COLOR_TITLE</td></tr><tr><td>gcompris.COLOR_TEXT_BUTTON</td><td>COLOR_TEXT_BUTTON</td></tr><tr><td>gcompris.COLOR_CONTENT</td><td>COLOR_CONTENT</td></tr><tr><td>gcompris.COLOR_SUBTITLE</td><td>COLOR_SUBTITLE</td></tr></tbody></table></div></div><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2788074"></a>Fonts constants mapping</h3></div></div><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Python constant</th><th>C equivalent</th></tr></thead><tbody><tr><td>gcompris.FONT_TITLE</td><td>FONT_TITLE</td></tr><tr><td>gcompris.FONT_TITLE_FALLBACK</td><td>FONT_TITLE_FALLBACK</td></tr><tr><td>gcompris.FONT_SUBTITLE</td><td>FONT_SUBTITLE</td></tr><tr><td>gcompris.FONT_SUBTITLE_FALLBACK</td><td>FONT_SUBTITLE_FALLBACK</td></tr><tr><td>gcompris.FONT_CONTENT</td><td>FONT_CONTENT</td></tr><tr><td>gcompris.FONT_CONTENT_FALLBACK</td><td>FONT_CONTENT_FALLBACK</td></tr></tbody></table></div></div><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2790868"></a>Board font constants mapping</h3></div></div><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Python constant</th><th>C equivalent</th></tr></thead><tbody><tr><td>gcompris.FONT_BOARD_TINY</td><td>FONT_BOARD_TINY</td></tr><tr><td>gcompris.FONT_BOARD_SMALL</td><td>FONT_BOARD_SMALL</td></tr><tr><td>gcompris.FONT_BOARD_MEDIUM</td><td>FONT_BOARD_MEDIUM</td></tr><tr><td>gcompris.FONT_BOARD_BIG</td><td>FONT_BOARD_BIG</td></tr><tr><td>gcompris.FONT_BOARD_BIG_BOLD</td><td>FONT_BOARD_BIG_BOLD</td></tr><tr><td>gcompris.FONT_BOARD_FIXED</td><td>FONT_BOARD_FIXED</td></tr><tr><td>gcompris.FONT_BOARD_TITLE</td><td>FONT_BOARD_TITLE</td></tr><tr><td>gcompris.FONT_BOARD_TITLE_BOLD</td><td>FONT_BOARD_TITLE_BOLD</td></tr><tr><td>gcompris.FONT_BOARD_HUGE</td><td>FONT_BOARD_HUGE</td></tr><tr><td>gcompris.FONT_BOARD_HUGE_BOLD</td><td>FONT_BOARD_HUGE_BOLD</td></tr></tbody></table></div></div><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2791000"></a>Cursor constants mapping</h3></div></div><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Python constant</th><th>C equivalent</th></tr></thead><tbody><tr><td>gcompris.CURSOR_FIRST_CUSTOM</td><td>GCOMPRIS_FIRST_CUSTOM_CURSOR</td></tr><tr><td>gcompris.CURSOR_BIG_RED_ARROW</td><td>GCOMPRIS_BIG_RED_ARROW_CURSOR</td></tr><tr><td>gcompris.CURSOR_BIRD</td><td>GCOMPRIS_BIRD_CURSOR</td></tr><tr><td>gcompris.CURSOR_LINE</td><td>GCOMPRIS_LINE_CURSOR</td></tr><tr><td>gcompris.CURSOR_FILLRECT</td><td>GCOMPRIS_FILLRECT_CURSOR</td></tr><tr><td>gcompris.CURSOR_RECT</td><td>GCOMPRIS_RECT_CURSOR</td></tr><tr><td>gcompris.CURSOR_FILLCIRCLE</td><td>GCOMPRIS_FILLCIRCLE_CURSOR</td></tr><tr><td>gcompris.CURSOR_CIRCLE</td><td>GCOMPRIS_CIRCLE_CURSOR</td></tr><tr><td>gcompris.CURSOR_DEL</td><td>GCOMPRIS_DEL_CURSOR</td></tr><tr><td>gcompris.CURSOR_FILL</td><td>GCOMPRIS_FILL_CURSOR</td></tr><tr><td>gcompris.CURSOR_SELECT</td><td>GCOMPRIS_SELECT_CURSOR</td></tr><tr><td>gcompris.CURSOR_DEFAULT</td><td>GCOMPRIS_DEFAULT_CURSOR</td></tr></tbody></table></div></div></div></div></body></html>