Extract X11 Display wrapper class in a private header.

No real changes, just extract a private Dpy class used by wxGTK to a header
and rename it to wxX11Display.

This will allow reusing it from X11 wxUIActionSimulator implementation in the
upcoming commits.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-08-22 22:15:13 +00:00
parent 1c9039c352
commit acdc8633de
2 changed files with 30 additions and 16 deletions

View File

@@ -48,6 +48,8 @@
#if wxUSE_DETECT_SM
#include "X11/Xlib.h"
#include "X11/SM/SMlib.h"
#include "wx/unix/utilsx11.h"
#endif
//-----------------------------------------------------------------------------
@@ -242,17 +244,7 @@ wxTimerImpl *wxGUIAppTraits::CreateTimerImpl(wxTimer *timer)
#if wxUSE_DETECT_SM
static wxString GetSM()
{
class Dpy
{
public:
Dpy() { m_dpy = XOpenDisplay(NULL); }
~Dpy() { if ( m_dpy ) XCloseDisplay(m_dpy); }
operator Display *() const { return m_dpy; }
private:
Display *m_dpy;
} dpy;
wxX11Display dpy;
if ( !dpy )
return wxEmptyString;