/////////////////////////////////////////////////////////////////////////////
-// Name: x11/dcclient.cpp
+// Name: src/x11/dcclient.cpp
// Purpose: wxClientDC class
// Author: Julian Smart, Robert Roebling
// Modified by:
// 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"
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 );
#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
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)
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);
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);
wxCHECK_RET( Ok(), wxT("invalid dc") );
m_font = font;
-
+
return;
-
+
#if wxUSE_UNICODE
m_fontdesc = font.GetNativeFontInfo()->description;
#endif
class wxDCModule : public wxModule
{
public:
- bool OnInit();
- void OnExit();
+ // we must be cleaned up before wxDisplayModule which closes the global
+ // display
+ wxDCModule()
+ {
+ AddDependency(wxClassInfo::FindClass(_T("wxX11DisplayModule")));
+ }
+
+ bool OnInit() { wxInitGCPool(); return true; }
+ void OnExit() { wxCleanUpGCPool(); }
private:
DECLARE_DYNAMIC_CLASS(wxDCModule)
IMPLEMENT_DYNAMIC_CLASS(wxDCModule, wxModule)
-bool wxDCModule::OnInit()
-{
- wxInitGCPool();
- return true;
-}
-
-void wxDCModule::OnExit()
-{
- wxCleanUpGCPool();
-}