X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4077791b7f40b8a1217ac3917e24a7b3b7b28b27..ccb5db57cdb1766eefb7023dda50ede9f0d01f78:/src/x11/dcclient.cpp diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 272cc1dd1a..849911fa69 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: x11/dcclient.cpp +// Name: src/x11/dcclient.cpp // Purpose: wxClientDC class // Author: Julian Smart, Robert Roebling // Modified by: @@ -9,18 +9,24 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/dcclient.h" -#include "wx/dcmemory.h" -#include "wx/window.h" -#include "wx/app.h" -#include "wx/image.h" -#include "wx/module.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/window.h" + #include "wx/dcmemory.h" + #include "wx/math.h" + #include "wx/image.h" + #include "wx/module.h" +#endif + #include "wx/fontutil.h" #include "wx/x11/private.h" -#include "wx/math.h" - #if wxUSE_UNICODE #include "glib.h" #include "pango/pangox.h" @@ -1189,7 +1195,7 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap, GC gc = XCreateGC( xdisplay, new_pixmap, 0, NULL ); XSetForeground( xdisplay, gc, BlackPixel(xdisplay,xscreen) ); - + XSetFillStyle( xdisplay, gc, FillSolid ); XFillRectangle( xdisplay, new_pixmap, gc, 0, 0, ww, hh ); @@ -1587,7 +1593,7 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y ) #endif { XDrawString( (Display*) m_display, (Window) m_window, - (GC) m_textGC, x, y + XFontStructGetAscent(xfont), text.c_str(), text.Len() ); + (GC) m_textGC, x, y + XFontStructGetAscent(xfont), text.c_str(), text.length() ); } #if 0 @@ -1663,7 +1669,7 @@ void wxWindowDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoor int direction, ascent, descent2; XCharStruct overall; - XTextExtents( xfont, (char*) string.c_str(), string.Len(), &direction, + XTextExtents( xfont, (char*) string.c_str(), string.length(), &direction, &ascent, &descent2, &overall); if (width) @@ -1685,10 +1691,10 @@ wxCoord wxWindowDC::GetCharWidth() const PangoLayout *layout = pango_layout_new( m_context ); if (m_fontdesc) - pango_layout_set_font_description(layout, m_fontdesc); + pango_layout_set_font_description(layout, m_fontdesc); else - pango_layout_set_font_description(layout, this->GetFont().GetNativeFontInfo()->description); - + pango_layout_set_font_description(layout, this->GetFont().GetNativeFontInfo()->description); + pango_layout_set_text(layout, "H", 1 ); int w,h; pango_layout_get_pixel_size(layout, &w, &h); @@ -1719,10 +1725,10 @@ wxCoord wxWindowDC::GetCharHeight() const PangoLayout *layout = pango_layout_new( m_context ); if (m_fontdesc) - pango_layout_set_font_description(layout, m_fontdesc); + pango_layout_set_font_description(layout, m_fontdesc); else - pango_layout_set_font_description(layout, this->GetFont().GetNativeFontInfo()->description); - + pango_layout_set_font_description(layout, this->GetFont().GetNativeFontInfo()->description); + pango_layout_set_text(layout, "H", 1 ); int w,h; pango_layout_get_pixel_size(layout, &w, &h); @@ -1780,9 +1786,9 @@ void wxWindowDC::SetFont( const wxFont &font ) wxCHECK_RET( Ok(), wxT("invalid dc") ); m_font = font; - + return; - + #if wxUSE_UNICODE m_fontdesc = font.GetNativeFontInfo()->description; #endif