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

Side by Side Diff: ui/gfx/rect.cc

Issue 7977025: aura: Make 'ui' buildable without gtk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 3 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
« no previous file with comments | « ui/gfx/rect.h ('k') | ui/ui.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "ui/gfx/rect.h" 5 #include "ui/gfx/rect.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #elif defined(OS_MACOSX) 9 #elif defined(OS_MACOSX)
10 #include <CoreGraphics/CGGeometry.h> 10 #include <CoreGraphics/CGGeometry.h>
11 #elif defined(USE_X11) 11 #elif defined(TOOLKIT_USES_GTK)
12 #include <gdk/gdk.h> 12 #include <gdk/gdk.h>
13 #endif 13 #endif
14 #if defined(USE_WAYLAND) 14 #if defined(USE_WAYLAND)
15 #include <cairo.h> 15 #include <cairo.h>
16 #endif 16 #endif
17 17
18 #include <ostream> 18 #include <ostream>
19 19
20 #include "ui/gfx/insets.h" 20 #include "ui/gfx/insets.h"
21 21
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 set_width(r.size.width); 73 set_width(r.size.width);
74 set_height(r.size.height); 74 set_height(r.size.height);
75 } 75 }
76 76
77 Rect& Rect::operator=(const CGRect& r) { 77 Rect& Rect::operator=(const CGRect& r) {
78 origin_.SetPoint(r.origin.x, r.origin.y); 78 origin_.SetPoint(r.origin.x, r.origin.y);
79 set_width(r.size.width); 79 set_width(r.size.width);
80 set_height(r.size.height); 80 set_height(r.size.height);
81 return *this; 81 return *this;
82 } 82 }
83 #elif defined(USE_X11) 83 #elif defined(TOOLKIT_USES_GTK)
84 Rect::Rect(const GdkRectangle& r) 84 Rect::Rect(const GdkRectangle& r)
85 : origin_(r.x, r.y) { 85 : origin_(r.x, r.y) {
86 set_width(r.width); 86 set_width(r.width);
87 set_height(r.height); 87 set_height(r.height);
88 } 88 }
89 89
90 Rect& Rect::operator=(const GdkRectangle& r) { 90 Rect& Rect::operator=(const GdkRectangle& r) {
91 origin_.SetPoint(r.x, r.y); 91 origin_.SetPoint(r.x, r.y);
92 set_width(r.width); 92 set_width(r.width);
93 set_height(r.height); 93 set_height(r.height);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 r.left = x(); 152 r.left = x();
153 r.right = right(); 153 r.right = right();
154 r.top = y(); 154 r.top = y();
155 r.bottom = bottom(); 155 r.bottom = bottom();
156 return r; 156 return r;
157 } 157 }
158 #elif defined(OS_MACOSX) 158 #elif defined(OS_MACOSX)
159 CGRect Rect::ToCGRect() const { 159 CGRect Rect::ToCGRect() const {
160 return CGRectMake(x(), y(), width(), height()); 160 return CGRectMake(x(), y(), width(), height());
161 } 161 }
162 #elif defined(USE_X11) 162 #elif defined(TOOLKIT_USES_GTK)
163 GdkRectangle Rect::ToGdkRectangle() const { 163 GdkRectangle Rect::ToGdkRectangle() const {
164 GdkRectangle r = {x(), y(), width(), height()}; 164 GdkRectangle r = {x(), y(), width(), height()};
165 return r; 165 return r;
166 } 166 }
167 #endif 167 #endif
168 #if defined(USE_WAYLAND) 168 #if defined(USE_WAYLAND)
169 cairo_rectangle_int_t Rect::ToCairoRectangle() const { 169 cairo_rectangle_int_t Rect::ToCairoRectangle() const {
170 cairo_rectangle_int_t r = {x(), y(), width(), height()}; 170 cairo_rectangle_int_t r = {x(), y(), width(), height()};
171 return r; 171 return r;
172 } 172 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 (x() == rect.right() || right() == rect.x())) || 271 (x() == rect.right() || right() == rect.x())) ||
272 (x() == rect.x() && width() == rect.width() && 272 (x() == rect.x() && width() == rect.width() &&
273 (y() == rect.bottom() || bottom() == rect.y())); 273 (y() == rect.bottom() || bottom() == rect.y()));
274 } 274 }
275 275
276 std::ostream& operator<<(std::ostream& out, const gfx::Rect& r) { 276 std::ostream& operator<<(std::ostream& out, const gfx::Rect& r) {
277 return out << r.origin() << " " << r.size(); 277 return out << r.origin() << " " << r.size();
278 } 278 }
279 279
280 } // namespace gfx 280 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/rect.h ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698