diff options
author | Bruno Coudoin <bcoudoin@src.gnome.org> | 2006-09-15 21:45:19 (GMT) |
---|---|---|
committer | Bruno Coudoin <bcoudoin@src.gnome.org> | 2006-09-15 21:45:19 (GMT) |
commit | 91de01835d8625970565a36622f8e1300dba09e3 (patch) | |
tree | deecd4975c259727a0750fcdd51d5e90c138e037 | |
parent | b450ca9eec5a16851cab443c73cb7e893d1fd0b4 (diff) |
minor update fixed category based on Poiroud Marc input Education;Teaching
* README.mingw: minor update
* gcompris-edit.desktop.in: fixed category based on Poiroud Marc input Education;Teaching
* gcompris.desktop.in: Game;KidsGame
* src/boards/py-mod-bonus.c: (python_gcompris_bonus_module_init): fixed API for board_finished
* src/boards/python/hexagon.py: reindent
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | README.mingw | 1 | ||||
-rw-r--r-- | gcompris-edit.desktop.in | 2 | ||||
-rw-r--r-- | gcompris.desktop.in | 2 | ||||
-rw-r--r-- | src/boards/py-mod-bonus.c | 24 | ||||
-rw-r--r-- | src/boards/python/hexagon.py | 58 |
6 files changed, 52 insertions, 43 deletions
@@ -1,3 +1,11 @@ +2006-09-15 Bruno coudoin <bruno.coudoin@free.fr> + + * README.mingw: minor update + * gcompris-edit.desktop.in: fixed category based on Poiroud Marc input Education;Teaching + * gcompris.desktop.in: Game;KidsGame + * src/boards/py-mod-bonus.c: (python_gcompris_bonus_module_init): fixed API for board_finished + * src/boards/python/hexagon.py: reindent + *** RELEASE 8.0BETA5 *** 2006-09-14 Bruno coudoin <bruno.coudoin@free.fr> diff --git a/README.mingw b/README.mingw index 07529f6..f5c2465 100644 --- a/README.mingw +++ b/README.mingw @@ -61,6 +61,7 @@ GNUCHESS_TOP := /gnuchess ======================== * On a GNU/Linux system, create gcompris-win-prepack.tar.gz with: make -f Makefile.mingw prep +* Now on the windows system: * Get a tarball or CVS snapshot of gcompris. * untar the gcompris-win-prepack.tar.gz in it * run make -f Makefile.mingw from gcompris's top-level directory. This will take a long time. diff --git a/gcompris-edit.desktop.in b/gcompris-edit.desktop.in index 737052f..8213ff7 100644 --- a/gcompris-edit.desktop.in +++ b/gcompris-edit.desktop.in @@ -6,7 +6,7 @@ Exec=gcompris -a Icon=gcompris-edit.png Terminal=false Type=Application -Categories=GTK;Teaching; +Categories=Education;Teaching; StartupNotify=true X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=gcompris diff --git a/gcompris.desktop.in b/gcompris.desktop.in index c94c48d..b0d18ab 100644 --- a/gcompris.desktop.in +++ b/gcompris.desktop.in @@ -7,7 +7,7 @@ Exec=gcompris Icon=gcompris.png Terminal=false Type=Application -Categories=GTK;KidsGame; +Categories=Game;KidsGame; StartupNotify=true X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=gcompris diff --git a/src/boards/py-mod-bonus.c b/src/boards/py-mod-bonus.c index 66ca9a7..8b5ee0a 100644 --- a/src/boards/py-mod-bonus.c +++ b/src/boards/py-mod-bonus.c @@ -48,7 +48,7 @@ py_gcompris_gc_bonus_end_display(PyObject* self, PyObject* args) static PyMethodDef PythonGcomprisBonusModule[] = { { "display", py_gc_bonus_display, METH_VARARGS, "gc_bonus_display" }, - { "gc_bonus_end_display", py_gcompris_gc_bonus_end_display, METH_VARARGS, "gc_bonus_end_display" }, + { "board_finished", py_gcompris_gc_bonus_end_display, METH_VARARGS, "gc_bonus_end_display" }, { NULL, NULL, 0, NULL} }; @@ -58,25 +58,25 @@ void python_gcompris_bonus_module_init(void) module = Py_InitModule("_gcompris_bonus", PythonGcomprisBonusModule); /* Misc constants */ - PyModule_AddIntConstant(module, "TIME_CLICK_TO", TIME_CLICK_TO_BONUS ); + 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, "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 ); + 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 ); + PyModule_AddIntConstant(module, "LOOSE", BOARD_LOOSE ); + PyModule_AddIntConstant(module, "WIN", BOARD_WIN ); + PyModule_AddIntConstant(module, "DRAW", BOARD_DRAW ); } /* Some usefull code parts ... */ diff --git a/src/boards/python/hexagon.py b/src/boards/python/hexagon.py index ff6f1d4..10926b7 100644 --- a/src/boards/python/hexagon.py +++ b/src/boards/python/hexagon.py @@ -1,23 +1,23 @@ # gcompris - Hexagon -# +# # Time-stamp: <2004/31/03 15:10:00 Ingo Konrad> -# +# # Copyright (C) 2004 Christof Petig and Ingo Konrad -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# import gnome import gnome.canvas import gcompris @@ -31,7 +31,7 @@ import math class Gcompris_hexagon: """The minouche activity""" - + def __init__(self, gcomprisBoard): self.gcomprisBoard = gcomprisBoard self.rootitem = None @@ -42,7 +42,7 @@ class Gcompris_hexagon: self.gamewon = False; - def start(self): + def start(self): gcompris.bar_set (0) gcompris.set_background(self.gcomprisBoard.canvas.root(), gcompris.skin.image_to_skin("gcompris-bg.jpg")) @@ -58,7 +58,7 @@ class Gcompris_hexagon: def end(self): self.cleanup() - + def ok(self): print("Gcompris_minouche ok.") @@ -66,11 +66,11 @@ class Gcompris_hexagon: #print("got key %i" % keyval) return False - # Called by gcompris core + # Called by gcompris core def pause(self, pause): - + self.board_paused = pause - + # When the bonus is displayed, it call us first with pause(1) and then with pause(0) # the game is won if(pause == 0 and self.gamewon): @@ -79,7 +79,7 @@ class Gcompris_hexagon: return - + # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- @@ -89,23 +89,23 @@ class Gcompris_hexagon: self.gamewon = False; # Remove the root item removes all the others inside it - if self.rootitem != None: + if self.rootitem != None: self.rootitem.destroy() self.rootitem = None def paint_hex(self, x, y, color=0x0099FFCCL): ax = 30+self.sqrt3*self.r*x ay = 30+1.5*self.r*y - + if y&1 : ax+=self.sqrt3/2*self.r self.pts = [] for i in range (len(self.cx)): self.pts.append (ax+self.cx [i]) - self.pts.append (ay+self.cy [i]) - - s = self.rootitem.add(gnome.canvas.CanvasPolygon, points = self.pts, - fill_color_rgba = color, outline_color = "black", width_units = + self.pts.append (ay+self.cy [i]) + + s = self.rootitem.add(gnome.canvas.CanvasPolygon, points = self.pts, + fill_color_rgba = color, outline_color = "black", width_units = 2.5) return s @@ -120,9 +120,9 @@ class Gcompris_hexagon: for x in range (22): for y in range (16): s = self.paint_hex(x, y) - + s.connect ("event", self.on_click, x-int(y/2), y) - + def coloring(self,dist): r=b=g=0 if dist <0.25: @@ -141,16 +141,16 @@ class Gcompris_hexagon: pass color = r*0x1000000+g*0x10000+b*0x100+0xFF return color - + def finished(self): gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM) - + def on_click (self, widget, event=None, x=0, y=0): if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1 : - + catdistance = self.distance_cat(x,y) #print self.random_catx, self.random_caty,x,y,catdistance - + if catdistance<0.1: self.paint_cat() self.gamewon = True; @@ -158,7 +158,7 @@ class Gcompris_hexagon: else: color = self.coloring (catdistance/30.0) widget.set(fill_color_rgba=color); - + def paint_cat(self): position =19+self.sqrt3*self.r*self.random_catx @@ -168,16 +168,16 @@ class Gcompris_hexagon: ("gcompris/misc/strawberry.png") h2 = 30 w2 = pixbuf2.get_width()*h2/pixbuf2.get_height() - self.rootitem.add(gnome.canvas.CanvasPixbuf, + self.rootitem.add(gnome.canvas.CanvasPixbuf, pixbuf=pixbuf2.scale_simple(w2, h2, gtk.gdk.INTERP_BILINEAR), x=position, y=14+1.5*self.random_caty*self.r) - + def distance_cat (self,x,y): dx = self.random_catx-x-int(self.random_caty/2) dy = self.random_caty-y - + if dx*dy >=0: return abs(dx)+abs(dy) if dx*dy<0: |