OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Computer, Inc. | 2 * Copyright (C) 2007 Apple Computer, Inc. |
3 * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. | 3 * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 14 matching lines...) Expand all Loading... |
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #ifndef FontCustomPlatformData_h | 32 #ifndef FontCustomPlatformData_h |
33 #define FontCustomPlatformData_h | 33 #define FontCustomPlatformData_h |
34 | 34 |
| 35 #include "platform/PlatformExport.h" |
35 #include "platform/fonts/FontOrientation.h" | 36 #include "platform/fonts/FontOrientation.h" |
36 #include "platform/fonts/FontWidthVariant.h" | 37 #include "platform/fonts/FontWidthVariant.h" |
37 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
38 #include "wtf/Noncopyable.h" | 39 #include "wtf/Noncopyable.h" |
39 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
40 | 41 |
41 #if OS(WIN) && ENABLE(GDI_FONTS_ON_WINDOWS) | 42 #if OS(WIN) && ENABLE(GDI_FONTS_ON_WINDOWS) |
42 #include <windows.h> | 43 #include <windows.h> |
43 #endif | 44 #endif |
44 | 45 |
45 #if OS(MACOSX) | 46 #if OS(MACOSX) |
46 #include "wtf/RetainPtr.h" | 47 #include "wtf/RetainPtr.h" |
47 #include <CoreFoundation/CFBase.h> | 48 #include <CoreFoundation/CFBase.h> |
48 typedef struct CGFont* CGFontRef; | 49 typedef struct CGFont* CGFontRef; |
49 #endif | 50 #endif |
50 | 51 |
51 #if OS(MACOSX) || OS(POSIX) || (OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)) | 52 #if OS(MACOSX) || OS(POSIX) || (OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)) |
52 #include "wtf/RefPtr.h" | 53 #include "wtf/RefPtr.h" |
53 class SkTypeface; | 54 class SkTypeface; |
54 #endif | 55 #endif |
55 | 56 |
56 namespace WebCore { | 57 namespace WebCore { |
57 | 58 |
58 class FontPlatformData; | 59 class FontPlatformData; |
59 class SharedBuffer; | 60 class SharedBuffer; |
60 | 61 |
61 class FontCustomPlatformData { | 62 class PLATFORM_EXPORT FontCustomPlatformData { |
62 WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); | 63 WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); |
63 public: | 64 public: |
64 static PassOwnPtr<FontCustomPlatformData> create(SharedBuffer*); | 65 static PassOwnPtr<FontCustomPlatformData> create(SharedBuffer*); |
65 ~FontCustomPlatformData(); | 66 ~FontCustomPlatformData(); |
66 | 67 |
67 FontPlatformData fontPlatformData(float size, bool bold, bool italic, FontOr
ientation = Horizontal, FontWidthVariant = RegularWidth); | 68 FontPlatformData fontPlatformData(float size, bool bold, bool italic, FontOr
ientation = Horizontal, FontWidthVariant = RegularWidth); |
68 | 69 |
69 static bool supportsFormat(const String&); | 70 static bool supportsFormat(const String&); |
70 | 71 |
71 private: | 72 private: |
72 #if OS(WIN) && ENABLE(GDI_FONTS_ON_WINDOWS) | 73 #if OS(WIN) && ENABLE(GDI_FONTS_ON_WINDOWS) |
73 FontCustomPlatformData(HANDLE fontReference, const String& name); | 74 FontCustomPlatformData(HANDLE fontReference, const String& name); |
74 HANDLE m_fontReference; | 75 HANDLE m_fontReference; |
75 String m_name; | 76 String m_name; |
76 #elif OS(MACOSX) | 77 #elif OS(MACOSX) |
77 explicit FontCustomPlatformData(CGFontRef, PassRefPtr<SkTypeface>); | 78 explicit FontCustomPlatformData(CGFontRef, PassRefPtr<SkTypeface>); |
78 RetainPtr<CGFontRef> m_cgFont; | 79 RetainPtr<CGFontRef> m_cgFont; |
79 RefPtr<SkTypeface> m_typeface; | 80 RefPtr<SkTypeface> m_typeface; |
80 #elif OS(POSIX) || (OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)) | 81 #elif OS(POSIX) || (OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)) |
81 explicit FontCustomPlatformData(PassRefPtr<SkTypeface>); | 82 explicit FontCustomPlatformData(PassRefPtr<SkTypeface>); |
82 RefPtr<SkTypeface> m_typeface; | 83 RefPtr<SkTypeface> m_typeface; |
83 #endif | 84 #endif |
84 }; | 85 }; |
85 | 86 |
86 } // namespace WebCore | 87 } // namespace WebCore |
87 | 88 |
88 #endif // FontCustomPlatformData_h | 89 #endif // FontCustomPlatformData_h |
OLD | NEW |