Blob Blame History Raw
// Generated by gmmproc 2.54.0 -- DO NOT MODIFY!


#include <glibmm.h>

#include <gtkmm/range.h>
#include <gtkmm/private/range_p.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 <gtk/gtk.h>
#include <gtkmm/adjustment.h>

namespace Gtk
{

void Range::unset_adjustment()
{
  gtk_range_set_adjustment(gobj(), nullptr);
}

void Range_Class::get_range_border_vfunc_callback(GtkRange* self, GtkBorder* border)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        Gtk::Border cxx_border(border, true);
        obj->get_range_border_vfunc(cxx_border);
        *border = *(cxx_border.gobj());
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
  );

  // Call the original underlying C function:
  if(base && base->get_range_border)
    (*base->get_range_border)(self, border);

}

Gdk::Rectangle Range::get_range_rect() const
{
  Gdk::Rectangle result;
  gtk_range_get_range_rect(const_cast<GtkRange*>(gobj()), result.gobj());
  return result;
}

} // namespace Gtk

namespace
{


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


static void Range_signal_adjust_bounds_callback(GtkRange* self, gdouble p0,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot< void,double >;

  auto obj = dynamic_cast<Range*>(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();
    }
  }
}

static const Glib::SignalProxyInfo Range_signal_adjust_bounds_info =
{
  "adjust_bounds",
  (GCallback) &Range_signal_adjust_bounds_callback,
  (GCallback) &Range_signal_adjust_bounds_callback
};


static void Range_signal_move_slider_callback(GtkRange* self, GtkScrollType p0,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot< void,ScrollType >;

  auto obj = dynamic_cast<Range*>(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))(((ScrollType)(p0))
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}

static const Glib::SignalProxyInfo Range_signal_move_slider_info =
{
  "move_slider",
  (GCallback) &Range_signal_move_slider_callback,
  (GCallback) &Range_signal_move_slider_callback
};


static gboolean Range_signal_change_value_callback(GtkRange* self, GtkScrollType p0,gdouble p1,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot< bool,ScrollType,double >;

  auto obj = dynamic_cast<Range*>(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))(((ScrollType)(p0))
, p1
));
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }

  using RType = gboolean;
  return RType();
}

static gboolean Range_signal_change_value_notify_callback(GtkRange* self, GtkScrollType p0,gdouble p1, void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot< void,ScrollType,double >;

  auto obj = dynamic_cast<Range*>(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))(((ScrollType)(p0))
, p1
);
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
  }

  using RType = gboolean;
  return RType();
}

static const Glib::SignalProxyInfo Range_signal_change_value_info =
{
  "change_value",
  (GCallback) &Range_signal_change_value_callback,
  (GCallback) &Range_signal_change_value_notify_callback
};


} // anonymous namespace


namespace Glib
{

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

} /* namespace Glib */

namespace Gtk
{


/* The *_Class implementation: */

const Glib::Class& Range_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_ = &Range_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_range_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:

  }

  return *this;
}


void Range_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);

  klass->get_range_border = &get_range_border_vfunc_callback;

  klass->value_changed = &value_changed_callback;
  klass->adjust_bounds = &adjust_bounds_callback;
  klass->move_slider = &move_slider_callback;
  klass->change_value = &change_value_callback;
}


void Range_Class::value_changed_callback(GtkRange* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->on_value_changed();
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->value_changed)
    (*base->value_changed)(self);
}
void Range_Class::adjust_bounds_callback(GtkRange* self, gdouble p0)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->on_adjust_bounds(p0
);
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->adjust_bounds)
    (*base->adjust_bounds)(self, p0);
}
void Range_Class::move_slider_callback(GtkRange* self, GtkScrollType p0)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->on_move_slider(((ScrollType)(p0))
);
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->move_slider)
    (*base->move_slider)(self, p0);
}
gboolean Range_Class::change_value_callback(GtkRange* self, GtkScrollType p0, gdouble p1)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return static_cast<int>(obj->on_change_value(((ScrollType)(p0))
, p1
));
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->change_value)
    return (*base->change_value)(self, p0, p1);

  using RType = gboolean;
  return RType();
}


Glib::ObjectBase* Range_Class::wrap_new(GObject* o)
{
  return manage(new Range((GtkRange*)(o)));

}


/* The implementation: */

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

Range::Range(GtkRange* castitem)
:
  Gtk::Widget((GtkWidget*)(castitem))
{
  }


Range::Range(Range&& src) noexcept
: Gtk::Widget(std::move(src))
{}

Range& Range::operator=(Range&& src) noexcept
{
  Gtk::Widget::operator=(std::move(src));
  return *this;
}

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

Range::CppClassType Range::range_class_; // initialize static member

GType Range::get_type()
{
  return range_class_.init().get_type();
}


GType Range::get_base_type()
{
  return gtk_range_get_type();
}


Range::Range()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Gtk::Widget(Glib::ConstructParams(range_class_.init()))
{
  

}

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

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

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

void Range::set_inverted(bool setting)
{
  gtk_range_set_inverted(gobj(), static_cast<int>(setting));
}

bool Range::get_inverted() const
{
  return gtk_range_get_inverted(const_cast<GtkRange*>(gobj()));
}

void Range::set_flippable(bool flippable)
{
  gtk_range_set_flippable(gobj(), static_cast<int>(flippable));
}

bool Range::get_flippable() const
{
  return gtk_range_get_flippable(const_cast<GtkRange*>(gobj()));
}

void Range::set_slider_size_fixed(bool size_fixed)
{
  gtk_range_set_slider_size_fixed(gobj(), static_cast<int>(size_fixed));
}

bool Range::get_slider_size_fixed() const
{
  return gtk_range_get_slider_size_fixed(const_cast<GtkRange*>(gobj()));
}

#ifndef GTKMM_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
void Range::set_min_slider_size(bool min_size)
{
  gtk_range_set_min_slider_size(gobj(), static_cast<int>(min_size));
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // GTKMM_DISABLE_DEPRECATED

#ifndef GTKMM_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
int Range::get_min_slider_size() const
{
  return gtk_range_get_min_slider_size(const_cast<GtkRange*>(gobj()));
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // GTKMM_DISABLE_DEPRECATED

void Range::get_slider_range(int& slider_start, int& slider_end) const
{
  gtk_range_get_slider_range(const_cast<GtkRange*>(gobj()), &(slider_start), &(slider_end));
}

void Range::set_lower_stepper_sensitivity(SensitivityType sensitivity)
{
  gtk_range_set_lower_stepper_sensitivity(gobj(), ((GtkSensitivityType)(sensitivity)));
}

SensitivityType Range::get_lower_stepper_sensitivity() const
{
  return ((SensitivityType)(gtk_range_get_lower_stepper_sensitivity(const_cast<GtkRange*>(gobj()))));
}

void Range::set_upper_stepper_sensitivity(SensitivityType sensitivity)
{
  gtk_range_set_upper_stepper_sensitivity(gobj(), ((GtkSensitivityType)(sensitivity)));
}

SensitivityType Range::get_upper_stepper_sensitivity() const
{
  return ((SensitivityType)(gtk_range_get_upper_stepper_sensitivity(const_cast<GtkRange*>(gobj()))));
}

void Range::set_increments(double step, double page)
{
  gtk_range_set_increments(gobj(), step, page);
}

void Range::set_range(double min, double max)
{
  gtk_range_set_range(gobj(), min, max);
}

void Range::set_value(double value)
{
  gtk_range_set_value(gobj(), value);
}

double Range::get_value() const
{
  return gtk_range_get_value(const_cast<GtkRange*>(gobj()));
}

void Range::set_show_fill_level(bool show_fill_level)
{
  gtk_range_set_show_fill_level(gobj(), static_cast<int>(show_fill_level));
}

bool Range::get_show_fill_level() const
{
  return gtk_range_get_show_fill_level(const_cast<GtkRange*>(gobj()));
}

void Range::set_restrict_to_fill_level(bool restrict_to_fill_level)
{
  gtk_range_set_restrict_to_fill_level(gobj(), static_cast<int>(restrict_to_fill_level));
}

bool Range::get_restrict_to_fill_level() const
{
  return gtk_range_get_restrict_to_fill_level(const_cast<GtkRange*>(gobj()));
}

void Range::set_fill_level(double fill_level)
{
  gtk_range_set_fill_level(gobj(), fill_level);
}

double Range::get_fill_level() const
{
  return gtk_range_get_fill_level(const_cast<GtkRange*>(gobj()));
}

void Range::set_round_digits(int round_digits)
{
  gtk_range_set_round_digits(gobj(), round_digits);
}

int Range::get_round_digits() const
{
  return gtk_range_get_round_digits(const_cast<GtkRange*>(gobj()));
}


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


Glib::SignalProxy< void,double > Range::signal_adjust_bounds()
{
  return Glib::SignalProxy< void,double >(this, &Range_signal_adjust_bounds_info);
}


Glib::SignalProxy< void,ScrollType > Range::signal_move_slider()
{
  return Glib::SignalProxy< void,ScrollType >(this, &Range_signal_move_slider_info);
}


Glib::SignalProxy< bool,ScrollType,double > Range::signal_change_value()
{
  return Glib::SignalProxy< bool,ScrollType,double >(this, &Range_signal_change_value_info);
}


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

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

Glib::PropertyProxy< bool > Range::property_inverted() 
{
  return Glib::PropertyProxy< bool >(this, "inverted");
}

Glib::PropertyProxy_ReadOnly< bool > Range::property_inverted() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "inverted");
}

Glib::PropertyProxy< SensitivityType > Range::property_lower_stepper_sensitivity() 
{
  return Glib::PropertyProxy< SensitivityType >(this, "lower-stepper-sensitivity");
}

Glib::PropertyProxy_ReadOnly< SensitivityType > Range::property_lower_stepper_sensitivity() const
{
  return Glib::PropertyProxy_ReadOnly< SensitivityType >(this, "lower-stepper-sensitivity");
}

Glib::PropertyProxy< SensitivityType > Range::property_upper_stepper_sensitivity() 
{
  return Glib::PropertyProxy< SensitivityType >(this, "upper-stepper-sensitivity");
}

Glib::PropertyProxy_ReadOnly< SensitivityType > Range::property_upper_stepper_sensitivity() const
{
  return Glib::PropertyProxy_ReadOnly< SensitivityType >(this, "upper-stepper-sensitivity");
}

Glib::PropertyProxy< bool > Range::property_show_fill_level() 
{
  return Glib::PropertyProxy< bool >(this, "show-fill-level");
}

Glib::PropertyProxy_ReadOnly< bool > Range::property_show_fill_level() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "show-fill-level");
}

Glib::PropertyProxy< bool > Range::property_restrict_to_fill_level() 
{
  return Glib::PropertyProxy< bool >(this, "restrict-to-fill-level");
}

Glib::PropertyProxy_ReadOnly< bool > Range::property_restrict_to_fill_level() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "restrict-to-fill-level");
}

Glib::PropertyProxy< double > Range::property_fill_level() 
{
  return Glib::PropertyProxy< double >(this, "fill-level");
}

Glib::PropertyProxy_ReadOnly< double > Range::property_fill_level() const
{
  return Glib::PropertyProxy_ReadOnly< double >(this, "fill-level");
}

Glib::PropertyProxy< int > Range::property_round_digits() 
{
  return Glib::PropertyProxy< int >(this, "round-digits");
}

Glib::PropertyProxy_ReadOnly< int > Range::property_round_digits() const
{
  return Glib::PropertyProxy_ReadOnly< int >(this, "round-digits");
}


void Gtk::Range::on_value_changed()
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->value_changed)
    (*base->value_changed)(gobj());
}
void Gtk::Range::on_adjust_bounds(double new_value)
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->adjust_bounds)
    (*base->adjust_bounds)(gobj(),new_value);
}
void Gtk::Range::on_move_slider(ScrollType scroll)
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->move_slider)
    (*base->move_slider)(gobj(),((GtkScrollType)(scroll)));
}
bool Gtk::Range::on_change_value(ScrollType scroll, double new_value)
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->change_value)
    return (*base->change_value)(gobj(),((GtkScrollType)(scroll)),new_value);

  using RType = bool;
  return RType();
}

void Gtk::Range::get_range_border_vfunc(Gtk::Border& border) const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->get_range_border)
  {
    (*base->get_range_border)(const_cast<GtkRange*>(gobj()),border.gobj());
  }
}


} // namespace Gtk