Remove WebKitTestRunner::setClientWindowRect.
[chromium-blink-merge.git] / ui / gfx / size.h
blobc96f5897f3b72d82770668dcc6828f17da4ce2ce
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.
5 #ifndef UI_GFX_SIZE_H_
6 #define UI_GFX_SIZE_H_
8 #include <string>
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"
15 #if defined(OS_WIN)
16 typedef struct tagSIZE SIZE;
17 #elif defined(OS_IOS)
18 #include <CoreGraphics/CoreGraphics.h>
19 #elif defined(OS_MACOSX)
20 #include <ApplicationServices/ApplicationServices.h>
21 #endif
23 namespace gfx {
25 // A size has width and height values.
26 class GFX_EXPORT Size : public SizeBase<Size, int> {
27 public:
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);
32 #endif
34 ~Size() {}
36 #if defined(OS_MACOSX)
37 Size& operator=(const CGSize& s);
38 #endif
40 #if defined(OS_WIN)
41 SIZE ToSIZE() const;
42 #elif defined(OS_MACOSX)
43 CGSize ToCGSize() const;
44 #endif
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) {
58 return !(lhs == rhs);
61 #if !defined(COMPILER_MSVC)
62 extern template class SizeBase<Size, int>;
63 #endif
65 } // namespace gfx
67 #endif // UI_GFX_SIZE_H_