[pyclutter/wip/introspection] Add touch events
- From: Bastian Winkler <bwinkler src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pyclutter/wip/introspection] Add touch events
- Date: Wed, 18 Apr 2012 13:49:03 +0000 (UTC)
commit 8f0944415f9b09677d7c4f819755320e56f228b0
Author: Bastian Winkler <buz netbuz org>
Date: Tue Apr 17 15:52:08 2012 +0200
Add touch events
introspection/Clutter.py | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/introspection/Clutter.py b/introspection/Clutter.py
index 79ac9cf..b8c7aee 100644
--- a/introspection/Clutter.py
+++ b/introspection/Clutter.py
@@ -444,6 +444,14 @@ class Event(Clutter.Event):
Clutter.EventType.SCROLL: 'scroll',
Clutter.EventType.STAGE_STATE: 'stage_state'
}
+ if clutter_version >= (1, 10, 0):
+ _UNION_MEMBERS.update({
+ Clutter.EventType.TOUCH_BEGIN: 'touch',
+ Clutter.EventType.TOUCH_END: 'touch',
+ Clutter.EventType.TOUCH_UPDATE: 'touch',
+ Clutter.EventType.TOUCH_CANCEL: 'touch'
+ })
+
def __new__(cls, *args, **kwargs):
return Clutter.Event.__new__(cls)
@@ -521,6 +529,30 @@ class Event(Clutter.Event):
actor_name(self.get_stage()))
elif self.type() == Clutter.EventType.NOTHING:
return '<Nothing>'
+ elif clutter_version >= (1, 10, 0) and \
+ self.type() == Clutter.EventType.TOUCH_BEGIN:
+ return ('<TouchBegin at (%d,%d); sequence: %s; modifier: %s; ' +
+ 'time: %d; source: %s>') % (self.touch.x, self.touch.y,
+ str(self.touch.sequence), self.get_time(),
+ actor_name(self.get_source()))
+ elif clutter_version >= (1, 10, 0) and \
+ self.type() == Clutter.EventType.TOUCH_UPDATE:
+ return ('<TouchUpdate at (%d,%d); sequence: %s; modifier: %s; ' +
+ 'time: %d; source: %s>') % (self.touch.x, self.touch.y,
+ str(self.touch.sequence), self.get_time(),
+ actor_name(self.get_source()))
+ elif clutter_version >= (1, 10, 0) and \
+ self.type() == Clutter.EventType.TOUCH_END:
+ return ('<TouchEnd at (%d,%d); sequence: %s; modifier: %s; ' +
+ 'time: %d; source: %s>') % (self.touch.x, self.touch.y,
+ str(self.touch.sequence), self.get_time(),
+ actor_name(self.get_source()))
+ elif clutter_version >= (1, 10, 0) and \
+ self.type() == Clutter.EventType.TOUCH_CANCEL:
+ return ('<TouchCancel at (%d,%d); sequence: %s; modifier: %s; ' +
+ 'time: %d; source: %s>') % (self.touch.x, self.touch.y,
+ str(self.touch.sequence), self.get_time(),
+ actor_name(self.get_source()))
else:
return '<Unkown event>'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]