Commit 339bf895 authored by Bruno Coudoin's avatar Bruno Coudoin

Continued the port to the Sugar architecture, more activities are working now

svn path=/branches/gcomprixo/; revision=2827
parent 1d8edfbb
activity=anim activity=anim
plugindir=. plugindir=.
if [ -f .libs/lib$activity.so ] if [ -f ../boards/.libs/libpython.so ]
then then
plugindir=.libs plugindir=../boards/.libs
fi fi
./gcompris.bin -L $plugindir -P . -A resources \ ./gcompris.bin -L $plugindir -P . -A resources \
......
SUBDIRS = activity SUBDIRS = activity resources
if PLATFORM_WIN32 if PLATFORM_WIN32
shared = -shared shared = -shared
......
SUBDIRS = activity SUBDIRS = activity resources
activity=chess activity=chess_computer
type=chess
plugindir=. plugindir=.
if [ -f .libs/lib$activity.so ] if [ -f .libs/lib$type.so ]
then then
plugindir=.libs plugindir=.libs
fi fi
......
SUBDIRS = activity SUBDIRS = activity resources
../boards/python/gcompris/
\ No newline at end of file
../boards/python/gcompris
\ No newline at end of file
...@@ -113,22 +113,30 @@ class Gcompris_drawnumber : ...@@ -113,22 +113,30 @@ class Gcompris_drawnumber :
self.gcomprisBoard.sublevel=sublevel self.gcomprisBoard.sublevel=sublevel
self.gcomprisBoard.number_of_sublevel=len(self.data) self.gcomprisBoard.number_of_sublevel=len(self.data)
#Display of score #Display of score
gcompris.score.start(gcompris.score.STYLE_NOTE, 10, 485,self.gcomprisBoard.number_of_sublevel) gcompris.score.start(gcompris.score.STYLE_NOTE, 10, 485,
self.gcomprisBoard.number_of_sublevel)
gcompris.score.set(self.gcomprisBoard.sublevel) gcompris.score.set(self.gcomprisBoard.sublevel)
#Set point number 0 from which the draw start. This point is equal to first one. #Set point number 0 from which the draw start. This point is equal to first one.
self.POINT[0]=self.point(0,self.data[sublevel][1][0],self.data[sublevel][1][1],30) self.POINT[0]=self.point(0,
self.data[sublevel][1][0],
self.data[sublevel][1][1],30)
self.POINT[0].hide() self.POINT[0].hide()
self.MAX=self.data[sublevel][0][0] self.MAX=self.data[sublevel][0][0]
print "ICI1"
#Data loading from global data and display of points and numbers #Data loading from global data and display of points and numbers
i=1 i=1
while(i<=(self.MAX)): while(i<=(self.MAX)):
self.TEXT.append(self.texte(i,self.data[sublevel][i][0],self.data[sublevel][i][1])) print i
self.TEXT[i].connect('event',self.action,i) self.TEXT.append(self.texte(i,
self.data[sublevel][i][0],
self.data[sublevel][i][1]))
self.TEXT[i].connect('event', self.action, i)
self.TEXT[i].lower(300-i) self.TEXT[i].lower(300-i)
self.POINT.append(self.point(i,self.data[sublevel][i][0],self.data[sublevel][i][1],30)) self.POINT.append(self.point(i,self.data[sublevel][i][0],
self.POINT[i].connect('event',self.action,i) self.data[sublevel][i][1],30))
self.POINT[i].connect('event', self.action, i)
#Setting of display level to prevent from covert a point with another point which #Setting of display level to prevent from covert a point with another point which
#cause an impossibility to select it. #cause an impossibility to select it.
...@@ -138,19 +146,20 @@ class Gcompris_drawnumber : ...@@ -138,19 +146,20 @@ class Gcompris_drawnumber :
#Setting color of the first point to blue instead of green #Setting color of the first point to blue instead of green
self.POINT[1].set(fill_color='blue') self.POINT[1].set(fill_color='blue')
def point(self,idpt,x,y,d=30): def point(self, idpt, x, y, d=30):
"""Setting point from his x and y location""" """Setting point from his x and y location"""
print "point"
rond=self.ROOT.add(gnomecanvas.CanvasEllipse, rond=self.ROOT.add(gnomecanvas.CanvasEllipse,
x1=(x-(d/2)),y1=(y-(d/2)), x1=(x-(d/2)),y1=(y-(d/2)),
x2=(x+(d/2)),y2=(y+(d/2)), x2=(x+(d/2)),y2=(y+(d/2)),
fill_color = "green", # default color is green and outline in black fill_color = "green", # default color is green and outline in black
outline_color = "black", outline_color = "black",
width_units = 1.5 width_units = 1.5
) )
rond.x,rond.y=x,y rond.x,rond.y=x,y
return rond return rond
def texte(self,idpt,xt,yt): def texte(self, idpt, xt, yt):
"""Setting text beside the point number idpt locate as xt, yt""" """Setting text beside the point number idpt locate as xt, yt"""
labell = self.ROOT.add(gnomecanvas.CanvasText, labell = self.ROOT.add(gnomecanvas.CanvasText,
x=xt, x=xt,
......
...@@ -640,7 +640,9 @@ gc_file_find_absolute(const gchar *format, ...) ...@@ -640,7 +640,9 @@ gc_file_find_absolute(const gchar *format, ...)
FOUND: FOUND:
g_free(filename); g_free(filename);
return absolute_filename; char *abs_name = realpath(absolute_filename, NULL);
g_free(absolute_filename);
return abs_name;
} }
/** Create a directory if needed. /** Create a directory if needed.
......
...@@ -119,14 +119,6 @@ class Gcompris_tuxpaint: ...@@ -119,14 +119,6 @@ class Gcompris_tuxpaint:
gcompris.sound.close() gcompris.sound.close()
# release pointergrab if running fullscreen, tuxpaint wants to grab the
# pointer itself
if (Prop.fullscreen and not Prop.noxf86vm):
gtk.gdk.pointer_ungrab()
#self.window.set_property("accept-focus", 0)
#self.window.set_keep_below(False)
try: try:
# bug in working_directory=None ? # bug in working_directory=None ?
if (tuxpaint_dir): if (tuxpaint_dir):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment