diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/gfx/size.cc | 13 | ||||
-rw-r--r-- | base/gfx/size.h | 7 |
2 files changed, 20 insertions, 0 deletions
diff --git a/base/gfx/size.cc b/base/gfx/size.cc index 76dc023..91f39c0 100644 --- a/base/gfx/size.cc +++ b/base/gfx/size.cc @@ -21,6 +21,19 @@ Size::Size(int width, int height) { set_height(height); } +#if defined(OS_MACOSX) +Size::Size(const CGSize& s) { + set_width(s.width); + set_height(s.height); +} + +Size& Size::operator=(const CGSize& s) { + set_width(s.width); + set_height(s.height); + return *this; +} +#endif + #if defined(OS_WIN) SIZE Size::ToSIZE() const { SIZE s; diff --git a/base/gfx/size.h b/base/gfx/size.h index 3e74e80..896908e8 100644 --- a/base/gfx/size.h +++ b/base/gfx/size.h @@ -24,9 +24,16 @@ class Size { public: Size() : width_(0), height_(0) {} Size(int width, int height); +#if defined(OS_MACOSX) + explicit Size(const CGSize& s); +#endif ~Size() {} +#if defined(OS_MACOSX) + Size& operator=(const CGSize& s); +#endif + int width() const { return width_; } int height() const { return height_; } |