[gcompris-devel] More commits :)

Olivier Samyn osamyn at ulb.ac.be
Tue Apr 22 08:04:12 UTC 2003


More commits again...

I finished the skin feature by implementing the necessary python binding
for it.

I also updated all plugins to use this new feature. I've done it for the
standard gcompris fonts and colors. Now if some plugins developpers
wants to use the skin feature to replace colors/fonts constants/defines
they are free and the framework is ready (take a look at the
boards/skin/default/skin.xml and src/gcompris/skin.[h,c] files)

For the future python board I'm writing... I've been up to now playing
with gnome canvas code and the python binding... So the current
pythontest board is just a testing/example board.

But... I began to implement something and I'll now have time to work on
it (If I don't find a new feature to impelement :) )



Now the future board:

The purpose of this board will simply be to connect two columns of
circle with lines... but the columns will have some text attached...

My sister who's a teacher use something like this to teach maths. For
example a typical board will be:

2x3 o  o 6
3x3 o  o 15
5x3 o  o 9

And the player will have to connect the good result with the good
operation like (ascii art isn't easy :( ):

2x3 o-----o 6
3x3 o-- --o 15
5x3 o--X--o 9

Also my sister doesn't correct the result immediately, she says:
"You made one, two,... error(s) let's take a look at the book/reference
and try to correct yourself."

Then the kid take his book, make some search and try to correct his
sheet. 

This procees loops until there are no more errors...

This seems simple, but for a teache with 20 kids it can become verry
hard to correct all copies.

So I'll try to implement something like this in gcompris. With a
reference dialog that will popup when the kid made a mistake... and this
dialog will contain the reference for the game...

For now the plugin contains two circle and a line that will one day
connect the two :)

Any sugggest is welcome !

Olivier Samyn


Le jeu 17/04/2003 à 22:33, bruno a écrit :
> Ouah, sounds excellent to me. I just did an autogen, installed it and it
> runs with no problem.
> As a minimal test, I entered/left all the boards one by one and got no
> core dumps and update issues. I have not tested each board completly.
> 
> So now you have a moving circle. Can't wait to see what you are going to
> implement with this.
> 
> If you have no idea, you can pick up one from this list:
> http://www.ofset.org/projects/edusoft/epi.html
> 
> Bruno.
> 
> 
> Le jeu 17/04/2003 à 20:19, Olivier Samyn a écrit :
> > 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