/* $Id: rectangle.hg,v 1.2 2004/01/05 17:32:12 murrayc Exp $ */

/* rectangle.h
 *
 * Copyright (C) 1998-2002 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gdk/gdk.h>

_DEFS(gdkmm,gdk)

namespace Gdk
{

/** Gdk::Rectangle is a structure holding the position and size of a rectangle.
 * The intersection of two rectangles can be computed with intersect(). To find the union of two rectangles use union().
 */
class Rectangle
{
  _CLASS_BOXEDTYPE_STATIC(Rectangle, GdkRectangle)
public:
//_CUSTOM_DEFAULT_CTOR
//Rectangle();
  Rectangle(int x, int y, int width, int height);

  Rectangle& join(const Rectangle& src2);
  Rectangle& intersect(const Rectangle& src2);
  Rectangle& intersect(const Rectangle& src2, bool& rectangles_intersect);

  bool has_zero_area() const;

  _MEMBER_GET(x, x, int, int)
  _MEMBER_SET(x, x, int, int)
  _MEMBER_GET(y, y, int, int)
  _MEMBER_SET(y, y, int, int)
  _MEMBER_GET(width, width, int, int)
  _MEMBER_SET(width, width, int, int)
  _MEMBER_GET(height, height, int, int)
  _MEMBER_SET(height, height, int, int)
};

} // namespace Gdk

