+ wxDCImpl::DoGradientFillLinear(rect, initialColour, destColour, nDirection);
+}
+
+#if wxUSE_DYNLIB_CLASS
+
+static DWORD wxGetDCLayout(HDC hdc)
+{
+ typedef DWORD (WINAPI *GetLayout_t)(HDC);
+ static GetLayout_t
+ wxDL_INIT_FUNC(s_pfn, GetLayout, wxDynamicLibrary(wxT("gdi32.dll")));
+
+ return s_pfnGetLayout ? s_pfnGetLayout(hdc) : (DWORD)-1;
+}
+
+wxLayoutDirection wxMSWDCImpl::GetLayoutDirection() const
+{
+ DWORD layout = wxGetDCLayout(GetHdc());
+
+ if ( layout == (DWORD)-1 )
+ return wxLayout_Default;
+
+ return layout & LAYOUT_RTL ? wxLayout_RightToLeft : wxLayout_LeftToRight;
+}
+
+void wxMSWDCImpl::SetLayoutDirection(wxLayoutDirection dir)
+{
+ typedef DWORD (WINAPI *SetLayout_t)(HDC, DWORD);
+ static SetLayout_t
+ wxDL_INIT_FUNC(s_pfn, SetLayout, wxDynamicLibrary(wxT("gdi32.dll")));
+ if ( !s_pfnSetLayout )
+ return;
+
+ if ( dir == wxLayout_Default )
+ {
+ dir = wxTheApp->GetLayoutDirection();
+ if ( dir == wxLayout_Default )
+ return;
+ }
+
+ DWORD layout = wxGetDCLayout(GetHdc());
+ if ( dir == wxLayout_RightToLeft )
+ layout |= LAYOUT_RTL;
+ else
+ layout &= ~LAYOUT_RTL;
+
+ s_pfnSetLayout(GetHdc(), layout);