Commit 9807d347 authored by Taddeus Kroes's avatar Taddeus Kroes

Rename event classes.

parent cd83ef17
class BasicEvent(object): class Event(object):
def __init__(self, point): def __init__(self, point):
self.point = point self.point = point
...@@ -17,15 +17,15 @@ class BasicEvent(object): ...@@ -17,15 +17,15 @@ class BasicEvent(object):
raise AttributeError raise AttributeError
class DownEvent(BasicEvent): class DownEvent(Event):
_name = 'down' _name = 'down'
class UpEvent(BasicEvent): class UpEvent(Event):
_name = 'up' _name = 'up'
class MoveEvent(BasicEvent): class MoveEvent(Event):
_name = 'move' _name = 'move'
def __str__(self): def __str__(self):
...@@ -34,7 +34,7 @@ class MoveEvent(BasicEvent): ...@@ -34,7 +34,7 @@ class MoveEvent(BasicEvent):
self.point.x, self.point.y, self.point.sid) self.point.x, self.point.y, self.point.sid)
class GestureEvent(object): class Gesture(object):
def __init__(self, x, y): def __init__(self, x, y):
self.x = x self.x = x
self.y = y self.y = y
...@@ -47,23 +47,23 @@ class GestureEvent(object): ...@@ -47,23 +47,23 @@ class GestureEvent(object):
return '<%s (%s, %s)>' % (self.__class__.__name__, self.x, self.y) return '<%s (%s, %s)>' % (self.__class__.__name__, self.x, self.y)
class TapEvent(GestureEvent): class Tap(Gesture):
_name = 'tap' _name = 'tap'
class SingleTapEvent(GestureEvent): class SingleTap(Gesture):
_name = 'single_tap' _name = 'single_tap'
class DoubleTapEvent(GestureEvent): class DoubleTap(Gesture):
_name = 'double_tap' _name = 'double_tap'
class FlickEvent(GestureEvent): class Flick(Gesture):
_name = 'flick' _name = 'flick'
def __init__(self, x, y, velocity): def __init__(self, x, y, velocity):
super(FlickEvent, self).__init__(x, y) super(Flick, self).__init__(x, y)
self.velocity = velocity self.velocity = velocity
def __str__(self): def __str__(self):
...@@ -71,11 +71,11 @@ class FlickEvent(GestureEvent): ...@@ -71,11 +71,11 @@ class FlickEvent(GestureEvent):
(self.__class__.__name__, self.x, self.y, self.velocity) (self.__class__.__name__, self.x, self.y, self.velocity)
class RotateEvent(GestureEvent): class Rotate(Gesture):
_name = 'rotate' _name = 'rotate'
def __init__(self, cx, cy, angle, n): def __init__(self, cx, cy, angle, n):
super(RotateEvent, self).__init__(cx, cy) super(Rotate, self).__init__(cx, cy)
self.angle = angle self.angle = angle
self.n = n self.n = n
...@@ -84,11 +84,11 @@ class RotateEvent(GestureEvent): ...@@ -84,11 +84,11 @@ class RotateEvent(GestureEvent):
(self.__class__.__name__, self.x, self.y, self.angle, self.n) (self.__class__.__name__, self.x, self.y, self.angle, self.n)
class PinchEvent(GestureEvent): class Pinch(Gesture):
_name = 'pinch' _name = 'pinch'
def __init__(self, cx, cy, amount, n): def __init__(self, cx, cy, amount, n):
super(PinchEvent, self).__init__(cx, cy) super(Pinch, self).__init__(cx, cy)
self.amount = amount self.amount = amount
self.n = n self.n = n
...@@ -97,11 +97,11 @@ class PinchEvent(GestureEvent): ...@@ -97,11 +97,11 @@ class PinchEvent(GestureEvent):
(self.__class__.__name__, self.x, self.y, self.amount, self.n) (self.__class__.__name__, self.x, self.y, self.amount, self.n)
class PanEvent(GestureEvent): class Pan(Gesture):
_name = 'pan' _name = 'pan'
def __init__(self, x, y, dx, dy, n): def __init__(self, x, y, dx, dy, n):
super(RotateEvent, self).__init__(x, y) super(Pan, self).__init__(x, y)
self.dx = dx self.dx = dx
self.dy = dy self.dy = dy
self.n = n self.n = n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment