OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 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 19 matching lines...) Expand all Loading... |
30 #include "core/css/FontFace.h" | 30 #include "core/css/FontFace.h" |
31 #include "wtf/Forward.h" | 31 #include "wtf/Forward.h" |
32 #include "wtf/PassRefPtr.h" | 32 #include "wtf/PassRefPtr.h" |
33 #include "wtf/RefCounted.h" | 33 #include "wtf/RefCounted.h" |
34 #include "wtf/Vector.h" | 34 #include "wtf/Vector.h" |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 class CSSSegmentedFontFace; | 38 class CSSSegmentedFontFace; |
39 class FontDescription; | 39 class FontDescription; |
| 40 class FontResource; |
40 class SimpleFontData; | 41 class SimpleFontData; |
41 | 42 |
42 // FIXME: Can this be a subclass of FontFace? | 43 // FIXME: Can this be a subclass of FontFace? |
43 class CSSFontFace : public RefCounted<CSSFontFace> { | 44 class CSSFontFace : public RefCounted<CSSFontFace> { |
44 public: | 45 public: |
45 static PassRefPtr<CSSFontFace> create(PassRefPtr<FontFace> fontFace) { retur
n adoptRef(new CSSFontFace(fontFace)); } | 46 static PassRefPtr<CSSFontFace> create(PassRefPtr<FontFace> fontFace) { retur
n adoptRef(new CSSFontFace(fontFace)); } |
46 | 47 |
47 struct UnicodeRange; | 48 struct UnicodeRange; |
48 | 49 |
49 FontFace* fontFace() const { return m_fontFace.get(); } | 50 FontFace* fontFace() const { return m_fontFace.get(); } |
50 | 51 |
51 void addRange(UChar32 from, UChar32 to) { m_ranges.append(UnicodeRange(from,
to)); } | 52 void addRange(UChar32 from, UChar32 to) { m_ranges.append(UnicodeRange(from,
to)); } |
52 const Vector<UnicodeRange>& ranges() const { return m_ranges; } | 53 const Vector<UnicodeRange>& ranges() const { return m_ranges; } |
53 | 54 |
54 void setSegmentedFontFace(CSSSegmentedFontFace*); | 55 void setSegmentedFontFace(CSSSegmentedFontFace*); |
55 void clearSegmentedFontFace() { m_segmentedFontFace = 0; } | 56 void clearSegmentedFontFace() { m_segmentedFontFace = 0; } |
56 | 57 |
57 bool isLoaded() const; | 58 bool isLoaded() const; |
58 bool isValid() const; | 59 bool isValid() const; |
59 | 60 |
60 void addSource(PassOwnPtr<CSSFontFaceSource>); | 61 void addSource(PassOwnPtr<CSSFontFaceSource>); |
61 | 62 |
| 63 void beginLoadingFontSoon(FontResource*); |
62 void fontLoaded(CSSFontFaceSource*); | 64 void fontLoaded(CSSFontFaceSource*); |
63 | 65 |
64 PassRefPtr<SimpleFontData> getFontData(const FontDescription&, bool syntheti
cBold, bool syntheticItalic); | 66 PassRefPtr<SimpleFontData> getFontData(const FontDescription&, bool syntheti
cBold, bool syntheticItalic); |
65 | 67 |
66 struct UnicodeRange { | 68 struct UnicodeRange { |
67 UnicodeRange(UChar32 from, UChar32 to) | 69 UnicodeRange(UChar32 from, UChar32 to) |
68 : m_from(from) | 70 : m_from(from) |
69 , m_to(to) | 71 , m_to(to) |
70 { | 72 { |
71 } | 73 } |
(...skipping 25 matching lines...) Expand all Loading... |
97 Vector<UnicodeRange> m_ranges; | 99 Vector<UnicodeRange> m_ranges; |
98 CSSSegmentedFontFace* m_segmentedFontFace; | 100 CSSSegmentedFontFace* m_segmentedFontFace; |
99 Vector<OwnPtr<CSSFontFaceSource> > m_sources; | 101 Vector<OwnPtr<CSSFontFaceSource> > m_sources; |
100 CSSFontFaceSource* m_activeSource; | 102 CSSFontFaceSource* m_activeSource; |
101 RefPtr<FontFace> m_fontFace; | 103 RefPtr<FontFace> m_fontFace; |
102 }; | 104 }; |
103 | 105 |
104 } | 106 } |
105 | 107 |
106 #endif | 108 #endif |
OLD | NEW |