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, |
(...skipping 30 matching lines...) Expand all Loading... |
41 #import "core/platform/SharedBuffer.h" | 41 #import "core/platform/SharedBuffer.h" |
42 #import "core/platform/graphics/BitmapImage.h" | 42 #import "core/platform/graphics/BitmapImage.h" |
43 #import "core/platform/graphics/Image.h" | 43 #import "core/platform/graphics/Image.h" |
44 #import "core/platform/graphics/ImageBuffer.h" | 44 #import "core/platform/graphics/ImageBuffer.h" |
45 #import "core/platform/graphics/StringTruncator.h" | 45 #import "core/platform/graphics/StringTruncator.h" |
46 #import "core/platform/graphics/cg/GraphicsContextCG.h" | 46 #import "core/platform/graphics/cg/GraphicsContextCG.h" |
47 #import "core/platform/graphics/mac/ColorMac.h" | 47 #import "core/platform/graphics/mac/ColorMac.h" |
48 #import "core/platform/mac/LocalCurrentGraphicsContext.h" | 48 #import "core/platform/mac/LocalCurrentGraphicsContext.h" |
49 #import "core/platform/mac/ThemeMac.h" | 49 #import "core/platform/mac/ThemeMac.h" |
50 #import "core/platform/mac/WebCoreNSCellExtras.h" | 50 #import "core/platform/mac/WebCoreNSCellExtras.h" |
51 #import "core/platform/mac/WebCoreSystemInterface.h" | |
52 #import "core/rendering/PaintInfo.h" | 51 #import "core/rendering/PaintInfo.h" |
53 #import "core/rendering/RenderLayer.h" | 52 #import "core/rendering/RenderLayer.h" |
54 #import "core/rendering/RenderMedia.h" | 53 #import "core/rendering/RenderMedia.h" |
55 #import "core/rendering/RenderMediaControls.h" | 54 #import "core/rendering/RenderMediaControls.h" |
56 #import "core/rendering/RenderMediaControlsChromium.h" | 55 #import "core/rendering/RenderMediaControlsChromium.h" |
57 #import "core/rendering/RenderMeter.h" | 56 #import "core/rendering/RenderMeter.h" |
58 #import "core/rendering/RenderProgress.h" | 57 #import "core/rendering/RenderProgress.h" |
59 #import "core/rendering/RenderSlider.h" | 58 #import "core/rendering/RenderSlider.h" |
60 #import "core/rendering/RenderView.h" | 59 #import "core/rendering/RenderView.h" |
61 | 60 |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 | 763 |
765 void RenderThemeChromiumMac::adjustTextFieldStyle(StyleResolver*, RenderStyle*,
Element*) const | 764 void RenderThemeChromiumMac::adjustTextFieldStyle(StyleResolver*, RenderStyle*,
Element*) const |
766 { | 765 { |
767 } | 766 } |
768 | 767 |
769 bool RenderThemeChromiumMac::paintCapsLockIndicator(RenderObject*, const PaintIn
fo& paintInfo, const IntRect& r) | 768 bool RenderThemeChromiumMac::paintCapsLockIndicator(RenderObject*, const PaintIn
fo& paintInfo, const IntRect& r) |
770 { | 769 { |
771 if (paintInfo.context->paintingDisabled()) | 770 if (paintInfo.context->paintingDisabled()) |
772 return true; | 771 return true; |
773 | 772 |
| 773 // This draws the caps lock indicator as it was done by WKDrawCapsLockIndica
tor. |
774 LocalCurrentGraphicsContext localContext(paintInfo.context); | 774 LocalCurrentGraphicsContext localContext(paintInfo.context); |
775 WKDrawCapsLockIndicator(localContext.cgContext(), r); | 775 CGContextRef c = localContext.cgContext(); |
| 776 CGMutablePathRef shape = CGPathCreateMutable(); |
| 777 |
| 778 // To draw the caps lock indicator, draw the shape into a small |
| 779 // square that is then scaled to the size of r. |
| 780 const CGFloat kSquareSize = 17; |
| 781 |
| 782 // Create a rounted square shape. |
| 783 CGPathMoveToPoint(shape, NULL, 16.5, 4.5); |
| 784 CGPathAddArc(shape, NULL, 12.5, 12.5, 4, 0, M_PI_2, false); |
| 785 CGPathAddArc(shape, NULL, 4.5, 12.5, 4, M_PI_2, M_PI, false); |
| 786 CGPathAddArc(shape, NULL, 4.5, 4.5, 4, M_PI, 3*M_PI/2, false); |
| 787 CGPathAddArc(shape, NULL, 12.5, 4.5, 4, 3*M_PI/2, 0, false); |
| 788 |
| 789 // Draw the arrow - note this is drawing in a flipped coordinate system, so
the |
| 790 // arrow is pointing down. |
| 791 CGPathMoveToPoint(shape, NULL, 8.5, 2); // Tip point. |
| 792 CGPathAddLineToPoint(shape, NULL, 4, 7); |
| 793 CGPathAddLineToPoint(shape, NULL, 6.25, 7); |
| 794 CGPathAddLineToPoint(shape, NULL, 6.25, 10.25); |
| 795 CGPathAddLineToPoint(shape, NULL, 10.75, 10.25); |
| 796 CGPathAddLineToPoint(shape, NULL, 10.75, 7); |
| 797 CGPathAddLineToPoint(shape, NULL, 13, 7); |
| 798 CGPathAddLineToPoint(shape, NULL, 8.5, 2); |
| 799 |
| 800 // Draw the rectangle that underneath (or above in the flipped system) the a
rrow. |
| 801 CGPathAddLineToPoint(shape, NULL, 10.75, 12); |
| 802 CGPathAddLineToPoint(shape, NULL, 6.25, 12); |
| 803 CGPathAddLineToPoint(shape, NULL, 6.25, 14.25); |
| 804 CGPathAddLineToPoint(shape, NULL, 10.75, 14.25); |
| 805 CGPathAddLineToPoint(shape, NULL, 10.75, 12); |
| 806 |
| 807 // Scale and translate the shape. |
| 808 CGRect cgr = r; |
| 809 CGFloat maxX = CGRectGetMaxX(cgr); |
| 810 CGFloat minY = CGRectGetMinY(cgr); |
| 811 CGFloat heightScale = r.height() / kSquareSize; |
| 812 CGAffineTransform transform = CGAffineTransformMake( |
| 813 heightScale, 0, // A B |
| 814 0, heightScale, // C D |
| 815 maxX - r.height(), minY); // Tx Ty |
| 816 |
| 817 CGMutablePathRef paintPath = CGPathCreateMutable(); |
| 818 CGPathAddPath(paintPath, &transform, shape); |
| 819 CGPathRelease(shape); |
| 820 |
| 821 CGContextSetRGBFillColor(c, 0, 0, 0, 0.4); |
| 822 CGContextBeginPath(c); |
| 823 CGContextAddPath(c, paintPath); |
| 824 CGContextFillPath(c); |
| 825 CGPathRelease(paintPath); |
776 | 826 |
777 return false; | 827 return false; |
778 } | 828 } |
779 | 829 |
780 bool RenderThemeChromiumMac::paintTextArea(RenderObject* o, const PaintInfo& pai
ntInfo, const IntRect& r) | 830 bool RenderThemeChromiumMac::paintTextArea(RenderObject* o, const PaintInfo& pai
ntInfo, const IntRect& r) |
781 { | 831 { |
782 LocalCurrentGraphicsContext localContext(paintInfo.context); | 832 LocalCurrentGraphicsContext localContext(paintInfo.context); |
783 _NSDrawCarbonThemeListBox(r, isEnabled(o) && !isReadOnlyControl(o), YES, YES
); | 833 _NSDrawCarbonThemeListBox(r, isEnabled(o) && !isReadOnlyControl(o), YES, YES
); |
784 return false; | 834 return false; |
785 } | 835 } |
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1976 { | 2026 { |
1977 return RenderMediaControlsChromium::paintMediaControlsPart(MediaEnterFullscr
eenButton, object, paintInfo, rect); | 2027 return RenderMediaControlsChromium::paintMediaControlsPart(MediaEnterFullscr
eenButton, object, paintInfo, rect); |
1978 } | 2028 } |
1979 | 2029 |
1980 bool RenderThemeChromiumMac::paintMediaToggleClosedCaptionsButton(RenderObject*
object, const PaintInfo& paintInfo, const IntRect& rect) | 2030 bool RenderThemeChromiumMac::paintMediaToggleClosedCaptionsButton(RenderObject*
object, const PaintInfo& paintInfo, const IntRect& rect) |
1981 { | 2031 { |
1982 return RenderMediaControlsChromium::paintMediaControlsPart(MediaShowClosedCa
ptionsButton, object, paintInfo, rect); | 2032 return RenderMediaControlsChromium::paintMediaControlsPart(MediaShowClosedCa
ptionsButton, object, paintInfo, rect); |
1983 } | 2033 } |
1984 | 2034 |
1985 } // namespace WebCore | 2035 } // namespace WebCore |
OLD | NEW |