| 1 | // ePDFView - A lightweight PDF Viewer. |
|---|
| 2 | // Copyright (C) 2006 Emma's Software. |
|---|
| 3 | // |
|---|
| 4 | // This program is free software; you can redistribute it and/or modify |
|---|
| 5 | // it under the terms of the GNU General Public License as published by |
|---|
| 6 | // the Free Software Foundation; either version 2 of the License, or |
|---|
| 7 | // (at your option) any later version. |
|---|
| 8 | // |
|---|
| 9 | // This program is distributed in the hope that it will be useful, |
|---|
| 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | // GNU General Public License for more details. |
|---|
| 13 | // |
|---|
| 14 | // You should have received a copy of the GNU General Public License |
|---|
| 15 | // along with this program; if not, write to the Free Software |
|---|
| 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 17 | |
|---|
| 18 | #include "epdfview.h" |
|---|
| 19 | |
|---|
| 20 | using namespace ePDFView; |
|---|
| 21 | |
|---|
| 22 | /// |
|---|
| 23 | /// @brief Constructs a new rectangle. |
|---|
| 24 | /// |
|---|
| 25 | /// @param x1 The X coordinate of the rectangle's top-left corner. |
|---|
| 26 | /// @param y1 The Y coordinate of the rectangle's top-left corner. |
|---|
| 27 | /// @param x2 The X coordinate of the rectangle's bottom-right corner. |
|---|
| 28 | /// @param y2 The Y coordinate of the rectangle's bottom-right corner. |
|---|
| 29 | /// |
|---|
| 30 | DocumentRectangle::DocumentRectangle (gdouble x1, gdouble y1, |
|---|
| 31 | gdouble x2, gdouble y2) |
|---|
| 32 | { |
|---|
| 33 | m_X1 = x1; |
|---|
| 34 | m_X2 = x2; |
|---|
| 35 | m_Y1 = y1; |
|---|
| 36 | m_Y2 = y2; |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | /// |
|---|
| 40 | /// @brief Constructs a new rectangle as a copy of another rectangle. |
|---|
| 41 | /// |
|---|
| 42 | /// @param original The original rectangle to copy. |
|---|
| 43 | /// |
|---|
| 44 | DocumentRectangle::DocumentRectangle (DocumentRectangle &original) |
|---|
| 45 | { |
|---|
| 46 | m_X1 = original.getX1 (); |
|---|
| 47 | m_X2 = original.getX2 (); |
|---|
| 48 | m_Y1 = original.getY1 (); |
|---|
| 49 | m_Y2 = original.getY2 (); |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | /// |
|---|
| 53 | /// @brief Destroys all dynamically allocated memory for DocumentRectangle. |
|---|
| 54 | /// |
|---|
| 55 | DocumentRectangle::~DocumentRectangle () |
|---|
| 56 | { |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | /// |
|---|
| 60 | /// @brief Gets the top-left corner X coordinates. |
|---|
| 61 | /// |
|---|
| 62 | /// @return The X coordinates of the rectangle's top-left corner. |
|---|
| 63 | /// |
|---|
| 64 | gdouble |
|---|
| 65 | DocumentRectangle::getX1 () |
|---|
| 66 | { |
|---|
| 67 | return m_X1; |
|---|
| 68 | } |
|---|
| 69 | |
|---|
| 70 | /// |
|---|
| 71 | /// @brief Gets the bottom-right corner X coordinates. |
|---|
| 72 | /// |
|---|
| 73 | /// @return The X coordinates of the rectangle's bottom-right corner. |
|---|
| 74 | /// |
|---|
| 75 | gdouble |
|---|
| 76 | DocumentRectangle::getX2 () |
|---|
| 77 | { |
|---|
| 78 | return m_X2; |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | /// |
|---|
| 82 | /// @brief Gets the top-left corner Y coordinates. |
|---|
| 83 | /// |
|---|
| 84 | /// @return The Y coordinates of the rectangle's top-left corner. |
|---|
| 85 | /// |
|---|
| 86 | gdouble |
|---|
| 87 | DocumentRectangle::getY1 () |
|---|
| 88 | { |
|---|
| 89 | return m_Y1; |
|---|
| 90 | } |
|---|
| 91 | |
|---|
| 92 | /// |
|---|
| 93 | /// @brief Gets the right-bottom corner Y coordinates. |
|---|
| 94 | /// |
|---|
| 95 | /// @return The Y coordinates of the rectangle's bottom-right corner. |
|---|
| 96 | /// |
|---|
| 97 | gdouble |
|---|
| 98 | DocumentRectangle::getY2 () |
|---|
| 99 | { |
|---|
| 100 | return m_Y2; |
|---|
| 101 | } |
|---|