| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2009 Google, Inc. | 3 * Copyright (C) 2008, 2009 Google, Inc. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #import "core/paint/ThemePainterMac.h" | 21 #import "core/paint/ThemePainterMac.h" |
| 22 | 22 |
| 23 #import "core/layout/LayoutMeter.h" | |
| 24 #import "core/layout/LayoutProgress.h" | 23 #import "core/layout/LayoutProgress.h" |
| 25 #import "core/layout/LayoutThemeMac.h" | 24 #import "core/layout/LayoutThemeMac.h" |
| 26 #import "core/layout/LayoutView.h" | 25 #import "core/layout/LayoutView.h" |
| 27 #import "core/paint/PaintInfo.h" | 26 #import "core/paint/PaintInfo.h" |
| 28 #import "platform/geometry/FloatRoundedRect.h" | 27 #import "platform/geometry/FloatRoundedRect.h" |
| 29 #import "platform/graphics/BitmapImage.h" | 28 #import "platform/graphics/BitmapImage.h" |
| 30 #import "platform/graphics/GraphicsContextStateSaver.h" | 29 #import "platform/graphics/GraphicsContextStateSaver.h" |
| 31 #import "platform/graphics/Image.h" | 30 #import "platform/graphics/Image.h" |
| 32 #import "platform/graphics/ImageBuffer.h" | 31 #import "platform/graphics/ImageBuffer.h" |
| 33 #import "platform/mac/ColorMac.h" | 32 #import "platform/mac/ColorMac.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 183 |
| 185 NSView *view = m_layoutTheme.documentViewFor(o); | 184 NSView *view = m_layoutTheme.documentViewFor(o); |
| 186 [popupButton drawWithFrame:inflatedRect inView:view]; | 185 [popupButton drawWithFrame:inflatedRect inView:view]; |
| 187 if (!ThemeMac::drawWithFrameDrawsFocusRing() && LayoutTheme::isFocused(o) &&
o.styleRef().outlineStyleIsAuto()) | 186 if (!ThemeMac::drawWithFrameDrawsFocusRing() && LayoutTheme::isFocused(o) &&
o.styleRef().outlineStyleIsAuto()) |
| 188 [popupButton cr_drawFocusRingWithFrame:inflatedRect inView:view]; | 187 [popupButton cr_drawFocusRingWithFrame:inflatedRect inView:view]; |
| 189 [popupButton setControlView:nil]; | 188 [popupButton setControlView:nil]; |
| 190 | 189 |
| 191 return false; | 190 return false; |
| 192 } | 191 } |
| 193 | 192 |
| 194 bool ThemePainterMac::paintMeter(const LayoutObject& layoutObject, const PaintIn
fo& paintInfo, const IntRect& rect) | |
| 195 { | |
| 196 if (!layoutObject.isMeter()) | |
| 197 return true; | |
| 198 | |
| 199 LocalCurrentGraphicsContext localContext(paintInfo.context, &paintInfo.cullR
ect().m_rect, rect); | |
| 200 | |
| 201 NSLevelIndicatorCell* cell = m_layoutTheme.levelIndicatorFor(toLayoutMeter(l
ayoutObject)); | |
| 202 GraphicsContextStateSaver stateSaver(paintInfo.context); | |
| 203 | |
| 204 [cell drawWithFrame:rect inView:m_layoutTheme.documentViewFor(layoutObject)]
; | |
| 205 [cell setControlView:nil]; | |
| 206 return false; | |
| 207 } | |
| 208 | |
| 209 bool ThemePainterMac::paintProgressBar(const LayoutObject& layoutObject, const P
aintInfo& paintInfo, const IntRect& rect) | 193 bool ThemePainterMac::paintProgressBar(const LayoutObject& layoutObject, const P
aintInfo& paintInfo, const IntRect& rect) |
| 210 { | 194 { |
| 211 if (!layoutObject.isProgress()) | 195 if (!layoutObject.isProgress()) |
| 212 return true; | 196 return true; |
| 213 | 197 |
| 214 float zoomLevel = layoutObject.styleRef().effectiveZoom(); | 198 float zoomLevel = layoutObject.styleRef().effectiveZoom(); |
| 215 NSControlSize controlSize = m_layoutTheme.controlSizeForFont(layoutObject.st
yleRef()); | 199 NSControlSize controlSize = m_layoutTheme.controlSizeForFont(layoutObject.st
yleRef()); |
| 216 IntSize size = m_layoutTheme.progressBarSizes()[controlSize]; | 200 IntSize size = m_layoutTheme.progressBarSizes()[controlSize]; |
| 217 size.setHeight(size.height() * zoomLevel); | 201 size.setHeight(size.height() * zoomLevel); |
| 218 size.setWidth(rect.width()); | 202 size.setWidth(rect.width()); |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 [search setSearchMenuTemplate:nil]; | 576 [search setSearchMenuTemplate:nil]; |
| 593 | 577 |
| 594 m_layoutTheme.updateActiveState([search searchButtonCell], o); | 578 m_layoutTheme.updateActiveState([search searchButtonCell], o); |
| 595 | 579 |
| 596 [[search searchButtonCell] drawWithFrame:unzoomedRect inView:m_layoutTheme.d
ocumentViewFor(o)]; | 580 [[search searchButtonCell] drawWithFrame:unzoomedRect inView:m_layoutTheme.d
ocumentViewFor(o)]; |
| 597 [[search searchButtonCell] setControlView:nil]; | 581 [[search searchButtonCell] setControlView:nil]; |
| 598 return false; | 582 return false; |
| 599 } | 583 } |
| 600 | 584 |
| 601 } // namespace blink | 585 } // namespace blink |
| OLD | NEW |