1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
4 * Copyright (C) 2006 Zack Rusin <zack@kde.org>
5 * Copyright (C) 2006 George Staikos <staikos@kde.org>
6 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
7 *
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
20 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
30 */
31
32 #include "config.h"
33 #include "ScrollView.h"
34
35 namespace WebCore {
36
platformInit()37 void ScrollView::platformInit()
38 {
39 m_widgetsPreventingBlitting = 0;
40 }
41
platformDestroy()42 void ScrollView::platformDestroy()
43 {
44 }
45
46 // Windowed plugins are using native windows and are thus preventing
47 // us from doing any kind of scrolling optimization.
48
adjustWidgetsPreventingBlittingCount(int delta)49 void ScrollView::adjustWidgetsPreventingBlittingCount(int delta)
50 {
51 m_widgetsPreventingBlitting += delta;
52 if (parent())
53 parent()->adjustWidgetsPreventingBlittingCount(delta);
54 }
55
platformAddChild(Widget * child)56 void ScrollView::platformAddChild(Widget* child)
57 {
58 adjustWidgetsPreventingBlittingCount(1);
59 }
60
platformRemoveChild(Widget * child)61 void ScrollView::platformRemoveChild(Widget* child)
62 {
63 child->hide();
64 adjustWidgetsPreventingBlittingCount(-1);
65 }
66
67 }
68 // vim: ts=4 sw=4 et
69