diff options
Diffstat (limited to 'base/gfx/rect.cc')
-rw-r--r-- | base/gfx/rect.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/base/gfx/rect.cc b/base/gfx/rect.cc index b7e2942..0f9708c 100644 --- a/base/gfx/rect.cc +++ b/base/gfx/rect.cc @@ -8,6 +8,8 @@ #include <windows.h> #elif defined(OS_MACOSX) #include <CoreGraphics/CGGeometry.h> +#elif defined(OS_LINUX) +#include <gdk/gdk.h> #endif #include "base/logging.h" @@ -68,6 +70,19 @@ Rect& Rect::operator=(const CGRect& r) { set_height(r.size.height); return *this; } +#elif defined(OS_LINUX) +Rect::Rect(const GdkRectangle& r) + : origin_(r.x, r.y) { + set_width(r.width); + set_height(r.height); +} + +Rect& Rect::operator=(const GdkRectangle& r) { + origin_.SetPoint(r.x, r.y); + set_width(r.width); + set_height(r.height); + return *this; +} #endif void Rect::set_width(int width) { |