]> Dogcows Code - chaz/openbox/blobdiff - otk/rect.hh
dont unset focused client if it is still/already set, that causes bugs!
[chaz/openbox] / otk / rect.hh
index 83c2b225b63ef2645a22a4bbe900a4c8369af934..65a679c74240440864df691885145a95f5e907ca 100644 (file)
@@ -35,6 +35,12 @@ public:
   inline Rect(const Point &location, const Point &size)
     : _x1(location.x()), _y1(location.y()),
       _x2(size.x() + location.x() - 1), _y2(size.y() + location.y() - 1) { }
+  //! Constructs a Rect from another Rect
+  /*!
+    @param rect The rectangle from which to construct this new one
+  */
+  inline Rect(const Rect &rect)
+    : _x1(rect._x1), _y1(rect._y1), _x2(rect._x2), _y2(rect._y2) { }
   //! Constructs a Rect from an XRectangle
   inline explicit Rect(const XRectangle& xrect)
     : _x1(xrect.x), _y1(xrect.y), _x2(xrect.width + xrect.x - 1),
@@ -213,6 +219,14 @@ public:
     @return true if the point is contained within this Rect; otherwise, false
   */
   bool contains(int x, int y) const;
+  //! Determines if this Rect contains a point
+  /*!
+    The rectangle contains the point if it falls within the rectangle's
+    boundaries.
+    @param p The point to operate on
+    @return true if the point is contained within this Rect; otherwise, false
+  */
+  bool contains(const Point &p) const;
   //! Determines if this Rect contains another Rect entirely
   /*!
     This rectangle contains the second rectangle if it is entirely within this
This page took 0.021494 seconds and 4 git commands to generate.