/* gstreamermm - a C++ wrapper for gstreamer
 *
 * Copyright 2008 The gstreamermm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gst/gst.h>
#include <glibmm/value.h>

_DEFS(gstreamermm,gst)

namespace Gst
{

_WRAP_ENUM(MiniObjectFlags, GstMiniObjectFlags)
_WRAP_ENUM(LockFlags, GstLockFlags)

/** This is a base class for some gstreamermm objects.
 * It is similar to Glib::Object but has no GObject property or signal support.
 */
class MiniObject
{
  _CLASS_OPAQUE_REFCOUNTED(MiniObject, GstMiniObject, NONE, gst_mini_object_ref, gst_mini_object_unref)
  _IGNORE(gst_mini_object_ref, gst_mini_object_unref)

public:
  ~MiniObject();
  _MEMBER_GET(flags, flags, guint, guint)
  _MEMBER_SET(flags, flags, guint, guint)

  _WRAP_METHOD(bool lock(LockFlags flags), gst_mini_object_lock)
  _WRAP_METHOD(void unlock(LockFlags flags), gst_mini_object_unlock)
  _WRAP_METHOD(bool is_writable() const, gst_mini_object_is_writable)
  _WRAP_METHOD(Glib::RefPtr<MiniObject> create_writable(), gst_mini_object_make_writable)

  // Copying a mini object can be achieved by assignment.
  _IGNORE(gst_mini_object_copy)
};

} // namespace Gst
