Back to index

gcompris  8.2.2
Public Member Functions | Public Attributes
redraw.Gcompris_redraw Class Reference

List of all members.

Public Member Functions

def __init__
def start
def end
def pause
def ok
def display_error
def set_level
def repeat
def config
def key_press
def erase_drawing_area
def display_current_level
def increment_level
def display_sublevel
def draw_tools
def tool_item_event
def draw_colors
def color_item_event
def draw_drawing_area
def reorder_coord
def get_symmetry
def draw_image_target
def draw_grid
def snap_to_grid
def move_item_event
def fillin_item_event
def fillout_item_event
def del_item
def del_item_event
def display_coord
def target_item_event
def create_item_event
def init_item_list

Public Attributes

 gcomprisBoard
 board_paused
 gamewon
 tools
 current_tool
 colors
 current_color
 current_step
 current_drawing
 image_target
 drawing_area
 target_area
 in_select_ofx
 in_select_ofy
 root_erroritem
 editing_mode
 rootitem
 coorditem
 coorditem_shadow
 root_drawingitem
 old_tool_item
 old_color_item
 root_targetitem
 newitem
 pos_x
 pos_y
 drawlist

Detailed Description

The Re-drawing activity

Definition at line 33 of file redraw.py.


Constructor & Destructor Documentation

def redraw.Gcompris_redraw.__init__ (   self,
  gcomprisBoard 
)

Definition at line 37 of file redraw.py.

00037 
00038   def __init__(self, gcomprisBoard):
00039 
00040     self.gcomprisBoard = gcomprisBoard
00041 
00042     # These are used to let us restart only after the bonus is displayed.
00043     # When the bonus is displayed, it call us first with pause(1) and then with pause(0)
00044     self.board_paused  = 0;
00045     self.gamewon       = 0;
00046 
00047     # TOOL SELECTION
00048     self.tools = [
00049       ["RECT",           "draw/tool-rectangle.png",       "draw/tool-rectangle_on.png",          gcompris.CURSOR_RECT],
00050       ["FILL_RECT",      "draw/tool-filledrectangle.png", "draw/tool-filledrectangle_on.png",    gcompris.CURSOR_FILLRECT],
00051       ["CIRCLE",         "draw/tool-circle.png",          "draw/tool-circle_on.png",             gcompris.CURSOR_CIRCLE],
00052       ["FILL_CIRCLE",    "draw/tool-filledcircle.png",    "draw/tool-filledcircle_on.png",       gcompris.CURSOR_FILLCIRCLE],
00053       ["LINE",           "draw/tool-line.png",            "draw/tool-line_on.png",               gcompris.CURSOR_LINE],
00054       ["DEL",            "draw/tool-del.png",             "draw/tool-del_on.png",                gcompris.CURSOR_DEL],
00055       ["FILL",           "draw/tool-fill.png",            "draw/tool-fill_on.png",               gcompris.CURSOR_FILL],
00056       ["SELECT",         "draw/tool-select.png",          "draw/tool-select_on.png",             gcompris.CURSOR_SELECT]
00057       ]
00058 
00059     self.current_tool=0
00060 
00061     # COLOR SELECTION
00062     self.colors = [ 0x2A2A2AFFL,
00063                     0x7C4B21FFL,
00064                     0xEE0000FFL,
00065                     0xFF8C45FFL,
00066                     0xFFFF0cFFL,
00067                     0xB9BC0DFFL,
00068                     0x14FF3bFFL,
00069                     0xA4FFB3FFL,
00070                     0xFF53AFFFL,
00071                     0x831891FFL,
00072                     0x666666FFL,
00073                     0xF0F0F0FFL]
00074 
00075     self.current_color = 0
00076     self.current_step = 0
00077 
00078     self.current_drawing = []
00079     self.image_target    = []
00080 
00081     # Define the coord of each drawing area
00082     self.drawing_area = [140.0, 20.0, 420.0, 500.0]
00083     self.target_area  = [440.0, 20.0, 720.0, 500.0]
00084 
00085     # Global used for the select event
00086     self.in_select_ofx = -1
00087     self.in_select_ofy = -1
00088 
00089     # The error root item
00090     self.root_erroritem = []
00091 
00092     # Set it to 1 to let you create new forms
00093     # Once set, draw your shape in the right area. Then clic on OK to display
00094     # the data for the form (in the console). Then copy the data in the list at the end of
00095     # this file in init_item_list
00096     # Set self.editing_mode = None to forbid drawing in the right area
00097     self.editing_mode = None
00098     #self.editing_mode = 1
00099 


Member Function Documentation

def redraw.Gcompris_redraw.color_item_event (   self,
  item,
  event,
  color 
)

Definition at line 455 of file redraw.py.

00455 
00456   def color_item_event(self, item, event, color):
00457     if event.type == gtk.gdk.BUTTON_PRESS:
00458       if event.button == 1:
00459         # Deactivate old button
00460         self.old_color_item.set(width_units = 0.0,
00461                                 outline_color_rgba= 0x144B9DFFL)
00462 
00463         # Activate new button
00464         self.current_color = color
00465         self.old_color_item = item
00466         self.old_color_item.set(width_units = 4.0,
00467                                 outline_color_rgba= 0x16EC3DFFL)
00468 

Here is the caller graph for this function:

Definition at line 267 of file redraw.py.

00267 
00268   def config(self):
00269     print("Gcompris_redraw config.")

def redraw.Gcompris_redraw.create_item_event (   self,
  item,
  event 
)

Definition at line 920 of file redraw.py.

00920 
00921   def create_item_event(self, item, event):
00922 
00923     if event.type == gtk.gdk.LEAVE_NOTIFY:
00924       self.display_coord(event.x,event.y, 3)
00925     else:
00926       self.display_coord(event.x,event.y, 1)
00927 
00928     if event.type == gtk.gdk.BUTTON_PRESS:
00929 
00930       # Delete error previous mark if any
00931       if(self.root_erroritem):
00932         self.root_erroritem.destroy()
00933 
00934       if event.button == 1:
00935         self.newitem = None
00936 
00937         if (self.tools[self.current_tool][0] == "DEL" or
00938             self.tools[self.current_tool][0] == "SELECT" or
00939             self.tools[self.current_tool][0] == "FILL"):
00940           # This event is treated in del_item_event to avoid
00941           # operating on background item and grid
00942           return False
00943 
00944         elif self.tools[self.current_tool][0] == "LINE":
00945 
00946           x,y = self.snap_to_grid(event.x,event.y)
00947           self.pos_x = x
00948           self.pos_y = y
00949 
00950           self.newitem = self.root_drawingitem.add(
00951             gnomecanvas.CanvasLine,
00952             points=(self.pos_x, self.pos_y, x, y),
00953             fill_color_rgba=self.colors[self.current_color],
00954             width_units=8.0
00955             )
00956           self.newitem.connect("event", self.fillin_item_event, len(self.current_drawing))
00957           self.newitem.connect("event", self.move_item_event, len(self.current_drawing))
00958 
00959           # Add the new item to our list
00960           self.current_drawing.append({'tool': self.tools[self.current_tool][0],
00961                                         'points':(self.pos_x, self.pos_y, x, y),
00962                                         'fill_color_rgba':self.colors[self.current_color],
00963                                         'width_units':8.0})
00964 
00965         elif self.tools[self.current_tool][0] == "RECT":
00966 
00967           x,y = self.snap_to_grid(event.x,event.y)
00968           self.pos_x = x
00969           self.pos_y = y
00970 
00971           self.newitem = self.root_drawingitem.add(
00972             gnomecanvas.CanvasRect,
00973             x1=self.pos_x,
00974             y1=self.pos_y,
00975             x2=x,
00976             y2=y,
00977             outline_color_rgba=self.colors[self.current_color],
00978             width_units=4.0
00979             )
00980           self.newitem.connect("event", self.fillout_item_event, len(self.current_drawing))
00981           self.newitem.connect("event", self.move_item_event, len(self.current_drawing))
00982 
00983           # Add the new item to our list
00984           self.current_drawing.append({'tool': self.tools[self.current_tool][0],
00985                                        'x1':self.pos_x,
00986                                        'y1':self.pos_y,
00987                                        'x2':x,
00988                                        'y2':y,
00989                                        'outline_color_rgba':self.colors[self.current_color],
00990                                        'width_units':4.0})
00991 
00992         elif self.tools[self.current_tool][0] == "FILL_RECT":
00993 
00994           x,y = self.snap_to_grid(event.x,event.y)
00995           self.pos_x = x
00996           self.pos_y = y
00997 
00998           self.newitem = self.root_drawingitem.add(
00999             gnomecanvas.CanvasRect,
01000             x1=self.pos_x,
01001             y1=self.pos_y,
01002             x2=x,
01003             y2=y,
01004             fill_color_rgba=self.colors[self.current_color],
01005             outline_color_rgba=0x000000FFL,
01006             width_units=1.0
01007             )
01008           self.newitem.connect("event", self.fillin_item_event, len(self.current_drawing))
01009           self.newitem.connect("event", self.move_item_event, len(self.current_drawing))
01010 
01011           # Add the new item to our list
01012           self.current_drawing.append({'tool': self.tools[self.current_tool][0],
01013                                        'x1':self.pos_x,
01014                                        'y1':self.pos_y,
01015                                        'x2':x,
01016                                        'y2':y,
01017                                        'fill_color_rgba':self.colors[self.current_color],
01018                                        'outline_color_rgba':0x000000FFL,
01019                                        'width_units':1.0})
01020 
01021         elif self.tools[self.current_tool][0] == "CIRCLE":
01022 
01023           x,y = self.snap_to_grid(event.x,event.y)
01024           self.pos_x = x
01025           self.pos_y = y
01026 
01027           self.newitem = self.root_drawingitem.add(
01028             gnomecanvas.CanvasEllipse,
01029             x1=self.pos_x,
01030             y1=self.pos_y,
01031             x2=x,
01032             y2=y,
01033             outline_color_rgba=self.colors[self.current_color],
01034             width_units=5.0
01035             )
01036           self.newitem.connect("event", self.fillout_item_event, len(self.current_drawing))
01037           self.newitem.connect("event", self.move_item_event, len(self.current_drawing))
01038 
01039           # Add the new item to our list
01040           self.current_drawing.append({'tool': self.tools[self.current_tool][0],
01041                                        'x1':self.pos_x,
01042                                        'y1':self.pos_y,
01043                                        'x2':x,
01044                                        'y2':y,
01045                                        'outline_color_rgba':self.colors[self.current_color],
01046                                        'width_units':5.0})
01047 
01048         elif self.tools[self.current_tool][0] == "FILL_CIRCLE":
01049 
01050           x,y = self.snap_to_grid(event.x,event.y)
01051           self.pos_x = x
01052           self.pos_y = y
01053 
01054           self.newitem = self.root_drawingitem.add(
01055             gnomecanvas.CanvasEllipse,
01056             x1=self.pos_x,
01057             y1=self.pos_y,
01058             x2=x,
01059             y2=y,
01060             fill_color_rgba=self.colors[self.current_color],
01061             outline_color_rgba=0x000000FFL,
01062             width_units=1.0
01063             )
01064           self.newitem.connect("event", self.fillin_item_event, len(self.current_drawing))
01065           self.newitem.connect("event", self.move_item_event, len(self.current_drawing))
01066 
01067           # Add the new item to our list
01068           self.current_drawing.append({'tool': self.tools[self.current_tool][0],
01069                                        'x1':self.pos_x,
01070                                        'y1':self.pos_y,
01071                                        'x2':x,
01072                                        'y2':y,
01073                                        'fill_color_rgba':self.colors[self.current_color],
01074                                        'outline_color_rgba':0x000000FFL,
01075                                        'width_units':1.0})
01076         if self.newitem != 0:
01077           self.newitem.connect("event", self.create_item_event)
01078           self.newitem.connect("event", self.del_item_event, len(self.current_drawing)-1)
01079 
01080       return True
01081 
01082     #
01083     # MOTION EVENT
01084     # ------------
01085     if event.type == gtk.gdk.MOTION_NOTIFY:
01086       if event.state & gtk.gdk.BUTTON1_MASK:
01087         x=event.x
01088         y=event.y
01089         x,y = self.snap_to_grid(event.x,event.y)
01090 
01091         # Check drawing boundaries
01092         if(event.x<self.drawing_area[0]):
01093           x=self.drawing_area[0]
01094         if(event.x>self.drawing_area[2]):
01095           x=self.drawing_area[2]
01096         if(event.y<self.drawing_area[1]):
01097           y=self.drawing_area[1]
01098         if(event.y>self.drawing_area[3]):
01099           y=self.drawing_area[3]
01100 
01101         if self.tools[self.current_tool][0] == "LINE":
01102           self.newitem.set( points=( self.pos_x, self.pos_y, x, y) )
01103           # Reset the item to our list
01104           self.current_drawing[len(self.current_drawing)-1]['points'] = ( self.pos_x, self.pos_y, x, y)
01105         elif (self.tools[self.current_tool][0] == "RECT" or
01106               self.tools[self.current_tool][0] == "FILL_RECT" or
01107               self.tools[self.current_tool][0] == "CIRCLE" or
01108               self.tools[self.current_tool][0] == "FILL_CIRCLE"):
01109           self.newitem.set(
01110             x2=x,
01111             y2=y)
01112           # Reset the item to our list
01113           self.current_drawing[len(self.current_drawing)-1]['x2'] = x
01114           self.current_drawing[len(self.current_drawing)-1]['y2'] = y
01115 
01116 
01117     #
01118     # MOUSE DRAG STOP
01119     # ---------------
01120     if event.type == gtk.gdk.BUTTON_RELEASE:
01121       if event.button == 1:
01122         # We have to remove empty created items (the kid did not drag enough)
01123         if self.tools[self.current_tool][0] == "LINE":
01124           bounds = self.current_drawing[len(self.current_drawing)-1]['points']
01125           if (bounds[0] == bounds[2]) and (bounds[1] == bounds[3]):
01126             # Oops, empty line
01127             self.del_item(self.newitem, len(self.current_drawing)-1)
01128           else:
01129             # We need to reord the coord in increasing order to allow later comparison
01130             # I use a trick, I do x1*x1+y1 and x2*x2+y2, put the lower as the A point
01131             i = bounds[0]*bounds[0] + bounds[1]
01132             j = bounds[2]*bounds[2] + bounds[3]
01133             if(i<=j):
01134               self.current_drawing[len(self.current_drawing)-1]['points'] = (bounds[0], bounds[1],
01135                                                                              bounds[2], bounds[3])
01136             else:
01137               self.current_drawing[len(self.current_drawing)-1]['points'] = (bounds[2], bounds[3],
01138                                                                              bounds[0], bounds[1])
01139 
01140         elif (self.tools[self.current_tool][0] == "RECT" or
01141               self.tools[self.current_tool][0] == "FILL_RECT" or
01142               self.tools[self.current_tool][0] == "CIRCLE" or
01143               self.tools[self.current_tool][0] == "FILL_CIRCLE"):
01144           # It's a rect or ellipse
01145           x1 = self.current_drawing[len(self.current_drawing)-1]['x1']
01146           y1 = self.current_drawing[len(self.current_drawing)-1]['y1']
01147           x2 = self.current_drawing[len(self.current_drawing)-1]['x2']
01148           y2 = self.current_drawing[len(self.current_drawing)-1]['y2']
01149           if (x1 == x2) or (y1 == y2):
01150             # Oups, empty rect
01151             self.del_item(self.newitem, len(self.current_drawing)-1)
01152           else:
01153             # We need to reord the coord in increasing order to allow later comparison
01154             x1, y1, x2, y2 = self.reorder_coord(x1, y1, x2, y2)
01155             self.current_drawing[len(self.current_drawing)-1]['x1'] = x1
01156             self.current_drawing[len(self.current_drawing)-1]['y1'] = y1
01157             self.current_drawing[len(self.current_drawing)-1]['x2'] = x2
01158             self.current_drawing[len(self.current_drawing)-1]['y2'] = y2
01159 
01160         return True
01161     return False
01162 

Here is the call graph for this function:

Here is the caller graph for this function:

def redraw.Gcompris_redraw.del_item (   self,
  item,
  drawing_item_index 
)

Definition at line 864 of file redraw.py.

00864 
00865   def del_item(self, item, drawing_item_index):
00866     item.destroy()
00867     # Warning, do not realy delete it or we bug the index of other items
00868     self.current_drawing[drawing_item_index] = []

Here is the caller graph for this function:

def redraw.Gcompris_redraw.del_item_event (   self,
  item,
  event,
  drawing_item_index 
)

Definition at line 870 of file redraw.py.

00870 
00871   def del_item_event(self, item, event, drawing_item_index):
00872     if event.type == gtk.gdk.BUTTON_PRESS:
00873       if event.button == 1:
00874         if self.tools[self.current_tool][0] == "DEL":
00875           self.del_item(item, drawing_item_index);
00876           return True
00877     return False

Here is the call graph for this function:

def redraw.Gcompris_redraw.display_coord (   self,
  x,
  y,
  type 
)

Definition at line 885 of file redraw.py.

00885 
00886   def display_coord(self, x, y, type):
00887     if(type == 1):
00888       xl = self.drawing_area[0]
00889     else:
00890       xl = self.target_area[0]
00891 
00892     yl = self.drawing_area[1]
00893 
00894     x = int(round(((x+(self.current_step/2)) - xl)/self.current_step) - 1)
00895     y = int(round(((y+(self.current_step/2)) - yl)/self.current_step) - 1)
00896 
00897     if(type == 3):
00898       self.coorditem.set(text="")
00899       self.coorditem_shadow.set(text="")
00900     else:
00901       self.coorditem.set(
00902         text=_("Coordinate") + " = (" + str(x) + "/" + str(y) + ")"
00903         )
00904       self.coorditem_shadow.set(
00905         text=_("Coordinate") + " = (" + str(x) + "/" + str(y) + ")"
00906         )
00907 
00908 
00909 

Here is the caller graph for this function:

Definition at line 282 of file redraw.py.

00282 
00283   def display_current_level(self):
00284     # Set the level in the control bar
00285     gcompris.bar_set_level(self.gcomprisBoard);
00286 
00287     # Calc the index in drawlist
00288     i = (self.gcomprisBoard.level-1)*self.gcomprisBoard.number_of_sublevel+ \
00289         (self.gcomprisBoard.sublevel-1)
00290 
00291     if(i>=len(self.drawlist)):
00292        # the current board is finished : bail out
00293        gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
00294        return
00295 
00296     self.draw_image_target(self.drawlist[i])
00297 
00298     self.display_sublevel()
00299 
00300     # Prepare an item for the coord display
00301     self.coorditem = self.root_targetitem.add(
00302       gnomecanvas.CanvasText,
00303       font=gcompris.skin.get_font("gcompris/content"),
00304       x=gcompris.BOARD_WIDTH / 2 + 1,
00305       y=gcompris.BOARD_HEIGHT - 10 + 1 ,
00306       fill_color_rgba=0x000000FFL
00307       )
00308     self.coorditem_shadow = self.root_targetitem.add(
00309       gnomecanvas.CanvasText,
00310       font=gcompris.skin.get_font("gcompris/content"),
00311       x=gcompris.BOARD_WIDTH / 2,
00312       y= gcompris.BOARD_HEIGHT - 10,
00313       fill_color_rgba=0xFFFFFFFFL
00314       )
00315 
00316     # Create our rootitem for drawing items
00317     self.root_drawingitem = self.gcomprisBoard.canvas.root().add(
00318       gnomecanvas.CanvasGroup,
00319       x=0.0,
00320       y=0.0
00321       )
00322 
00323     # Reset the drawing
00324     self.current_drawing = []

Here is the call graph for this function:

Here is the caller graph for this function:

def redraw.Gcompris_redraw.display_error (   self,
  target,
  in_target 
)

Definition at line 223 of file redraw.py.

00223 
00224   def display_error(self, target, in_target):
00225 
00226     # Bad Icon Width and Height / 2
00227     icw=8
00228     ich=8
00229 
00230     if self.gcomprisBoard.mode == 'symmetrical' and in_target:
00231       target = self.get_symmetry(target)
00232 
00233     # The images target are always drawn on the drawing area to ease the final comparison
00234     if in_target:
00235       xofset = self.target_area[0] - self.drawing_area[0]
00236     else:
00237       xofset = 0
00238 
00239     for t in target:
00240       if(t.has_key('points')):
00241         self.root_erroritem.add(
00242           gnomecanvas.CanvasPixbuf,
00243           pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("mini_bad.png")),
00244           x = t['points'][0] + (t['points'][2]-t['points'][0])/2 - icw + xofset,
00245           y = t['points'][1] + (t['points'][3]-t['points'][1])/2 -ich
00246           )
00247       else:
00248         self.root_erroritem.add(
00249           gnomecanvas.CanvasPixbuf,
00250           pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("mini_bad.png")),
00251           x = t['x1'] + (t['x2']-t['x1'])/2 -icw + xofset,
00252           y = t['y1'] + (t['y2']-t['y1'])/2 -ich
00253           )
00254 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 343 of file redraw.py.

00343 
00344   def display_sublevel(self):
00345 
00346     self.root_targetitem.add(
00347       gnomecanvas.CanvasText,
00348       text=_("Level") + " " + str(self.gcomprisBoard.sublevel) + "/"
00349       + str(self.gcomprisBoard.number_of_sublevel),
00350       font=gcompris.skin.get_font("gcompris/content"),
00351       x=gcompris.BOARD_WIDTH - 10 + 1,
00352       y=gcompris.BOARD_HEIGHT - 10 + 1,
00353       fill_color_rgba=0x000000FFL,
00354       anchor=gtk.ANCHOR_EAST,
00355       )
00356     self.root_targetitem.add(
00357       gnomecanvas.CanvasText,
00358       text=_("Level") + " " + str(self.gcomprisBoard.sublevel) + "/"
00359       + str(self.gcomprisBoard.number_of_sublevel),
00360       font=gcompris.skin.get_font("gcompris/content"),
00361       x=gcompris.BOARD_WIDTH - 10,
00362       y=gcompris.BOARD_HEIGHT - 10,
00363       fill_color_rgba=0xFFFFFFFFL,
00364       anchor=gtk.ANCHOR_EAST
00365       )

Here is the caller graph for this function:

Definition at line 420 of file redraw.py.

00420 
00421   def draw_colors(self):
00422 
00423     x1=13.0
00424     x2=59.0
00425     y=230.0
00426     stepy=45
00427 
00428     # Display the tools
00429     for i in range(0,len(self.colors)):
00430       if(i%2):
00431         theX = x2
00432       else:
00433         theX = x1
00434 
00435       item = self.rootitem.add(
00436         gnomecanvas.CanvasRect,
00437         fill_color_rgba = self.colors[i],
00438         x1=theX,
00439         y1=y,
00440         x2=theX+30,
00441         y2=y+30,
00442         width_units=0.0,
00443         outline_color_rgba= 0x144B9DFFL
00444         )
00445       item.connect("event", self.color_item_event, i)
00446       if i%2:
00447         y += stepy
00448 
00449     # The last item is the one we select by default
00450     self.current_color = i
00451     self.old_color_item = item
00452     self.old_color_item.set(width_units = 4.0,
00453                             outline_color_rgba= 0x16EC3DFFL)

Here is the call graph for this function:

def redraw.Gcompris_redraw.draw_drawing_area (   self,
  step 
)

Definition at line 470 of file redraw.py.

00470 
00471   def draw_drawing_area(self, step):
00472 
00473     self.current_step = step
00474 
00475     x1=self.drawing_area[0]
00476     y1=self.drawing_area[1]
00477     x2=self.drawing_area[2]
00478     y2=self.drawing_area[3]
00479 
00480     item = self.rootitem.add (
00481       gnomecanvas.CanvasRect,
00482       x1=x1,
00483       y1=y1,
00484       x2=x2,
00485       y2=y2,
00486       fill_color_rgba=0x0099FFFFL,
00487       width_units=2.0,
00488       outline_color_rgba=0x111199FFL
00489       )
00490     item.connect("event", self.create_item_event)
00491 
00492     self.draw_grid(x1,x2,y1,y2,step)
00493 
00494     x1=self.target_area[0]
00495     y1=self.target_area[1]
00496     x2=self.target_area[2]
00497     y2=self.target_area[3]
00498 
00499     item = self.rootitem.add (
00500       gnomecanvas.CanvasRect,
00501       x1=x1,
00502       y1=y1,
00503       x2=x2,
00504       y2=y2,
00505       fill_color_rgba=0x0099FFFFL,
00506       width_units=2.0,
00507       outline_color_rgba=0x111199FFL
00508       )
00509     item.connect("event", self.target_item_event)
00510 
00511     self.draw_grid(x1,x2,y1,y2,step)
00512 
00513     #
00514     # Given coord are returned swapped
00515     # Work fine for rect and ellipse but not line
00516     # so that y2 > y1 and x2 > x1
    #

Here is the call graph for this function:

def redraw.Gcompris_redraw.draw_grid (   self,
  x1,
  x2,
  y1,
  y2,
  step 
)

Definition at line 657 of file redraw.py.

00657 
00658   def draw_grid(self, x1, x2, y1, y2, step):
00659 
00660     # Coord of the written numbers
00661     if(x1<self.target_area[0]):
00662       x_text = x1 - 14
00663     else:
00664       x_text = x2 + 14
00665 
00666     y_text = y1 - 10
00667 
00668     # We manage a 2 colors grid
00669     ci = 0
00670     ca = 0x1D0DFFFFL
00671     cb = 0xAAEEAAFFL
00672 
00673     for i in range(x1,x2,step):
00674       if(ci%2):
00675         color = ca
00676       else:
00677         color = cb
00678       ci += 1
00679 
00680       item = self.rootitem.add (
00681         gnomecanvas.CanvasLine,
00682         points=(i , y1, i , y2),
00683         fill_color_rgba=color,
00684         width_units=1.0,
00685         )
00686       # Shadow for text number
00687       self.rootitem.add (
00688         gnomecanvas.CanvasText,
00689         text=int((i-x1) / step),
00690         font=gcompris.skin.get_font("gcompris/content"),
00691         x=i+1,
00692         y=y_text+1,
00693         fill_color_rgba=0x000000FFL
00694         )
00695       # Text number
00696       self.rootitem.add (
00697         gnomecanvas.CanvasText,
00698         text=int((i-x1) / step),
00699         font=gcompris.skin.get_font("gcompris/content"),
00700         x=i,
00701         y=y_text,
00702         fill_color_rgba=0xFFFFA0FFL
00703         )
00704 
00705       # Clicking on lines let you create object
00706       if(x1<self.target_area[0]):
00707         item.connect("event", self.create_item_event)
00708       else:
00709         item.connect("event", self.target_item_event)
00710 
00711     for i in range(y1,y2,step):
00712       if(ci%2):
00713         color = ca
00714       else:
00715         color = cb
00716       ci += 1
00717 
00718       item = self.rootitem.add (
00719         gnomecanvas.CanvasLine,
00720         points=(x1, i, x2 , i),
00721         fill_color_rgba=color,
00722         width_units=1.0,
00723         )
00724       # Shadow for text number
00725       self.rootitem.add (
00726         gnomecanvas.CanvasText,
00727         text=int((i-y1) / step),
00728         font=gcompris.skin.get_font("gcompris/content"),
00729         x=x_text+1,
00730         y=i+1,
00731         fill_color_rgba=0x000000FFL
00732         )
00733       # Text number
00734       self.rootitem.add (
00735         gnomecanvas.CanvasText,
00736         text=int((i-y1) / step),
00737         font=gcompris.skin.get_font("gcompris/content"),
00738         x=x_text,
00739         y=i,
00740         fill_color_rgba=0xFFFFA0FFL
00741         )
00742 
00743       # Clicking on lines let you create object
00744       if(x1<self.target_area[0]):
00745         item.connect("event", self.create_item_event)

Here is the call graph for this function:

Here is the caller graph for this function:

def redraw.Gcompris_redraw.draw_image_target (   self,
  drawing 
)

Definition at line 576 of file redraw.py.

00576 
00577   def draw_image_target(self, drawing):
00578 
00579     # Save the drawing in image_target for future comparison
00580     self.image_target = drawing
00581 
00582     # Create our rootitem for target items
00583     self.root_targetitem = self.gcomprisBoard.canvas.root().add(
00584       gnomecanvas.CanvasGroup,
00585       x=0.0,
00586       y=0.0
00587       )
00588 
00589     if self.gcomprisBoard.mode == 'symmetrical':
00590       drawing = self.get_symmetry(drawing)
00591 
00592     # The images target are always drawn on the drawing area to ease the final comparison
00593     xofset = self.target_area[0] - self.drawing_area[0]
00594     for i in drawing:
00595       #
00596       # Can specify the item type to draw via a real GTK type or a TOOL string
00597       if(i.has_key('type')):
00598         item = self.root_targetitem.add ( i['type'] )
00599         item.connect("event", self.target_item_event)
00600 
00601       elif(i.has_key('tool')):
00602         if(i['tool'] == "RECT"):
00603           item = self.root_targetitem.add ( gnomecanvas.CanvasRect )
00604         elif(i['tool'] == "FILL_RECT"):
00605           item = self.root_targetitem.add ( gnomecanvas.CanvasRect )
00606         elif(i['tool'] == "CIRCLE"):
00607           item = self.root_targetitem.add ( gnomecanvas.CanvasEllipse )
00608         elif(i['tool'] == "FILL_CIRCLE"):
00609           item = self.root_targetitem.add ( gnomecanvas.CanvasEllipse )
00610         elif(i['tool'] == "LINE"):
00611           item = self.root_targetitem.add ( gnomecanvas.CanvasLine )
00612         else:
00613           print ("ERROR: incorrect type in draw_image_target", i)
00614         item.connect("event", self.target_item_event)
00615 
00616       for k, v in i.items():
00617         if k == 'fill_color' :
00618           item.set ( fill_color = v )
00619         elif k == 'fill_color_rgba' :
00620           item.set ( fill_color_rgba = v )
00621         elif k == 'height' :
00622           item.set ( height = v )
00623         elif k == 'height_set' :
00624           item.set ( height_set = v )
00625         elif k == 'outline_color' :
00626           item.set ( outline_color = v )
00627         elif k == 'outline_color_rgba' :
00628           item.set ( outline_color_rgba = v )
00629         elif k == 'points' :
00630           v2 = (v[0]+xofset, v[1], v[2]+xofset, v[3])
00631           item.set ( points = v2)
00632         elif k == 'width_units' :
00633           item.set ( width_units = v )
00634         elif k == 'width_pixels' :
00635           item.set ( width_pixels = v )
00636         elif k == 'width' :
00637           v[0] += xofset
00638           v[2] += xofset
00639           item.set ( width = v )
00640         elif k == 'width_set' :
00641           item.set ( width_set = v )
00642         elif k == 'x' :
00643           item.set ( x = v + xofset)
00644         elif k == 'y' :
00645           item.set ( y = v)
00646         elif k == 'x1' :
00647           item.set ( x1 = v + xofset)
00648         elif k == 'y1' :
00649           item.set ( y1 = v)
00650         elif k == 'x2' :
00651           item.set ( x2 = v + xofset)
00652         elif k == 'y2' :
00653           item.set ( y2 = v)

Here is the caller graph for this function:

Definition at line 367 of file redraw.py.

00367 
00368   def draw_tools(self):
00369 
00370     self.rootitem.add(
00371       gnomecanvas.CanvasPixbuf,
00372       pixbuf = gcompris.utils.load_pixmap("draw/little-tool-selector.png"),
00373       x=5,
00374       y=20.0,
00375       width=30.0
00376       )
00377 
00378     x1=11.0
00379     x2=56.0
00380     y=30.0
00381     stepy=45
00382 
00383     # Display the tools
00384     for i in range(0,len(self.tools)):
00385       if(i%2):
00386         theX = x2
00387       else:
00388         theX = x1
00389 
00390       item = self.rootitem.add(
00391         gnomecanvas.CanvasPixbuf,
00392         pixbuf = gcompris.utils.load_pixmap(self.tools[i][1]),
00393         x=theX,
00394         y=y
00395         )
00396       item.connect("event", self.tool_item_event, i)
00397       if i%2:
00398         y += stepy
00399 
00400     # The last item is select, we select it by default
00401     self.current_tool = i
00402     self.old_tool_item = item
00403     self.old_tool_item.set(pixbuf = gcompris.utils.load_pixmap(self.tools[i][2]))
00404     gcompris.set_cursor(self.tools[i][3]);
00405 

Here is the call graph for this function:

Definition at line 139 of file redraw.py.

00139 
00140   def end(self):
00141     # Remove the root item removes all the others inside it
00142     gcompris.set_cursor(gcompris.CURSOR_DEFAULT);
00143     self.rootitem.destroy()
00144     self.root_drawingitem.destroy()
00145     self.root_targetitem.destroy()
00146     # Delete error previous mark if any
00147     if(self.root_erroritem):
00148       self.root_erroritem.destroy()
00149 
00150 

Definition at line 275 of file redraw.py.

00275 
00276   def erase_drawing_area(self):
00277     self.root_targetitem.destroy()
00278     self.root_drawingitem.destroy()
00279     if(self.root_erroritem):
00280       self.root_erroritem.destroy()

Here is the caller graph for this function:

def redraw.Gcompris_redraw.fillin_item_event (   self,
  item,
  event,
  drawing_item_index 
)

Definition at line 842 of file redraw.py.

00842 
00843   def fillin_item_event(self, item, event, drawing_item_index):
00844     if event.type == gtk.gdk.BUTTON_PRESS:
00845       if event.button == 1:
00846         if self.tools[self.current_tool][0] == "FILL":
00847           item.set(fill_color_rgba=self.colors[self.current_color])
00848           # Reset the item to our list
00849           self.current_drawing[drawing_item_index]['fill_color_rgba'] = self.colors[self.current_color]
00850           return True
00851     return False

def redraw.Gcompris_redraw.fillout_item_event (   self,
  item,
  event,
  drawing_item_index 
)

Definition at line 853 of file redraw.py.

00853 
00854   def fillout_item_event(self, item, event, drawing_item_index):
00855     if event.type == gtk.gdk.BUTTON_PRESS:
00856       if event.button == 1:
00857         if self.tools[self.current_tool][0] == "FILL":
00858           item.set(outline_color_rgba=self.colors[self.current_color])
00859           # Reset the item to our list
00860           self.current_drawing[drawing_item_index]['outline_color_rgba'] = self.colors[self.current_color]
00861           return True
00862     return False

def redraw.Gcompris_redraw.get_symmetry (   self,
  drawing_source 
)

Definition at line 531 of file redraw.py.

00531 
00532   def get_symmetry(self, drawing_source):
00533     # Make a deepcopy of the list
00534     drawing  = copy.deepcopy(drawing_source)
00535 
00536     xofset = 0
00537 
00538     for item in drawing:
00539 
00540       for k, v in item.items():
00541 
00542         if k == 'points' :
00543           if self.gcomprisBoard.mode == 'normal':
00544             v2 = (v[0]+xofset, v[1], v[2]+xofset, v[3])
00545           else:
00546             # Symmetrical view
00547             v2 = (self.drawing_area[2] - (v[0] - self.drawing_area[0])+xofset, v[1],
00548                   self.drawing_area[2] - (v[2] - self.drawing_area[0])+xofset, v[3])
00549           item[k] = v2
00550 
00551         elif k == 'x' :
00552           if self.gcomprisBoard.mode == 'normal':
00553             item[k] = v + xofset
00554           else:
00555             # Symmetrical view
00556             item[k] = self.drawing_area[2] - (v - self.drawing_area[0])  + xofset
00557 
00558         elif k == 'x1' :
00559           if self.gcomprisBoard.mode == 'normal':
00560             item[k] = v + xofset
00561           else:
00562             # Symmetrical view
00563             item[k] = self.drawing_area[2] - (v - self.drawing_area[0])  + xofset
00564 
00565         elif k == 'x2' :
00566           if self.gcomprisBoard.mode == 'normal':
00567             item[k] = v + xofset
00568           else:
00569             # Symmetrical view
00570             item[k] = self.drawing_area[2] - (v - self.drawing_area[0])  + xofset
00571 
00572     return drawing

Here is the caller graph for this function:

Definition at line 328 of file redraw.py.

00328 
00329   def increment_level(self):
00330     self.gcomprisBoard.sublevel += 1
00331 
00332     if(self.gcomprisBoard.sublevel>self.gcomprisBoard.number_of_sublevel):
00333       # Try the next level
00334       self.gcomprisBoard.sublevel=1
00335       self.gcomprisBoard.level += 1
00336       if(self.gcomprisBoard.level>self.gcomprisBoard.maxlevel) or self.gcomprisBoard.level*self.gcomprisBoard.sublevel>=len(self.drawlist):
00337         # the current board is finished : bail out
00338         gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
00339         return 0
00340 
00341     return 1

Here is the caller graph for this function:

Definition at line 1164 of file redraw.py.

01164 
01165   def init_item_list(self):
01166 
01167     if self.gcomprisBoard.mode == 'normal':
01168       self.drawlist = \
01169                     [
01170         # Two stripes
01171       [{'x2': 420.0, 'width_units': 1.0, 'y2': 100.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 80.0, 'tool': 'FILL_RECT', 'x1': 140.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 440.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 420.0, 'tool': 'FILL_RECT', 'x1': 140.0}]
01172       ,
01173       # Top centered box
01174       [{'x2': 360.0, 'y2': 80.0, 'width_units': 1.0, 'fill_color_rgba': 4042322175L, 'outline_color_rgba': 255L, 'y1': 40.0, 'x1': 200.0, 'tool': 'FILL_RECT'}]
01175       ,
01176       # 4 small corners
01177       [{'x2': 200.0, 'y2': 80.0,  'width_units': 1.0,'fill_color_rgba': 4042322175L, 'outline_color_rgba': 255L, 'y1': 40.0, 'x1': 160.0, 'tool': 'FILL_RECT'},
01178        {'x2': 400.0, 'y2': 80.0,  'width_units': 1.0,'fill_color_rgba': 4042322175L, 'outline_color_rgba': 255L, 'y1': 40.0, 'x1': 360.0, 'tool': 'FILL_RECT'},
01179        {'x2': 200.0, 'y2': 480.0, 'width_units': 1.0, 'fill_color_rgba': 4042322175L, 'outline_color_rgba': 255L, 'y1': 440.0, 'x1': 160.0, 'tool': 'FILL_RECT'},
01180        {'x2': 400.0, 'y2': 480.0,  'width_units': 1.0,'fill_color_rgba': 4042322175L, 'outline_color_rgba': 255L, 'y1': 440.0, 'x1': 360.0, 'tool': 'FILL_RECT'}]
01181       ,
01182       # 4 non filled Rects organised in rect and shifted
01183       [{'x2': 200.0, 'y2': 360.0, 'outline_color_rgba': 4042322175L, 'width_units': 4.0, 'y1': 200.0, 'x1': 180.0, 'tool': 'RECT'},
01184        {'x2': 340.0, 'y2': 400.0, 'outline_color_rgba': 4042322175L, 'width_units': 4.0, 'y1':380.0, 'x1': 180.0, 'tool': 'RECT'},
01185        {'x2': 380.0, 'y2': 400.0, 'outline_color_rgba': 4042322175L, 'width_units': 4.0, 'y1': 240.0, 'x1': 360.0, 'tool': 'RECT'},
01186        {'x2': 380.0, 'y2': 220.0, 'outline_color_rgba': 4042322175L, 'width_units': 4.0, 'y1': 200.0, 'x1': 220.0, 'tool': 'RECT'}]
01187       ,
01188       # Letter A
01189       [{'tool': 'LINE', 'points': (200.0, 120.0, 280.0, 120.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (280.0, 120.0, 280.0,240.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (200.0, 120.0, 200.0, 240.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (200.0, 180.0, 280.0, 180.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}]
01190       ,
01191       # Letter B
01192       [{'tool': 'LINE', 'points': (240.0, 240.0, 320.0, 240.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (300.0, 180.0, 320.0,200.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (300.0, 180.0, 320.0, 160.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (240.0, 180.0, 300.0, 180.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (320.0, 100.0, 320.0, 160.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool':'LINE', 'points': (240.0, 100.0, 320.0, 100.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (240.0, 100.0, 240.0, 240.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (320.0, 200.0, 320.0, 240.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}]
01193       ,
01194       # A door
01195       [{'x2': 360.0, 'y2': 360.0, 'outline_color_rgba': 4042322175L, 'width_units': 4.0, 'y1': 180.0, 'x1': 200.0, 'tool': 'RECT'},
01196        {'x2': 340.0, 'y2': 320.0, 'width_units': 1.0, 'fill_color_rgba': 4042322175L, 'outline_color_rgba': 255L, 'y1': 280.0, 'x1': 300.0, 'tool': 'FILL_CIRCLE'},
01197        {'x2': 320.0, 'y2': 260.0, 'width_units': 1.0, 'fill_color_rgba': 4042322175L, 'outline_color_rgba': 255L, 'y1': 200.0, 'x1': 240.0, 'tool': 'FILL_RECT'}]
01198       ,
01199       # A top left kind of target
01200       [{'x2': 260.0, 'y2': 140.0, 'outline_color_rgba': 4042322175L, 'y1': 40.0, 'x1': 160.0, 'tool': 'CIRCLE', 'width_units': 5.0},
01201        {'x2': 240.0, 'y2': 120.0, 'width_units': 1.0, 'fill_color_rgba': 4042322175L, 'outline_color_rgba': 255L, 'y1': 60.0, 'x1': 180.0, 'tool': 'FILL_CIRCLE'}]
01202       ,
01203       # 4 Huge Diagonal lines
01204       [{'tool': 'LINE', 'points': (140.0, 260.0, 260.0, 20.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (140.0, 260.0, 260.0, 500.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (260.0, 500.0, 420.0, 260.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (260.0, 20.0, 420.0, 260.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}]
01205       ,
01206       # Balloon
01207       [{'tool': 'LINE', 'points': (220.0, 240.0, 220.0, 340.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'x2': 260.0, 'width_units': 1.0, 'y2': 240.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 140.0, 'tool': 'FILL_CIRCLE', 'x1': 180.0}, {'x2': 380.0, 'width_units': 1.0, 'y2': 180.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4283674623L, 'y1': 80.0, 'tool': 'FILL_CIRCLE', 'x1': 300.0}, {'tool': 'LINE', 'points': (340.0, 180.0, 340.0, 280.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}]
01208       ,
01209       # Watch
01210       [{'x2': 380.0, 'y2': 340.0, 'outline_color_rgba': 4042322175L, 'width_units': 5.0, 'y1': 140.0, 'tool': 'CIRCLE', 'x1': 180.0}, {'tool': 'LINE', 'points': (280.0, 160.0, 280.0, 240.0), 'width_units': 8.0, 'fill_color_rgba': 3992977663L}, {'tool': 'LINE', 'points': (280.0, 240.0, 320.0, 200.0), 'width_units': 8.0, 'fill_color_rgba': 352271359L}, {'tool': 'LINE', 'points': (220.0, 280.0, 280.0, 240.0), 'width_units': 8.0, 'fill_color_rgba': 4294905087L}]
01211       ,
01212       # Colored pyramid
01213       [{'x2': 280.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 100.0, 'tool': 'FILL_RECT', 'x1': 260.0}, {'x2': 300.0, 'width_units': 1.0, 'y2': 140.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4294905087L, 'y1': 120.0, 'tool': 'FILL_RECT', 'x1': 240.0}, {'x2': 320.0, 'width_units': 1.0, 'y2': 160.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 140.0, 'tool': 'FILL_RECT', 'x1': 220.0}, {'x2': 340.0, 'width_units': 1.0, 'y2': 180.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4283674623L, 'y1': 160.0, 'tool': 'FILL_RECT', 'x1': 200.0}, {'x2': 360.0, 'width_units': 1.0, 'y2': 200.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 1717987071L, 'y1': 180.0, 'tool': 'FILL_RECT', 'x1': 180.0}]
01214       ,
01215       # Colored Rectangle bigger and bigger
01216       [{'x2': 180.0, 'width_units': 1.0, 'y2': 60.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4283674623L, 'y1': 20.0, 'tool': 'FILL_RECT', 'x1': 140.0}, {'x2': 240.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 60.0, 'tool': 'FILL_RECT', 'x1': 180.0}, {'x2': 320.0, 'width_units': 1.0, 'y2': 200.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4294905087L, 'y1': 120.0, 'tool': 'FILL_RECT', 'x1': 240.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 300.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 200.0, 'tool': 'FILL_RECT', 'x1': 320.0}]
01217       ,
01218       # Tree
01219       [{'x2': 420.0, 'width_units': 1.0, 'y2': 500.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2085298687L, 'y1': 460.0, 'tool': 'FILL_RECT', 'x1': 140.0}, {'x2': 260.0, 'width_units': 1.0, 'y2': 460.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 360.0, 'tool': 'FILL_RECT', 'x1': 240.0}, {'x2': 320.0, 'width_units': 1.0, 'y2': 360.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 280.0, 'tool': 'FILL_CIRCLE', 'x1': 180.0}]
01220       ,
01221       # bipbip (big non flying bird)
01222       [{'x2': 280.0, 'width_units': 1.0, 'y2': 320.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 120.0, 'tool': 'FILL_RECT', 'x1': 260.0}, {'x2': 300.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 80.0, 'tool': 'FILL_RECT', 'x1': 260.0}, {'x2': 320.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 100.0, 'tool': 'FILL_RECT', 'x1': 300.0}, {'x2': 280.0, 'width_units': 1.0, 'y2': 380.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 320.0, 'tool': 'FILL_RECT', 'x1': 200.0}, {'x2': 220.0, 'width_units': 1.0, 'y2': 320.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 300.0, 'tool': 'FILL_RECT', 'x1': 200.0}, {'x2': 260.0, 'width_units': 1.0, 'y2': 460.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 380.0, 'tool': 'FILL_RECT', 'x1': 240.0}, {'x2': 280.0, 'width_units': 1.0, 'y2': 460.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 440.0, 'tool': 'FILL_RECT', 'x1': 260.0}]
01223       ,
01224       # Dog
01225       [{'x2': 180.0, 'width_units': 1.0, 'y2': 200.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 180.0, 'tool': 'FILL_RECT', 'x1': 160.0}, {'x2': 340.0, 'width_units': 1.0, 'y2': 240.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 200.0, 'tool': 'FILL_RECT', 'x1': 180.0}, {'x2': 200.0, 'width_units': 1.0, 'y2': 280.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 240.0, 'tool': 'FILL_RECT', 'x1': 180.0}, {'x2': 340.0,'width_units': 1.0, 'y2': 280.0, 'outline_color_rgba': 255L, 'fill_color_rgba':2199425535L, 'y1': 240.0, 'tool': 'FILL_RECT', 'x1': 320.0}, {'x2': 380.0, 'width_units': 1.0, 'y2': 200.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 160.0, 'tool': 'FILL_RECT', 'x1': 320.0}]
01226       ,
01227       # Fish
01228       [{'x2': 360.0, 'width_units': 1.0, 'y2': 280.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4294905087L, 'y1': 160.0, 'tool': 'FILL_CIRCLE', 'x1': 180.0}, {'x2': 340.0, 'width_units': 1.0, 'y2': 220.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 200.0, 'tool': 'FILL_CIRCLE', 'x1': 320.0}, {'x2': 180.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4294905087L, 'y1': 180.0, 'tool': 'FILL_RECT', 'x1': 160.0}]
01229       ,
01230       # Balloon (human)
01231       [{'x2': 380.0, 'width_units': 1.0, 'y2': 300.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 100.0, 'tool': 'FILL_CIRCLE', 'x1': 200.0}, {'x2': 340.0, 'width_units': 1.0, 'y2': 380.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4294905087L, 'y1': 320.0, 'tool': 'FILL_RECT', 'x1': 240.0}, {'tool': 'LINE', 'points': (220.0, 260.0, 260.0, 320.0), 'width_units': 8.0, 'fill_color_rgba': 4287383039L}, {'tool': 'LINE', 'points': (320.0, 320.0, 360.0, 260.0),
01232 'width_units': 8.0, 'fill_color_rgba': 4287383039L}]
01233       ,
01234       # House
01235       [{'x2': 360.0, 'width_units': 1.0, 'y2': 340.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 240.0, 'tool': 'FILL_RECT', 'x1': 200.0}, {'x2': 280.0, 'width_units': 1.0, 'y2': 340.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 280.0, 'tool': 'FILL_RECT', 'x1': 240.0}, {'x2': 340.0, 'width_units': 1.0, 'y2': 300.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 260.0, 'tool': 'FILL_RECT', 'x1': 300.0}, {'tool': 'LINE', 'points': (200.0, 240.0, 280.0, 160.0), 'width_units': 8.0, 'fill_color_rgba': 4287383039L}, {'tool': 'LINE', 'points': (280.0, 160.0, 360.0, 240.0), 'width_units': 8.0, 'fill_color_rgba': 4287383039L}]
01236       ,
01237       # Truck
01238       [{'x2': 220.0, 'width_units': 1.0, 'y2': 280.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 240.0, 'tool': 'FILL_CIRCLE', 'x1': 180.0}, {'x2': 320.0, 'width_units': 1.0, 'y2': 280.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 240.0, 'tool': 'FILL_CIRCLE', 'x1': 280.0}, {'x2': 220.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 220.0, 'tool': 'FILL_RECT', 'x1': 160.0}, {'x2': 300.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 180.0, 'tool': 'FILL_RECT', 'x1': 220.0}, {'x2': 320.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 220.0, 'tool': 'FILL_RECT', 'x1': 300.0}, {'x2': 280.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 200.0, 'tool': 'FILL_RECT', 'x1': 240.0}]
01239       ,
01240       # Fire truck
01241       [{'x2': 200.0, 'width_units': 1.0, 'y2': 300.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 260.0, 'tool': 'FILL_CIRCLE', 'x1': 160.0}, {'x2': 360.0, 'width_units': 1.0, 'y2': 300.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 260.0, 'tool': 'FILL_CIRCLE', 'x1': 320.0}, {'x2': 380.0, 'width_units': 1.0, 'y2': 280.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 220.0, 'tool': 'FILL_RECT', 'x1': 160.0}, {'tool': 'LINE', 'points': (160.0, 200.0, 340.0, 180.0), 'width_units': 8.0, 'fill_color_rgba': 3992977663L}, {'x2': 200.0, 'width_units': 1.0, 'y2': 220.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 200.0, 'tool': 'FILL_RECT', 'x1': 180.0}, {'x2': 360.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 220.0, 'tool': 'FILL_RECT', 'x1': 320.0}, {'x2': 300.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 220.0, 'tool': 'FILL_RECT', 'x1': 280.0}]
01242       ,
01243       # Billard
01244       [
01245         {'width_units': 8.0, 'points': (180.0, 80.0, 180.0, 440.0), 'tool': 'LINE', 'fill_color_rgba': 4042322175L},
01246         {'width_units': 8.0, 'points': (180.0, 460.0, 380.0, 460.0), 'tool': 'LINE', 'fill_color_rgba': 4042322175L},
01247         {'width_units': 8.0, 'points': (380.0, 80.0, 380.0, 440.0), 'tool': 'LINE', 'fill_color_rgba': 4042322175L},
01248         {'width_units': 8.0, 'points': (180.0, 60.0, 380.0, 60.0), 'tool': 'LINE', 'fill_color_rgba': 4042322175L},
01249         {'width_units': 8.0, 'points': (280.0, 320.0, 280.0, 420.0), 'tool': 'LINE', 'fill_color_rgba': 2199425535L},
01250         {'x2': 280.0, 'width_units': 1.0, 'y2': 320.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 300.0, 'x1': 260.0, 'tool': 'FILL_CIRCLE'},
01251         {'x2': 260.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 100.0, 'x1': 240.0, 'tool': 'FILL_CIRCLE'},
01252         {'x2': 280.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 100.0, 'x1': 260.0, 'tool': 'FILL_CIRCLE'},
01253         {'x2': 300.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 100.0, 'x1': 280.0, 'tool': 'FILL_CIRCLE'},
01254         {'x2': 320.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2085298687L, 'y1': 100.0, 'x1': 300.0, 'tool': 'FILL_CIRCLE'},
01255         {'x2': 280.0, 'width_units': 1.0, 'y2': 140.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3116109311L, 'y1': 120.0, 'x1': 260.0, 'tool': 'FILL_CIRCLE'},
01256         {'x2': 300.0, 'width_units': 1.0, 'y2': 140.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 120.0, 'x1': 280.0, 'tool': 'FILL_CIRCLE'}
01257         ]
01258       ,
01259       # Clara (my daughter)
01260       [{'x2': 240.0, 'width_units': 1.0, 'y2': 480.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 400.0, 'x1': 220.0, 'tool': 'FILL_RECT'}, {'x2': 320.0, 'width_units': 1.0, 'y2': 480.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 400.0, 'x1': 300.0, 'tool': 'FILL_RECT'}, {'x2': 220.0, 'width_units': 1.0, 'y2': 200.0,'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 180.0, 'x1': 160.0, 'tool': 'FILL_RECT'}, {'x2': 380.0, 'width_units': 1.0, 'y2': 200.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 180.0, 'x1': 320.0, 'tool': 'FILL_RECT'}, {'x2': 380.0, 'width_units': 1.0, 'y2': 180.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 120.0, 'x1': 360.0, 'tool': 'FILL_RECT'}, {'x2': 180.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 200.0, 'x1': 160.0, 'tool': 'FILL_RECT'}, {'x2': 320.0, 'width_units': 1.0, 'y2': 160.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 60.0, 'x1': 220.0, 'tool': 'FILL_CIRCLE'}, {'x2': 260.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2768221183L, 'y1': 100.0, 'x1': 240.0, 'tool': 'FILL_CIRCLE'}, {'x2': 300.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2768221183L, 'y1': 100.0, 'x1': 280.0, 'tool': 'FILL_CIRCLE'}, {'width_units': 8.0, 'points': (260.0, 140.0, 280.0, 140.0), 'tool': 'LINE', 'fill_color_rgba': 3992977663L}, {'x2': 300.0, 'width_units': 1.0, 'y2': 180.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 160.0, 'x1': 240.0, 'tool': 'FILL_RECT'}, {'x2': 320.0, 'width_units': 1.0, 'y2': 320.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4283674623L, 'y1': 180.0, 'x1': 220.0, 'tool': 'FILL_RECT'}, {'x2': 340.0, 'width_units': 1.0, 'y2': 400.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4283674623L, 'y1': 320.0, 'x1': 200.0, 'tool': 'FILL_RECT'}]
01261       ,
01262       # Bicycle
01263       [{'x2': 240.0, 'y2': 340.0, 'outline_color_rgba': 4287383039L, 'width_units': 5.0, 'y1': 260.0, 'tool': 'CIRCLE', 'x1': 160.0}, {'x2': 400.0, 'y2': 340.0, 'outline_color_rgba': 4287383039L, 'width_units': 5.0, 'y1': 260.0, 'tool': 'CIRCLE', 'x1': 320.0}, {'tool': 'LINE', 'points': (200.0, 300.0, 280.0, 300.0), 'width_units': 8.0, 'fill_color_rgba': 3992977663L}, {'tool': 'LINE', 'points': (280.0,300.0, 340.0, 240.0), 'width_units': 8.0, 'fill_color_rgba': 3992977663L}, {'tool': 'LINE', 'points': (240.0, 240.0, 340.0, 240.0), 'width_units': 8.0, 'fill_color_rgba': 3992977663L}, {'tool': 'LINE', 'points': (200.0, 300.0, 240.0, 240.0), 'width_units': 8.0, 'fill_color_rgba': 3992977663L}, {'tool': 'LINE', 'points': (240.0, 220.0, 240.0, 240.0), 'width_units': 8.0, 'fill_color_rgba': 2199425535L}, {'tool': 'LINE', 'points': (220.0, 220.0, 260.0, 220.0), 'width_units': 8.0, 'fill_color_rgba': 2199425535L}, {'tool': 'LINE', 'points': (340.0, 200.0, 340.0, 240.0), 'width_units': 8.0, 'fill_color_rgba': 2199425535L}, {'tool': 'LINE', 'points': (320.0, 200.0, 340.0, 200.0), 'width_units': 8.0, 'fill_color_rgba': 2199425535L}, {'tool': 'LINE', 'points': (340.0, 240.0, 360.0, 300.0), 'width_units': 8.0, 'fill_color_rgba': 3992977663L}]
01264       ,
01265       # Sea boat and sun
01266       [{'x2': 420.0, 'width_units': 1.0, 'y2': 500.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2768221183L, 'y1': 420.0, 'tool': 'FILL_RECT', 'x1': 140.0}, {'x2': 260.0, 'width_units': 1.0, 'y2': 160.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4294905087L, 'y1': 60.0, 'tool': 'FILL_CIRCLE', 'x1': 160.0}, {'x2': 360.0, 'width_units': 1.0, 'y2': 200.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 160.0, 'tool': 'FILL_CIRCLE', 'x1': 260.0}, {'x2': 360.0, 'width_units': 1.0, 'y2': 220.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 200.0, 'tool': 'FILL_CIRCLE', 'x1': 300.0}, {'x2': 400.0,'width_units': 1.0, 'y2': 160.0, 'outline_color_rgba': 255L, 'fill_color_rgba':4042322175L, 'y1': 140.0, 'tool': 'FILL_CIRCLE', 'x1': 360.0}, {'tool': 'LINE','points': (220.0, 400.0, 240.0, 420.0), 'width_units': 8.0, 'fill_color_rgba': 3992977663L}, {'tool': 'LINE', 'points': (240.0, 420.0, 280.0, 420.0), 'width_units': 8.0, 'fill_color_rgba': 3992977663L}, {'tool': 'LINE', 'points': (280.0, 420.0, 300.0, 400.0), 'width_units': 8.0, 'fill_color_rgba': 3992977663L}, {'tool': 'LINE', 'points': (220.0, 400.0, 300.0, 400.0), 'width_units': 8.0, 'fill_color_rgba': 3992977663L}, {'tool': 'LINE', 'points': (260.0, 280.0, 260.0, 400.0),'width_units': 8.0, 'fill_color_rgba': 3992977663L}, {'tool': 'LINE', 'points':(260.0, 280.0, 300.0, 380.0), 'width_units': 8.0, 'fill_color_rgba': 2199425535L}, {'tool': 'LINE', 'points': (260.0, 380.0, 300.0, 380.0), 'width_units': 8.0,'fill_color_rgba': 2199425535L}]
01267 
01268       ]
01269     else:
01270       # Symmetrical items
01271       self.drawlist = \
01272       [
01273         # 3 white box in triangle
01274         [{'x2': 420.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 220.0, 'tool': 'FILL_RECT', 'x1': 380.0}, {'x2': 380.0, 'width_units': 1.0, 'y2': 220.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 180.0, 'tool': 'FILL_RECT', 'x1': 340.0}, {'x2': 380.0, 'width_units': 1.0, 'y2': 300.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 260.0, 'tool': 'FILL_RECT', 'x1': 340.0}]
01275         ,
01276         # Colored pyramid
01277         [{'x2': 420.0, 'width_units': 1.0, 'y2': 460.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 1717987071L, 'y1': 420.0, 'tool': 'FILL_RECT', 'x1': 140.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 420.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4283674623L, 'y1': 380.0, 'tool': 'FILL_RECT', 'x1': 180.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 380.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 340.0, 'tool': 'FILL_RECT', 'x1': 220.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 340.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4294905087L, 'y1': 300.0, 'tool': 'FILL_RECT', 'x1': 260.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 300.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 260.0, 'tool': 'FILL_RECT', 'x1': 300.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 707406591L, 'y1': 220.0, 'tool': 'FILL_RECT', 'x1': 340.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 220.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2085298687L, 'y1': 180.0, 'tool': 'FILL_RECT', 'x1': 380.0}]
01278         ,
01279         # Butterfly
01280         [{'x2': 420.0, 'width_units': 1.0, 'y2': 380.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4294905087L, 'y1': 180.0, 'tool': 'FILL_RECT', 'x1': 380.0}, {'tool': 'LINE', 'points': (360.0, 80.0, 400.0, 180.0), 'width_units': 8.0, 'fill_color_rgba': 707406591L}, {'x2': 380.0, 'width_units': 1.0, 'y2': 440.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 100.0, 'tool': 'FILL_CIRCLE', 'x1': 180.0}, {'x2': 360.0, 'width_units': 1.0, 'y2': 380.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 180.0, 'tool': 'FILL_CIRCLE', 'x1': 260.0}]
01281         ,
01282         # Robot
01283         [{'x2': 420.0, 'width_units': 1.0, 'y2': 360.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 160.0, 'tool': 'FILL_RECT', 'x1': 340.0}, {'x2': 380.0, 'width_units': 1.0, 'y2': 500.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 360.0, 'tool': 'FILL_RECT', 'x1': 340.0}, {'x2': 340.0, 'width_units': 1.0, 'y2': 200.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 160.0, 'tool': 'FILL_RECT', 'x1': 260.0}, {'x2': 300.0, 'width_units': 1.0, 'y2': 280.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 200.0, 'tool': 'FILL_RECT', 'x1': 260.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 160.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 140.0, 'tool': 'FILL_RECT', 'x1': 380.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 140.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2768221183L, 'y1': 60.0, 'tool': 'FILL_RECT', 'x1': 360.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3116109311L, 'y1': 100.0, 'tool': 'FILL_RECT', 'x1': 400.0}, {'x2': 400.0, 'width_units': 1.0, 'y2': 100.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4283674623L, 'y1': 80.0, 'tool': 'FILL_CIRCLE', 'x1': 380.0}]
01284         ,
01285         # Arrow
01286         [{'x2': 420.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 240.0, 'tool': 'FILL_RECT', 'x1': 300.0}, {'tool': 'LINE', 'points': (180.0, 240.0, 300.0, 140.0), 'width_units': 8.0, 'fill_color_rgba': 4287383039L}, {'tool': 'LINE', 'points': (180.0, 240.0, 180.0, 260.0), 'width_units': 8.0, 'fill_color_rgba': 4287383039L}, {'tool': 'LINE', 'points': (180.0, 260.0, 300.0, 360.0), 'width_units': 8.0, 'fill_color_rgba': 4287383039L}, {'tool': 'LINE', 'points': (300.0, 140.0, 300.0, 360.0), 'width_units': 8.0, 'fill_color_rgba': 4287383039L}]
01287         ,
01288         # House
01289         [{'x2': 420.0, 'width_units': 1.0, 'y2': 460.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 440.0, 'tool': 'FILL_RECT', 'x1': 200.0}, {'x2': 220.0, 'width_units': 1.0, 'y2': 440.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 280.0, 'tool': 'FILL_RECT', 'x1': 200.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 280.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 260.0, 'tool': 'FILL_RECT', 'x1': 200.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 440.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 360.0, 'tool': 'FILL_RECT', 'x1': 380.0}, {'x2': 360.0, 'width_units': 1.0, 'y2': 400.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4294905087L, 'y1': 300.0, 'tool': 'FILL_RECT', 'x1': 240.0}, {'tool': 'LINE', 'points': (200.0, 260.0, 420.0, 100.0), 'width_units': 8.0, 'fill_color_rgba': 4294905087L}]
01290         ,
01291         # Plane
01292         [{'x2': 420.0, 'width_units': 1.0, 'y2': 380.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 140.0, 'tool': 'FILL_RECT', 'x1': 360.0}, {'x2': 360.0, 'width_units': 1.0, 'y2': 280.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 220.0, 'tool': 'FILL_RECT', 'x1': 180.0}, {'x2': 260.0, 'width_units': 1.0, 'y2': 220.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 707406591L, 'y1': 200.0, 'tool': 'FILL_RECT', 'x1': 240.0}, {'tool': 'LINE', 'points': (180.0, 200.0, 320.0, 200.0), 'width_units': 8.0, 'fill_color_rgba': 4283674623L}, {'x2': 420.0, 'width_units': 1.0, 'y2': 420.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 360.0, 'tool': 'FILL_RECT', 'x1': 400.0}, {'x2': 420.0, 'width_units': 1.0, 'y2': 180.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 160.0, 'tool': 'FILL_RECT', 'x1': 380.0}]
01293         ,
01294         # bipbip (big non flying bird)
01295         [{'x2': 280.0, 'width_units': 1.0, 'y2': 320.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 120.0, 'tool': 'FILL_RECT', 'x1': 260.0}, {'x2': 300.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 80.0, 'tool': 'FILL_RECT', 'x1': 260.0}, {'x2': 320.0, 'width_units': 1.0, 'y2': 120.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 100.0, 'tool': 'FILL_RECT', 'x1': 300.0}, {'x2': 280.0, 'width_units': 1.0, 'y2': 380.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 320.0, 'tool': 'FILL_RECT', 'x1': 200.0}, {'x2': 220.0, 'width_units': 1.0, 'y2': 320.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 300.0, 'tool': 'FILL_RECT', 'x1': 200.0}, {'x2': 260.0, 'width_units': 1.0, 'y2': 460.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 380.0, 'tool': 'FILL_RECT', 'x1': 240.0}, {'x2': 280.0, 'width_units': 1.0, 'y2': 460.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 352271359L, 'y1': 440.0, 'tool': 'FILL_RECT', 'x1': 260.0}]
01296         ,
01297         # Dog
01298         [{'x2': 180.0, 'width_units': 1.0, 'y2': 200.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 180.0, 'tool': 'FILL_RECT', 'x1': 160.0}, {'x2': 340.0, 'width_units': 1.0, 'y2': 240.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 200.0, 'tool': 'FILL_RECT', 'x1': 180.0}, {'x2': 200.0, 'width_units': 1.0, 'y2': 280.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 240.0, 'tool': 'FILL_RECT', 'x1': 180.0}, {'x2': 340.0,'width_units': 1.0, 'y2': 280.0, 'outline_color_rgba': 255L, 'fill_color_rgba':2199425535L, 'y1': 240.0, 'tool': 'FILL_RECT', 'x1': 320.0}, {'x2': 380.0, 'width_units': 1.0, 'y2': 200.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 2199425535L, 'y1': 160.0, 'tool': 'FILL_RECT', 'x1': 320.0}]
01299         ,
01300         # Fish
01301         [{'x2': 360.0, 'width_units': 1.0, 'y2': 280.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4294905087L, 'y1': 160.0, 'tool': 'FILL_CIRCLE', 'x1': 180.0}, {'x2': 340.0, 'width_units': 1.0, 'y2': 220.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4042322175L, 'y1': 200.0, 'tool': 'FILL_CIRCLE', 'x1': 320.0}, {'x2': 180.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4294905087L, 'y1': 180.0, 'tool': 'FILL_RECT', 'x1': 160.0}]
01302         ,
01303         # Boat
01304         [{'tool': 'LINE', 'points': (260.0, 340.0, 420.0, 340.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (220.0, 260.0, 260.0, 340.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (220.0, 260.0, 420.0, 260.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (340.0, 260.0, 360.0, 220.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (360.0, 220.0, 420.0, 220.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'x2': 320.0, 'width_units': 1.0, 'y2': 300.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 280.0, 'tool': 'FILL_CIRCLE', 'x1': 300.0}, {'x2': 360.0, 'width_units': 1.0, 'y2': 300.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 280.0, 'tool': 'FILL_CIRCLE', 'x1': 340.0}, {'x2': 400.0, 'width_units': 1.0, 'y2': 300.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 280.0, 'tool': 'FILL_CIRCLE', 'x1': 380.0}]
01305         ,
01306         # Spaceship
01307         [{'tool': 'LINE', 'points': (220.0, 400.0, 340.0, 400.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (340.0, 400.0, 360.0, 420.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (360.0, 320.0, 360.0, 420.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (340.0, 300.0, 360.0, 320.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (340.0, 100.0, 340.0, 300.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (200.0, 420.0, 220.0, 400.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (200.0, 320.0, 200.0, 420.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (200.0, 320.0, 220.0, 300.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (220.0, 100.0, 220.0, 300.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (220.0, 100.0, 280.0, 20.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (280.0, 20.0, 340.0, 100.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (220.0, 100.0, 340.0, 100.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (220.0, 120.0, 340.0, 120.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (220.0, 300.0, 340.0, 300.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (280.0, 300.0, 280.0, 420.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}]
01308         ,
01309         # Question mark
01310         [{'tool': 'LINE', 'points': (280.0, 260.0, 280.0, 440.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (280.0, 260.0, 340.0, 220.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (340.0, 160.0, 340.0, 220.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (280.0, 120.0, 340.0, 160.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (220.0, 160.0, 280.0, 120.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (220.0, 160.0, 220.0, 200.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (220.0, 200.0, 260.0, 220.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}]
01311         ,
01312         # Flying toy (cerf volant in french)
01313         [{'tool': 'LINE', 'points': (160.0, 140.0, 260.0, 100.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (160.0, 140.0, 160.0, 220.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (160.0, 220.0, 260.0, 380.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (260.0, 380.0, 360.0, 220.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (360.0, 140.0, 360.0, 220.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (260.0, 100.0, 360.0, 140.0), 'width_units': 8.0, 'fill_color_rgba': 4042322175L}, {'tool': 'LINE', 'points': (220.0, 500.0, 260.0, 380.0), 'width_units': 8.0, 'fill_color_rgba': 707406591L}, {'x2': 240.0, 'width_units': 1.0, 'y2': 180.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 160.0, 'tool': 'FILL_RECT', 'x1': 220.0}, {'x2': 300.0, 'width_units': 1.0, 'y2': 220.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 200.0, 'tool': 'FILL_RECT', 'x1': 280.0}, {'x2': 240.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 3992977663L, 'y1': 240.0, 'tool': 'FILL_RECT', 'x1': 220.0}, {'x2': 300.0, 'width_units': 1.0, 'y2': 180.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 160.0, 'tool': 'FILL_CIRCLE', 'x1': 280.0}, {'x2': 240.0, 'width_units': 1.0, 'y2': 220.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 200.0, 'tool': 'FILL_CIRCLE', 'x1': 220.0}, {'x2': 300.0, 'width_units': 1.0, 'y2': 260.0, 'outline_color_rgba': 255L, 'fill_color_rgba': 4287383039L, 'y1': 240.0, 'tool': 'FILL_CIRCLE', 'x1': 280.0}]
01314 
01315       ]
01316 
01317     # No more than 9 level allowed in gcompris
01318     self.gcomprisBoard.number_of_sublevel=math.ceil(len(self.drawlist)/9.0)
01319     self.gcomprisBoard.maxlevel=min(9, math.ceil(float(len(self.drawlist))/self.gcomprisBoard.number_of_sublevel))
01320     print "Number of target=", len(self.drawlist)
01321     print "Maxlevel=", self.gcomprisBoard.maxlevel, " sublevel=", self.gcomprisBoard.number_of_sublevel
01322 

Here is the caller graph for this function:

def redraw.Gcompris_redraw.key_press (   self,
  keyval,
  commit_str,
  preedit_str 
)

Definition at line 270 of file redraw.py.

00270 
00271   def key_press(self, keyval, commit_str, preedit_str):
00272     print("got key %i" % keyval)
00273     return False

def redraw.Gcompris_redraw.move_item_event (   self,
  item,
  event,
  item_index 
)

Definition at line 760 of file redraw.py.

00760 
00761   def move_item_event(self, item, event, item_index):
00762 
00763     if self.tools[self.current_tool][0] != "SELECT":
00764       return False
00765 
00766     #
00767     # MOUSE DRAG STOP
00768     # ---------------
00769     if event.type == gtk.gdk.BUTTON_RELEASE:
00770       if event.button == 1:
00771 
00772         # Reset thein_select_ofx ofset
00773         self.in_select_ofx = -1
00774         self.in_select_ofy = -1
00775 
00776         return True
00777 
00778     if event.state & gtk.gdk.BUTTON1_MASK:
00779       x=event.x
00780       y=event.y
00781 
00782       # Workaround for bad line positionning
00783       if(self.current_drawing[item_index].has_key('points')):
00784         item.set(width_units=1.0)
00785 
00786       bounds = item.get_bounds()
00787 
00788       # Save the ofset between the mouse pointer and the upper left corner of the object
00789       if(self.in_select_ofx == -1):
00790         self.in_select_ofx = x-bounds[0]
00791         self.in_select_ofy = y-bounds[1]
00792 
00793       x -= self.in_select_ofx
00794       y -= self.in_select_ofy
00795 
00796       x,y = self.snap_to_grid(x,y)
00797 
00798       # Check drawing boundaries
00799       if(x<self.drawing_area[0]):
00800         x=self.drawing_area[0]
00801       if(x>(self.drawing_area[2]-(bounds[2]-bounds[0]))):
00802         x=self.drawing_area[2]-(bounds[2]-bounds[0])
00803         # We need to realign x cause the bounds values are not precise enough
00804         x,n = self.snap_to_grid(x,y)
00805       if(y<self.drawing_area[1]):
00806         y=self.drawing_area[1]
00807       if(y>(self.drawing_area[3]-(bounds[3]-bounds[1]))):
00808         y=self.drawing_area[3]-(bounds[3]-bounds[1])
00809         # We need to realign y cause the bounds values are not precise enough
00810         n,y = self.snap_to_grid(x,y)
00811 
00812       # Need to update current_drawing
00813       if(self.current_drawing[item_index].has_key('x1')):
00814         # It's not a line
00815         ox = x - self.current_drawing[item_index]['x1']
00816         oy = y - self.current_drawing[item_index]['y1']
00817         self.current_drawing[item_index]['x1'] += ox
00818         self.current_drawing[item_index]['y1'] += oy
00819         self.current_drawing[item_index]['x2'] += ox
00820         self.current_drawing[item_index]['y2'] += oy
00821       else:
00822         # It can only be a line
00823         ox = x - min(self.current_drawing[item_index]['points'][0], self.current_drawing[item_index]['points'][2])
00824         oy = y - min(self.current_drawing[item_index]['points'][1], self.current_drawing[item_index]['points'][3])
00825         nx1 = self.current_drawing[item_index]['points'][0] + ox
00826         ny1 = self.current_drawing[item_index]['points'][1] + oy
00827         nx2 = self.current_drawing[item_index]['points'][2] + ox
00828         ny2 = self.current_drawing[item_index]['points'][3] + oy
00829         self.current_drawing[item_index]['points'] = (nx1, ny1, nx2, ny2)
00830 
00831       # Now perform the object move
00832       gcompris.utils.item_absolute_move(item, x, y)
00833 
00834       # Workaround for bad line positionning
00835       if(self.current_drawing[item_index].has_key('points')):
00836         item.set(width_units=8.0)
00837 
00838       return True
00839 
00840     return False

Here is the call graph for this function:

def redraw.Gcompris_redraw.ok (   self)

Definition at line 164 of file redraw.py.

00164 
00165   def ok(self):
00166     # Save a copy of the target drawing future comparison
00167     target  = list(self.image_target)
00168     target2 = list(self.image_target)
00169 
00170     # Save a copy of the drawing cause we need to remove empty items
00171     source = list(self.current_drawing)
00172 
00173     # Remove all empty items
00174     while 1:
00175       try:
00176         source.remove ([])
00177       except:
00178         break
00179 
00180     if self.editing_mode != None :
00181       print("To add item in this activity, Copy the following data in init_item_list in redraw.py (near the end)")
00182       print("-------------------------------------------------------------------------------")
00183       print source
00184       print("-------------------------------------------------------------------------------")
00185 
00186     # Need to check if target image equals drawing image
00187     for i in source:
00188       for j in target:
00189         if i == j:
00190           target.remove(j)
00191 
00192     for i in target2:
00193       for j in source:
00194         if i == j:
00195           source.remove(j)
00196 
00197     if(len(target) == 0 and len(source) == 0):
00198       # This is a WIN
00199       self.erase_drawing_area()
00200       if (self.increment_level() == 1):
00201         self.gamewon = 1
00202         gcompris.bonus.display(gcompris.bonus.WIN, gcompris.bonus.FLOWER)
00203         self.display_current_level()
00204         self.root_targetitem.hide()
00205 
00206     else:
00207       # Delete previous mark if any
00208       if(self.root_erroritem):
00209         self.root_erroritem.destroy()
00210 
00211       # Create our rootitem for error items mark
00212       self.root_erroritem = self.gcomprisBoard.canvas.root().add(
00213         gnomecanvas.CanvasGroup,
00214         x=0.0,
00215         y=0.0
00216         )
00217 
00218       self.display_error(target, 1)
00219       self.display_error(source, 0)
00220 

Here is the call graph for this function:

def redraw.Gcompris_redraw.pause (   self,
  pause 
)

Definition at line 151 of file redraw.py.

00151 
00152   def pause(self, pause):
00153 
00154     self.board_paused = pause
00155 
00156     # When the bonus is displayed, it call us first with pause(1) and then with pause(0)
00157     # the game is won
00158     if(self.gamewon == 1 and pause == 0):
00159       self.root_targetitem.show()
00160       self.gamewon = 0
00161 
00162     return
00163 

def redraw.Gcompris_redraw.reorder_coord (   self,
  x1,
  y1,
  x2,
  y2 
)

Definition at line 517 of file redraw.py.

00517 
00518   def reorder_coord(self, x1, y1, x2, y2):
00519     p = [x1, y1, x2, y2]
00520     if(x1>x2):
00521       p[0] = x2
00522       p[2] = x1
00523     if(y1>y2):
00524       p[1] = y2
00525       p[3] = y1
00526     return p
00527 

Definition at line 263 of file redraw.py.

00263 
00264   def repeat(self):
00265     print("Gcompris_redraw repeat.")
00266 

Here is the caller graph for this function:

def redraw.Gcompris_redraw.set_level (   self,
  level 
)

Definition at line 256 of file redraw.py.

00256 
00257   def set_level(self, level):
00258     self.gcomprisBoard.level=level;
00259     self.gcomprisBoard.sublevel=1;
00260 
00261     self.erase_drawing_area()
00262     self.display_current_level()

Here is the call graph for this function:

def redraw.Gcompris_redraw.snap_to_grid (   self,
  x,
  y 
)

Definition at line 747 of file redraw.py.

00747 
00748   def snap_to_grid(self, x, y):
00749     result = []
00750     tmp = round(((x+(self.current_step)) -
00751                self.drawing_area[0])/self.current_step) - 1
00752     result.append(float(self.drawing_area[0] + tmp*self.current_step))
00753 
00754     tmp = round(((y+(self.current_step)) -
00755                self.drawing_area[1])/self.current_step) - 1
00756     result.append(float(self.drawing_area[1] + tmp*self.current_step))
00757     return result
00758 

Here is the caller graph for this function:

Definition at line 100 of file redraw.py.

00100 
00101   def start(self):
00102     self.gcomprisBoard.level=1
00103     self.gcomprisBoard.maxlevel=1
00104     self.gcomprisBoard.sublevel=1
00105     self.gcomprisBoard.number_of_sublevel=1
00106 
00107     gcompris.bar_set(gcompris.BAR_OK|gcompris.BAR_LEVEL)
00108     gcompris.set_background(self.gcomprisBoard.canvas.root(),
00109                             gcompris.skin.image_to_skin("gcompris-bg.jpg"))
00110     gcompris.bar_set_level(self.gcomprisBoard)
00111 
00112     # Create our rootitem. We put each canvas item in it so at the end we
00113     # only have to kill it. The canvas deletes all the items it contains automaticaly.
00114     self.rootitem = self.gcomprisBoard.canvas.root().add(
00115       gnomecanvas.CanvasGroup,
00116       x=0.0,
00117       y=0.0
00118       )
00119 
00120     self.rootitem.add(
00121       gnomecanvas.CanvasPixbuf,
00122       pixbuf = gcompris.utils.load_pixmap(self.gcomprisBoard.icon_name),
00123       x = gcompris.BOARD_WIDTH - 60,
00124       y = 5,
00125       width = 60,
00126       height = 60,
00127       width_set = 1,
00128       height_set = 1
00129       )
00130 
00131     self.draw_tools()
00132     self.draw_colors()
00133     self.draw_drawing_area(20)
00134 
00135     self.init_item_list()
00136     self.display_current_level()
00137 
00138     self.pause(0);

def redraw.Gcompris_redraw.target_item_event (   self,
  item,
  event 
)

Definition at line 911 of file redraw.py.

00911 
00912   def target_item_event(self, item, event):
00913 
00914     if event.type == gtk.gdk.LEAVE_NOTIFY:
00915       self.display_coord(event.x,event.y, 3)
00916     else:
00917       self.display_coord(event.x,event.y, 2)
00918 

Here is the call graph for this function:

Here is the caller graph for this function:

def redraw.Gcompris_redraw.tool_item_event (   self,
  item,
  event,
  tool 
)

Definition at line 407 of file redraw.py.

00407 
00408   def tool_item_event(self, item, event, tool):
00409     if event.type == gtk.gdk.BUTTON_PRESS:
00410       if event.button == 1:
00411         # Deactivate old button
00412         self.old_tool_item.set(pixbuf = gcompris.utils.load_pixmap(self.tools[self.current_tool][1]))
00413 
00414         # Activate new button
00415         self.current_tool = tool
00416         self.old_tool_item = item
00417         self.old_tool_item.set(pixbuf = gcompris.utils.load_pixmap(self.tools[self.current_tool][2]))
00418         gcompris.set_cursor(self.tools[self.current_tool][3]);

Here is the caller graph for this function:


Member Data Documentation

Definition at line 43 of file redraw.py.

Definition at line 61 of file redraw.py.

Definition at line 300 of file redraw.py.

Definition at line 307 of file redraw.py.

Definition at line 74 of file redraw.py.

Definition at line 77 of file redraw.py.

Definition at line 75 of file redraw.py.

Definition at line 58 of file redraw.py.

Definition at line 81 of file redraw.py.

Definition at line 1167 of file redraw.py.

Definition at line 96 of file redraw.py.

Definition at line 44 of file redraw.py.

Definition at line 39 of file redraw.py.

Definition at line 78 of file redraw.py.

Definition at line 85 of file redraw.py.

Definition at line 86 of file redraw.py.

Definition at line 934 of file redraw.py.

Definition at line 450 of file redraw.py.

Definition at line 401 of file redraw.py.

Definition at line 946 of file redraw.py.

Definition at line 947 of file redraw.py.

Definition at line 316 of file redraw.py.

Definition at line 89 of file redraw.py.

Definition at line 582 of file redraw.py.

Definition at line 113 of file redraw.py.

Definition at line 82 of file redraw.py.

Definition at line 47 of file redraw.py.


The documentation for this class was generated from the following file: