From b098b62129781c0158ffa531a6de2aa9524d18bf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 19 Oct 2006 14:42:01 +0000 Subject: [PATCH] extracted wxGtkString in a separate file, it's also needed by wxX11 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42120 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/private.h | 21 +------------------- include/wx/gtk/private/string.h | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 20 deletions(-) create mode 100644 include/wx/gtk/private/string.h diff --git a/include/wx/gtk/private.h b/include/wx/gtk/private.h index c689eaa55d..105b572190 100644 --- a/include/wx/gtk/private.h +++ b/include/wx/gtk/private.h @@ -15,6 +15,7 @@ #include #include "wx/event.h" +#include "wx/gtk/private/string.h" // fail all version tests if the GTK+ version is so ancient that it doesn't // even have GTK_CHECK_VERSION @@ -80,26 +81,6 @@ G_END_DECLS extern void wxapp_install_idle_handler(); extern bool g_isIdle; -//----------------------------------------------------------------------------- -// Convenience class for g_freeing a gchar* on scope exit automatically -//----------------------------------------------------------------------------- - -class wxGtkString -{ -public: - explicit wxGtkString(gchar *s) : m_str(s) { } - ~wxGtkString() { g_free(m_str); } - - const gchar *c_str() const { return m_str; } - - operator gchar *() const { return m_str; } - -private: - gchar *m_str; - - DECLARE_NO_COPY_CLASS(wxGtkString) -}; - //----------------------------------------------------------------------------- // Misc. functions //----------------------------------------------------------------------------- diff --git a/include/wx/gtk/private/string.h b/include/wx/gtk/private/string.h new file mode 100644 index 0000000000..d6ef553132 --- /dev/null +++ b/include/wx/gtk/private/string.h @@ -0,0 +1,35 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/gtk/private/string.h +// Purpose: wxGtkString class declaration +// Author: Vadim Zeitlin +// Created: 2006-10-19 +// RCS-ID: $Id$ +// Copyright: (c) 2006 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_GTK_PRIVATE_STRING_H_ +#define _WX_GTK_PRIVATE_STRING_H_ + +// ---------------------------------------------------------------------------- +// Convenience class for g_freeing a gchar* on scope exit automatically +// ---------------------------------------------------------------------------- + +class wxGtkString +{ +public: + explicit wxGtkString(gchar *s) : m_str(s) { } + ~wxGtkString() { g_free(m_str); } + + const gchar *c_str() const { return m_str; } + + operator gchar *() const { return m_str; } + +private: + gchar *m_str; + + DECLARE_NO_COPY_CLASS(wxGtkString) +}; + +#endif // _WX_GTK_PRIVATE_STRING_H_ + -- 2.45.2