[gcompris-devel] More commits :)

Olivier Samyn osamyn at ulb.ac.be
Thu Apr 17 11:19:05 UTC 2003


Here is the "changelog" of what I just commited to the gcompris cvs...

- Modified the python plugin to work with a python class instead of a
set of functions. (See python.html and pythontest.py for more infos)
- Added a way to specify skins colors and fonts (a skin.xml file located
in the skin directory)
- Modified the gcompris core to use those new infos.


If you want to see what those changes made, take a look at:
http://student.ulb.ac.be/~osamyn/gc-screenshot.jpg

I just replaced the fonts name in the pink's skin.xml file...

If you want to use those changes, replace the FONT_* (and FONT_BOARD_*)
constants with: gcompris_skin_font_* variables...
The same behaviour occurs with the color constants given in the
gcompris.h file. I don't already updated the current plugins but the
scripts to do it are ready...

To end this stroy, plugin writers may specify their own fonts and colors
into the skins skin.xml files using their own "id". To get the value
from the current skin, just use the following functions:

guint32 gcompris_skin_get_color(gchar* id);
guint32 gcompris_skin_get_color_default(gchar* id, guint32 defvalue);
gchar* gcompris_skin_get_font(gchar* id);
gchar* gcompris_skin_get_font_default(gchar* id, gchar* defvalue);

They return the value associated to a the given id. The _default version
let you specify the value that have to be returned in case of the id
isn't known. the other version are macros that give you a black color
and Sans 12 as default values.

To end with this, skin writers don't have to specify all colors/fonts,
the default skin is first loaded and then the values are updated with
the selected skin.

For python, I updated the doc (docs/C/python.html) to reflect the
changes I made and to give some tips on programming a gcompris python
board.

I also made some changes on the pythontest.py... but it's always not a
playable game (or moving a circle on a screen is a game ?)

And Bruno, just as remember, don't forget to do an autogen.sh and to
install all since there are new files ;)

See you...
-- 
Olivier Samyn <osamyn at ulb.ac.be>





More information about the Gcompris-devel mailing list