1/* 2 * Copyright (C) 2007, 2009 Holger Hans Peter Freyther zecke@selfish.org 3 * Copyright (C) 2010 Gustavo Noronha Silva <gns@gnome.org> 4 * Copyright (C) 2010 Collabora Ltd. 5 * Copyright (C) 2010, 2011 Igalia S.L. 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public 9 * License as published by the Free Software Foundation; either 10 * version 2 of the License, or (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this library; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 */ 21 22#include "config.h" 23#include "MainFrameScrollbarGtk.h" 24 25#include "GtkVersioning.h" 26#include "IntRect.h" 27#include "ScrollableArea.h" 28#include <gtk/gtk.h> 29 30using namespace WebCore; 31 32PassRefPtr<MainFrameScrollbarGtk> MainFrameScrollbarGtk::create(ScrollableArea* scrollableArea, ScrollbarOrientation orientation) 33{ 34 return adoptRef(new MainFrameScrollbarGtk(scrollableArea, orientation)); 35} 36 37// A MainFrameScrollbar is just a non-painting scrollbar. Otherwise it is fully 38// functional. A non-painting scrollbar allows a main-frame ScrollView to use 39// a containing GtkScrolledWindow as its user interface. The ChromeClient in the 40// WebKit layer just listens for scrolling and sizing changes and updates its 41// container (the GtkScrolledWindow) accordingly. The ScrollView is responsible 42// for deciding whether or not to create a MainFrameScrollbar or native scrollbar. 43MainFrameScrollbarGtk::MainFrameScrollbarGtk(ScrollableArea* scrollableArea, ScrollbarOrientation orientation) 44 : Scrollbar(scrollableArea, orientation, RegularScrollbar) 45{ 46 // We don't want to take up any space. 47 resize(0, 0); 48} 49 50void MainFrameScrollbarGtk::paint(GraphicsContext*, const IntRect&) 51{ 52 // Main frame scrollbars are not painted by WebCore. 53 return; 54} 55