Constantin Kaplinsky | 23c6022 | 2008-06-04 03:58:07 +0000 | [diff] [blame] | 1 | /* Copyright (C) 2006-2008 Constantin Kaplinsky. All Rights Reserved. |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 2 | * |
| 3 | * This is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation; either version 2 of the License, or |
| 6 | * (at your option) any later version. |
| 7 | * |
| 8 | * This software is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this software; if not, write to the Free Software |
| 15 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
| 16 | * USA. |
| 17 | */ |
| 18 | |
| 19 | // |
| 20 | // Geometry.h |
| 21 | // |
| 22 | |
| 23 | #ifndef __GEOMETRY_H__ |
| 24 | #define __GEOMETRY_H__ |
| 25 | |
Constantin Kaplinsky | 23c6022 | 2008-06-04 03:58:07 +0000 | [diff] [blame] | 26 | #include <rfb/Rect.h> |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 27 | #include <rfb/Configuration.h> |
| 28 | |
| 29 | using namespace rfb; |
| 30 | |
| 31 | class Geometry |
| 32 | { |
| 33 | public: |
| 34 | Geometry(int fullWidth, int fullHeight); |
| 35 | |
Constantin Kaplinsky | 23c6022 | 2008-06-04 03:58:07 +0000 | [diff] [blame] | 36 | int width() const { return m_rect.width(); } |
| 37 | int height() const { return m_rect.height(); } |
| 38 | int offsetLeft() const { return m_rect.tl.x; } |
| 39 | int offsetTop() const { return m_rect.tl.y; } |
| 40 | |
| 41 | const Rect& getRect() const { return m_rect; } |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 42 | |
| 43 | protected: |
Constantin Kaplinsky | 5120e5e | 2008-08-20 06:04:57 +0000 | [diff] [blame] | 44 | Rect parseString(const char *arg) const; |
| 45 | |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 46 | static StringParameter m_geometryParam; |
| 47 | |
Constantin Kaplinsky | 23c6022 | 2008-06-04 03:58:07 +0000 | [diff] [blame] | 48 | Rect m_rect; |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | #endif // __GEOMETRY_H__ |
| 52 | |