// Generated by gmmproc 2.84.0 -- DO NOT MODIFY!


#include <glibmm.h>

#include <gdkmm/colorstate.h>
#include <gdkmm/private/colorstate_p.h>


/* Copyright (C) 2024 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/>.
 */

#include <gdkmm/cicpparams.h>

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

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

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

namespace
{
} // anonymous namespace


/* Why reinterpret_cast<ColorState*>(gobject) is needed:
 *
 * A ColorState instance is in fact always a GdkColorState instance.
 * Unfortunately, GdkColorState cannot be a member of ColorState,
 * because it is an opaque struct.  Also, the C interface does not provide
 * any hooks to install a destroy notification handler, thus we cannot
 * wrap it dynamically either.
 *
 * The cast works because ColorState does not have any member data, and
 * it is impossible to derive from it.  This is ensured by using final on the
 * class and by using = delete on the default constructor.
 */

namespace Glib
{

Glib::RefPtr<Gdk::ColorState> wrap(GdkColorState* object, bool take_copy)
{
  if(take_copy && object)
    gdk_color_state_ref(object);

  // See the comment at the top of this file, if you want to know why the cast works.
  return Glib::make_refptr_for_instance<Gdk::ColorState>(reinterpret_cast<Gdk::ColorState*>(object));
}

} // namespace Glib


namespace Gdk
{

void ColorState::reference() const
{
  // See the comment at the top of this file, if you want to know why the cast works.
  gdk_color_state_ref(reinterpret_cast<GdkColorState*>(const_cast<ColorState*>(this)));
}

void ColorState::unreference() const
{
  // See the comment at the top of this file, if you want to know why the cast works.
  gdk_color_state_unref(reinterpret_cast<GdkColorState*>(const_cast<ColorState*>(this)));
}

GdkColorState* ColorState::gobj()
{
  // See the comment at the top of this file, if you want to know why the cast works.
  return reinterpret_cast<GdkColorState*>(this);
}

const GdkColorState* ColorState::gobj() const
{
  // See the comment at the top of this file, if you want to know why the cast works.
  return reinterpret_cast<const GdkColorState*>(this);
}

GdkColorState* ColorState::gobj_copy() const
{
  // See the comment at the top of this file, if you want to know why the cast works.
  const auto gobject = reinterpret_cast<GdkColorState*>(const_cast<ColorState*>(this));
  gdk_color_state_ref(gobject);
  return gobject;
}


Glib::RefPtr<ColorState> ColorState::get_srgb()
{

  auto retvalue = Glib::wrap(gdk_color_state_get_srgb());
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us
  return retvalue;
}

Glib::RefPtr<ColorState> ColorState::get_srgb_linear()
{

  auto retvalue = Glib::wrap(gdk_color_state_get_srgb_linear());
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us
  return retvalue;
}

Glib::RefPtr<ColorState> ColorState::get_rec2100_pq()
{

  auto retvalue = Glib::wrap(gdk_color_state_get_rec2100_pq());
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us
  return retvalue;
}

Glib::RefPtr<ColorState> ColorState::get_rec2100_linear()
{

  auto retvalue = Glib::wrap(gdk_color_state_get_rec2100_linear());
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us
  return retvalue;
}

Glib::RefPtr<ColorState> ColorState::get_oklab()
{

  auto retvalue = Glib::wrap(gdk_color_state_get_oklab());
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us
  return retvalue;
}

Glib::RefPtr<ColorState> ColorState::get_oklch()
{

  auto retvalue = Glib::wrap(gdk_color_state_get_oklch());
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us
  return retvalue;
}

bool ColorState::equal(const Glib::RefPtr<const ColorState>& other) const
{
  return gdk_color_state_equal(const_cast<GdkColorState*>(gobj()), const_cast<GdkColorState*>(Glib::unwrap(other)));
}

bool ColorState::equivalent(const Glib::RefPtr<const ColorState>& other) const
{
  return gdk_color_state_equivalent(const_cast<GdkColorState*>(gobj()), const_cast<GdkColorState*>(Glib::unwrap(other)));
}

Glib::RefPtr<CicpParams> ColorState::create_cicp_params() const
{
  return Glib::wrap(gdk_color_state_create_cicp_params(const_cast<GdkColorState*>(gobj())));
}


} // namespace Gdk


