~ubuntu-branches/ubuntu/trusty/libavg/trusty-proposed

« back to all changes in this revision

Viewing changes to src/player/TouchEvent.cpp

  • Committer: Package Import Robot
  • Author(s): OXullo Intersecans
  • Date: 2011-12-06 22:44:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20111206224456-qc7250z3ya1vi8s9
Tags: 1.7.0-0ubuntu1
* New upstream release (LP: #899183)
* Remove patches 0002-libav-0.7.patch, 0003-fglrx-segfault-on-startup.patch
  now merged to upstream
* Remove unnecessary .la files
* Update debian/watch file
* Fix debian/copyright dep-5 compliancy
* Update standards to version 3.9.2
* Add man pages for avg_checktouch, avg_checkvsync, avg_showsvg
* Minor debian/rules enhancement
* Add librsvg2-dev, libgdk-pixbuf2.0-dev to Build-Depends
* Proper transition to dh_python2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
2
//  libavg - Media Playback Engine. 
3
 
//  Copyright (C) 2003-2008 Ulrich von Zadow
 
3
//  Copyright (C) 2003-2011 Ulrich von Zadow
4
4
//
5
5
//  This library is free software; you can redistribute it and/or
6
6
//  modify it under the terms of the GNU Lesser General Public
29
29
#include "../graphics/Bitmap.h"
30
30
#include "../graphics/Filterfill.h"
31
31
#include "../graphics/Pixel8.h"
 
32
#include "../base/Exception.h"
32
33
 
33
34
#include "../base/Logger.h"
34
35
 
37
38
namespace avg {
38
39
 
39
40
TouchEvent::TouchEvent(int id, Type eventType, BlobPtr pBlob, const IntPoint& pos, 
40
 
        Source source, const DPoint& speed, const IntPoint& lastDownPos)
 
41
        Source source, const DPoint& speed)
41
42
    : CursorEvent(id, eventType, pos, source),
42
43
      m_pBlob(pBlob),
43
 
      m_Speed(speed),
44
44
      m_bHasHandOrientation(false)
45
45
{
46
 
    setLastDownPos(lastDownPos);
 
46
    setSpeed(speed);
47
47
    if (pBlob) {
48
48
        m_Orientation = pBlob->getOrientation();
49
49
        m_Area = pBlob->getArea();
60
60
        }
61
61
    } else {
62
62
        m_Orientation = 0;
63
 
        m_Area = 0;
 
63
        m_Area = 20;
64
64
        m_Center = DPoint(0, 0);
65
65
        m_Eccentricity = 0;
66
 
        m_MajorAxis = DPoint(0, 0);
67
 
        m_MinorAxis = DPoint(0, 0);
 
66
        m_MajorAxis = DPoint(5, 0);
 
67
        m_MinorAxis = DPoint(0, 5);
68
68
    }
69
69
}
70
70
 
71
71
TouchEvent::TouchEvent(int id, Type eventType, const IntPoint& pos, Source source, 
72
 
                const DPoint& speed, double orientation, double area, 
73
 
                double eccentricity, DPoint majorAxis, DPoint minorAxis)
 
72
        const DPoint& speed, double orientation, double area, double eccentricity, 
 
73
        DPoint majorAxis, DPoint minorAxis)
74
74
    : CursorEvent(id, eventType, pos, source),
75
 
      m_Speed(speed),
76
75
      m_Orientation(orientation),
77
76
      m_Area(area),
78
77
      m_Eccentricity(eccentricity),
79
78
      m_MajorAxis(majorAxis),
80
79
      m_MinorAxis(minorAxis)
81
80
{
 
81
    setSpeed(speed);
 
82
}
 
83
 
 
84
TouchEvent::TouchEvent(int id, Type eventType, const IntPoint& pos, Source source,
 
85
        const DPoint& speed)
 
86
    : CursorEvent(id, eventType, pos, source),
 
87
      m_Orientation(0),
 
88
      m_Area(20),
 
89
      m_Eccentricity(0),
 
90
      m_MajorAxis(5, 0),
 
91
      m_MinorAxis(0, 5)
 
92
{
 
93
    setSpeed(speed);
82
94
}
83
95
 
84
96
TouchEvent::~TouchEvent()
92
104
    return pClone;
93
105
}
94
106
 
95
 
const DPoint& TouchEvent::getSpeed() const
96
 
{
97
 
    return m_Speed;
98
 
}
99
 
 
100
107
double TouchEvent::getOrientation() const 
101
108
{
102
109
    return m_Orientation;
177
184
    return pRelatedEvents;
178
185
}
179
186
 
 
187
void TouchEvent::removeBlob()
 
188
{
 
189
    m_pBlob = BlobPtr();
 
190
}
 
191
 
180
192
void TouchEvent::trace()
181
193
{
182
 
    Event::trace();
183
 
    AVG_TRACE(Logger::EVENTS2, "pos: " << m_Position 
 
194
    CursorEvent::trace();
 
195
    AVG_TRACE(Logger::EVENTS2, "pos: " << getPos() 
184
196
            << ", ID: " << getCursorID()
185
197
            << ", Area: " << m_Area
186
198
            << ", Eccentricity: " << m_Eccentricity);