m_font = window->GetFont();
- m_x11window = (WXWindow*) window->GetMainWindow();
+ m_x11window = (WXWindow*) window->X11GetMainWindow();
// not realized ?
if (!m_x11window)
void wxWindowDCImpl::DoGetSize( int* width, int* height ) const
{
- wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") );
+ wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") );
m_window->GetSize(width, height);
}
CalcBoundingBox (x, y);
}
-void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
+void wxWindowDCImpl::DoDrawLines( int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset )
{
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
delete[] xpoints;
}
-void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[],
+void wxWindowDCImpl::DoDrawPolygon( int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode WXUNUSED(fillStyle) )
{
// wxUSE_NANOX/!wxUSE_NANOX
bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
- wxDC *source, wxCoord xsrc, wxCoord ysrc,
+ wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode logical_func, bool useMask,
wxCoord xsrcMask, wxCoord ysrcMask )
{
PangoLayout *layout = pango_layout_new(m_context);
pango_layout_set_font_description(layout, m_fontdesc);
- const wxCharBuffer data = wxConvUTF8.cWC2MB( text );
- pango_layout_set_text(layout, (const char*) data, strlen( (const char*) data ));
+ const wxScopedCharBuffer data(text.utf8_str());
+ pango_layout_set_text(layout, data, data.length());
// Measure layout.
int w,h;
wxCoord *descent, wxCoord *externalLeading,
const wxFont *font ) const
{
- wxCHECK_RET( IsOk(), wxT("invalid dc") );
+ // Do not test for DC validity here, querying text extents is supposed to
+ // work even with a non-initialized wxMemoryDC. And the code below does
+ // actually work in this case.
if (string.empty())
{
else
pango_layout_set_font_description(layout, m_fontdesc);
- const wxCharBuffer data = wxConvUTF8.cWC2MB( string );
- pango_layout_set_text(layout, (const char*) data, strlen( (const char*) data ));
+ const wxScopedCharBuffer data(string.utf8_str());
+ pango_layout_set_text(layout, data, data.length());
// Measure text.
int w,h;
wxCoord wxWindowDCImpl::GetCharWidth() const
{
- wxCHECK_MSG( IsOk(), 0, wxT("invalid dc") );
+ // Do not test for DC validity here for the same reasons as in
+ // DoGetTextExtent() above.
#if wxUSE_UNICODE
PangoLayout *layout = pango_layout_new( m_context );
wxCoord wxWindowDCImpl::GetCharHeight() const
{
- wxCHECK_MSG( IsOk(), 0, wxT("invalid dc") );
+ // Do not test for DC validity here for the same reasons as in
+ // DoGetTextExtent() above.
#if wxUSE_UNICODE
PangoLayout *layout = pango_layout_new( m_context );
wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window )
: wxWindowDCImpl( owner, window )
{
- wxCHECK_RET( window, _T("NULL window in wxClientDC::wxClientDC") );
+ wxCHECK_RET( window, wxT("NULL window in wxClientDC::wxClientDC") );
m_x11window = (WXWindow*) window->GetClientAreaWindow();
// Adjust the client area when the wxWindow is not using 2 X11 windows.
- if (m_x11window == (WXWindow*) window->GetMainWindow())
+ if (m_x11window == (WXWindow*) window->X11GetMainWindow())
{
wxPoint ptOrigin = window->GetClientAreaOrigin();
SetDeviceOrigin(ptOrigin.x, ptOrigin.y);
void wxClientDCImpl::DoGetSize(int *width, int *height) const
{
- wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") );
+ wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") );
m_window->GetClientSize( width, height );
}
// display
wxDCModule()
{
- AddDependency(wxClassInfo::FindClass(_T("wxX11DisplayModule")));
+ AddDependency(wxClassInfo::FindClass(wxT("wxX11DisplayModule")));
}
bool OnInit() { wxInitGCPool(); return true; }