1 /**************************************************************************** 2 ** 3 ** Copyright (C) 2016 The Qt Company Ltd. 4 ** Contact: https://www.qt.io/licensing/ 5 ** 6 ** This file is part of the test suite of Qt for Python. 7 ** 8 ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 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 https://www.qt.io/terms-conditions. For further 15 ** information use the contact form at https://www.qt.io/contact-us. 16 ** 17 ** GNU General Public License Usage 18 ** Alternatively, this file may be used under the terms of the GNU 19 ** General Public License version 3 as published by the Free Software 20 ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 ** included in the packaging of this file. Please review the following 22 ** information to ensure the GNU General Public License requirements will 23 ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 ** 25 ** $QT_END_LICENSE$ 26 ** 27 ****************************************************************************/ 28 29 #ifndef RECT_H 30 #define RECT_H 31 32 #include "libsamplemacros.h" 33 34 class LIBSAMPLE_API Rect 35 { 36 public: Rect()37 Rect() 38 { 39 m_left = m_top = 0; 40 m_right = m_bottom = -1; 41 } Rect(int left,int top,int right,int bottom)42 Rect(int left, int top, int right, int bottom) 43 : m_left(left), m_top(top), m_right(right), m_bottom(bottom) { } ~Rect()44 ~Rect() {} left()45 inline int left() const { return m_left; } top()46 inline int top() const { return m_top; } right()47 inline int right() const { return m_right; } bottom()48 inline int bottom() const { return m_bottom; } 49 private: 50 int m_left; 51 int m_top; 52 int m_right; 53 int m_bottom; 54 }; 55 56 class LIBSAMPLE_API RectF 57 { 58 public: RectF()59 RectF() 60 { 61 m_left = m_top = 0; 62 m_right = m_bottom = -1; 63 } RectF(int left,int top,int right,int bottom)64 RectF(int left, int top, int right, int bottom) 65 : m_left(left), m_top(top), m_right(right), m_bottom(bottom) { } RectF(const Rect & other)66 RectF(const Rect& other) 67 { 68 m_left = other.left(); 69 m_top = other.top(); 70 m_right = other.right(); 71 m_bottom = other.bottom(); 72 } ~RectF()73 ~RectF() {} left()74 inline double left() const { return m_left; } top()75 inline double top() const { return m_top; } right()76 inline double right() const { return m_right; } bottom()77 inline double bottom() const { return m_bottom; } 78 private: 79 double m_left; 80 double m_top; 81 double m_right; 82 double m_bottom; 83 }; 84 85 #endif // RECT_H 86 87