src/gui/styles/qgtkpainter.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   106 #define DRAW_TO_CACHE(draw_func)                                                                   \
   106 #define DRAW_TO_CACHE(draw_func)                                                                   \
   107     if (rect.width() > QWIDGETSIZE_MAX || rect.height() > QWIDGETSIZE_MAX)                         \
   107     if (rect.width() > QWIDGETSIZE_MAX || rect.height() > QWIDGETSIZE_MAX)                         \
   108         return;                                                                                    \
   108         return;                                                                                    \
   109     QRect pixmapRect(0, 0, rect.width(), rect.height());                                           \
   109     QRect pixmapRect(0, 0, rect.width(), rect.height());                                           \
   110     {                                                                                              \
   110     {                                                                                              \
   111         GdkPixmap *pixmap = QGtk::gdk_pixmap_new((GdkDrawable*)(m_window->window),                    \
   111         GdkPixmap *pixmap = QGtkStylePrivate::gdk_pixmap_new((GdkDrawable*)(m_window->window),                    \
   112                                             rect.width(), rect.height(), -1);                      \
   112                                             rect.width(), rect.height(), -1);                      \
   113         if (!pixmap)                                                                               \
   113         if (!pixmap)                                                                               \
   114             return;                                                                                \
   114             return;                                                                                \
   115         style = QGtk::gtk_style_attach (style, m_window->window);                                  \
   115         style = QGtkStylePrivate::gtk_style_attach (style, m_window->window);                                  \
   116         QGtk::gdk_draw_rectangle(pixmap, m_alpha ? style->black_gc : *style->bg_gc, true,                \
   116         QGtkStylePrivate::gdk_draw_rectangle(pixmap, m_alpha ? style->black_gc : *style->bg_gc, true,                \
   117                            0, 0, rect.width(), rect.height());                                     \
   117                            0, 0, rect.width(), rect.height());                                     \
   118         draw_func;                                                                                 \
   118         draw_func;                                                                                 \
   119         GdkPixbuf *imgb = QGtk::gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, rect.width(), rect.height());\
   119         GdkPixbuf *imgb = QGtkStylePrivate::gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, rect.width(), rect.height());\
   120         if (!imgb)                                                                                 \
   120         if (!imgb)                                                                                 \
   121             return;                                                                                \
   121             return;                                                                                \
   122         imgb = QGtk::gdk_pixbuf_get_from_drawable(imgb, pixmap, NULL, 0, 0, 0, 0,                  \
   122         imgb = QGtkStylePrivate::gdk_pixbuf_get_from_drawable(imgb, pixmap, NULL, 0, 0, 0, 0,                  \
   123                                             rect.width(), rect.height());                          \
   123                                             rect.width(), rect.height());                          \
   124         uchar* bdata = (uchar*)QGtk::gdk_pixbuf_get_pixels(imgb);                                  \
   124         uchar* bdata = (uchar*)QGtkStylePrivate::gdk_pixbuf_get_pixels(imgb);                                  \
   125         if (m_alpha) {                                                                             \
   125         if (m_alpha) {                                                                             \
   126             QGtk::gdk_draw_rectangle(pixmap, style->white_gc, true, 0, 0, rect.width(), rect.height());  \
   126             QGtkStylePrivate::gdk_draw_rectangle(pixmap, style->white_gc, true, 0, 0, rect.width(), rect.height());  \
   127             draw_func;                                                                             \
   127             draw_func;                                                                             \
   128             GdkPixbuf *imgw = QGtk::gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, rect.              \
   128             GdkPixbuf *imgw = QGtkStylePrivate::gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, rect.              \
   129                                              width(), rect.height());                              \
   129                                              width(), rect.height());                              \
   130             if (!imgw)                                                                             \
   130             if (!imgw)                                                                             \
   131                 return;                                                                            \
   131                 return;                                                                            \
   132             imgw = QGtk::gdk_pixbuf_get_from_drawable(imgw, pixmap, NULL, 0, 0, 0, 0,              \
   132             imgw = QGtkStylePrivate::gdk_pixbuf_get_from_drawable(imgw, pixmap, NULL, 0, 0, 0, 0,              \
   133                                                 rect.width(), rect.height());                      \
   133                                                 rect.width(), rect.height());                      \
   134             uchar* wdata = (uchar*)QGtk::gdk_pixbuf_get_pixels(imgw);                                    \
   134             uchar* wdata = (uchar*)QGtkStylePrivate::gdk_pixbuf_get_pixels(imgw);                                    \
   135             cache = renderTheme(bdata, wdata, rect);                                               \
   135             cache = renderTheme(bdata, wdata, rect);                                               \
   136             QGtk::gdk_pixbuf_unref(imgw);                                                          \
   136             QGtkStylePrivate::gdk_pixbuf_unref(imgw);                                                          \
   137         } else {                                                                                   \
   137         } else {                                                                                   \
   138             cache = renderTheme(bdata, 0, rect);                                                   \
   138             cache = renderTheme(bdata, 0, rect);                                                   \
   139         }                                                                                          \
   139         }                                                                                          \
   140         QGtk::gdk_drawable_unref(pixmap);                                                          \
   140         QGtkStylePrivate::gdk_drawable_unref(pixmap);                                                          \
   141         QGtk::gdk_pixbuf_unref(imgb);                                                              \
   141         QGtkStylePrivate::gdk_pixbuf_unref(imgb);                                                              \
   142     }
   142     }
   143 
   143 
   144 QGtkPainter::QGtkPainter(QPainter *_painter)
   144 QGtkPainter::QGtkPainter(QPainter *_painter)
   145         : m_window(QGtk::gtkWidget(QLatin1String("GtkWindow")))
   145         : m_window(QGtkStylePrivate::gtkWidget(QLatin1String("GtkWindow")))
   146         , m_painter(_painter)
   146         , m_painter(_painter)
   147         , m_alpha(true)
   147         , m_alpha(true)
   148         , m_hflipped(false)
   148         , m_hflipped(false)
   149         , m_vflipped(false)
   149         , m_vflipped(false)
   150         , m_usePixmapCache(true)
   150         , m_usePixmapCache(true)
   183     return style;
   183     return style;
   184 }
   184 }
   185 
   185 
   186 QPixmap QGtkPainter::getIcon(const char* iconName, GtkIconSize size)
   186 QPixmap QGtkPainter::getIcon(const char* iconName, GtkIconSize size)
   187 {
   187 {
   188     GtkStyle *style = QGtk::gtkStyle();
   188     GtkStyle *style = QGtkStylePrivate::gtkStyle();
   189     GtkIconSet* iconSet  = QGtk::gtk_icon_factory_lookup_default (iconName);
   189     GtkIconSet* iconSet  = QGtkStylePrivate::gtk_icon_factory_lookup_default (iconName);
   190     GdkPixbuf* icon = QGtk::gtk_icon_set_render_icon(iconSet,
   190     GdkPixbuf* icon = QGtkStylePrivate::gtk_icon_set_render_icon(iconSet,
   191                                                  style,
   191                                                  style,
   192                                                  GTK_TEXT_DIR_LTR,
   192                                                  GTK_TEXT_DIR_LTR,
   193                                                  GTK_STATE_NORMAL,
   193                                                  GTK_STATE_NORMAL,
   194                                                  size,
   194                                                  size,
   195                                                  NULL,
   195                                                  NULL,
   196                                                  "button");
   196                                                  "button");
   197     uchar* data = (uchar*)QGtk::gdk_pixbuf_get_pixels(icon);
   197     uchar* data = (uchar*)QGtkStylePrivate::gdk_pixbuf_get_pixels(icon);
   198     int width = QGtk::gdk_pixbuf_get_width(icon);
   198     int width = QGtkStylePrivate::gdk_pixbuf_get_width(icon);
   199     int height = QGtk::gdk_pixbuf_get_height(icon);
   199     int height = QGtkStylePrivate::gdk_pixbuf_get_height(icon);
   200     QImage converted(width, height, QImage::Format_ARGB32);
   200     QImage converted(width, height, QImage::Format_ARGB32);
   201     uchar* tdata = (uchar*)converted.bits();
   201     uchar* tdata = (uchar*)converted.bits();
   202 
   202 
   203     for ( int index = 0 ; index < height * width*4 ; index +=4 ) {
   203     for ( int index = 0 ; index < height * width*4 ; index +=4 ) {
   204         //int index = y * rowstride + x;
   204         //int index = y * rowstride + x;
   206         tdata[index + QT_GREEN] = data[index + GTK_GREEN];
   206         tdata[index + QT_GREEN] = data[index + GTK_GREEN];
   207         tdata[index + QT_BLUE] = data[index + GTK_BLUE];
   207         tdata[index + QT_BLUE] = data[index + GTK_BLUE];
   208         tdata[index + QT_ALPHA] = data[index + GTK_ALPHA];
   208         tdata[index + QT_ALPHA] = data[index + GTK_ALPHA];
   209     }
   209     }
   210 
   210 
   211     QGtk::gdk_pixbuf_unref(icon);
   211     QGtkStylePrivate::gdk_pixbuf_unref(icon);
   212 
   212 
   213     // should we free iconset?
   213     // should we free iconset?
   214     return QPixmap::fromImage(converted);
   214     return QPixmap::fromImage(converted);
   215 
   215 
   216 }
   216 }
   238 
   238 
   239     QString gapExtras = QString(QLS("s %0 w %1 g %2")).arg(gap_side).arg(width).arg(x);
   239     QString gapExtras = QString(QLS("s %0 w %1 g %2")).arg(gap_side).arg(width).arg(x);
   240     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + gapExtras;
   240     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + gapExtras;
   241 
   241 
   242     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   242     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   243         DRAW_TO_CACHE(QGtk::gtk_paint_box_gap (style,
   243         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_box_gap (style,
   244                                            pixmap,
   244                                            pixmap,
   245                                            state,
   245                                            state,
   246                                            shadow,
   246                                            shadow,
   247                                            NULL,
   247                                            NULL,
   248                                            gtkWidget,
   248                                            gtkWidget,
   303 
   303 
   304     QString pixmapName = uniqueName(QLS(part), state, shadow,
   304     QString pixmapName = uniqueName(QLS(part), state, shadow,
   305                                     rect.size(), gtkWidget) + pmKey;
   305                                     rect.size(), gtkWidget) + pmKey;
   306 
   306 
   307     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   307     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   308         DRAW_TO_CACHE(QGtk::gtk_paint_box (style,
   308         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_box (style,
   309                                            pixmap,
   309                                            pixmap,
   310                                            state,
   310                                            state,
   311                                            shadow,
   311                                            shadow,
   312                                            NULL,
   312                                            NULL,
   313                                            gtkWidget,
   313                                            gtkWidget,
   354     QPixmap cache;
   354     QPixmap cache;
   355     QString hLineExtras = QString(QLS("%0 %1 %2")).arg(x1).arg(x2).arg(y);
   355     QString hLineExtras = QString(QLS("%0 %1 %2")).arg(x1).arg(x2).arg(y);
   356     QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget)
   356     QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget)
   357                          + hLineExtras + pmKey;
   357                          + hLineExtras + pmKey;
   358     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   358     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   359         DRAW_TO_CACHE(QGtk::gtk_paint_hline (style,
   359         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_hline (style,
   360                                          pixmap,
   360                                          pixmap,
   361                                          state,
   361                                          state,
   362                                          NULL,
   362                                          NULL,
   363                                          gtkWidget,
   363                                          gtkWidget,
   364                                          part,
   364                                          part,
   381     QPixmap cache;
   381     QPixmap cache;
   382     QString vLineExtras = QString(QLS("%0 %1 %2")).arg(y1).arg(y2).arg(x);
   382     QString vLineExtras = QString(QLS("%0 %1 %2")).arg(y1).arg(y2).arg(x);
   383     QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(),
   383     QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(),
   384                                     gtkWidget) + vLineExtras +pmKey;
   384                                     gtkWidget) + vLineExtras +pmKey;
   385     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   385     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   386         DRAW_TO_CACHE(QGtk::gtk_paint_vline (style,
   386         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_vline (style,
   387                                          pixmap,
   387                                          pixmap,
   388                                          state,
   388                                          state,
   389                                          NULL,
   389                                          NULL,
   390                                          gtkWidget,
   390                                          gtkWidget,
   391                                          part,
   391                                          part,
   408 
   408 
   409     QPixmap cache;
   409     QPixmap cache;
   410     QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(),
   410     QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(),
   411                                     gtkWidget) + QString::number(expander_state) + pmKey;
   411                                     gtkWidget) + QString::number(expander_state) + pmKey;
   412     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   412     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   413         DRAW_TO_CACHE(QGtk::gtk_paint_expander (style, pixmap,
   413         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_expander (style, pixmap,
   414                                             state, NULL,
   414                                             state, NULL,
   415                                             gtkWidget, part,
   415                                             gtkWidget, part,
   416                                             rect.width()/2,
   416                                             rect.width()/2,
   417                                             rect.height()/2,
   417                                             rect.height()/2,
   418                                             expander_state));
   418                                             expander_state));
   431         return;
   431         return;
   432 
   432 
   433     QPixmap cache;
   433     QPixmap cache;
   434     QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget) + pmKey;
   434     QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget) + pmKey;
   435     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   435     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   436         DRAW_TO_CACHE(QGtk::gtk_paint_focus (style, pixmap, state, NULL,
   436         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_focus (style, pixmap, state, NULL,
   437                                          gtkWidget,
   437                                          gtkWidget,
   438                                          part,
   438                                          part,
   439                                          0, 0,
   439                                          0, 0,
   440                                          rect.width(),
   440                                          rect.width(),
   441                                          rect.height()));
   441                                          rect.height()));
   456         return;
   456         return;
   457 
   457 
   458     QPixmap cache;
   458     QPixmap cache;
   459     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + pmKey;
   459     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + pmKey;
   460     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   460     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   461         DRAW_TO_CACHE(QGtk::gtk_paint_resize_grip (style, pixmap, state,
   461         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_resize_grip (style, pixmap, state,
   462                                                NULL, gtkWidget,
   462                                                NULL, gtkWidget,
   463                                                part, edge, 0, 0,
   463                                                part, edge, 0, 0,
   464                                                rect.width(),
   464                                                rect.width(),
   465                                                rect.height()));
   465                                                rect.height()));
   466         if (m_usePixmapCache)
   466         if (m_usePixmapCache)
   486 
   486 
   487     GdkRectangle gtkCliprect = {0, 0, rect.width(), rect.height()};
   487     GdkRectangle gtkCliprect = {0, 0, rect.width(), rect.height()};
   488     int xOffset = m_cliprect.isValid() ? arrowrect.x() - m_cliprect.x() : 0;
   488     int xOffset = m_cliprect.isValid() ? arrowrect.x() - m_cliprect.x() : 0;
   489     int yOffset = m_cliprect.isValid() ? arrowrect.y() - m_cliprect.y() : 0;
   489     int yOffset = m_cliprect.isValid() ? arrowrect.y() - m_cliprect.y() : 0;
   490     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   490     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   491         DRAW_TO_CACHE(QGtk::gtk_paint_arrow (style, pixmap, state, shadow,
   491         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_arrow (style, pixmap, state, shadow,
   492                                          &gtkCliprect,
   492                                          &gtkCliprect,
   493                                          gtkWidget,
   493                                          gtkWidget,
   494                                          part,
   494                                          part,
   495                                          arrow_type, fill,
   495                                          arrow_type, fill,
   496                                          xOffset, yOffset,
   496                                          xOffset, yOffset,
   513 
   513 
   514     QPixmap cache;
   514     QPixmap cache;
   515     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size())
   515     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size())
   516                          + QString::number(orientation);
   516                          + QString::number(orientation);
   517     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   517     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   518         DRAW_TO_CACHE(QGtk::gtk_paint_handle (style,
   518         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_handle (style,
   519                                           pixmap,
   519                                           pixmap,
   520                                           state,
   520                                           state,
   521                                           shadow,
   521                                           shadow,
   522                                           NULL,
   522                                           NULL,
   523                                           gtkWidget,
   523                                           gtkWidget,
   541         return;
   541         return;
   542 
   542 
   543     QPixmap cache;
   543     QPixmap cache;
   544     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + pmKey;
   544     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + pmKey;
   545     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   545     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   546         DRAW_TO_CACHE(QGtk::gtk_paint_slider (style,
   546         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_slider (style,
   547                                           pixmap,
   547                                           pixmap,
   548                                           state,
   548                                           state,
   549                                           shadow,
   549                                           shadow,
   550                                           NULL,
   550                                           NULL,
   551                                           gtkWidget,
   551                                           gtkWidget,
   572 
   572 
   573     QRect r = rect;
   573     QRect r = rect;
   574     QPixmap cache;
   574     QPixmap cache;
   575     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) + pmKey;
   575     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) + pmKey;
   576     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   576     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   577         DRAW_TO_CACHE(QGtk::gtk_paint_shadow(style, pixmap, state, shadow, NULL,
   577         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_shadow(style, pixmap, state, shadow, NULL,
   578                                          gtkWidget, part, 0, 0, rect.width(), rect.height()));
   578                                          gtkWidget, part, 0, 0, rect.width(), rect.height()));
   579         if (m_usePixmapCache)
   579         if (m_usePixmapCache)
   580             QPixmapCache::insert(pixmapName, cache);
   580             QPixmapCache::insert(pixmapName, cache);
   581     }
   581     }
   582     m_painter->drawPixmap(rect.topLeft(), cache);
   582     m_painter->drawPixmap(rect.topLeft(), cache);
   591         return;
   591         return;
   592     QRect r = rect;
   592     QRect r = rect;
   593     QPixmap cache;
   593     QPixmap cache;
   594     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) + pmKey;
   594     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) + pmKey;
   595     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   595     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   596         DRAW_TO_CACHE(QGtk::gtk_paint_flat_box (style,
   596         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_flat_box (style,
   597                                             pixmap,
   597                                             pixmap,
   598                                             state,
   598                                             state,
   599                                             shadow,
   599                                             shadow,
   600                                             NULL,
   600                                             NULL,
   601                                             gtkWidget,
   601                                             gtkWidget,
   620     QPixmap cache;
   620     QPixmap cache;
   621     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget);
   621     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget);
   622     pixmapName += QString::number(gap_pos);
   622     pixmapName += QString::number(gap_pos);
   623 
   623 
   624     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   624     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   625         DRAW_TO_CACHE(QGtk::gtk_paint_extension (style, pixmap, state, shadow,
   625         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_extension (style, pixmap, state, shadow,
   626                                              NULL, gtkWidget,
   626                                              NULL, gtkWidget,
   627                                              (gchar*)part, 0, 0,
   627                                              (gchar*)part, 0, 0,
   628                                              rect.width(),
   628                                              rect.width(),
   629                                              rect.height(),
   629                                              rect.height(),
   630                                              gap_pos));
   630                                              gap_pos));
   649     QString pixmapName = uniqueName(detail, state, shadow, rect.size());
   649     QString pixmapName = uniqueName(detail, state, shadow, rect.size());
   650     GdkRectangle gtkCliprect = {0, 0, rect.width(), rect.height()};
   650     GdkRectangle gtkCliprect = {0, 0, rect.width(), rect.height()};
   651     int xOffset = m_cliprect.isValid() ? radiorect.x() - m_cliprect.x() : 0;
   651     int xOffset = m_cliprect.isValid() ? radiorect.x() - m_cliprect.x() : 0;
   652     int yOffset = m_cliprect.isValid() ? radiorect.y() - m_cliprect.y() : 0;
   652     int yOffset = m_cliprect.isValid() ? radiorect.y() - m_cliprect.y() : 0;
   653     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   653     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   654         DRAW_TO_CACHE(QGtk::gtk_paint_option(style, pixmap,
   654         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_option(style, pixmap,
   655                                          state, shadow,
   655                                          state, shadow,
   656                                          &gtkCliprect,
   656                                          &gtkCliprect,
   657                                          gtkWidget,
   657                                          gtkWidget,
   658                                          detail.toLatin1(),
   658                                          detail.toLatin1(),
   659                                          xOffset, yOffset,
   659                                          xOffset, yOffset,
   681     QString pixmapName = uniqueName(detail, state, shadow, rect.size());
   681     QString pixmapName = uniqueName(detail, state, shadow, rect.size());
   682     GdkRectangle gtkCliprect = {0, 0, rect.width(), rect.height()};
   682     GdkRectangle gtkCliprect = {0, 0, rect.width(), rect.height()};
   683     int xOffset = m_cliprect.isValid() ? checkrect.x() - m_cliprect.x() : 0;
   683     int xOffset = m_cliprect.isValid() ? checkrect.x() - m_cliprect.x() : 0;
   684     int yOffset = m_cliprect.isValid() ? checkrect.y() - m_cliprect.y() : 0;
   684     int yOffset = m_cliprect.isValid() ? checkrect.y() - m_cliprect.y() : 0;
   685     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   685     if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
   686         DRAW_TO_CACHE(QGtk::gtk_paint_check (style,
   686         DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_check (style,
   687                                          pixmap,
   687                                          pixmap,
   688                                          state,
   688                                          state,
   689                                          shadow,
   689                                          shadow,
   690                                          &gtkCliprect,
   690                                          &gtkCliprect,
   691                                          gtkWidget,
   691                                          gtkWidget,