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


#include <glibmm.h>

#include <gtkmm/spinbutton.h>
#include <gtkmm/private/spinbutton_p.h>

#include <gtk/gtk.h>

/* Copyright 1998-2002 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <gtkmm/adjustment.h>
#include <gtk/gtk.h>

using UpdatePolicy = Gtk::SpinButton::UpdatePolicy;

namespace Gtk
{

SpinButton::SpinButton(double climb_rate, guint digits)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Gtk::Widget(Glib::ConstructParams(spinbutton_class_.init(), "climb_rate",climb_rate,"digits",digits, nullptr))
{}

void SpinButton::unset_adjustment()
{
  gtk_spin_button_set_adjustment(gobj(), nullptr);
}

} // namespace Gtk


namespace
{


static gint SpinButton_signal_input_callback(GtkSpinButton* self, double* p0,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<int(double&)>;

  auto obj = dynamic_cast<SpinButton*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        return (*static_cast<SlotType*>(slot))(*(p0)
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }

  using RType = gint;
  return RType();
}

static gint SpinButton_signal_input_notify_callback(GtkSpinButton* self, double* p0, void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(double&)>;

  auto obj = dynamic_cast<SpinButton*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(*(p0)
);
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
  }

  using RType = gint;
  return RType();
}

static const Glib::SignalProxyInfo SpinButton_signal_input_info =
{
  "input",
  (GCallback) &SpinButton_signal_input_callback,
  (GCallback) &SpinButton_signal_input_notify_callback
};


static gboolean SpinButton_signal_output_callback(GtkSpinButton* self, void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<bool()>;

  auto obj = dynamic_cast<SpinButton*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        return static_cast<int>((*static_cast<SlotType*>(slot))());
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }

  using RType = gboolean;
  return RType();
}

static gboolean SpinButton_signal_output_notify_callback(GtkSpinButton* self,  void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void()>;

  auto obj = dynamic_cast<SpinButton*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))();
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
  }

  using RType = gboolean;
  return RType();
}

static const Glib::SignalProxyInfo SpinButton_signal_output_info =
{
  "output",
  (GCallback) &SpinButton_signal_output_callback,
  (GCallback) &SpinButton_signal_output_notify_callback
};


static const Glib::SignalProxyInfo SpinButton_signal_wrapped_info =
{
  "wrapped",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


static const Glib::SignalProxyInfo SpinButton_signal_value_changed_info =
{
  "value_changed",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


} // anonymous namespace

// static
GType Glib::Value<Gtk::SpinType>::value_type()
{
  return gtk_spin_type_get_type();
}

// static
GType Glib::Value<Gtk::SpinButton::UpdatePolicy>::value_type()
{
  return gtk_spin_button_update_policy_get_type();
}


namespace Glib
{

Gtk::SpinButton* wrap(GtkSpinButton* object, bool take_copy)
{
  return dynamic_cast<Gtk::SpinButton *> (Glib::wrap_auto ((GObject*)(object), take_copy));
}

} /* namespace Glib */

namespace Gtk
{


/* The *_Class implementation: */

const Glib::Class& SpinButton_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &SpinButton_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(gtk_spin_button_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:
  Orientable::add_interface(get_type());
  Editable::add_interface(get_type());
  CellEditable::add_interface(get_type());

  }

  return *this;
}


void SpinButton_Class::class_init_function(void* g_class, void* class_data)
{
  const auto klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);


}


Glib::ObjectBase* SpinButton_Class::wrap_new(GObject* o)
{
  return manage(new SpinButton((GtkSpinButton*)(o)));

}


/* The implementation: */

SpinButton::SpinButton(const Glib::ConstructParams& construct_params)
:
  Gtk::Widget(construct_params)
{
  }

SpinButton::SpinButton(GtkSpinButton* castitem)
:
  Gtk::Widget((GtkWidget*)(castitem))
{
  }


SpinButton::SpinButton(SpinButton&& src) noexcept
: Gtk::Widget(std::move(src))
  , Orientable(std::move(src))
  , Editable(std::move(src))
  , CellEditable(std::move(src))
{}

SpinButton& SpinButton::operator=(SpinButton&& src) noexcept
{
  Gtk::Widget::operator=(std::move(src));
  Orientable::operator=(std::move(src));
  Editable::operator=(std::move(src));
  CellEditable::operator=(std::move(src));
  return *this;
}

SpinButton::~SpinButton() noexcept
{
  destroy_();
}

SpinButton::CppClassType SpinButton::spinbutton_class_; // initialize static member

GType SpinButton::get_type()
{
  return spinbutton_class_.init().get_type();
}


GType SpinButton::get_base_type()
{
  return gtk_spin_button_get_type();
}


SpinButton::SpinButton(const Glib::RefPtr<Adjustment>& adjustment, double climb_rate, guint digits)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Gtk::Widget(Glib::ConstructParams(spinbutton_class_.init(), "adjustment", Glib::unwrap(adjustment), "climb_rate", climb_rate, "digits", digits, nullptr))
{
  

}

void SpinButton::configure(const Glib::RefPtr<Adjustment>& adjustment, double climb_rate, guint digits)
{
  gtk_spin_button_configure(gobj(), Glib::unwrap(adjustment), climb_rate, digits);
}

void SpinButton::set_adjustment(const Glib::RefPtr<Adjustment>& adjustment)
{
  gtk_spin_button_set_adjustment(gobj(), Glib::unwrap(adjustment));
}

Glib::RefPtr<Adjustment> SpinButton::get_adjustment()
{
  auto retvalue = Glib::wrap(gtk_spin_button_get_adjustment(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Adjustment> SpinButton::get_adjustment() const
{
  return const_cast<SpinButton*>(this)->get_adjustment();
}

void SpinButton::set_digits(guint digits)
{
  gtk_spin_button_set_digits(gobj(), digits);
}

guint SpinButton::get_digits() const
{
  return gtk_spin_button_get_digits(const_cast<GtkSpinButton*>(gobj()));
}

void SpinButton::set_increments(double step, double page)
{
  gtk_spin_button_set_increments(gobj(), step, page);
}

void SpinButton::get_increments(double& step, double& page) const
{
  gtk_spin_button_get_increments(const_cast<GtkSpinButton*>(gobj()), &(step), &(page));
}

void SpinButton::set_range(double min, double max)
{
  gtk_spin_button_set_range(gobj(), min, max);
}

void SpinButton::get_range(double& min, double& max) const
{
  gtk_spin_button_get_range(const_cast<GtkSpinButton*>(gobj()), &(min), &(max));
}

double SpinButton::get_value() const
{
  return gtk_spin_button_get_value(const_cast<GtkSpinButton*>(gobj()));
}

int SpinButton::get_value_as_int() const
{
  return gtk_spin_button_get_value_as_int(const_cast<GtkSpinButton*>(gobj()));
}

void SpinButton::set_value(double value)
{
  gtk_spin_button_set_value(gobj(), value);
}

void SpinButton::set_update_policy(UpdatePolicy policy)
{
  gtk_spin_button_set_update_policy(gobj(), static_cast<GtkSpinButtonUpdatePolicy>(policy));
}

UpdatePolicy SpinButton::get_update_policy() const
{
  return static_cast<UpdatePolicy>(gtk_spin_button_get_update_policy(const_cast<GtkSpinButton*>(gobj())));
}

void SpinButton::set_numeric(bool numeric)
{
  gtk_spin_button_set_numeric(gobj(), static_cast<int>(numeric));
}

bool SpinButton::get_numeric() const
{
  return gtk_spin_button_get_numeric(const_cast<GtkSpinButton*>(gobj()));
}

void SpinButton::spin(SpinType direction, double increment)
{
  gtk_spin_button_spin(gobj(), static_cast<GtkSpinType>(direction), increment);
}

void SpinButton::set_wrap(bool wrap)
{
  gtk_spin_button_set_wrap(gobj(), static_cast<int>(wrap));
}

bool SpinButton::get_wrap() const
{
  return gtk_spin_button_get_wrap(const_cast<GtkSpinButton*>(gobj()));
}

void SpinButton::set_snap_to_ticks(bool snap_to_ticks)
{
  gtk_spin_button_set_snap_to_ticks(gobj(), static_cast<int>(snap_to_ticks));
}

bool SpinButton::get_snap_to_ticks() const
{
  return gtk_spin_button_get_snap_to_ticks(const_cast<GtkSpinButton*>(gobj()));
}

void SpinButton::set_climb_rate(double climb_rate)
{
  gtk_spin_button_set_climb_rate(gobj(), climb_rate);
}

double SpinButton::get_climb_rate() const
{
  return gtk_spin_button_get_climb_rate(const_cast<GtkSpinButton*>(gobj()));
}

void SpinButton::update()
{
  gtk_spin_button_update(gobj());
}


Glib::SignalProxy<int(double&)> SpinButton::signal_input()
{
  return Glib::SignalProxy<int(double&) >(this, &SpinButton_signal_input_info);
}


Glib::SignalProxy<bool()> SpinButton::signal_output()
{
  return Glib::SignalProxy<bool() >(this, &SpinButton_signal_output_info);
}


Glib::SignalProxy<void()> SpinButton::signal_wrapped()
{
  return Glib::SignalProxy<void() >(this, &SpinButton_signal_wrapped_info);
}


Glib::SignalProxy<void()> SpinButton::signal_value_changed()
{
  return Glib::SignalProxy<void() >(this, &SpinButton_signal_value_changed_info);
}


static_assert(Glib::Traits::ValueCompatibleWithWrapProperty<Glib::RefPtr<Adjustment>>::value,
  "Type Glib::RefPtr<Adjustment> cannot be used in _WRAP_PROPERTY. "
  "There is no suitable template specialization of Glib::Value<>.");

Glib::PropertyProxy< Glib::RefPtr<Adjustment> > SpinButton::property_adjustment() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Adjustment> >(this, "adjustment");
}

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Adjustment> > SpinButton::property_adjustment() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Adjustment> >(this, "adjustment");
}

Glib::PropertyProxy< double > SpinButton::property_climb_rate() 
{
  return Glib::PropertyProxy< double >(this, "climb-rate");
}

Glib::PropertyProxy_ReadOnly< double > SpinButton::property_climb_rate() const
{
  return Glib::PropertyProxy_ReadOnly< double >(this, "climb-rate");
}

Glib::PropertyProxy< guint > SpinButton::property_digits() 
{
  return Glib::PropertyProxy< guint >(this, "digits");
}

Glib::PropertyProxy_ReadOnly< guint > SpinButton::property_digits() const
{
  return Glib::PropertyProxy_ReadOnly< guint >(this, "digits");
}

Glib::PropertyProxy< bool > SpinButton::property_snap_to_ticks() 
{
  return Glib::PropertyProxy< bool >(this, "snap-to-ticks");
}

Glib::PropertyProxy_ReadOnly< bool > SpinButton::property_snap_to_ticks() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "snap-to-ticks");
}

Glib::PropertyProxy< bool > SpinButton::property_numeric() 
{
  return Glib::PropertyProxy< bool >(this, "numeric");
}

Glib::PropertyProxy_ReadOnly< bool > SpinButton::property_numeric() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "numeric");
}

Glib::PropertyProxy< bool > SpinButton::property_wrap() 
{
  return Glib::PropertyProxy< bool >(this, "wrap");
}

Glib::PropertyProxy_ReadOnly< bool > SpinButton::property_wrap() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "wrap");
}

static_assert(Glib::Traits::ValueCompatibleWithWrapProperty<UpdatePolicy>::value,
  "Type UpdatePolicy cannot be used in _WRAP_PROPERTY. "
  "There is no suitable template specialization of Glib::Value<>.");

Glib::PropertyProxy< UpdatePolicy > SpinButton::property_update_policy() 
{
  return Glib::PropertyProxy< UpdatePolicy >(this, "update-policy");
}

Glib::PropertyProxy_ReadOnly< UpdatePolicy > SpinButton::property_update_policy() const
{
  return Glib::PropertyProxy_ReadOnly< UpdatePolicy >(this, "update-policy");
}

Glib::PropertyProxy< double > SpinButton::property_value() 
{
  return Glib::PropertyProxy< double >(this, "value");
}

Glib::PropertyProxy_ReadOnly< double > SpinButton::property_value() const
{
  return Glib::PropertyProxy_ReadOnly< double >(this, "value");
}


} // namespace Gtk


