+ NULL,
+ button,
+ "button",
+ dc.LogicalToDeviceX(rect.x) - x_diff, rect.y, rect.width, rect.height
+ );
+
+ return DrawHeaderButtonContents(win, dc, rect, flags, sortArrow, params);
+}
+
+// draw a ">" or "v" button
+void
+wxRendererGTK::DrawTreeItemButton(wxWindow* win,
+ wxDC& dc, const wxRect& rect, int flags)
+{
+ GtkWidget *tree = GetTreeWidget();
+
+ GdkWindow* gdk_window = NULL;
+#if wxUSE_NEW_DC
+ wxImplDC *impl = dc.GetImpl();
+ wxGTKImplDC *gtk_impl = wxDynamicCast( impl, wxGTKImplDC );
+ if (gtk_impl)
+ gdk_window = gtk_impl->GetGDKWindow();
+#else
+ gdk_window = dc.GetGDKWindow();
+#endif
+ wxASSERT_MSG( gdk_window,
+ wxT("cannot use wxRendererNative on wxDC of this type") );
+
+ GtkStateType state;
+ if ( flags & wxCONTROL_CURRENT )
+ state = GTK_STATE_PRELIGHT;
+ else
+ state = GTK_STATE_NORMAL;
+
+ int x_diff = 0;
+ if (win->GetLayoutDirection() == wxLayout_RightToLeft)
+ x_diff = rect.width;
+
+ // VZ: I don't know how to get the size of the expander so as to centre it
+ // in the given rectangle, +2/3 below is just what looks good here...
+ gtk_paint_expander
+ (
+ tree->style,
+ gdk_window,
+ state,
+ NULL,
+ tree,
+ "treeview",
+ dc.LogicalToDeviceX(rect.x) + 6 - x_diff,
+ dc.LogicalToDeviceY(rect.y) + 3,
+ flags & wxCONTROL_EXPANDED ? GTK_EXPANDER_EXPANDED
+ : GTK_EXPANDER_COLLAPSED
+ );
+}
+
+
+// ----------------------------------------------------------------------------
+// splitter sash drawing
+// ----------------------------------------------------------------------------
+
+static int GetGtkSplitterFullSize()
+{
+ static GtkWidget *s_paned = NULL;
+ if (s_paned == NULL)
+ s_paned = gtk_vpaned_new();
+
+ gint handle_size;
+ gtk_widget_style_get (s_paned, "handle_size", &handle_size, NULL);
+
+ return handle_size;
+}
+
+wxSplitterRenderParams
+wxRendererGTK::GetSplitterParams(const wxWindow *WXUNUSED(win))
+{
+ // we don't draw any border, hence 0 for the second field
+ return wxSplitterRenderParams
+ (
+ GetGtkSplitterFullSize(),
+ 0,
+ true // hot sensitive
+ );
+}
+
+void
+wxRendererGTK::DrawSplitterBorder(wxWindow * WXUNUSED(win),
+ wxDC& WXUNUSED(dc),
+ const wxRect& WXUNUSED(rect),
+ int WXUNUSED(flags))
+{
+ // nothing to do
+}
+
+void
+wxRendererGTK::DrawSplitterSash(wxWindow *win,
+ wxDC& dc,
+ const wxSize& size,
+ wxCoord position,
+ wxOrientation orient,
+ int flags)
+{
+ if ( !win->m_wxwindow->window )
+ {
+ // window not realized yet
+ return;
+ }
+
+ GdkWindow* gdk_window = NULL;
+#if wxUSE_NEW_DC
+ wxImplDC *impl = dc.GetImpl();
+ wxGTKImplDC *gtk_impl = wxDynamicCast( impl, wxGTKImplDC );
+ if (gtk_impl)
+ gdk_window = gtk_impl->GetGDKWindow();
+#else
+ gdk_window = dc.GetGDKWindow();
+#endif
+ wxASSERT_MSG( gdk_window,
+ wxT("cannot use wxRendererNative on wxDC of this type") );
+
+ wxCoord full_size = GetGtkSplitterFullSize();
+
+ // are we drawing vertical or horizontal splitter?
+ const bool isVert = orient == wxVERTICAL;
+
+ GdkRectangle rect;
+
+ if ( isVert )
+ {
+ rect.x = position;
+ rect.y = 0;
+ rect.width = full_size;
+ rect.height = size.y;
+ }
+ else // horz
+ {
+ rect.x = 0;
+ rect.y = position;
+ rect.height = full_size;
+ rect.width = size.x;
+ }
+
+ int x_diff = 0;
+ if (win->GetLayoutDirection() == wxLayout_RightToLeft)
+ x_diff = rect.width;
+
+ gtk_paint_handle
+ (
+ win->m_wxwindow->style,
+ gdk_window,
+ flags & wxCONTROL_CURRENT ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL,
+ GTK_SHADOW_NONE,
+ NULL /* no clipping */,