]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/themes/gtk.cpp
Add doc for wxGraphicsContext.Create(), which is a lightweight context with no target...
[wxWidgets.git] / src / univ / themes / gtk.cpp
index 843c61cd58ea57e6a8d45a1e41a17229e6147de8..40083c9747284dc11859d9bad6d46b0e55fd383c 100644 (file)
     #pragma hdrstop
 #endif
 
     #pragma hdrstop
 #endif
 
+#include "wx/univ/theme.h"
+
+#if wxUSE_THEME_GTK
+
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/dcmemory.h"
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/dcmemory.h"
+    #include "wx/dcclient.h"
     #include "wx/window.h"
 
     #include "wx/menu.h"
     #include "wx/window.h"
 
     #include "wx/menu.h"
 #include "wx/notebook.h"
 #include "wx/spinbutt.h"
 #include "wx/artprov.h"
 #include "wx/notebook.h"
 #include "wx/spinbutt.h"
 #include "wx/artprov.h"
-#ifdef wxUSE_TOGGLEBTN
 #include "wx/tglbtn.h"
 #include "wx/tglbtn.h"
-#endif // wxUSE_TOGGLEBTN
 
 #include "wx/univ/stdrend.h"
 #include "wx/univ/inpcons.h"
 #include "wx/univ/inphand.h"
 #include "wx/univ/colschem.h"
 
 #include "wx/univ/stdrend.h"
 #include "wx/univ/inpcons.h"
 #include "wx/univ/inphand.h"
 #include "wx/univ/colschem.h"
-#include "wx/univ/theme.h"
 
 
-class WXDLLEXPORT wxGTKMenuGeometryInfo;
+class wxGTKMenuGeometryInfo;
 
 // ----------------------------------------------------------------------------
 // constants
 
 // ----------------------------------------------------------------------------
 // constants
@@ -81,7 +83,7 @@ public:
     wxGTKRenderer(const wxColourScheme *scheme);
 
     // wxRenderer methods
     wxGTKRenderer(const wxColourScheme *scheme);
 
     // wxRenderer methods
-    virtual void DrawFocusRect(wxDC& dc, const wxRect& rect);
+    virtual void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0);
     virtual void DrawTextBorder(wxDC& dc,
                                 wxBorder border,
                                 const wxRect& rect,
     virtual void DrawTextBorder(wxDC& dc,
                                 wxBorder border,
                                 const wxRect& rect,
@@ -115,13 +117,6 @@ public:
                                     wxOrientation orient,
                                     const wxRect& rect,
                                     int flags = 0);
                                     wxOrientation orient,
                                     const wxRect& rect,
                                     int flags = 0);
-    virtual void DrawScrollCorner(wxDC& dc,
-                                  const wxRect& rect);
-    virtual void DrawCheckItem(wxDC& dc,
-                               const wxString& label,
-                               const wxBitmap& bitmap,
-                               const wxRect& rect,
-                               int flags = 0);
 
 #if wxUSE_TOOLBAR
     virtual void DrawToolBarButton(wxDC& dc,
 
 #if wxUSE_TOOLBAR
     virtual void DrawToolBarButton(wxDC& dc,
@@ -137,6 +132,7 @@ public:
     virtual void DrawLineWrapMark(wxDC& dc, const wxRect& rect);
 #endif // wxUSE_TEXTCTRL
 
     virtual void DrawLineWrapMark(wxDC& dc, const wxRect& rect);
 #endif // wxUSE_TEXTCTRL
 
+#if wxUSE_NOTEBOOK
     virtual void DrawTab(wxDC& dc,
                          const wxRect& rect,
                          wxDirection dir,
     virtual void DrawTab(wxDC& dc,
                          const wxRect& rect,
                          wxDirection dir,
@@ -144,6 +140,7 @@ public:
                          const wxBitmap& bitmap = wxNullBitmap,
                          int flags = 0,
                          int indexAccel = -1);
                          const wxBitmap& bitmap = wxNullBitmap,
                          int flags = 0,
                          int indexAccel = -1);
+#endif // wxUSE_NOTEBOOK
 
 #if wxUSE_SLIDER
     virtual void DrawSliderShaft(wxDC& dc,
 
 #if wxUSE_SLIDER
     virtual void DrawSliderShaft(wxDC& dc,
@@ -191,46 +188,6 @@ public:
                                    const wxMenuGeometryInfo& geomInfo);
 #endif // wxUSE_MENUS
 
                                    const wxMenuGeometryInfo& geomInfo);
 #endif // wxUSE_MENUS
 
-#if wxUSE_STATUSBAR
-    virtual void DrawStatusField(wxDC& dc,
-                                 const wxRect& rect,
-                                 const wxString& label,
-                                 int flags = 0, int style = 0);
-#endif // wxUSE_STATUSBAR
-
-    virtual void DrawFrameTitleBar(wxDC& dc,
-                                   const wxRect& rect,
-                                   const wxString& title,
-                                   const wxIcon& icon,
-                                   int flags,
-                                   int specialButton = 0,
-                                   int specialButtonFlag = 0);
-    virtual void DrawFrameBorder(wxDC& dc,
-                                 const wxRect& rect,
-                                 int flags);
-    virtual void DrawFrameBackground(wxDC& dc,
-                                     const wxRect& rect,
-                                     int flags);
-    virtual void DrawFrameTitle(wxDC& dc,
-                                const wxRect& rect,
-                                const wxString& title,
-                                int flags);
-    virtual void DrawFrameIcon(wxDC& dc,
-                               const wxRect& rect,
-                               const wxIcon& icon,
-                               int flags);
-    virtual void DrawFrameButton(wxDC& dc,
-                                 wxCoord x, wxCoord y,
-                                 int button,
-                                 int flags = 0);
-
-    // titlebars
-    virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const;
-    virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const;
-    virtual wxSize GetFrameMinSize(int flags) const;
-    virtual wxSize GetFrameIconSize() const;
-    virtual int HitTestFrame(const wxRect& rect, const wxPoint& pt, int flags) const;
-
     virtual void GetComboBitmaps(wxBitmap *bmpNormal,
                                  wxBitmap *bmpFocus,
                                  wxBitmap *bmpPressed,
     virtual void GetComboBitmaps(wxBitmap *bmpNormal,
                                  wxBitmap *bmpFocus,
                                  wxBitmap *bmpPressed,
@@ -239,16 +196,11 @@ public:
     virtual void AdjustSize(wxSize *size, const wxWindow *window);
 
     // geometry and hit testing
     virtual void AdjustSize(wxSize *size, const wxWindow *window);
 
     // geometry and hit testing
+#if wxUSE_SCROLLBAR
     virtual wxSize GetScrollbarArrowSize() const
         { return m_sizeScrollbarArrow; }
     virtual wxSize GetScrollbarArrowSize() const
         { return m_sizeScrollbarArrow; }
-#if wxUSE_SCROLLBAR
-    virtual wxRect GetScrollbarRect(const wxScrollBar *scrollbar,
-                                    wxScrollBar::Element elem,
-                                    int thumbPos = -1) const;
 #endif // wxUSE_SCROLLBAR
 
 #endif // wxUSE_SCROLLBAR
 
-    virtual wxCoord GetListboxItemHeight(wxCoord fontHeight)
-        { return fontHeight + 2; }
     virtual wxSize GetCheckBitmapSize() const
         { return wxSize(10, 10); }
     virtual wxSize GetRadioBitmapSize() const
     virtual wxSize GetCheckBitmapSize() const
         { return wxSize(10, 10); }
     virtual wxSize GetRadioBitmapSize() const
@@ -256,21 +208,23 @@ public:
     virtual wxCoord GetCheckItemMargin() const
         { return 2; }
 
     virtual wxCoord GetCheckItemMargin() const
         { return 2; }
 
+#if wxUSE_TOOLBAR
     virtual wxSize GetToolBarButtonSize(wxCoord *separator) const
         { if ( separator ) *separator = 5; return wxSize(16, 15); }
     virtual wxSize GetToolBarMargin() const
         { return wxSize(6, 6); }
     virtual wxSize GetToolBarButtonSize(wxCoord *separator) const
         { if ( separator ) *separator = 5; return wxSize(16, 15); }
     virtual wxSize GetToolBarMargin() const
         { return wxSize(6, 6); }
+#endif // wxUSE_TOOLBAR
 
 #if wxUSE_TEXTCTRL
 
 #if wxUSE_TEXTCTRL
-    virtual wxRect GetTextTotalArea(const wxTextCtrl *text,
-                                    const wxRect& rect) const;
     virtual wxRect GetTextClientArea(const wxTextCtrl *text,
                                      const wxRect& rect,
                                      wxCoord *extraSpaceBeyond) const;
 #endif // wxUSE_TEXTCTRL
 
     virtual wxRect GetTextClientArea(const wxTextCtrl *text,
                                      const wxRect& rect,
                                      wxCoord *extraSpaceBeyond) const;
 #endif // wxUSE_TEXTCTRL
 
+#if wxUSE_NOTEBOOK
     virtual wxSize GetTabIndent() const { return wxSize(2, 2); }
     virtual wxSize GetTabPadding() const { return wxSize(6, 6); }
     virtual wxSize GetTabIndent() const { return wxSize(2, 2); }
     virtual wxSize GetTabPadding() const { return wxSize(6, 6); }
+#endif // wxUSE_NOTEBOOK
 
 #if wxUSE_SLIDER
     virtual wxCoord GetSliderDim() const { return 15; }
 
 #if wxUSE_SLIDER
     virtual wxCoord GetSliderDim() const { return 15; }
@@ -292,16 +246,13 @@ public:
                                                 const wxMenu& menu) const;
 #endif // wxUSE_MENUS
 
                                                 const wxMenu& menu) const;
 #endif // wxUSE_MENUS
 
-#if wxUSE_STATUSBAR
-    virtual wxSize GetStatusBarBorders(wxCoord *borderBetweenFields) const;
-#endif // wxUSE_STATUSBAR
-
     // helpers for "wxBitmap wxColourScheme::Get()"
     void DrawCheckBitmap(wxDC& dc, const wxRect& rect);
     void DrawUncheckBitmap(wxDC& dc, const wxRect& rect, bool isPressed);
     void DrawUndeterminedBitmap(wxDC& dc, const wxRect& rect, bool isPressed);
 
 protected:
     // helpers for "wxBitmap wxColourScheme::Get()"
     void DrawCheckBitmap(wxDC& dc, const wxRect& rect);
     void DrawUncheckBitmap(wxDC& dc, const wxRect& rect, bool isPressed);
     void DrawUndeterminedBitmap(wxDC& dc, const wxRect& rect, bool isPressed);
 
 protected:
+    // overridden wxStdRenderer methods
     virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect);
 
     virtual void DrawFrameWithLabel(wxDC& dc,
     virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect);
 
     virtual void DrawFrameWithLabel(wxDC& dc,
@@ -312,6 +263,11 @@ protected:
                                     int alignment,
                                     int indexAccel);
 
                                     int alignment,
                                     int indexAccel);
 
+    virtual void DrawCheckItemBitmap(wxDC& dc,
+                                     const wxBitmap& bitmap,
+                                     const wxRect& rect,
+                                     int flags);
+
     // get the colour to use for background
     wxColour GetBackgroundColour(int flags) const
     {
     // get the colour to use for background
     wxColour GetBackgroundColour(int flags) const
     {
@@ -354,26 +310,6 @@ protected:
     // draw inner GTK shadow
     void DrawInnerShadedRect(wxDC& dc, wxRect *rect);
 
     // draw inner GTK shadow
     void DrawInnerShadedRect(wxDC& dc, wxRect *rect);
 
-#if wxUSE_SCROLLBAR
-    // returns the size of the arrow for the scrollbar (depends on
-    // orientation)
-    wxSize GetScrollbarArrowSize(const wxScrollBar *scrollbar) const
-    {
-        wxSize size;
-        if ( scrollbar->IsVertical() )
-        {
-            size = m_sizeScrollbarArrow;
-        }
-        else
-        {
-            size.x = m_sizeScrollbarArrow.y;
-            size.y = m_sizeScrollbarArrow.x;
-        }
-
-        return size;
-    }
-#endif // wxUSE_SCROLLBAR
-
     // get the line wrap indicator bitmap
     wxBitmap GetLineWrapBitmap() const;
 
     // get the line wrap indicator bitmap
     wxBitmap GetLineWrapBitmap() const;
 
@@ -390,16 +326,7 @@ protected:
                      wxCoord y1, wxCoord y2);
 
     // draw the radio button bitmap for the given state
                      wxCoord y1, wxCoord y2);
 
     // draw the radio button bitmap for the given state
-    void DrawRadioBitmap(wxDC& dc, const wxRect& rect, int flags);
-
-    // draw check/radio - the bitmap must be a valid one by now
-    void DoDrawCheckOrRadioBitmap(wxDC& dc,
-                                  const wxString& label,
-                                  const wxBitmap& bitmap,
-                                  const wxRect& rectTotal,
-                                  int flags,
-                                  wxAlignment align,
-                                  int indexAccel);
+    void DrawRadioButtonBitmap(wxDC& dc, const wxRect& rect, int flags);
 
     // common part of DrawMenuItem() and DrawMenuBarItem()
     void DoDrawMenuItem(wxDC& dc,
 
     // common part of DrawMenuItem() and DrawMenuBarItem()
     void DoDrawMenuItem(wxDC& dc,
@@ -414,9 +341,12 @@ protected:
     // initialize the combo bitmaps
     void InitComboBitmaps();
 
     // initialize the combo bitmaps
     void InitComboBitmaps();
 
-private:
-    const wxColourScheme *m_scheme;
+    virtual wxBitmap GetFrameButtonBitmap(FrameButtonType WXUNUSED(type))
+    {
+        return wxNullBitmap;
+    }
 
 
+private:
     // data
     wxSize m_sizeScrollbarArrow;
 
     // data
     wxSize m_sizeScrollbarArrow;
 
@@ -584,8 +514,6 @@ private:
     wxSortedArrayString m_handlerNames;
     wxArrayHandlers m_handlers;
 
     wxSortedArrayString m_handlerNames;
     wxArrayHandlers m_handlers;
 
-    wxGTKInputHandler *m_handlerDefault;
-
     wxGTKColourScheme *m_scheme;
 
     WX_DECLARE_THEME(gtk)
     wxGTKColourScheme *m_scheme;
 
     WX_DECLARE_THEME(gtk)
@@ -605,23 +533,14 @@ wxGTKTheme::wxGTKTheme()
 {
     m_scheme = NULL;
     m_renderer = NULL;
 {
     m_scheme = NULL;
     m_renderer = NULL;
-    m_handlerDefault = NULL;
     m_artProvider = NULL;
 }
 
 wxGTKTheme::~wxGTKTheme()
 {
     m_artProvider = NULL;
 }
 
 wxGTKTheme::~wxGTKTheme()
 {
-    size_t count = m_handlers.GetCount();
-    for ( size_t n = 0; n < count; n++ )
-    {
-        if ( m_handlers[n] != m_handlerDefault )
-            delete m_handlers[n];
-    }
-
-    delete m_handlerDefault;
     delete m_renderer;
     delete m_scheme;
     delete m_renderer;
     delete m_scheme;
-    wxArtProvider::RemoveProvider(m_artProvider);
+    delete m_artProvider;
 }
 
 wxRenderer *wxGTKTheme::GetRenderer()
 }
 
 wxRenderer *wxGTKTheme::GetRenderer()
@@ -725,7 +644,7 @@ wxColour wxGTKColourScheme::GetBackground(wxWindow *win) const
     if ( !win->ShouldInheritColours() )
     {
         // doesn't depend on the state
     if ( !win->ShouldInheritColours() )
     {
         // doesn't depend on the state
-        if ( !col.Ok() )
+        if ( !col.IsOk() )
         {
             col = Get(WINDOW);
         }
         {
             col = Get(WINDOW);
         }
@@ -736,7 +655,7 @@ wxColour wxGTKColourScheme::GetBackground(wxWindow *win) const
 
         // the colour set by the user should be used for the normal state
         // and for the states for which we don't have any specific colours
 
         // the colour set by the user should be used for the normal state
         // and for the states for which we don't have any specific colours
-        if ( !col.Ok() || (flags != 0) )
+        if ( !col.IsOk() || (flags != 0) )
         {
 #if wxUSE_SCROLLBAR
             if ( wxDynamicCast(win, wxScrollBar) )
         {
 #if wxUSE_SCROLLBAR
             if ( wxDynamicCast(win, wxScrollBar) )
@@ -759,6 +678,7 @@ wxColour wxGTKColourScheme::Get(wxGTKColourScheme::StdColour col) const
 {
     switch ( col )
     {
 {
     switch ( col )
     {
+        case FRAME:
         case WINDOW:            return *wxWHITE;
 
         case SHADOW_DARK:       return *wxBLACK;
         case WINDOW:            return *wxWHITE;
 
         case SHADOW_DARK:       return *wxBLACK;
@@ -794,7 +714,7 @@ wxColour wxGTKColourScheme::Get(wxGTKColourScheme::StdColour col) const
 
         case MAX:
         default:
 
         case MAX:
         default:
-            wxFAIL_MSG(_T("invalid standard colour"));
+            wxFAIL_MSG(wxT("invalid standard colour"));
             return *wxBLACK;
     }
 }
             return *wxBLACK;
     }
 }
@@ -850,7 +770,7 @@ void wxGTKRenderer::DrawAntiShadedRectSide(wxDC& dc,
             break;
 
         default:
             break;
 
         default:
-            wxFAIL_MSG(_T("unknown rectangle side"));
+            wxFAIL_MSG(wxT("unknown rectangle side"));
     }
 }
 
     }
 }
 
@@ -891,7 +811,8 @@ void wxGTKRenderer::DrawSunkenBorder(wxDC& dc, wxRect *rect)
     DrawShadedRect(dc, rect, m_penBlack, m_penLightGrey);
 }
 
     DrawShadedRect(dc, rect, m_penBlack, m_penLightGrey);
 }
 
-void wxGTKRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect)
+void
+wxGTKRenderer::DrawFocusRect(wxWindow* WXUNUSED(win), wxDC& dc, const wxRect& rect, int WXUNUSED(flags))
 {
     dc.SetBrush(*wxTRANSPARENT_BRUSH);
     wxRect rectFocus = rect;
 {
     dc.SetBrush(*wxTRANSPARENT_BRUSH);
     wxRect rectFocus = rect;
@@ -1002,33 +923,18 @@ void wxGTKRenderer::DrawFrameWithLabel(wxDC& dc,
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
-// label
+// check/radio buttons
 // ----------------------------------------------------------------------------
 
 // ----------------------------------------------------------------------------
 
-void wxGTKRenderer::DrawCheckItem(wxDC& dc,
-                                  const wxString& label,
-                                  const wxBitmap& bitmap,
-                                  const wxRect& rect,
-                                  int flags)
+void wxGTKRenderer::DrawCheckItemBitmap(wxDC& dc,
+                                        const wxBitmap& bitmap,
+                                        const wxRect& rect,
+                                        int flags)
 {
 {
-    wxRect rectBitmap = rect;
-    rectBitmap.x -= 1;
-    rectBitmap.width = GetCheckBitmapSize().x;
-
     // never draw the focus rect around the check indicators here
     // never draw the focus rect around the check indicators here
-    DrawCheckButton(dc, wxEmptyString, bitmap, rectBitmap, flags & ~wxCONTROL_FOCUSED);
-
-    wxRect rectLabel = rect;
-    wxCoord shift = rectBitmap.width + 2*GetCheckItemMargin();
-    rectLabel.x += shift;
-    rectLabel.width -= shift;
-    DrawItem(dc, label, rectLabel, flags);
+    DrawCheckButton(dc, wxEmptyString, bitmap, rect, flags & ~wxCONTROL_FOCUSED);
 }
 
 }
 
-// ----------------------------------------------------------------------------
-// check/radion buttons
-// ----------------------------------------------------------------------------
-
 void wxGTKRenderer::DrawUndeterminedBitmap(wxDC& dc,
                                            const wxRect& rectTotal,
                                            bool isPressed)
 void wxGTKRenderer::DrawUndeterminedBitmap(wxDC& dc,
                                            const wxRect& rectTotal,
                                            bool isPressed)
@@ -1089,9 +995,9 @@ void wxGTKRenderer::DrawCheckBitmap(wxDC& dc, const wxRect& rectTotal)
     dc.DrawRectangle(rect);
 }
 
     dc.DrawRectangle(rect);
 }
 
-void wxGTKRenderer::DrawRadioBitmap(wxDC& dc,
-                                    const wxRect& rect,
-                                    int flags)
+void wxGTKRenderer::DrawRadioButtonBitmap(wxDC& dc,
+                                          const wxRect& rect,
+                                          int flags)
 {
     wxCoord x = rect.x,
             y = rect.y,
 {
     wxCoord x = rect.x,
             y = rect.y,
@@ -1161,7 +1067,7 @@ void wxGTKRenderer::DrawDownZag(wxDC& dc,
 
 wxBitmap wxGTKRenderer::GetCheckBitmap(int flags)
 {
 
 wxBitmap wxGTKRenderer::GetCheckBitmap(int flags)
 {
-    if ( !m_bitmapsCheckbox[0][0].Ok() )
+    if ( !m_bitmapsCheckbox[0][0].IsOk() )
     {
         // init the bitmaps once only
         wxRect rect;
     {
         // init the bitmaps once only
         wxRect rect;
@@ -1218,7 +1124,7 @@ wxBitmap wxGTKRenderer::GetRadioBitmap(int flags)
     GetIndicatorsFromFlags(flags, state, status);
 
     wxBitmap& bmp = m_bitmapsRadiobtn[state][status];
     GetIndicatorsFromFlags(flags, state, status);
 
     wxBitmap& bmp = m_bitmapsRadiobtn[state][status];
-    if ( !bmp.Ok() )
+    if ( !bmp.IsOk() )
     {
         const wxSize size = GetRadioBitmapSize();
 
     {
         const wxSize size = GetRadioBitmapSize();
 
@@ -1226,7 +1132,7 @@ wxBitmap wxGTKRenderer::GetRadioBitmap(int flags)
         bmp.Create(size.x, size.y);
         dc.SelectObject(bmp);
 
         bmp.Create(size.x, size.y);
         dc.SelectObject(bmp);
 
-        DrawRadioBitmap(dc, size, flags);
+        DrawRadioButtonBitmap(dc, size, flags);
     }
 
     return bmp;
     }
 
     return bmp;
@@ -1234,7 +1140,7 @@ wxBitmap wxGTKRenderer::GetRadioBitmap(int flags)
 
 wxBitmap wxGTKRenderer::GetLineWrapBitmap() const
 {
 
 wxBitmap wxGTKRenderer::GetLineWrapBitmap() const
 {
-    if ( !m_bmpLineWrap.Ok() )
+    if ( !m_bmpLineWrap.IsOk() )
     {
         // the line wrap bitmap as used by GTK+
         #define line_wrap_width 6
     {
         // the line wrap bitmap as used by GTK+
         #define line_wrap_width 6
@@ -1245,9 +1151,9 @@ wxBitmap wxGTKRenderer::GetLineWrapBitmap() const
         };
 
         wxBitmap bmpLineWrap(line_wrap_bits, line_wrap_width, line_wrap_height);
         };
 
         wxBitmap bmpLineWrap(line_wrap_bits, line_wrap_width, line_wrap_height);
-        if ( !bmpLineWrap.Ok() )
+        if ( !bmpLineWrap.IsOk() )
         {
         {
-            wxFAIL_MSG( _T("Failed to create line wrap XBM") );
+            wxFAIL_MSG( wxT("Failed to create line wrap XBM") );
         }
         else
         {
         }
         else
         {
@@ -1268,7 +1174,7 @@ void wxGTKRenderer::DrawToolBarButton(wxDC& dc,
                                       int tbarStyle)
 {
     // we don't draw the separators at all
                                       int tbarStyle)
 {
     // we don't draw the separators at all
-    if ( !label.empty() || bitmap.Ok() )
+    if ( !label.empty() || bitmap.IsOk() )
     {
         wxRect rect = rectOrig;
         rect.Deflate(BORDER_THICKNESS);
     {
         wxRect rect = rectOrig;
         rect.Deflate(BORDER_THICKNESS);
@@ -1313,20 +1219,12 @@ void wxGTKRenderer::DrawToolBarButton(wxDC& dc,
 
 #if wxUSE_TEXTCTRL
 
 
 #if wxUSE_TEXTCTRL
 
-wxRect wxGTKRenderer::GetTextTotalArea(const wxTextCtrl * WXUNUSED(text),
-                                       const wxRect& rect) const
-{
-    wxRect rectTotal = rect;
-    rectTotal.Inflate(2*BORDER_THICKNESS);
-    return rectTotal;
-}
-
 wxRect wxGTKRenderer::GetTextClientArea(const wxTextCtrl *text,
                                         const wxRect& rect,
                                         wxCoord *extraSpaceBeyond) const
 {
 wxRect wxGTKRenderer::GetTextClientArea(const wxTextCtrl *text,
                                         const wxRect& rect,
                                         wxCoord *extraSpaceBeyond) const
 {
-    wxRect rectText = rect;
-    rectText.Deflate(2*BORDER_THICKNESS);
+    wxRect
+      rectText = wxStdRenderer::GetTextClientArea(text, rect, extraSpaceBeyond);
 
     if ( text->WrapLines() )
     {
 
     if ( text->WrapLines() )
     {
@@ -1342,8 +1240,6 @@ wxRect wxGTKRenderer::GetTextClientArea(const wxTextCtrl *text,
     return rectText;
 }
 
     return rectText;
 }
 
-#endif // wxUSE_TEXTCTRL
-
 void wxGTKRenderer::DrawLineWrapMark(wxDC& dc, const wxRect& rect)
 {
     wxBitmap bmpLineWrap = GetLineWrapBitmap();
 void wxGTKRenderer::DrawLineWrapMark(wxDC& dc, const wxRect& rect)
 {
     wxBitmap bmpLineWrap = GetLineWrapBitmap();
@@ -1362,17 +1258,21 @@ void wxGTKRenderer::DrawLineWrapMark(wxDC& dc, const wxRect& rect)
     dc.DrawBitmap(bmpLineWrap,
                   rect.x, rect.y + (rect.height - bmpLineWrap.GetHeight())/2);
 
     dc.DrawBitmap(bmpLineWrap,
                   rect.x, rect.y + (rect.height - bmpLineWrap.GetHeight())/2);
 
-    if ( colFgOld.Ok() )
+    if ( colFgOld.IsOk() )
     {
         // restore old colour
         dc.SetTextForeground(colFgOld);
     }
 }
 
     {
         // restore old colour
         dc.SetTextForeground(colFgOld);
     }
 }
 
+#endif // wxUSE_TEXTCTRL
+
 // ----------------------------------------------------------------------------
 // notebook
 // ----------------------------------------------------------------------------
 
 // ----------------------------------------------------------------------------
 // notebook
 // ----------------------------------------------------------------------------
 
+#if wxUSE_NOTEBOOK
+
 void wxGTKRenderer::DrawTab(wxDC& dc,
                             const wxRect& rectOrig,
                             wxDirection dir,
 void wxGTKRenderer::DrawTab(wxDC& dc,
                             const wxRect& rectOrig,
                             wxDirection dir,
@@ -1401,7 +1301,7 @@ void wxGTKRenderer::DrawTab(wxDC& dc,
         switch ( dir )
         {
             default:
         switch ( dir )
         {
             default:
-                wxFAIL_MSG(_T("invaild notebook tab orientation"));
+                wxFAIL_MSG(wxT("invaild notebook tab orientation"));
                 // fall through
 
             case wxTOP:
                 // fall through
 
             case wxTOP:
@@ -1569,12 +1469,14 @@ void wxGTKRenderer::DrawTab(wxDC& dc,
     }
 }
 
     }
 }
 
-#if wxUSE_SLIDER
+#endif // wxUSE_NOTEBOOK
 
 // ----------------------------------------------------------------------------
 // slider
 // ----------------------------------------------------------------------------
 
 
 // ----------------------------------------------------------------------------
 // slider
 // ----------------------------------------------------------------------------
 
+#if wxUSE_SLIDER
+
 wxSize wxGTKRenderer::GetSliderThumbSize(const wxRect& rect,
                                          int lenThumb,
                                          wxOrientation orient) const
 wxSize wxGTKRenderer::GetSliderThumbSize(const wxRect& rect,
                                          int lenThumb,
                                          wxOrientation orient) const
@@ -1669,7 +1571,7 @@ void wxGTKRenderer::DrawSliderThumb(wxDC& dc,
 // ----------------------------------------------------------------------------
 
 // wxGTKMenuGeometryInfo: the wxMenuGeometryInfo used by wxGTKRenderer
 // ----------------------------------------------------------------------------
 
 // wxGTKMenuGeometryInfo: the wxMenuGeometryInfo used by wxGTKRenderer
-class WXDLLEXPORT wxGTKMenuGeometryInfo : public wxMenuGeometryInfo
+class wxGTKMenuGeometryInfo : public wxMenuGeometryInfo
 {
 public:
     virtual wxSize GetSize() const { return m_size; }
 {
 public:
     virtual wxSize GetSize() const { return m_size; }
@@ -1773,12 +1675,12 @@ void wxGTKRenderer::DoDrawMenuItem(wxDC& dc,
     if ( geometryInfo )
     {
         wxBitmap bmp = bitmap;
     if ( geometryInfo )
     {
         wxBitmap bmp = bitmap;
-        if ( !bmp.Ok() && (flags & wxCONTROL_CHECKABLE) )
+        if ( !bmp.IsOk() && (flags & wxCONTROL_CHECKABLE) )
         {
             bmp = GetCheckBitmap(flags);
         }
 
         {
             bmp = GetCheckBitmap(flags);
         }
 
-        if ( bmp.Ok() )
+        if ( bmp.IsOk() )
         {
             rect.SetRight(geometryInfo->GetLabelOffset());
             wxControlRenderer::DrawBitmap(dc, bmp, rect);
         {
             rect.SetRight(geometryInfo->GetLabelOffset());
             wxControlRenderer::DrawBitmap(dc, bmp, rect);
@@ -1799,7 +1701,7 @@ void wxGTKRenderer::DoDrawMenuItem(wxDC& dc,
     if ( !accel.empty() )
     {
         // menubar items shouldn't have them
     if ( !accel.empty() )
     {
         // menubar items shouldn't have them
-        wxCHECK_RET( geometryInfo, _T("accel strings only valid for menus") );
+        wxCHECK_RET( geometryInfo, wxT("accel strings only valid for menus") );
 
         rect.x = geometryInfo->GetAccelOffset();
         rect.SetRight(geometryInfo->GetSize().x);
 
         rect.x = geometryInfo->GetAccelOffset();
         rect.SetRight(geometryInfo->GetSize().x);
@@ -1811,7 +1713,7 @@ void wxGTKRenderer::DoDrawMenuItem(wxDC& dc,
     // draw the submenu indicator
     if ( flags & wxCONTROL_ISSUBMENU )
     {
     // draw the submenu indicator
     if ( flags & wxCONTROL_ISSUBMENU )
     {
-        wxCHECK_RET( geometryInfo, _T("wxCONTROL_ISSUBMENU only valid for menus") );
+        wxCHECK_RET( geometryInfo, wxT("wxCONTROL_ISSUBMENU only valid for menus") );
 
         rect.x = geometryInfo->GetSize().x - MENU_RIGHT_MARGIN;
         rect.width = MENU_RIGHT_MARGIN;
 
         rect.x = geometryInfo->GetSize().x - MENU_RIGHT_MARGIN;
         rect.width = MENU_RIGHT_MARGIN;
@@ -1878,7 +1780,7 @@ wxMenuGeometryInfo *wxGTKRenderer::GetMenuGeometry(wxWindow *win,
             h = heightText;
 
             wxCoord widthLabel;
             h = heightText;
 
             wxCoord widthLabel;
-            dc.GetTextExtent(item->GetLabel(), &widthLabel, NULL);
+            dc.GetTextExtent(item->GetItemLabelText(), &widthLabel, NULL);
             if ( widthLabel > widthLabelMax )
             {
                 widthLabelMax = widthLabel;
             if ( widthLabel > widthLabelMax )
             {
                 widthLabelMax = widthLabel;
@@ -1892,7 +1794,7 @@ wxMenuGeometryInfo *wxGTKRenderer::GetMenuGeometry(wxWindow *win,
             }
 
             const wxBitmap& bmp = item->GetBitmap();
             }
 
             const wxBitmap& bmp = item->GetBitmap();
-            if ( bmp.Ok() )
+            if ( bmp.IsOk() )
             {
                 wxCoord widthBmp = bmp.GetWidth();
                 if ( widthBmp > widthBmpMax )
             {
                 wxCoord widthBmp = bmp.GetWidth();
                 if ( widthBmp > widthBmpMax )
@@ -1931,27 +1833,6 @@ wxMenuGeometryInfo *wxGTKRenderer::GetMenuGeometry(wxWindow *win,
 
 #endif // wxUSE_MENUS
 
 
 #endif // wxUSE_MENUS
 
-#if wxUSE_STATUSBAR
-
-// ----------------------------------------------------------------------------
-// status bar
-// ----------------------------------------------------------------------------
-
-wxSize
-wxGTKRenderer::GetStatusBarBorders(wxCoord * WXUNUSED(borderBetweenFields)) const
-{
-    return wxSize(0,0);
-}
-
-void wxGTKRenderer::DrawStatusField(wxDC& WXUNUSED(dc),
-                                    const wxRect& WXUNUSED(rect),
-                                    const wxString& WXUNUSED(label),
-                                    int WXUNUSED(flags), int WXUNUSED(style))
-{
-}
-
-#endif // wxUSE_STATUSBAR
-
 // ----------------------------------------------------------------------------
 // combobox
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // combobox
 // ----------------------------------------------------------------------------
@@ -1995,7 +1876,7 @@ void wxGTKRenderer::GetComboBitmaps(wxBitmap *bmpNormal,
                                     wxBitmap *bmpPressed,
                                     wxBitmap *bmpDisabled)
 {
                                     wxBitmap *bmpPressed,
                                     wxBitmap *bmpDisabled)
 {
-    if ( !m_bitmapsCombo[ComboState_Normal].Ok() )
+    if ( !m_bitmapsCombo[ComboState_Normal].IsOk() )
     {
         InitComboBitmaps();
     }
     {
         InitComboBitmaps();
     }
@@ -2067,7 +1948,7 @@ void wxGTKRenderer::DrawArrowBorder(wxDC& dc,
             break;
 
         default:
             break;
 
         default:
-            wxFAIL_MSG(_T("unknown arrow direction"));
+            wxFAIL_MSG(wxT("unknown arrow direction"));
             return;
     }
 
             return;
     }
 
@@ -2202,7 +2083,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc,
             break;
 
         default:
             break;
 
         default:
-            wxFAIL_MSG(_T("unknown arrow direction"));
+            wxFAIL_MSG(wxT("unknown arrow direction"));
     }
 
     dc.DrawPolygon(WXSIZEOF(ptArrow), ptArrow);
     }
 
     dc.DrawPolygon(WXSIZEOF(ptArrow), ptArrow);
@@ -2214,7 +2095,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc,
         case wxUP:
             dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]);
             dc.DrawPoint(ptArrow[Point_First]);
         case wxUP:
             dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]);
             dc.DrawPoint(ptArrow[Point_First]);
-            if ( penShadow[3].Ok() )
+            if ( penShadow[3].IsOk() )
             {
                 dc.SetPen(penShadow[3]);
                 dc.DrawLine(ptArrow[Point_First].x + 1, ptArrow[Point_First].y,
             {
                 dc.SetPen(penShadow[3]);
                 dc.DrawLine(ptArrow[Point_First].x + 1, ptArrow[Point_First].y,
@@ -2226,7 +2107,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc,
             dc.DrawPoint(ptArrow[Point_Third]);
             dc.DrawLine(ptArrow[Point_Third].x - 2, ptArrow[Point_Third].y,
                         ptArrow[Point_First].x + 1, ptArrow[Point_First].y);
             dc.DrawPoint(ptArrow[Point_Third]);
             dc.DrawLine(ptArrow[Point_Third].x - 2, ptArrow[Point_Third].y,
                         ptArrow[Point_First].x + 1, ptArrow[Point_First].y);
-            if ( penShadow[2].Ok() )
+            if ( penShadow[2].IsOk() )
             {
                 dc.SetPen(penShadow[2]);
                 dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y,
             {
                 dc.SetPen(penShadow[2]);
                 dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y,
@@ -2240,7 +2121,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc,
             dc.DrawLine(ptArrow[Point_First], ptArrow[Point_Second]);
             dc.DrawLine(ptArrow[Point_First].x + 2, ptArrow[Point_First].y,
                         ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y);
             dc.DrawLine(ptArrow[Point_First], ptArrow[Point_Second]);
             dc.DrawLine(ptArrow[Point_First].x + 2, ptArrow[Point_First].y,
                         ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y);
-            if ( penShadow[2].Ok() )
+            if ( penShadow[2].IsOk() )
             {
                 dc.SetPen(penShadow[2]);
                 dc.DrawLine(ptArrow[Point_Second].x, ptArrow[Point_Second].y - 1,
             {
                 dc.SetPen(penShadow[2]);
                 dc.DrawLine(ptArrow[Point_Second].x, ptArrow[Point_Second].y - 1,
@@ -2254,7 +2135,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc,
         case wxLEFT:
             dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]);
             dc.DrawPoint(ptArrow[Point_First]);
         case wxLEFT:
             dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]);
             dc.DrawPoint(ptArrow[Point_First]);
-            if ( penShadow[2].Ok() )
+            if ( penShadow[2].IsOk() )
             {
                 dc.SetPen(penShadow[2]);
                 dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y,
             {
                 dc.SetPen(penShadow[2]);
                 dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y,
@@ -2279,7 +2160,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc,
             break;
 
         default:
             break;
 
         default:
-            wxFAIL_MSG(_T("unknown arrow direction"));
+            wxFAIL_MSG(wxT("unknown arrow direction"));
             return;
     }
 }
             return;
     }
 }
@@ -2345,29 +2226,6 @@ void wxGTKRenderer::DrawScrollbarShaft(wxDC& dc,
     DrawSolidRect(dc, wxSCHEME_COLOUR(m_scheme, SCROLLBAR), rectBar);
 }
 
     DrawSolidRect(dc, wxSCHEME_COLOUR(m_scheme, SCROLLBAR), rectBar);
 }
 
-void wxGTKRenderer::DrawScrollCorner(wxDC& dc, const wxRect& rect)
-{
-    DrawSolidRect(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rect);
-}
-
-#if wxUSE_SCROLLBAR
-wxRect wxGTKRenderer::GetScrollbarRect(const wxScrollBar *scrollbar,
-                                       wxScrollBar::Element elem,
-                                       int thumbPos) const
-{
-    // as GTK scrollbars can't be disabled, it makes no sense to remove the
-    // thumb for a scrollbar with range 0 - instead, make it fill the entire
-    // scrollbar shaft
-    if ( (elem == wxScrollBar::Element_Thumb) && !scrollbar->GetRange() )
-    {
-        elem = wxScrollBar::Element_Bar_2;
-    }
-
-    return wxStdRenderer::GetScrollbarRect(scrollbar, elem, thumbPos);
-}
-
-#endif // wxUSE_SCROLLBAR
-
 // ----------------------------------------------------------------------------
 // size adjustments
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // size adjustments
 // ----------------------------------------------------------------------------
@@ -2407,104 +2265,22 @@ void wxGTKRenderer::AdjustSize(wxSize *size, const wxWindow *window)
 #if wxUSE_SCROLLBAR
     if ( wxDynamicCast(window, wxScrollBar) )
     {
 #if wxUSE_SCROLLBAR
     if ( wxDynamicCast(window, wxScrollBar) )
     {
-        // we only set the width of vert scrollbars and height of the
-        // horizontal ones
-        if ( window->GetWindowStyle() & wxSB_HORIZONTAL )
-            size->y = m_sizeScrollbarArrow.x;
-        else
-            size->x = m_sizeScrollbarArrow.x;
+        /*
+        Don't adjust the size for a scrollbar as its DoGetBestClientSize
+        already has the correct size set. Any size changes here would get
+        added to the best size, making the scrollbar larger.
+        Also skip border width adjustments, they don't make sense for us.
+        */
+        return;
     }
     else
 #endif // wxUSE_SCROLLBAR
     {
         // take into account the border width
     }
     else
 #endif // wxUSE_SCROLLBAR
     {
         // take into account the border width
-        wxRect rectBorder = GetBorderDimensions(window->GetBorder());
-        size->x += rectBorder.x + rectBorder.width;
-        size->y += rectBorder.y + rectBorder.height;
+        wxStdRenderer::AdjustSize(size, window);
     }
 }
 
     }
 }
 
-// ----------------------------------------------------------------------------
-// top level windows
-// ----------------------------------------------------------------------------
-
-void wxGTKRenderer::DrawFrameTitleBar(wxDC& WXUNUSED(dc),
-                                      const wxRect& WXUNUSED(rect),
-                                      const wxString& WXUNUSED(title),
-                                      const wxIcon& WXUNUSED(icon),
-                                      int WXUNUSED(flags),
-                                      int WXUNUSED(specialButton),
-                                      int WXUNUSED(specialButtonFlag))
-{
-}
-
-void wxGTKRenderer::DrawFrameBorder(wxDC& WXUNUSED(dc),
-                                    const wxRect& WXUNUSED(rect),
-                                    int WXUNUSED(flags))
-{
-}
-
-void wxGTKRenderer::DrawFrameBackground(wxDC& WXUNUSED(dc),
-                                        const wxRect& WXUNUSED(rect),
-                                        int WXUNUSED(flags))
-{
-}
-
-void wxGTKRenderer::DrawFrameTitle(wxDC& WXUNUSED(dc),
-                                   const wxRect& WXUNUSED(rect),
-                                   const wxString& WXUNUSED(title),
-                                   int WXUNUSED(flags))
-{
-}
-
-void wxGTKRenderer::DrawFrameIcon(wxDC& WXUNUSED(dc),
-                                  const wxRect& WXUNUSED(rect),
-                                  const wxIcon& WXUNUSED(icon),
-                                  int WXUNUSED(flags))
-{
-}
-
-void wxGTKRenderer::DrawFrameButton(wxDC& WXUNUSED(dc),
-                                    wxCoord WXUNUSED(x),
-                                    wxCoord WXUNUSED(y),
-                                    int WXUNUSED(button),
-                                    int WXUNUSED(flags))
-{
-}
-
-wxRect
-wxGTKRenderer::GetFrameClientArea(const wxRect& rect,
-                                  int WXUNUSED(flags)) const
-{
-    return rect;
-}
-
-wxSize
-wxGTKRenderer::GetFrameTotalSize(const wxSize& clientSize,
-                                 int WXUNUSED(flags)) const
-{
-    return clientSize;
-}
-
-wxSize wxGTKRenderer::GetFrameMinSize(int WXUNUSED(flags)) const
-{
-    return wxSize(0,0);
-}
-
-wxSize wxGTKRenderer::GetFrameIconSize() const
-{
-    return wxSize(wxDefaultCoord, wxDefaultCoord);
-}
-
-int
-wxGTKRenderer::HitTestFrame(const wxRect& WXUNUSED(rect),
-                            const wxPoint& WXUNUSED(pt),
-                            int WXUNUSED(flags)) const
-{
-    return wxHT_TOPLEVEL_CLIENT_AREA;
-}
-
-
 // ----------------------------------------------------------------------------
 // standard icons
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // standard icons
 // ----------------------------------------------------------------------------
@@ -2959,3 +2735,5 @@ bool wxGTKTextCtrlInputHandler::HandleKey(wxInputConsumer *control,
 }
 
 #endif // wxUSE_TEXTCTRL
 }
 
 #endif // wxUSE_TEXTCTRL
+
+#endif // wxUSE_THEME_GTK