Home | History | Annotate | Download | only in gtk
      1 /*
      2  * Copyright (C) 2010 Igalia S.L.
      3  * All rights reserved.
      4  *
      5  * This library is free software; you can redistribute it and/or
      6  * modify it under the terms of the GNU Library General Public
      7  * License as published by the Free Software Foundation; either
      8  * version 2 of the License, or (at your option) any later version.
      9  *
     10  * This library is distributed in the hope that it will be useful,
     11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13  * Library General Public License for more details.
     14  *
     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
     17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     18  * Boston, MA 02110-1301, USA.
     19  *
     20  */
     21 
     22 #ifndef WidgetRenderingContext_h
     23 #define WidgetRenderingContext_h
     24 
     25 #ifdef GTK_API_VERSION_2
     26 
     27 #include "IntRect.h"
     28 
     29 // Usually this is too expensive to have in headers, but GtkStateType GtkShadowType are
     30 // enums and cannot be forward declared. WidgetRenderingContext.h is currently only
     31 // included in RenderThemeGtk2.cpp and ScrollbarThemeGtk2.cpp.
     32 #include <gtk/gtk.h>
     33 
     34 namespace WebCore {
     35 
     36 class GraphicsContext;
     37 class RenderThemeGtk;
     38 
     39 class WidgetRenderingContext {
     40 public:
     41     WidgetRenderingContext(GraphicsContext*, const IntRect&);
     42     ~WidgetRenderingContext();
     43 
     44     void gtkPaintBox(const IntRect&, GtkWidget*, GtkStateType, GtkShadowType, const gchar*);
     45     void gtkPaintFlatBox(const IntRect&, GtkWidget*, GtkStateType, GtkShadowType, const gchar*);
     46     void gtkPaintFocus(const IntRect&, GtkWidget*, GtkStateType, const gchar*);
     47     void gtkPaintSlider(const IntRect&, GtkWidget*, GtkStateType, GtkShadowType, const gchar*, GtkOrientation);
     48     void gtkPaintCheck(const IntRect&, GtkWidget*, GtkStateType, GtkShadowType, const gchar*);
     49     void gtkPaintOption(const IntRect&, GtkWidget*, GtkStateType, GtkShadowType, const gchar*);
     50     void gtkPaintShadow(const IntRect&, GtkWidget*, GtkStateType, GtkShadowType, const gchar*);
     51     void gtkPaintArrow(const IntRect&, GtkWidget*, GtkStateType, GtkShadowType, int arrowDirection, const gchar*);
     52     void gtkPaintVLine(const IntRect&, GtkWidget*, GtkStateType, const gchar*);
     53 
     54 private:
     55     GraphicsContext* m_graphicsContext;
     56     IntRect m_targetRect;
     57     GdkRectangle m_paintRect;
     58     IntSize m_extraSpace;
     59     bool m_hadError;
     60     GdkDrawable* m_target;
     61 
     62 };
     63 
     64 }
     65 
     66 #endif // GTK_API_VERSION_2
     67 #endif // WidgetRenderingContext_h
     68