/* Copyright (C) 2006 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gtk/gtkrecentmanager.h>

namespace Gtk
{

bool RecentInfo::equal(const RecentInfo& other) const
{
  return (static_cast<bool>(gtk_recent_info_match(const_cast<GtkRecentInfo*>(this->gobj()),
                                                  const_cast<GtkRecentInfo*>(other.gobj()))));
}

RecentInfo::operator bool() const
{
  return gobj() != 0;
}

Glib::StringArrayHandle RecentInfo::get_applications() const
{
  //We pass 0 for the length output argument, because we don't need it, because the returned array is null-terminated.
  return Glib::StringArrayHandle(gtk_recent_info_get_applications(const_cast<GtkRecentInfo*>(this->gobj()), 0));
}

Glib::StringArrayHandle RecentInfo::get_groups() const
{
  //We pass 0 for the length output argument, because we don't need it, because the returned array is null-terminated.
  return Glib::StringArrayHandle(gtk_recent_info_get_groups(const_cast<GtkRecentInfo*>(this->gobj()), 0));
}

RecentInfoTraits::CppType RecentInfoTraits::to_cpp_type(const CType& obj)
{
  return Glib::wrap(const_cast<CTypeNonConst>(obj), true);
}

} // namespace Gtk
