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

« back to all changes in this revision

Viewing changes to sources/global.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:
23
23
#ifndef GLOBAL_H
24
24
#define GLOBAL_H
25
25
 
26
 
#include <QPair>
27
 
 
28
26
namespace qpdfview
29
27
{
30
28
 
37
35
    NumberOfRotations = 4
38
36
};
39
37
 
 
38
struct RenderResolution
 
39
{
 
40
    int resolutionX;
 
41
    int resolutionY;
 
42
    qreal devicePixelRatio;
 
43
 
 
44
    RenderResolution(int resolutionX = 72, int resolutionY = 72,
 
45
                     qreal devicePixelRatio = 1.0) :
 
46
        resolutionX(resolutionX),
 
47
        resolutionY(resolutionY),
 
48
        devicePixelRatio(devicePixelRatio) {}
 
49
 
 
50
    bool operator==(const RenderResolution& other) const
 
51
    {
 
52
        return resolutionX == other.resolutionX
 
53
                && resolutionY == other.resolutionY
 
54
                && qFuzzyCompare(devicePixelRatio, other.devicePixelRatio);
 
55
    }
 
56
 
 
57
    bool operator!=(const RenderResolution& other) const { return !operator==(other); }
 
58
 
 
59
};
 
60
 
 
61
struct RenderParam
 
62
{
 
63
    RenderResolution resolution;
 
64
 
 
65
    qreal scaleFactor;
 
66
    Rotation rotation;
 
67
    bool invertColors;
 
68
 
 
69
    RenderParam(const RenderResolution& resolution = RenderResolution(),
 
70
                qreal scaleFactor = 1.0, Rotation rotation = RotateBy0, bool invertColors = false) :
 
71
        resolution(resolution),
 
72
        scaleFactor(scaleFactor),
 
73
        rotation(rotation),
 
74
        invertColors(invertColors) {}
 
75
 
 
76
    bool operator==(const RenderParam& other) const
 
77
    {
 
78
        return resolution == other.resolution
 
79
                && qFuzzyCompare(scaleFactor, other.scaleFactor)
 
80
                && rotation == other.rotation
 
81
                && invertColors == other.invertColors;
 
82
    }
 
83
 
 
84
    bool operator!=(const RenderParam& other) const { return !operator==(other); }
 
85
 
 
86
};
 
87
 
40
88
enum RubberBandMode
41
89
{
42
90
    ModifiersMode = 0,
63
111
    NumberOfScaleModes = 3
64
112
};
65
113
 
66
 
typedef QPair< int, QString > Jump;
67
 
typedef QList< QPair< int, QString > > JumpList;
68
 
 
69
114
} // qpdfview
70
115
 
71
116
#endif // GLOBAL_H