aboutsummaryrefslogtreecommitdiffstats
path: root/unix/x0vncserver/Geometry.h
diff options
context:
space:
mode:
authorConstantin Kaplinsky <const@tightvnc.com>2008-06-04 03:58:07 +0000
committerConstantin Kaplinsky <const@tightvnc.com>2008-06-04 03:58:07 +0000
commit23c60222f2d481166230788c87df801ec2902678 (patch)
tree03839bcf302c45804bb97a3d728771541d1a759d /unix/x0vncserver/Geometry.h
parente0c80c566649a80697556b767cd014a9625e913f (diff)
downloadtigervnc-23c60222f2d481166230788c87df801ec2902678.tar.gz
tigervnc-23c60222f2d481166230788c87df801ec2902678.zip
Code improvements and better error checking in the Geometry class:
coordinates are now kept as a Rect, added new getRect() method. Also, when the "Geometry" parameter is present but not valid, the constructor will not set the geometry to full screen, zero-size rectangle will be used instead. In that case, x0vncserver will exit with error. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2573 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/x0vncserver/Geometry.h')
-rw-r--r--unix/x0vncserver/Geometry.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/unix/x0vncserver/Geometry.h b/unix/x0vncserver/Geometry.h
index 95059e7d..fdd9033d 100644
--- a/unix/x0vncserver/Geometry.h
+++ b/unix/x0vncserver/Geometry.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 Constantin Kaplinsky. All Rights Reserved.
+/* Copyright (C) 2006-2008 Constantin Kaplinsky. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@
#ifndef __GEOMETRY_H__
#define __GEOMETRY_H__
+#include <rfb/Rect.h>
#include <rfb/Configuration.h>
using namespace rfb;
@@ -32,18 +33,17 @@ class Geometry
public:
Geometry(int fullWidth, int fullHeight);
- int width() const { return m_width; }
- int height() const { return m_height; }
- int offsetLeft() const { return m_offsetLeft; }
- int offsetTop() const { return m_offsetTop; }
+ int width() const { return m_rect.width(); }
+ int height() const { return m_rect.height(); }
+ int offsetLeft() const { return m_rect.tl.x; }
+ int offsetTop() const { return m_rect.tl.y; }
+
+ const Rect& getRect() const { return m_rect; }
protected:
static StringParameter m_geometryParam;
- int m_width;
- int m_height;
- int m_offsetLeft;
- int m_offsetTop;
+ Rect m_rect;
};
#endif // __GEOMETRY_H__