]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/private/object.h
   1 /////////////////////////////////////////////////////////////////////////////// 
   2 // Name:        wx/gtk/private/object.h 
   3 // Purpose:     wxGtkObject class declaration 
   4 // Author:      Vadim Zeitlin 
   7 // Copyright:   (c) 2008 Vadim Zeitlin <vadim@wxwindows.org> 
   8 // Licence:     wxWindows licence 
   9 /////////////////////////////////////////////////////////////////////////////// 
  11 #ifndef _WX_GTK_PRIVATE_OBJECT_H_ 
  12 #define _WX_GTK_PRIVATE_OBJECT_H_ 
  14 // ---------------------------------------------------------------------------- 
  15 // Convenience class for calling g_object_unref() automatically 
  16 // ---------------------------------------------------------------------------- 
  22     explicit wxGtkObject(T 
*p
) : m_ptr(p
) { } 
  23     ~wxGtkObject() { g_object_unref(m_ptr
); } 
  25     operator T 
*() const { return m_ptr
; } 
  30     // copying could be implemented by using g_object_ref() but for now there 
  31     // is no need for it so don't implement it 
  32     wxDECLARE_NO_COPY_CLASS(wxGtkObject
); 
  35 #endif // _WX_GTK_PRIVATE_OBJECT_H_