~fginther/oif-qml/precise-original

« back to all changes in this revision

Viewing changes to src/oifrotatearea.cpp

  • Committer: Francis Ginther
  • Date: 2012-08-16 20:49:49 UTC
  • mfrom: (0.1.118 oif-qml)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: francis.ginther@canonical.com-20120816204949-ogn4vabacgymkgac
Tags: upstream-1.0.7
ImportĀ upstreamĀ versionĀ 1.0.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2011 Canonical, Ltd. This software is licensed under the GNU
 
2
 * Lesser General Public License version 3 or later (see the file COPYING).
 
3
 */
 
4
 
 
5
#include "oifrotatearea.h"
 
6
 
 
7
#include "gestureevent.h"
 
8
 
 
9
OIFRotateArea::OIFRotateArea(QDeclarativeItem* parent)
 
10
  : ContinuousGestureArea(parent, kRotate)
 
11
{}
 
12
 
 
13
bool OIFRotateArea::IsGestureEventHandled(GestureEvent* event) {
 
14
  GeisFloat angle =
 
15
    event->attributes().value(GEIS_GESTURE_ATTRIBUTE_ANGLE).toFloat();
 
16
 
 
17
  angle_.set(angle);
 
18
 
 
19
  return ContinuousGestureArea::IsGestureEventHandled(event) ||
 
20
         angle_.receivers(SIGNAL(initialChanged())) > 0 ||
 
21
         angle_.receivers(SIGNAL(currentChanged())) > 0;
 
22
}
 
23
 
 
24
void OIFRotateArea::HandleGestureUpdateEvent(bool end,
 
25
                                                GestureEvent* event) {
 
26
  GeisFloat angle =
 
27
    event->attributes().value(GEIS_GESTURE_ATTRIBUTE_ANGLE).toFloat();
 
28
 
 
29
  angle_.update(angle);
 
30
 
 
31
  ContinuousGestureArea::HandleGestureUpdateEvent(end, event);
 
32
}