Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qpaintdevice.cpp |
Source code | Switch to Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | /**************************************************************************** | - | ||||||
2 | ** | - | ||||||
3 | ** Copyright (C) 2015 The Qt Company Ltd. | - | ||||||
4 | ** Contact: http://www.qt.io/licensing/ | - | ||||||
5 | ** | - | ||||||
6 | ** This file is part of the QtGui module of the Qt Toolkit. | - | ||||||
7 | ** | - | ||||||
8 | ** $QT_BEGIN_LICENSE:LGPL21$ | - | ||||||
9 | ** Commercial License Usage | - | ||||||
10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||
11 | ** accordance with the commercial license agreement provided with the | - | ||||||
12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||
13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||
14 | ** and conditions see http://www.qt.io/terms-conditions. For further | - | ||||||
15 | ** information use the contact form at http://www.qt.io/contact-us. | - | ||||||
16 | ** | - | ||||||
17 | ** GNU Lesser General Public License Usage | - | ||||||
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||
19 | ** General Public License version 2.1 or version 3 as published by the Free | - | ||||||
20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and | - | ||||||
21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the | - | ||||||
22 | ** following information to ensure the GNU Lesser General Public License | - | ||||||
23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | - | ||||||
24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | - | ||||||
25 | ** | - | ||||||
26 | ** As a special exception, The Qt Company gives you certain additional | - | ||||||
27 | ** rights. These rights are described in The Qt Company LGPL Exception | - | ||||||
28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | - | ||||||
29 | ** | - | ||||||
30 | ** $QT_END_LICENSE$ | - | ||||||
31 | ** | - | ||||||
32 | ****************************************************************************/ | - | ||||||
33 | - | |||||||
34 | #include "qpaintdevice.h" | - | ||||||
35 | - | |||||||
36 | QT_BEGIN_NAMESPACE | - | ||||||
37 | - | |||||||
38 | QPaintDevice::QPaintDevice() Q_DECL_NOEXCEPT | - | ||||||
39 | { | - | ||||||
40 | reserved = 0; | - | ||||||
41 | painters = 0; | - | ||||||
42 | } never executed: end of block | 0 | ||||||
43 | - | |||||||
44 | QPaintDevice::~QPaintDevice() | - | ||||||
45 | { | - | ||||||
46 | if (paintingActive())
| 0 | ||||||
47 | qWarning("QPaintDevice: Cannot destroy paint device that is being " never executed: QMessageLogger(__FILE__, 47, __PRETTY_FUNCTION__).warning("QPaintDevice: Cannot destroy paint device that is being " "painted"); | 0 | ||||||
48 | "painted"); never executed: QMessageLogger(__FILE__, 47, __PRETTY_FUNCTION__).warning("QPaintDevice: Cannot destroy paint device that is being " "painted"); | 0 | ||||||
49 | } never executed: end of block | 0 | ||||||
50 | - | |||||||
51 | - | |||||||
52 | /*! | - | ||||||
53 | \internal | - | ||||||
54 | */ | - | ||||||
55 | void QPaintDevice::initPainter(QPainter *) const | - | ||||||
56 | { | - | ||||||
57 | } | - | ||||||
58 | - | |||||||
59 | /*! | - | ||||||
60 | \internal | - | ||||||
61 | */ | - | ||||||
62 | QPaintDevice *QPaintDevice::redirected(QPoint *) const | - | ||||||
63 | { | - | ||||||
64 | return 0; never executed: return 0; | 0 | ||||||
65 | } | - | ||||||
66 | - | |||||||
67 | /*! | - | ||||||
68 | \internal | - | ||||||
69 | */ | - | ||||||
70 | QPainter *QPaintDevice::sharedPainter() const | - | ||||||
71 | { | - | ||||||
72 | return 0; never executed: return 0; | 0 | ||||||
73 | } | - | ||||||
74 | - | |||||||
75 | Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, QPaintDevice::PaintDeviceMetric metric) | - | ||||||
76 | { | - | ||||||
77 | return device->metric(metric); never executed: return device->metric(metric); | 0 | ||||||
78 | } | - | ||||||
79 | - | |||||||
80 | int QPaintDevice::metric(PaintDeviceMetric m) const | - | ||||||
81 | { | - | ||||||
82 | // Fallback: A subclass has not implemented PdmDevicePixelRatioScaled but might | - | ||||||
83 | // have implemented PdmDevicePixelRatio. | - | ||||||
84 | if (m == PdmDevicePixelRatioScaled)
| 0 | ||||||
85 | return this->metric(PdmDevicePixelRatio) * devicePixelRatioFScale(); never executed: return this->metric(PdmDevicePixelRatio) * devicePixelRatioFScale(); | 0 | ||||||
86 | - | |||||||
87 | qWarning("QPaintDevice::metrics: Device has no metric information"); | - | ||||||
88 | - | |||||||
89 | if (m == PdmDpiX) {
| 0 | ||||||
90 | return 72; never executed: return 72; | 0 | ||||||
91 | } else if (m == PdmDpiY) {
| 0 | ||||||
92 | return 72; never executed: return 72; | 0 | ||||||
93 | } else if (m == PdmNumColors) {
| 0 | ||||||
94 | // FIXME: does this need to be a real value? | - | ||||||
95 | return 256; never executed: return 256; | 0 | ||||||
96 | } else if (m == PdmDevicePixelRatio) {
| 0 | ||||||
97 | return 1; never executed: return 1; | 0 | ||||||
98 | } else { | - | ||||||
99 | qDebug("Unrecognised metric %d!",m); | - | ||||||
100 | return 0; never executed: return 0; | 0 | ||||||
101 | } | - | ||||||
102 | } | - | ||||||
103 | - | |||||||
104 | QT_END_NAMESPACE | - | ||||||
Source code | Switch to Preprocessed file |