1/* 2 * Copyright (C) 2010 Igalia S.L. 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 */ 18 19 20#ifndef MainFrameScrollbarGtk_h 21#define MainFrameScrollbarGtk_h 22 23#include "GRefPtrGtk.h" 24#include "Scrollbar.h" 25#include <wtf/PassRefPtr.h> 26 27typedef struct _GtkAdjustment GtkAdjustment; 28 29namespace WebCore { 30 31class MainFrameScrollbarGtk : public Scrollbar { 32public: 33 static PassRefPtr<MainFrameScrollbarGtk> create(ScrollableArea*, ScrollbarOrientation, GtkAdjustment*); 34 35 ~MainFrameScrollbarGtk(); 36 virtual void paint(GraphicsContext*, const IntRect&); 37 void detachAdjustment(); 38 void attachAdjustment(GtkAdjustment*); 39 40protected: 41 virtual void updateThumbPosition(); 42 virtual void updateThumbProportion(); 43 44private: 45 MainFrameScrollbarGtk(ScrollableArea*, ScrollbarOrientation, GtkAdjustment*); 46 static void gtkValueChanged(GtkAdjustment*, MainFrameScrollbarGtk*); 47 48 GRefPtr<GtkAdjustment> m_adjustment; 49}; 50 51} 52 53#endif // ScrollbarGtk_h 54