OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070 | 716 #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070 |
717 bool useNSTextFieldCell = o->style()->hasAppearance() | 717 bool useNSTextFieldCell = o->style()->hasAppearance() |
718 && o->style()->visitedDependentColor(CSSPropertyBackgroundColor) == Colo
r::white | 718 && o->style()->visitedDependentColor(CSSPropertyBackgroundColor) == Colo
r::white |
719 && !o->style()->hasBackgroundImage(); | 719 && !o->style()->hasBackgroundImage(); |
720 | 720 |
721 // We do not use NSTextFieldCell to draw styled text fields on Lion and Snow
Leopard because | 721 // We do not use NSTextFieldCell to draw styled text fields on Lion and Snow
Leopard because |
722 // there are a number of bugs on those platforms that require NSTextFieldCel
l to be in charge | 722 // there are a number of bugs on those platforms that require NSTextFieldCel
l to be in charge |
723 // of painting its own background. We need WebCore to paint styled backgroun
ds, so we'll use | 723 // of painting its own background. We need WebCore to paint styled backgroun
ds, so we'll use |
724 // this WebCoreSystemInterface function instead. | 724 // this WebCoreSystemInterface function instead. |
725 if (!useNSTextFieldCell) { | 725 if (!useNSTextFieldCell) { |
726 wkDrawBezeledTextFieldCell(r, isEnabled(o) && !isReadOnlyControl(o)); | 726 WKDrawBezeledTextFieldCell(r, isEnabled(o) && !isReadOnlyControl(o)); |
727 return false; | 727 return false; |
728 } | 728 } |
729 #endif | 729 #endif |
730 | 730 |
731 NSTextFieldCell *textField = this->textField(); | 731 NSTextFieldCell *textField = this->textField(); |
732 | 732 |
733 GraphicsContextStateSaver stateSaver(*paintInfo.context); | 733 GraphicsContextStateSaver stateSaver(*paintInfo.context); |
734 | 734 |
735 [textField setEnabled:(isEnabled(o) && !isReadOnlyControl(o))]; | 735 [textField setEnabled:(isEnabled(o) && !isReadOnlyControl(o))]; |
736 [textField drawWithFrame:NSRect(r) inView:documentViewFor(o)]; | 736 [textField drawWithFrame:NSRect(r) inView:documentViewFor(o)]; |
737 | 737 |
738 [textField setControlView:nil]; | 738 [textField setControlView:nil]; |
739 | 739 |
740 return false; | 740 return false; |
741 } | 741 } |
742 | 742 |
743 void RenderThemeMacShared::adjustTextFieldStyle(StyleResolver*, RenderStyle*, El
ement*) const | 743 void RenderThemeMacShared::adjustTextFieldStyle(StyleResolver*, RenderStyle*, El
ement*) const |
744 { | 744 { |
745 } | 745 } |
746 | 746 |
747 bool RenderThemeMacShared::paintCapsLockIndicator(RenderObject*, const PaintInfo
& paintInfo, const IntRect& r) | 747 bool RenderThemeMacShared::paintCapsLockIndicator(RenderObject*, const PaintInfo
& paintInfo, const IntRect& r) |
748 { | 748 { |
749 if (paintInfo.context->paintingDisabled()) | 749 if (paintInfo.context->paintingDisabled()) |
750 return true; | 750 return true; |
751 | 751 |
752 LocalCurrentGraphicsContext localContext(paintInfo.context); | 752 LocalCurrentGraphicsContext localContext(paintInfo.context); |
753 wkDrawCapsLockIndicator(localContext.cgContext(), r); | 753 WKDrawCapsLockIndicator(localContext.cgContext(), r); |
754 | 754 |
755 return false; | 755 return false; |
756 } | 756 } |
757 | 757 |
758 bool RenderThemeMacShared::paintTextArea(RenderObject* o, const PaintInfo& paint
Info, const IntRect& r) | 758 bool RenderThemeMacShared::paintTextArea(RenderObject* o, const PaintInfo& paint
Info, const IntRect& r) |
759 { | 759 { |
760 LocalCurrentGraphicsContext localContext(paintInfo.context); | 760 LocalCurrentGraphicsContext localContext(paintInfo.context); |
761 wkDrawBezeledTextArea(r, isEnabled(o) && !isReadOnlyControl(o)); | 761 WKDrawBezeledTextArea(r, isEnabled(o) && !isReadOnlyControl(o)); |
762 return false; | 762 return false; |
763 } | 763 } |
764 | 764 |
765 void RenderThemeMacShared::adjustTextAreaStyle(StyleResolver*, RenderStyle*, Ele
ment*) const | 765 void RenderThemeMacShared::adjustTextAreaStyle(StyleResolver*, RenderStyle*, Ele
ment*) const |
766 { | 766 { |
767 } | 767 } |
768 | 768 |
769 const int* RenderThemeMacShared::popupButtonMargins() const | 769 const int* RenderThemeMacShared::popupButtonMargins() const |
770 { | 770 { |
771 static const int margins[3][4] = | 771 static const int margins[3][4] = |
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 strToTruncate = fileListDefaultLabel(multipleFilesAllowed); | 1806 strToTruncate = fileListDefaultLabel(multipleFilesAllowed); |
1807 else if (fileList->length() == 1) | 1807 else if (fileList->length() == 1) |
1808 strToTruncate = [[NSFileManager defaultManager] displayNameAtPath:(fileL
ist->item(0)->path())]; | 1808 strToTruncate = [[NSFileManager defaultManager] displayNameAtPath:(fileL
ist->item(0)->path())]; |
1809 else | 1809 else |
1810 return StringTruncator::rightTruncate(multipleFileUploadText(fileList->l
ength()), width, font, StringTruncator::EnableRoundingHacks); | 1810 return StringTruncator::rightTruncate(multipleFileUploadText(fileList->l
ength()), width, font, StringTruncator::EnableRoundingHacks); |
1811 | 1811 |
1812 return StringTruncator::centerTruncate(strToTruncate, width, font, StringTru
ncator::EnableRoundingHacks); | 1812 return StringTruncator::centerTruncate(strToTruncate, width, font, StringTru
ncator::EnableRoundingHacks); |
1813 } | 1813 } |
1814 | 1814 |
1815 } // namespace WebCore | 1815 } // namespace WebCore |
OLD | NEW |