Début de refactoring du curseur.
authorpin <pin@fe552daf-6dbe-4428-90eb-1537e0879342>
Fri, 19 Feb 2010 17:28:17 +0000 (17:28 +0000)
committerpin <pin@fe552daf-6dbe-4428-90eb-1537e0879342>
Fri, 19 Feb 2010 17:28:17 +0000 (17:28 +0000)
git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@47 fe552daf-6dbe-4428-90eb-1537e0879342

51 files changed:
src/app/widgets/cursors.py [new file with mode: 0755]
src/app/widgets/data/black/0.png [new file with mode: 0755]
src/app/widgets/data/black/1.png [new file with mode: 0755]
src/app/widgets/data/black/10.png [new file with mode: 0755]
src/app/widgets/data/black/2.png [new file with mode: 0755]
src/app/widgets/data/black/3.png [new file with mode: 0755]
src/app/widgets/data/black/4.png [new file with mode: 0755]
src/app/widgets/data/black/5.png [new file with mode: 0755]
src/app/widgets/data/black/6.png [new file with mode: 0755]
src/app/widgets/data/black/7.png [new file with mode: 0755]
src/app/widgets/data/black/8.png [new file with mode: 0755]
src/app/widgets/data/black/9.png [new file with mode: 0755]
src/app/widgets/data/black/cursorBlack.svg [new file with mode: 0755]
src/app/widgets/data/black/flash.png [new file with mode: 0644]
src/app/widgets/data/blue/0.png [new file with mode: 0644]
src/app/widgets/data/blue/1.png [new file with mode: 0644]
src/app/widgets/data/blue/10.png [new file with mode: 0644]
src/app/widgets/data/blue/2.png [new file with mode: 0644]
src/app/widgets/data/blue/3.png [new file with mode: 0644]
src/app/widgets/data/blue/4.png [new file with mode: 0644]
src/app/widgets/data/blue/5.png [new file with mode: 0644]
src/app/widgets/data/blue/6.png [new file with mode: 0644]
src/app/widgets/data/blue/7.png [new file with mode: 0644]
src/app/widgets/data/blue/8.png [new file with mode: 0644]
src/app/widgets/data/blue/9.png [new file with mode: 0644]
src/app/widgets/data/blue/cursorBlue.svg [new file with mode: 0644]
src/app/widgets/data/green/0.png [new file with mode: 0644]
src/app/widgets/data/green/1.png [new file with mode: 0644]
src/app/widgets/data/green/10.png [new file with mode: 0644]
src/app/widgets/data/green/2.png [new file with mode: 0644]
src/app/widgets/data/green/3.png [new file with mode: 0644]
src/app/widgets/data/green/4.png [new file with mode: 0644]
src/app/widgets/data/green/5.png [new file with mode: 0644]
src/app/widgets/data/green/6.png [new file with mode: 0644]
src/app/widgets/data/green/7.png [new file with mode: 0644]
src/app/widgets/data/green/8.png [new file with mode: 0644]
src/app/widgets/data/green/9.png [new file with mode: 0644]
src/app/widgets/data/green/cursorGreen.svg [new file with mode: 0644]
src/app/widgets/data/red/0.png [new file with mode: 0644]
src/app/widgets/data/red/1.png [new file with mode: 0644]
src/app/widgets/data/red/10.png [new file with mode: 0644]
src/app/widgets/data/red/2.png [new file with mode: 0644]
src/app/widgets/data/red/3.png [new file with mode: 0644]
src/app/widgets/data/red/4.png [new file with mode: 0644]
src/app/widgets/data/red/5.png [new file with mode: 0644]
src/app/widgets/data/red/6.png [new file with mode: 0644]
src/app/widgets/data/red/7.png [new file with mode: 0644]
src/app/widgets/data/red/8.png [new file with mode: 0644]
src/app/widgets/data/red/9.png [new file with mode: 0644]
src/app/widgets/data/red/cursorRed.svg [new file with mode: 0644]
src/app/widgets/playingscreen.py

diff --git a/src/app/widgets/cursors.py b/src/app/widgets/cursors.py
new file mode 100755 (executable)
index 0000000..2cbe4cc
--- /dev/null
@@ -0,0 +1,112 @@
+# -*- coding: utf-8 -*-
+"""
+Curseurs winwii
+
+$Id$
+$URL$
+"""
+
+import pygame
+import os
+
+
+class WarpingCursor(pygame.sprite.Sprite):
+    '''
+    The class for animating the warping cursor
+        
+        durations:
+            The duration of each image in the animation
+        centerPosition:
+            The Position of the center of the cursor
+        _imagePointer:
+            A pointer to the current image
+        _animationOffset:
+            The time elapsed since when the current image should have been displayed
+    '''
+    #screen = None
+    #images = None
+    #durations = None
+    #centerPosition = None
+    #_imagePointer = None
+    #_animationOffset = None
+
+    @staticmethod
+    def _get_theme_images(name) : 
+        basePath = os.path.abspath(__file__).split(os.path.sep)[:-1]
+        basePath.append('data')
+        basePath.append(name)
+        basePath = os.path.sep.join(basePath)
+        images = [f for f in os.listdir(basePath) if os.path.splitext(f)[1] == '.png']
+        return basePath, images
+    
+
+    def __init__(self, theme='black', duration=75):
+        pygame.sprite.Sprite.__init__(self)
+        imagesPath, images = WarpingCursor._get_theme_images(theme)
+        flashImage = images.pop(images.index('flash.png'))
+        images.sort(lambda a, b : cmp(*[int(os.path.splitext(f)[0]) for f in [a, b]]))
+
+        self.images = []
+        for img in images :
+            imagePath = os.path.sep.join([imagesPath, img])
+            self.images = pygame.image.load(imagePath).convert_alpha()
+            
+        #self.flashImagePath = flashImage
+        #self.durations = durations
+        #self.centerPosition = initCenterPosition
+        #self.flashLength = 100
+        #self.flashing = False
+        #self.image = pygame.image.load(self.images[0]).convert_alpha()
+        #self._imagePointer = 0
+        #self._animationOffset = 0
+        #self._flashTimer = 0        
+    
+    def update(self, elapsedTime, centerPosition):
+        '''
+        Update the cursor's look and position
+        
+            elapsedTime:
+                The time passed since the previous update
+            centerPosition:
+                the new position of the creep
+        '''
+        self._updateImage(elapsedTime)
+        self.centerPosition = centerPosition
+        if self.flashing :
+            self._flashTimer += elapsedTime
+            if self._flashTimer > self.flashLength:
+                self.flashing = False
+    
+    def _updateImage(self, elapsedTime):
+        '''
+        Update the cursor's image
+        
+            elapsedTime:
+                The time passed since the previous update
+        '''
+        self._animationOffset += elapsedTime
+        
+        if self._animationOffset > self.durations[self._imagePointer]:
+            #New animation offset is computed first, before updating the pointer
+            self._animationOffset -= self.durations[self._imagePointer]
+            #point to the next image (restarts from the beginning when it reaches the end)
+            self._imagePointer = (self._imagePointer + 1) % len(self.images)
+            
+        if self.flashing:
+            self.image = pygame.image.load(self.flashImagePath).convert_alpha()                       
+        else :    
+            self.image = pygame.image.load(self.images[self._imagePointer]).convert_alpha()
+        
+    def flash(self,flashLength = None):
+        self._flashTimer = 0
+        self.flashing = True
+        if flashLength:
+            self.flashlength = flashLength
+    
+    def blit(self,surface):
+        '''
+        Draw the circle on surface
+        '''
+        
+        newPos = (self.centerPosition[0] - self.image.get_width() / 2, self.centerPosition[1] - self.image.get_height() / 2)
+        surface.blit(self.image, newPos)
diff --git a/src/app/widgets/data/black/0.png b/src/app/widgets/data/black/0.png
new file mode 100755 (executable)
index 0000000..d676349
Binary files /dev/null and b/src/app/widgets/data/black/0.png differ
diff --git a/src/app/widgets/data/black/1.png b/src/app/widgets/data/black/1.png
new file mode 100755 (executable)
index 0000000..7703e89
Binary files /dev/null and b/src/app/widgets/data/black/1.png differ
diff --git a/src/app/widgets/data/black/10.png b/src/app/widgets/data/black/10.png
new file mode 100755 (executable)
index 0000000..6c85004
Binary files /dev/null and b/src/app/widgets/data/black/10.png differ
diff --git a/src/app/widgets/data/black/2.png b/src/app/widgets/data/black/2.png
new file mode 100755 (executable)
index 0000000..9eec08e
Binary files /dev/null and b/src/app/widgets/data/black/2.png differ
diff --git a/src/app/widgets/data/black/3.png b/src/app/widgets/data/black/3.png
new file mode 100755 (executable)
index 0000000..ce93f45
Binary files /dev/null and b/src/app/widgets/data/black/3.png differ
diff --git a/src/app/widgets/data/black/4.png b/src/app/widgets/data/black/4.png
new file mode 100755 (executable)
index 0000000..7c9d191
Binary files /dev/null and b/src/app/widgets/data/black/4.png differ
diff --git a/src/app/widgets/data/black/5.png b/src/app/widgets/data/black/5.png
new file mode 100755 (executable)
index 0000000..34b149d
Binary files /dev/null and b/src/app/widgets/data/black/5.png differ
diff --git a/src/app/widgets/data/black/6.png b/src/app/widgets/data/black/6.png
new file mode 100755 (executable)
index 0000000..d118680
Binary files /dev/null and b/src/app/widgets/data/black/6.png differ
diff --git a/src/app/widgets/data/black/7.png b/src/app/widgets/data/black/7.png
new file mode 100755 (executable)
index 0000000..68ec2dd
Binary files /dev/null and b/src/app/widgets/data/black/7.png differ
diff --git a/src/app/widgets/data/black/8.png b/src/app/widgets/data/black/8.png
new file mode 100755 (executable)
index 0000000..c938fe9
Binary files /dev/null and b/src/app/widgets/data/black/8.png differ
diff --git a/src/app/widgets/data/black/9.png b/src/app/widgets/data/black/9.png
new file mode 100755 (executable)
index 0000000..e5e4f09
Binary files /dev/null and b/src/app/widgets/data/black/9.png differ
diff --git a/src/app/widgets/data/black/cursorBlack.svg b/src/app/widgets/data/black/cursorBlack.svg
new file mode 100755 (executable)
index 0000000..7c3c9b4
--- /dev/null
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="48px"
+   height="48px"
+   id="svg2397"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="cursor.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/home/sbenven/Desktop/cursorGifs/cursor00.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs2399">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 24 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="48 : 24 : 1"
+       inkscape:persp3d-origin="24 : 16 : 1"
+       id="perspective2405" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="7"
+     inkscape:cx="-1.2857143"
+     inkscape:cy="24.45"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:window-width="1920"
+     inkscape:window-height="1125"
+     inkscape:window-x="1680"
+     inkscape:window-y="25"
+     showguides="true"
+     inkscape:guide-bbox="true">
+    <sodipodi:guide
+       orientation="0,1"
+       position="-4.4285714,24"
+       id="guide3229" />
+    <sodipodi:guide
+       orientation="1,0"
+       position="24,-18.571429"
+       id="guide3231" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata2402">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <path
+       sodipodi:type="arc"
+       style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       id="path2413"
+       sodipodi:cx="37.57143"
+       sodipodi:cy="36.57143"
+       sodipodi:rx="21.571428"
+       sodipodi:ry="21.571428"
+       d="M 59.142859,36.57143 A 21.571428,21.571428 0 1 1 16.000002,36.57143 A 21.571428,21.571428 0 1 1 59.142859,36.57143 z"
+       transform="matrix(1.0873786,0,0,1.0873787,-16.782941,-15.838419)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3227"
+       sodipodi:cx="10.928572"
+       sodipodi:cy="13.928572"
+       sodipodi:rx="13.785714"
+       sodipodi:ry="13.785714"
+       d="M 24.714286,13.928572 A 13.785714,13.785714 0 1 1 -2.8571424,13.928572 A 13.785714,13.785714 0 1 1 24.714286,13.928572 z"
+       transform="matrix(1.5759606,0,0,1.567424,6.8484288,2.1217689)"
+       inkscape:export-filename="/home/sbenven/Desktop/cursorGifs/cursor100.png"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90" />
+  </g>
+</svg>
diff --git a/src/app/widgets/data/black/flash.png b/src/app/widgets/data/black/flash.png
new file mode 100644 (file)
index 0000000..412cbce
Binary files /dev/null and b/src/app/widgets/data/black/flash.png differ
diff --git a/src/app/widgets/data/blue/0.png b/src/app/widgets/data/blue/0.png
new file mode 100644 (file)
index 0000000..9535e33
Binary files /dev/null and b/src/app/widgets/data/blue/0.png differ
diff --git a/src/app/widgets/data/blue/1.png b/src/app/widgets/data/blue/1.png
new file mode 100644 (file)
index 0000000..894e8c4
Binary files /dev/null and b/src/app/widgets/data/blue/1.png differ
diff --git a/src/app/widgets/data/blue/10.png b/src/app/widgets/data/blue/10.png
new file mode 100644 (file)
index 0000000..8ef30f7
Binary files /dev/null and b/src/app/widgets/data/blue/10.png differ
diff --git a/src/app/widgets/data/blue/2.png b/src/app/widgets/data/blue/2.png
new file mode 100644 (file)
index 0000000..5dcd4a9
Binary files /dev/null and b/src/app/widgets/data/blue/2.png differ
diff --git a/src/app/widgets/data/blue/3.png b/src/app/widgets/data/blue/3.png
new file mode 100644 (file)
index 0000000..e547688
Binary files /dev/null and b/src/app/widgets/data/blue/3.png differ
diff --git a/src/app/widgets/data/blue/4.png b/src/app/widgets/data/blue/4.png
new file mode 100644 (file)
index 0000000..0fb1d9d
Binary files /dev/null and b/src/app/widgets/data/blue/4.png differ
diff --git a/src/app/widgets/data/blue/5.png b/src/app/widgets/data/blue/5.png
new file mode 100644 (file)
index 0000000..6f3b35a
Binary files /dev/null and b/src/app/widgets/data/blue/5.png differ
diff --git a/src/app/widgets/data/blue/6.png b/src/app/widgets/data/blue/6.png
new file mode 100644 (file)
index 0000000..7ca3eb6
Binary files /dev/null and b/src/app/widgets/data/blue/6.png differ
diff --git a/src/app/widgets/data/blue/7.png b/src/app/widgets/data/blue/7.png
new file mode 100644 (file)
index 0000000..0a2033b
Binary files /dev/null and b/src/app/widgets/data/blue/7.png differ
diff --git a/src/app/widgets/data/blue/8.png b/src/app/widgets/data/blue/8.png
new file mode 100644 (file)
index 0000000..c75055c
Binary files /dev/null and b/src/app/widgets/data/blue/8.png differ
diff --git a/src/app/widgets/data/blue/9.png b/src/app/widgets/data/blue/9.png
new file mode 100644 (file)
index 0000000..f013e60
Binary files /dev/null and b/src/app/widgets/data/blue/9.png differ
diff --git a/src/app/widgets/data/blue/cursorBlue.svg b/src/app/widgets/data/blue/cursorBlue.svg
new file mode 100644 (file)
index 0000000..34c72b0
--- /dev/null
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="48px"
+   height="48px"
+   id="svg2397"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="cursorBlue.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/home/sbenven/Desktop/cursorGifs/cursor00.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs2399">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 24 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="48 : 24 : 1"
+       inkscape:persp3d-origin="24 : 16 : 1"
+       id="perspective2405" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="7"
+     inkscape:cx="-31.071429"
+     inkscape:cy="24.45"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:window-width="1920"
+     inkscape:window-height="1125"
+     inkscape:window-x="1680"
+     inkscape:window-y="25"
+     showguides="true"
+     inkscape:guide-bbox="true">
+    <sodipodi:guide
+       orientation="0,1"
+       position="-4.4285714,24"
+       id="guide3229" />
+    <sodipodi:guide
+       orientation="1,0"
+       position="24,-18.571429"
+       id="guide3231" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata2402">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <path
+       sodipodi:type="arc"
+       style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#0000ff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       id="path2413"
+       sodipodi:cx="37.57143"
+       sodipodi:cy="36.57143"
+       sodipodi:rx="21.571428"
+       sodipodi:ry="21.571428"
+       d="M 59.142859,36.57143 A 21.571428,21.571428 0 1 1 16.000002,36.57143 A 21.571428,21.571428 0 1 1 59.142859,36.57143 z"
+       transform="matrix(1.0873786,0,0,1.0873787,-16.782941,-15.838419)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#ffffff;fill-opacity:0;stroke:#0000ff;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3227"
+       sodipodi:cx="10.928572"
+       sodipodi:cy="13.928572"
+       sodipodi:rx="13.785714"
+       sodipodi:ry="13.785714"
+       d="M 24.714286,13.928572 A 13.785714,13.785714 0 1 1 -2.8571424,13.928572 A 13.785714,13.785714 0 1 1 24.714286,13.928572 z"
+       transform="matrix(1.5759606,0,0,1.567424,6.8484293,2.1217687)"
+       inkscape:export-filename="/home/sbenven/Desktop/cursorGifs/cursor100.png"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90" />
+  </g>
+</svg>
diff --git a/src/app/widgets/data/green/0.png b/src/app/widgets/data/green/0.png
new file mode 100644 (file)
index 0000000..a601813
Binary files /dev/null and b/src/app/widgets/data/green/0.png differ
diff --git a/src/app/widgets/data/green/1.png b/src/app/widgets/data/green/1.png
new file mode 100644 (file)
index 0000000..a0343a6
Binary files /dev/null and b/src/app/widgets/data/green/1.png differ
diff --git a/src/app/widgets/data/green/10.png b/src/app/widgets/data/green/10.png
new file mode 100644 (file)
index 0000000..a57da5e
Binary files /dev/null and b/src/app/widgets/data/green/10.png differ
diff --git a/src/app/widgets/data/green/2.png b/src/app/widgets/data/green/2.png
new file mode 100644 (file)
index 0000000..3c611a1
Binary files /dev/null and b/src/app/widgets/data/green/2.png differ
diff --git a/src/app/widgets/data/green/3.png b/src/app/widgets/data/green/3.png
new file mode 100644 (file)
index 0000000..75169da
Binary files /dev/null and b/src/app/widgets/data/green/3.png differ
diff --git a/src/app/widgets/data/green/4.png b/src/app/widgets/data/green/4.png
new file mode 100644 (file)
index 0000000..19b9062
Binary files /dev/null and b/src/app/widgets/data/green/4.png differ
diff --git a/src/app/widgets/data/green/5.png b/src/app/widgets/data/green/5.png
new file mode 100644 (file)
index 0000000..f0d521c
Binary files /dev/null and b/src/app/widgets/data/green/5.png differ
diff --git a/src/app/widgets/data/green/6.png b/src/app/widgets/data/green/6.png
new file mode 100644 (file)
index 0000000..9732994
Binary files /dev/null and b/src/app/widgets/data/green/6.png differ
diff --git a/src/app/widgets/data/green/7.png b/src/app/widgets/data/green/7.png
new file mode 100644 (file)
index 0000000..8c77ca7
Binary files /dev/null and b/src/app/widgets/data/green/7.png differ
diff --git a/src/app/widgets/data/green/8.png b/src/app/widgets/data/green/8.png
new file mode 100644 (file)
index 0000000..a2a97a7
Binary files /dev/null and b/src/app/widgets/data/green/8.png differ
diff --git a/src/app/widgets/data/green/9.png b/src/app/widgets/data/green/9.png
new file mode 100644 (file)
index 0000000..b950aa1
Binary files /dev/null and b/src/app/widgets/data/green/9.png differ
diff --git a/src/app/widgets/data/green/cursorGreen.svg b/src/app/widgets/data/green/cursorGreen.svg
new file mode 100644 (file)
index 0000000..34e8bc6
--- /dev/null
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="48px"
+   height="48px"
+   id="svg2397"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="cursorGreen.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/home/sbenven/Desktop/cursorGifs/cursor00.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs2399">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 24 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="48 : 24 : 1"
+       inkscape:persp3d-origin="24 : 16 : 1"
+       id="perspective2405" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="7"
+     inkscape:cx="-31.071429"
+     inkscape:cy="24.45"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:window-width="1920"
+     inkscape:window-height="1125"
+     inkscape:window-x="1680"
+     inkscape:window-y="25"
+     showguides="true"
+     inkscape:guide-bbox="true">
+    <sodipodi:guide
+       orientation="0,1"
+       position="-4.4285714,24"
+       id="guide3229" />
+    <sodipodi:guide
+       orientation="1,0"
+       position="24,-18.571429"
+       id="guide3231" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata2402">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <path
+       sodipodi:type="arc"
+       style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#00ff00;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       id="path2413"
+       sodipodi:cx="37.57143"
+       sodipodi:cy="36.57143"
+       sodipodi:rx="21.571428"
+       sodipodi:ry="21.571428"
+       d="M 59.142859,36.57143 A 21.571428,21.571428 0 1 1 16.000002,36.57143 A 21.571428,21.571428 0 1 1 59.142859,36.57143 z"
+       transform="matrix(1.0873786,0,0,1.0873787,-16.782941,-15.838419)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#ffffff;fill-opacity:0;stroke:#00ff00;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3227"
+       sodipodi:cx="10.928572"
+       sodipodi:cy="13.928572"
+       sodipodi:rx="13.785714"
+       sodipodi:ry="13.785714"
+       d="M 24.714286,13.928572 A 13.785714,13.785714 0 1 1 -2.8571424,13.928572 A 13.785714,13.785714 0 1 1 24.714286,13.928572 z"
+       transform="matrix(1.5759606,0,0,1.567424,6.8484285,2.1680224)"
+       inkscape:export-filename="/home/sbenven/Desktop/cursorGifs/cursor100.png"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90" />
+  </g>
+</svg>
diff --git a/src/app/widgets/data/red/0.png b/src/app/widgets/data/red/0.png
new file mode 100644 (file)
index 0000000..839bc89
Binary files /dev/null and b/src/app/widgets/data/red/0.png differ
diff --git a/src/app/widgets/data/red/1.png b/src/app/widgets/data/red/1.png
new file mode 100644 (file)
index 0000000..7124ee3
Binary files /dev/null and b/src/app/widgets/data/red/1.png differ
diff --git a/src/app/widgets/data/red/10.png b/src/app/widgets/data/red/10.png
new file mode 100644 (file)
index 0000000..e4323c2
Binary files /dev/null and b/src/app/widgets/data/red/10.png differ
diff --git a/src/app/widgets/data/red/2.png b/src/app/widgets/data/red/2.png
new file mode 100644 (file)
index 0000000..7df10de
Binary files /dev/null and b/src/app/widgets/data/red/2.png differ
diff --git a/src/app/widgets/data/red/3.png b/src/app/widgets/data/red/3.png
new file mode 100644 (file)
index 0000000..3088b82
Binary files /dev/null and b/src/app/widgets/data/red/3.png differ
diff --git a/src/app/widgets/data/red/4.png b/src/app/widgets/data/red/4.png
new file mode 100644 (file)
index 0000000..8e7549d
Binary files /dev/null and b/src/app/widgets/data/red/4.png differ
diff --git a/src/app/widgets/data/red/5.png b/src/app/widgets/data/red/5.png
new file mode 100644 (file)
index 0000000..a18a1a4
Binary files /dev/null and b/src/app/widgets/data/red/5.png differ
diff --git a/src/app/widgets/data/red/6.png b/src/app/widgets/data/red/6.png
new file mode 100644 (file)
index 0000000..6a6c2af
Binary files /dev/null and b/src/app/widgets/data/red/6.png differ
diff --git a/src/app/widgets/data/red/7.png b/src/app/widgets/data/red/7.png
new file mode 100644 (file)
index 0000000..865f580
Binary files /dev/null and b/src/app/widgets/data/red/7.png differ
diff --git a/src/app/widgets/data/red/8.png b/src/app/widgets/data/red/8.png
new file mode 100644 (file)
index 0000000..785a4b1
Binary files /dev/null and b/src/app/widgets/data/red/8.png differ
diff --git a/src/app/widgets/data/red/9.png b/src/app/widgets/data/red/9.png
new file mode 100644 (file)
index 0000000..e4c9758
Binary files /dev/null and b/src/app/widgets/data/red/9.png differ
diff --git a/src/app/widgets/data/red/cursorRed.svg b/src/app/widgets/data/red/cursorRed.svg
new file mode 100644 (file)
index 0000000..54f5fc0
--- /dev/null
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="48px"
+   height="48px"
+   id="svg2397"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="cursorRed.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/home/sbenven/Desktop/cursorGifs/cursor00.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs2399">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 24 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="48 : 24 : 1"
+       inkscape:persp3d-origin="24 : 16 : 1"
+       id="perspective2405" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="7"
+     inkscape:cx="-31.071429"
+     inkscape:cy="22.307143"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:window-width="1920"
+     inkscape:window-height="1125"
+     inkscape:window-x="1680"
+     inkscape:window-y="25"
+     showguides="true"
+     inkscape:guide-bbox="true">
+    <sodipodi:guide
+       orientation="0,1"
+       position="-4.4285714,24"
+       id="guide3229" />
+    <sodipodi:guide
+       orientation="1,0"
+       position="24,-18.571429"
+       id="guide3231" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata2402">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <path
+       sodipodi:type="arc"
+       style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       id="path2413"
+       sodipodi:cx="37.57143"
+       sodipodi:cy="36.57143"
+       sodipodi:rx="21.571428"
+       sodipodi:ry="21.571428"
+       d="M 59.142859,36.57143 A 21.571428,21.571428 0 1 1 16.000002,36.57143 A 21.571428,21.571428 0 1 1 59.142859,36.57143 z"
+       transform="matrix(1.0873786,0,0,1.0873787,-16.782941,-15.838419)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#ffffff;fill-opacity:0;stroke:#ff0000;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3227"
+       sodipodi:cx="10.928572"
+       sodipodi:cy="13.928572"
+       sodipodi:rx="13.785714"
+       sodipodi:ry="13.785714"
+       d="M 24.714286,13.928572 A 13.785714,13.785714 0 1 1 -2.8571424,13.928572 A 13.785714,13.785714 0 1 1 24.714286,13.928572 z"
+       transform="matrix(1.5759606,0,0,1.567424,6.9912861,2.264626)"
+       inkscape:export-filename="/home/sbenven/Desktop/cursorGifs/cursor100.png"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90" />
+  </g>
+</svg>
index 955a3ab..055ed71 100755 (executable)
@@ -23,9 +23,9 @@ ON_SATURATION = 1
 ON_COLUMN_OVERSIZING = 1.5
 
 
-def rename_method(newName) :
+def event_handler(eventType) :
     def doRename(m) :
-        m.__name__ = newName
+        m.__name__ = 'eventHandler%s' % eventType
         return m
     return doRename
 
@@ -113,7 +113,7 @@ class _PlayingScreenBase(pygame.sprite.OrderedUpdates) :
         handler = getattr(self, 'eventHandler%s' % event.type, lambda e:None)
         handler(event)
     
-    @rename_method('eventHandler%s' % pygame.KEYDOWN)       
+    @event_handler(pygame.KEYDOWN)       
     def handleKeyDown(self, event) :
         if event.key == pygame.K_q:
             self._running = False
@@ -121,6 +121,9 @@ class _PlayingScreenBase(pygame.sprite.OrderedUpdates) :
         
         if uni.isdigit() and int(uni) <=8 :
             self.highlightColumn(int(uni))
+    
+    @event_handler(pygame.MOUSEMOTION)
+    def handleMouseMotion(self, event) :