wxWidgets/include/wx/gtk/private/value.h
Vadim Zeitlin 3f84cb17ca Add wxActivityIndicator control.
This is a simple animated control indicating some program activity.

Provide native GTK+ (for > 2.20) and OS X implementations as well as a generic
one used under MSW.

Update the sample and the documentation.
2015-03-20 00:08:37 +01:00

44 lines
1.2 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/private/value.h
// Purpose: Helper wrapper for working with GValue.
// Author: Vadim Zeitlin
// Created: 2015-03-05
// Copyright: (c) 2015 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_PRIVATE_VALUE_H_
#define _WX_GTK_PRIVATE_VALUE_H_
// ----------------------------------------------------------------------------
// wxGtkValue: RAII wrapper for GValue
// ----------------------------------------------------------------------------
class wxGtkValue
{
public:
// Initialize the value of the specified type.
explicit wxGtkValue(GType gtype)
: m_val(G_VALUE_INIT)
{
g_value_init(&m_val, gtype);
}
~wxGtkValue()
{
g_value_unset(&m_val);
}
// Unsafe but convenient access to the real value for GTK+ functions.
operator GValue*() { return &m_val; }
private:
GValue m_val;
// For now we just don't support copying at all for simplicity, it could be
// implemented later if needed.
wxDECLARE_NO_COPY_CLASS(wxGtkValue);
};
#endif // _WX_GTK_PRIVATE_VALUE_H_