1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
10 #include "base/compiler_specific.h"
11 #include "ui/gfx/gfx_export.h"
12 #include "ui/gfx/size_base.h"
13 #include "ui/gfx/size_f.h"
16 typedef struct tagSIZE SIZE;
18 #include <CoreGraphics/CoreGraphics.h>
19 #elif defined(OS_MACOSX)
20 #include <ApplicationServices/ApplicationServices.h>
25 // A size has width and height values.
26 class GFX_EXPORT Size : public SizeBase<Size, int> {
28 Size() : SizeBase<Size, int>(0, 0) {}
29 Size(int width, int height) : SizeBase<Size, int>(width, height) {}
30 #if defined(OS_MACOSX)
31 explicit Size(const CGSize& s);
36 #if defined(OS_MACOSX)
37 Size& operator=(const CGSize& s);
42 #elif defined(OS_MACOSX)
43 CGSize ToCGSize() const;
46 operator SizeF() const {
47 return SizeF(width(), height());
50 std::string ToString() const;
53 inline bool operator==(const Size& lhs, const Size& rhs) {
54 return lhs.width() == rhs.width() && lhs.height() == rhs.height();
57 inline bool operator!=(const Size& lhs, const Size& rhs) {
61 #if !defined(COMPILER_MSVC)
62 extern template class SizeBase<Size, int>;
67 #endif // UI_GFX_SIZE_H_