/* Copyright (C) 2023 The gtkmm 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, see <http://www.gnu.org/licenses/>.
 */

namespace Gdk
{
std::pair<guint32, guint64> DmabufFormats::get_format(gsize idx) const
{
  guint32 fourcc = 0;
  guint64 modifier = 0;
  gdk_dmabuf_formats_get_format(const_cast<GdkDmabufFormats*>(gobj()), idx, &fourcc, &modifier);
  return {fourcc, modifier};
}
} // namespace Gdk

namespace Glib
{
GType Value<RefPtr<Gdk::DmabufFormats> >::value_type()
{
  return GDK_TYPE_DMABUF_FORMATS;
}

void Value<RefPtr<Gdk::DmabufFormats> >::set(const CppType& data)
{
  set_boxed(Glib::unwrap(data));
}

Value<RefPtr<Gdk::DmabufFormats>>::CppType Value<RefPtr<Gdk::DmabufFormats>>::get() const
{
  return Glib::wrap(static_cast<CType>(get_boxed()), true);
}

} // namespace Glib
