~ubuntu-branches/ubuntu/vivid/qpdfview/vivid

« back to all changes in this revision

Viewing changes to sources/rendertask.h

  • Committer: Package Import Robot
  • Author(s): Benjamin Eltzner
  • Date: 2014-10-22 21:49:15 UTC
  • mfrom: (1.2.15)
  • Revision ID: package-import@ubuntu.com-20141022214915-agqeoe318lzs2s4d
Tags: 0.4.12-1
* New upstream release.
* Fixed option to zoom to selection and implemented tiled rendering
  (Closes: #739554)
* Enable support for qt5 and poppler-qt5.
* Explicit dependence on hicolor-icon-theme.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#ifndef RENDERTASK_H
23
23
#define RENDERTASK_H
24
24
 
 
25
#include <QColor>
25
26
#include <QImage>
26
27
#include <QMutex>
27
28
#include <QRunnable>
42
43
    Q_OBJECT
43
44
 
44
45
public:
45
 
    explicit RenderTask(QObject* parent = 0);
 
46
    explicit RenderTask(Model::Page* page, QObject* parent = 0);
46
47
 
47
48
    void wait();
48
49
 
49
50
    bool isRunning() const;
 
51
 
50
52
    bool wasCanceled() const;
 
53
    bool wasCanceledNormally() const;
 
54
    bool wasCanceledForcibly() const;
51
55
 
52
56
    void run();
53
57
 
54
58
signals:
55
59
    void finished();
56
60
 
57
 
    void imageReady(int resolutionX, int resolutionY, qreal devicePixelRatio, qreal scaleFactor, Rotation rotation, bool invertColors, bool prefetch, QImage image);
 
61
    void imageReady(const RenderParam& renderParam,
 
62
                    const QRect& rect, bool prefetch,
 
63
                    QImage image, QRectF cropRect);
58
64
 
59
65
public slots:
60
 
    void start(Model::Page* page, int resolutionX, int resolutionY, qreal devicePixelRatio, qreal scaleFactor, Rotation rotation, bool invertColors, bool prefetch);
61
 
    void cancel();
 
66
    void start(const RenderParam& renderParam,
 
67
               const QRect& rect, bool prefetch,
 
68
               bool trimMargins, const QColor& paperColor);
 
69
 
 
70
    void cancel(bool force = false);
62
71
 
63
72
private:
64
73
    Q_DISABLE_COPY(RenderTask)
66
75
    mutable QMutex m_mutex;
67
76
    QWaitCondition m_waitCondition;
68
77
 
 
78
    bool m_isRunning;
 
79
    QAtomicInt m_wasCanceled;
 
80
 
69
81
    void finish();
70
82
 
71
 
    bool m_isRunning;
72
 
    bool m_wasCanceled;
73
83
 
74
84
    Model::Page* m_page;
75
85
 
76
 
    int m_resolutionX;
77
 
    int m_resolutionY;
78
 
    qreal m_devicePixelRatio;
79
 
 
80
 
    qreal m_scaleFactor;
81
 
    Rotation m_rotation;
82
 
 
83
 
    bool m_invertColors;
84
 
 
 
86
    RenderParam m_renderParam;
 
87
 
 
88
    QRect m_rect;
85
89
    bool m_prefetch;
86
90
 
 
91
    bool m_trimMargins;
 
92
    QColor m_paperColor;
 
93
 
87
94
};
88
95
 
89
96
} // qpdfview