OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Inc. All rights reserved. |
3 * Copyright (C) 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
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, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 #ifndef SVGDocumentExtensions_h | 21 #ifndef SVGDocumentExtensions_h |
22 #define SVGDocumentExtensions_h | 22 #define SVGDocumentExtensions_h |
23 | 23 |
| 24 #include "platform/geometry/FloatPoint.h" |
24 #include "wtf/Forward.h" | 25 #include "wtf/Forward.h" |
25 #include "wtf/HashMap.h" | 26 #include "wtf/HashMap.h" |
26 #include "wtf/HashSet.h" | 27 #include "wtf/HashSet.h" |
27 #include "wtf/text/AtomicStringHash.h" | 28 #include "wtf/text/AtomicStringHash.h" |
28 | 29 |
29 namespace WebCore { | 30 namespace WebCore { |
30 | 31 |
31 class Document; | 32 class Document; |
32 class RenderSVGResourceContainer; | 33 class RenderSVGResourceContainer; |
33 class SubtreeLayoutScope; | 34 class SubtreeLayoutScope; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 79 |
79 #if ENABLE(SVG_FONTS) | 80 #if ENABLE(SVG_FONTS) |
80 const HashSet<SVGFontFaceElement*>& svgFontFaceElements() const { return m_s
vgFontFaceElements; } | 81 const HashSet<SVGFontFaceElement*>& svgFontFaceElements() const { return m_s
vgFontFaceElements; } |
81 void registerSVGFontFaceElement(SVGFontFaceElement*); | 82 void registerSVGFontFaceElement(SVGFontFaceElement*); |
82 void unregisterSVGFontFaceElement(SVGFontFaceElement*); | 83 void unregisterSVGFontFaceElement(SVGFontFaceElement*); |
83 | 84 |
84 void registerPendingSVGFontFaceElementsForRemoval(PassRefPtr<SVGFontFaceElem
ent>); | 85 void registerPendingSVGFontFaceElementsForRemoval(PassRefPtr<SVGFontFaceElem
ent>); |
85 void removePendingSVGFontFaceElementsForRemoval(); | 86 void removePendingSVGFontFaceElementsForRemoval(); |
86 #endif | 87 #endif |
87 | 88 |
| 89 bool zoomAndPanEnabled() const; |
| 90 |
| 91 void startPan(const FloatPoint& start); |
| 92 void updatePan(const FloatPoint& pos) const; |
| 93 |
| 94 static SVGSVGElement* rootElement(const Document&); |
| 95 SVGSVGElement* rootElement() const; |
| 96 |
88 private: | 97 private: |
89 Document* m_document; // weak reference | 98 Document* m_document; // weak reference |
90 HashSet<SVGSVGElement*> m_timeContainers; // For SVG 1.2 support this will n
eed to be made more general. | 99 HashSet<SVGSVGElement*> m_timeContainers; // For SVG 1.2 support this will n
eed to be made more general. |
91 #if ENABLE(SVG_FONTS) | 100 #if ENABLE(SVG_FONTS) |
92 HashSet<SVGFontFaceElement*> m_svgFontFaceElements; | 101 HashSet<SVGFontFaceElement*> m_svgFontFaceElements; |
93 // SVGFontFaceElements that are pending and scheduled for removal. | 102 // SVGFontFaceElements that are pending and scheduled for removal. |
94 HashSet<RefPtr<SVGFontFaceElement> > m_pendingSVGFontFaceElementsForRemoval; | 103 HashSet<RefPtr<SVGFontFaceElement> > m_pendingSVGFontFaceElementsForRemoval; |
95 #endif | 104 #endif |
96 HashMap<AtomicString, RenderSVGResourceContainer*> m_resources; | 105 HashMap<AtomicString, RenderSVGResourceContainer*> m_resources; |
97 HashMap<AtomicString, OwnPtr<SVGPendingElements> > m_pendingResources; // Re
sources that are pending. | 106 HashMap<AtomicString, OwnPtr<SVGPendingElements> > m_pendingResources; // Re
sources that are pending. |
98 HashMap<AtomicString, OwnPtr<SVGPendingElements> > m_pendingResourcesForRemo
val; // Resources that are pending and scheduled for removal. | 107 HashMap<AtomicString, OwnPtr<SVGPendingElements> > m_pendingResourcesForRemo
val; // Resources that are pending and scheduled for removal. |
99 HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*> > > m_elementDependencies; | 108 HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*> > > m_elementDependencies; |
100 OwnPtr<SVGResourcesCache> m_resourcesCache; | 109 OwnPtr<SVGResourcesCache> m_resourcesCache; |
101 HashSet<SVGSVGElement*> m_relativeLengthSVGRoots; // Root SVG elements with
relative length descendants. | 110 HashSet<SVGSVGElement*> m_relativeLengthSVGRoots; // Root SVG elements with
relative length descendants. |
| 111 FloatPoint m_translate; |
102 #if !ASSERT_DISABLED | 112 #if !ASSERT_DISABLED |
103 bool m_inRelativeLengthSVGRootsInvalidation; | 113 bool m_inRelativeLengthSVGRootsInvalidation; |
104 #endif | 114 #endif |
105 | 115 |
106 public: | 116 public: |
107 // This HashMap contains a list of pending resources. Pending resources, are
such | 117 // This HashMap contains a list of pending resources. Pending resources, are
such |
108 // which are referenced by any object in the SVG document, but do NOT exist
yet. | 118 // which are referenced by any object in the SVG document, but do NOT exist
yet. |
109 // For instance, dynamically build gradients / patterns / clippers... | 119 // For instance, dynamically build gradients / patterns / clippers... |
110 void addPendingResource(const AtomicString& id, Element*); | 120 void addPendingResource(const AtomicString& id, Element*); |
111 bool hasPendingResource(const AtomicString& id) const; | 121 bool hasPendingResource(const AtomicString& id) const; |
112 bool isElementPendingResources(Element*) const; | 122 bool isElementPendingResources(Element*) const; |
113 bool isElementPendingResource(Element*, const AtomicString& id) const; | 123 bool isElementPendingResource(Element*, const AtomicString& id) const; |
114 void clearHasPendingResourcesIfPossible(Element*); | 124 void clearHasPendingResourcesIfPossible(Element*); |
115 void removeElementFromPendingResources(Element*); | 125 void removeElementFromPendingResources(Element*); |
116 PassOwnPtr<SVGPendingElements> removePendingResource(const AtomicString& id)
; | 126 PassOwnPtr<SVGPendingElements> removePendingResource(const AtomicString& id)
; |
117 | 127 |
118 void serviceAnimations(double monotonicAnimationStartTime); | 128 void serviceAnimations(double monotonicAnimationStartTime); |
119 | 129 |
120 // The following two functions are used for scheduling a pending resource to
be removed. | 130 // The following two functions are used for scheduling a pending resource to
be removed. |
121 void markPendingResourcesForRemoval(const AtomicString&); | 131 void markPendingResourcesForRemoval(const AtomicString&); |
122 Element* removeElementFromPendingResourcesForRemoval(const AtomicString&); | 132 Element* removeElementFromPendingResourcesForRemoval(const AtomicString&); |
123 | 133 |
124 private: | 134 private: |
125 PassOwnPtr<SVGPendingElements> removePendingResourceForRemoval(const AtomicS
tring&); | 135 PassOwnPtr<SVGPendingElements> removePendingResourceForRemoval(const AtomicS
tring&); |
126 }; | 136 }; |
127 | 137 |
128 } | 138 } |
129 | 139 |
130 #endif | 140 #endif |
OLD | NEW |