Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: ui/gfx/size.h

Issue 10993094: Make adding and subtracting gfx:: point types simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_SIZE_H_ 5 #ifndef UI_GFX_SIZE_H_
6 #define UI_GFX_SIZE_H_ 6 #define UI_GFX_SIZE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 #include "ui/base/ui_export.h" 11 #include "ui/base/ui_export.h"
12 #include "ui/gfx/size_base.h" 12 #include "ui/gfx/size_base.h"
13 #include "ui/gfx/size_f.h"
13 14
14 #if defined(OS_WIN) 15 #if defined(OS_WIN)
15 typedef struct tagSIZE SIZE; 16 typedef struct tagSIZE SIZE;
16 #elif defined(OS_IOS) 17 #elif defined(OS_IOS)
17 #include <CoreGraphics/CoreGraphics.h> 18 #include <CoreGraphics/CoreGraphics.h>
18 #elif defined(OS_MACOSX) 19 #elif defined(OS_MACOSX)
19 #include <ApplicationServices/ApplicationServices.h> 20 #include <ApplicationServices/ApplicationServices.h>
20 #endif 21 #endif
21 22
22 namespace gfx { 23 namespace gfx {
(...skipping 13 matching lines...) Expand all
36 Size& operator=(const CGSize& s); 37 Size& operator=(const CGSize& s);
37 #endif 38 #endif
38 39
39 #if defined(OS_WIN) 40 #if defined(OS_WIN)
40 SIZE ToSIZE() const; 41 SIZE ToSIZE() const;
41 #elif defined(OS_MACOSX) 42 #elif defined(OS_MACOSX)
42 CGSize ToCGSize() const; 43 CGSize ToCGSize() const;
43 #endif 44 #endif
44 45
45 std::string ToString() const; 46 std::string ToString() const;
47
48 operator SizeF() const {
sky 2012/10/01 21:02:20 Why is this better than ToSizeF?
49 return SizeF(width(), height());
50 }
46 }; 51 };
47 52
48 #if !defined(COMPILER_MSVC) 53 #if !defined(COMPILER_MSVC)
49 extern template class SizeBase<Size, int>; 54 extern template class SizeBase<Size, int>;
50 #endif 55 #endif
51 56
52 } // namespace gfx 57 } // namespace gfx
53 58
54 #endif // UI_GFX_SIZE_H_ 59 #endif // UI_GFX_SIZE_H_
OLDNEW
« ui/gfx/rect.h ('K') | « ui/gfx/rect.h ('k') | ui/gfx/size_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698