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


#include <glibmm.h>

#include <gtkmm/colordialog.h>
#include <gtkmm/private/colordialog_p.h>


/* Copyright 2022 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/slot_async.h>
#include <gtkmm/window.h>

namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gtk::ColorDialog> wrap(GtkColorDialog* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Gtk::ColorDialog>( dynamic_cast<Gtk::ColorDialog*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Gtk
{


/* The *_Class implementation: */

const Glib::Class& ColorDialog_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Do not derive a GType, or use a derived class:
    gtype_ = gtk_color_dialog_get_type();

  }

  return *this;
}


Glib::ObjectBase* ColorDialog_Class::wrap_new(GObject* object)
{
  return new ColorDialog((GtkColorDialog*)object);
}


/* The implementation: */

GtkColorDialog* ColorDialog::gobj_copy()
{
  reference();
  return gobj();
}

ColorDialog::ColorDialog(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

ColorDialog::ColorDialog(GtkColorDialog* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


ColorDialog::ColorDialog(ColorDialog&& src) noexcept
: Glib::Object(std::move(src))
{}

ColorDialog& ColorDialog::operator=(ColorDialog&& src) noexcept
{
  Glib::Object::operator=(std::move(src));
  return *this;
}


ColorDialog::~ColorDialog() noexcept
{}


ColorDialog::CppClassType ColorDialog::colordialog_class_; // initialize static member

GType ColorDialog::get_type()
{
  return colordialog_class_.init().get_type();
}


GType ColorDialog::get_base_type()
{
  return gtk_color_dialog_get_type();
}


ColorDialog::ColorDialog()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Glib::Object(Glib::ConstructParams(colordialog_class_.init()))
{
  

}

Glib::RefPtr<ColorDialog> ColorDialog::create()
{
  return Glib::make_refptr_for_instance<ColorDialog>( new ColorDialog() );
}

Glib::ustring ColorDialog::get_title() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gtk_color_dialog_get_title(const_cast<GtkColorDialog*>(gobj())));
}

void ColorDialog::set_title(const Glib::ustring& title)
{
  gtk_color_dialog_set_title(gobj(), title.c_str());
}

bool ColorDialog::get_modal() const
{
  return gtk_color_dialog_get_modal(const_cast<GtkColorDialog*>(gobj()));
}

void ColorDialog::set_modal(bool modal)
{
  gtk_color_dialog_set_modal(gobj(), static_cast<int>(modal));
}

bool ColorDialog::get_with_alpha() const
{
  return gtk_color_dialog_get_with_alpha(const_cast<GtkColorDialog*>(gobj()));
}

void ColorDialog::set_with_alpha(bool with_alpha)
{
  gtk_color_dialog_set_with_alpha(gobj(), static_cast<int>(with_alpha));
}

void ColorDialog::choose_rgba(Window& parent, const Gdk::RGBA& initial_color, const Gio::SlotAsyncReady& slot, const Glib::RefPtr<Gio::Cancellable>& cancellable) const
{
  // Create a copy of the slot.
  auto slot_copy = new Gio::SlotAsyncReady(slot); 

  gtk_color_dialog_choose_rgba(const_cast<GtkColorDialog*>(gobj()), (parent).gobj(), (initial_color).gobj(), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

void ColorDialog::choose_rgba(Window& parent, const Gio::SlotAsyncReady& slot, const Glib::RefPtr<Gio::Cancellable>& cancellable) const
{
  // Create a copy of the slot.
  auto slot_copy = new Gio::SlotAsyncReady(slot); 

  gtk_color_dialog_choose_rgba(const_cast<GtkColorDialog*>(gobj()), (parent).gobj(), nullptr, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

void ColorDialog::choose_rgba(const Gdk::RGBA& initial_color, const Gio::SlotAsyncReady& slot, const Glib::RefPtr<Gio::Cancellable>& cancellable) const
{
  // Create a copy of the slot.
  auto slot_copy = new Gio::SlotAsyncReady(slot); 

  gtk_color_dialog_choose_rgba(const_cast<GtkColorDialog*>(gobj()), nullptr, (initial_color).gobj(), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

void ColorDialog::choose_rgba(const Gio::SlotAsyncReady& slot, const Glib::RefPtr<Gio::Cancellable>& cancellable) const
{
  // Create a copy of the slot.
  auto slot_copy = new Gio::SlotAsyncReady(slot); 

  gtk_color_dialog_choose_rgba(const_cast<GtkColorDialog*>(gobj()), nullptr, nullptr, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

Gdk::RGBA ColorDialog::choose_rgba_finish(const Glib::RefPtr<Gio::AsyncResult>& result) const
{
  GError* gerror = nullptr;
  auto retvalue = Glib::wrap(gtk_color_dialog_choose_rgba_finish(const_cast<GtkColorDialog*>(gobj()), Glib::unwrap(result), &(gerror)), false);
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}


Glib::PropertyProxy< Glib::ustring > ColorDialog::property_title() 
{
  return Glib::PropertyProxy< Glib::ustring >(this, "title");
}

Glib::PropertyProxy_ReadOnly< Glib::ustring > ColorDialog::property_title() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "title");
}

Glib::PropertyProxy< bool > ColorDialog::property_modal() 
{
  return Glib::PropertyProxy< bool >(this, "modal");
}

Glib::PropertyProxy_ReadOnly< bool > ColorDialog::property_modal() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "modal");
}

Glib::PropertyProxy< bool > ColorDialog::property_with_alpha() 
{
  return Glib::PropertyProxy< bool >(this, "with-alpha");
}

Glib::PropertyProxy_ReadOnly< bool > ColorDialog::property_with_alpha() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "with-alpha");
}


} // namespace Gtk


