OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2010, 2011, 2012 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2010, 2011, 2012 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 12 matching lines...) Expand all Loading... |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #import "config.h" | 26 #import "config.h" |
27 #import "platform/mac/ThemeMac.h" | 27 #import "platform/mac/ThemeMac.h" |
28 | 28 |
29 #import <Carbon/Carbon.h> | 29 #import <Carbon/Carbon.h> |
30 #import "platform/graphics/GraphicsContextStateSaver.h" | 30 #import "platform/graphics/GraphicsContextStateSaver.h" |
31 #import "platform/mac/BlockExceptions.h" | 31 #import "platform/mac/BlockExceptions.h" |
32 #import "platform/mac/LocalCurrentGraphicsContext.h" | 32 #import "platform/mac/LocalCurrentGraphicsContext.h" |
33 #import "platform/mac/VersionUtilMac.h" | |
34 #import "platform/mac/WebCoreNSCellExtras.h" | 33 #import "platform/mac/WebCoreNSCellExtras.h" |
35 #import "platform/scroll/ScrollableArea.h" | 34 #import "platform/scroll/ScrollableArea.h" |
36 #include "wtf/StdLibExtras.h" | 35 #include "wtf/StdLibExtras.h" |
37 | 36 |
38 // This is a view whose sole purpose is to tell AppKit that it's flipped. | 37 // This is a view whose sole purpose is to tell AppKit that it's flipped. |
39 @interface WebCoreFlippedView : NSControl | 38 @interface WebCoreFlippedView : NSControl |
40 @end | 39 @end |
41 | 40 |
42 @implementation WebCoreFlippedView | 41 @implementation WebCoreFlippedView |
43 | 42 |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 paintButton(part, states, context, zoomedRect, zoomFactor, scrollabl
eArea); | 689 paintButton(part, states, context, zoomedRect, zoomFactor, scrollabl
eArea); |
691 break; | 690 break; |
692 case InnerSpinButtonPart: | 691 case InnerSpinButtonPart: |
693 paintStepper(states, context, zoomedRect, zoomFactor, scrollableArea
); | 692 paintStepper(states, context, zoomedRect, zoomFactor, scrollableArea
); |
694 break; | 693 break; |
695 default: | 694 default: |
696 break; | 695 break; |
697 } | 696 } |
698 } | 697 } |
699 | 698 |
| 699 #ifndef NSAppKitVersionNumber10_7 |
| 700 #define NSAppKitVersionNumber10_7 1138 |
| 701 #endif |
| 702 #ifndef NSAppKitVersionNumber10_9 |
| 703 #define NSAppKitVersionNumber10_9 1265 |
| 704 #endif |
| 705 |
700 bool ThemeMac::drawWithFrameDrawsFocusRing() | 706 bool ThemeMac::drawWithFrameDrawsFocusRing() |
701 { | 707 { |
702 #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_V
ERSION_10_8 | 708 #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_V
ERSION_10_8 |
703 // If compiling against an OSX 10.8+ SDK, only 10.7 and older OSes will draw a | 709 // If compiling against an OSX 10.8+ SDK, only 10.7 and older OSes will draw a |
704 // focus ring with the frame. | 710 // focus ring with the frame. |
705 return IsOSLionOrEarlier(); | 711 return floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_7; |
706 #else | 712 #else |
707 // If compiling an OSX 10.7 or older SDK, OSes up through 10.9 will draw a focus | 713 // If compiling an OSX 10.7 or older SDK, OSes up through 10.9 will draw a focus |
708 // ring with the frame. | 714 // ring with the frame. |
709 return IsOSMavericksOrEarlier(); | 715 return floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_9; |
710 #endif | 716 #endif |
711 } | 717 } |
712 | 718 |
713 } | 719 } |
OLD | NEW |