OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@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, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 { | 42 { |
43 Element* elem = document.documentElement(); | 43 Element* elem = document.documentElement(); |
44 return isSVGSVGElement(elem) ? toSVGSVGElement(elem) : 0; | 44 return isSVGSVGElement(elem) ? toSVGSVGElement(elem) : 0; |
45 } | 45 } |
46 | 46 |
47 SVGSVGElement* SVGDocument::rootElement() const | 47 SVGSVGElement* SVGDocument::rootElement() const |
48 { | 48 { |
49 return rootElement(*this); | 49 return rootElement(*this); |
50 } | 50 } |
51 | 51 |
52 void SVGDocument::dispatchZoomEvent(float prevScale, float newScale) | |
53 { | |
54 RefPtrWillBeRawPtr<SVGZoomEvent> event = SVGZoomEvent::create(); | |
55 event->initEvent(EventTypeNames::zoom, true, false); | |
56 event->setPreviousScale(prevScale); | |
57 event->setNewScale(newScale); | |
58 rootElement()->dispatchEvent(event.release(), IGNORE_EXCEPTION); | |
59 } | |
60 | |
61 void SVGDocument::dispatchScrollEvent() | |
62 { | |
63 RefPtrWillBeRawPtr<Event> event = Event::create(); | |
64 event->initEvent(EventTypeNames::scroll, true, false); | |
65 rootElement()->dispatchEvent(event.release(), IGNORE_EXCEPTION); | |
66 } | |
67 | |
68 bool SVGDocument::zoomAndPanEnabled() const | 52 bool SVGDocument::zoomAndPanEnabled() const |
69 { | 53 { |
70 if (SVGSVGElement* svg = rootElement()) { | 54 if (SVGSVGElement* svg = rootElement()) { |
71 if (svg->useCurrentView()) { | 55 if (svg->useCurrentView()) { |
72 if (svg->currentView()) | 56 if (svg->currentView()) |
73 return svg->currentView()->zoomAndPan() == SVGZoomAndPanMagnify; | 57 return svg->currentView()->zoomAndPan() == SVGZoomAndPanMagnify; |
74 } else { | 58 } else { |
75 return svg->zoomAndPan() == SVGZoomAndPanMagnify; | 59 return svg->zoomAndPan() == SVGZoomAndPanMagnify; |
76 } | 60 } |
77 } | 61 } |
(...skipping 15 matching lines...) Expand all Loading... |
93 renderer()->repaint(); | 77 renderer()->repaint(); |
94 } | 78 } |
95 } | 79 } |
96 | 80 |
97 PassRefPtr<Document> SVGDocument::cloneDocumentWithoutChildren() | 81 PassRefPtr<Document> SVGDocument::cloneDocumentWithoutChildren() |
98 { | 82 { |
99 return create(DocumentInit(url())); | 83 return create(DocumentInit(url())); |
100 } | 84 } |
101 | 85 |
102 } | 86 } |
OLD | NEW |