summaryrefslogtreecommitdiff
path: root/libsowatch/watch.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-09-18 04:26:20 +0200
committerJavier S. Pedro <maemo@javispedro.com>2011-09-18 04:26:20 +0200
commitc42d5abff1f5f51facc169dd593725d819c4c868 (patch)
tree9aa8bdef88bf89561c7726948541a1ba3906b81e /libsowatch/watch.cpp
parentf225345d4de3b198a557fe3566f9630163e76d51 (diff)
downloadsowatch-c42d5abff1f5f51facc169dd593725d819c4c868.tar.gz
sowatch-c42d5abff1f5f51facc169dd593725d819c4c868.zip
separation into lib and plugins complete
Diffstat (limited to 'libsowatch/watch.cpp')
-rw-r--r--libsowatch/watch.cpp51
1 files changed, 2 insertions, 49 deletions
diff --git a/libsowatch/watch.cpp b/libsowatch/watch.cpp
index e8da790..7792693 100644
--- a/libsowatch/watch.cpp
+++ b/libsowatch/watch.cpp
@@ -3,60 +3,13 @@
using namespace sowatch;
-Watch::Watch(const QImage& image, QObject* parent) :
- QObject(parent), _image(image), _paintEngine(0)
+Watch::Watch(QObject* parent) :
+ QObject(parent)
{
}
Watch::~Watch()
{
- if (_paintEngine) {
- delete _paintEngine;
- }
-}
-
-QPaintEngine* Watch::paintEngine() const
-{
- if (!_paintEngine) {
- _paintEngine = new WatchPaintEngine(const_cast<Watch*>(this),
- const_cast<QImage*>(&_image));
- }
-
- return _paintEngine;
-}
-int Watch::metric(PaintDeviceMetric metric) const
-{
- switch (metric) {
- case PdmWidth:
- return _image.width();
- case PdmHeight:
- return _image.height();
- case PdmWidthMM:
- return _image.widthMM();
- case PdmHeightMM:
- return _image.heightMM();
- case PdmNumColors:
- return _image.numColors();
- case PdmDepth:
- return _image.depth();
- case PdmDpiX:
- return _image.logicalDpiX();
- case PdmDpiY:
- return _image.logicalDpiY();
- case PdmPhysicalDpiX:
- return _image.physicalDpiX();
- case PdmPhysicalDpiY:
- return _image.physicalDpiY();
- }
-
- return -1;
-}
-
-void Watch::update(const QRect &rect)
-{
- QList<QRect> rects;
- rects << rect;
- update(rects);
}