76450f35b1
git-svn-id: svn://localhost/ardour2/branches/2.1-staging@1416 d708f5d6-7413-0410-9779-e7cbd77b26cf
430 lines
14 KiB
C++
430 lines
14 KiB
C++
// -*- c++ -*-
|
|
// Generated by gtkmmproc -- DO NOT MODIFY!
|
|
#ifndef _GTKMM_RANGE_H
|
|
#define _GTKMM_RANGE_H
|
|
|
|
|
|
#include <glibmm.h>
|
|
|
|
/* $Id$ */
|
|
|
|
/* Copyright (C) 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 Library General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 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
|
|
* Library General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Library General Public
|
|
* License along with this library; if not, write to the Free
|
|
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*/
|
|
|
|
#include <gtkmm/widget.h>
|
|
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
|
typedef struct _GtkRange GtkRange;
|
|
typedef struct _GtkRangeClass GtkRangeClass;
|
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
|
|
|
|
|
namespace Gtk
|
|
{ class Range_Class; } // namespace Gtk
|
|
namespace Gtk
|
|
{
|
|
|
|
/** @addtogroup gtkmmEnums Enums and Flags */
|
|
|
|
/**
|
|
* @ingroup gtkmmEnums
|
|
*/
|
|
enum SensitivityType
|
|
{
|
|
SENSITIVITY_AUTO,
|
|
SENSITIVITY_ON,
|
|
SENSITIVITY_OFF
|
|
};
|
|
|
|
} // namespace Gtk
|
|
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
|
namespace Glib
|
|
{
|
|
|
|
template <>
|
|
class Value<Gtk::SensitivityType> : public Glib::Value_Enum<Gtk::SensitivityType>
|
|
{
|
|
public:
|
|
static GType value_type() G_GNUC_CONST;
|
|
};
|
|
|
|
} // namespace Glib
|
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
|
|
|
|
|
namespace Gtk
|
|
{
|
|
|
|
|
|
class Adjustment;
|
|
|
|
/** Base class for widgets which visualize an adjustment.
|
|
*
|
|
* @ingroup Widgets
|
|
*/
|
|
|
|
class Range : public Widget
|
|
{
|
|
public:
|
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
|
typedef Range CppObjectType;
|
|
typedef Range_Class CppClassType;
|
|
typedef GtkRange BaseObjectType;
|
|
typedef GtkRangeClass BaseClassType;
|
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
|
|
|
virtual ~Range();
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
|
|
|
private:
|
|
friend class Range_Class;
|
|
static CppClassType range_class_;
|
|
|
|
// noncopyable
|
|
Range(const Range&);
|
|
Range& operator=(const Range&);
|
|
|
|
protected:
|
|
explicit Range(const Glib::ConstructParams& construct_params);
|
|
explicit Range(GtkRange* castitem);
|
|
|
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
|
|
|
public:
|
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
|
static GType get_type() G_GNUC_CONST;
|
|
static GType get_base_type() G_GNUC_CONST;
|
|
#endif
|
|
|
|
///Provides access to the underlying C GtkObject.
|
|
GtkRange* gobj() { return reinterpret_cast<GtkRange*>(gobject_); }
|
|
|
|
///Provides access to the underlying C GtkObject.
|
|
const GtkRange* gobj() const { return reinterpret_cast<GtkRange*>(gobject_); }
|
|
|
|
|
|
public:
|
|
//C++ methods used to invoke GTK+ virtual functions:
|
|
#ifdef GLIBMM_VFUNCS_ENABLED
|
|
#endif //GLIBMM_VFUNCS_ENABLED
|
|
|
|
protected:
|
|
//GTK+ Virtual Functions (override these to change behaviour):
|
|
#ifdef GLIBMM_VFUNCS_ENABLED
|
|
#endif //GLIBMM_VFUNCS_ENABLED
|
|
|
|
//Default Signal Handlers::
|
|
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
|
virtual void on_value_changed();
|
|
virtual void on_adjust_bounds(double new_value);
|
|
virtual void on_move_slider(ScrollType scroll);
|
|
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
|
|
|
|
|
private:
|
|
|
|
protected:
|
|
Range();
|
|
public:
|
|
|
|
|
|
/** Sets the update policy for the range. Gtk::UPDATE_CONTINUOUS means that
|
|
* anytime the range slider is moved, the range value will change and the
|
|
* value_changed signal will be emitted. Gtk::UPDATE_DELAYED means that
|
|
* the value will be updated after a brief timeout where no slider motion
|
|
* occurs, so updates are spaced by a short time rather than
|
|
* continuous. Gtk::UPDATE_DISCONTINUOUS means that the value will only
|
|
* be updated when the user releases the button and ends the slider
|
|
* drag operation.
|
|
* @param policy Update policy.
|
|
*/
|
|
void set_update_policy(UpdateType policy);
|
|
|
|
/** Gets the update policy of @a range . See set_update_policy().
|
|
* @return The current update policy.
|
|
*/
|
|
UpdateType get_update_policy() const;
|
|
|
|
/** Sets the adjustment to be used as the "model" object for this range
|
|
* widget. The adjustment indicates the current range value, the
|
|
* minimum and maximum range values, the step/page increments used
|
|
* for keybindings and scrolling, and the page size. The page size
|
|
* is normally 0 for Gtk::Scale and nonzero for Gtk::Scrollbar, and
|
|
* indicates the size of the visible area of the widget being scrolled.
|
|
* The page size affects the size of the scrollbar slider.
|
|
* @param adjustment A Gtk::Adjustment.
|
|
*/
|
|
void set_adjustment(Gtk::Adjustment& adjustment);
|
|
void unset_adjustment();
|
|
|
|
|
|
/** Get the Gtk::Adjustment which is the "model" object for Gtk::Range.
|
|
* See set_adjustment() for details.
|
|
* The return value does not have a reference added, so should not
|
|
* be unreferenced.
|
|
* @return A Gtk::Adjustment.
|
|
*/
|
|
Gtk::Adjustment* get_adjustment();
|
|
|
|
/** Get the Gtk::Adjustment which is the "model" object for Gtk::Range.
|
|
* See set_adjustment() for details.
|
|
* The return value does not have a reference added, so should not
|
|
* be unreferenced.
|
|
* @return A Gtk::Adjustment.
|
|
*/
|
|
const Gtk::Adjustment* get_adjustment() const;
|
|
|
|
/** Ranges normally move from lower to higher values as the
|
|
* slider moves from top to bottom or left to right. Inverted
|
|
* ranges have higher values at the top or on the right rather than
|
|
* on the bottom or left.
|
|
* @param setting <tt>true</tt> to invert the range.
|
|
*/
|
|
void set_inverted(bool setting = true);
|
|
|
|
/** Gets the value set by set_inverted().
|
|
* @return <tt>true</tt> if the range is inverted.
|
|
*/
|
|
bool get_inverted() const;
|
|
|
|
|
|
void set_lower_stepper_sensitivity(SensitivityType sensitivity);
|
|
|
|
SensitivityType get_lower_stepper_sensitivity() const;
|
|
|
|
void set_upper_stepper_sensitivity(SensitivityType sensitivity);
|
|
|
|
SensitivityType get_upper_stepper_sensitivity() const;
|
|
|
|
|
|
/** Sets the step and page sizes for the range.
|
|
* The step size is used when the user clicks the Gtk::Scrollbar
|
|
* arrows or moves Gtk::Scale via arrow keys. The page size
|
|
* is used for example when moving via Page Up or Page Down keys.
|
|
* @param step Step size.
|
|
* @param page Page size.
|
|
*/
|
|
void set_increments(double step, double page);
|
|
|
|
/** Sets the allowable values in the Gtk::Range, and clamps the range
|
|
* value to be between @a min and @a max . (If the range has a non-zero
|
|
* page size, it is clamped between @a min and @a max - page-size.)
|
|
* @param min Minimum range value.
|
|
* @param max Maximum range value.
|
|
*/
|
|
void set_range(double min, double max);
|
|
|
|
/** Sets the current value of the range; if the value is outside the
|
|
* minimum or maximum range values, it will be clamped to fit inside
|
|
* them. The range emits the "value_changed" signal if the value
|
|
* changes.
|
|
* @param value New value of the range.
|
|
*/
|
|
void set_value(double value);
|
|
|
|
/** Gets the current value of the range.
|
|
* @return Current value of the range.
|
|
*/
|
|
double get_value() const;
|
|
|
|
|
|
/**
|
|
* @par Prototype:
|
|
* <tt>void %value_changed()</tt>
|
|
*/
|
|
|
|
Glib::SignalProxy0< void > signal_value_changed();
|
|
|
|
|
|
/**
|
|
* @par Prototype:
|
|
* <tt>void %adjust_bounds(double new_value)</tt>
|
|
*/
|
|
|
|
Glib::SignalProxy1< void,double > signal_adjust_bounds();
|
|
|
|
|
|
/**
|
|
* @par Prototype:
|
|
* <tt>void %move_slider(ScrollType scroll)</tt>
|
|
*/
|
|
|
|
Glib::SignalProxy1< void,ScrollType > signal_move_slider();
|
|
|
|
|
|
//We use no_default_handler for this, because we can not add a new vfunc to 2.5 without breaking ABI.
|
|
//TODO: Remove no_default_handler when we do an ABI-break-with-parallel-install.
|
|
/** The change_value signal is emitted when a scroll action is
|
|
* performed on a range. It allows an application to determine the
|
|
* type of scroll event that occurred and the resultant new value.
|
|
* The application can handle the event itself and return true to
|
|
* prevent further processing. Or, by returning false, it can pass
|
|
* the event to other handlers until the default GTK+ handler is
|
|
* reached.
|
|
*
|
|
* The value parameter is unrounded. An application that overrides
|
|
* the change_value signal is responsible for clamping the value to
|
|
* the desired number of decimal digits; the default handler
|
|
* clamps the value based on range->round_digits.
|
|
*
|
|
* It is not possible to use delayed update policies in an overridden
|
|
* change_value handler.
|
|
*
|
|
* @param scroll the type of scroll action that was performed.
|
|
* @param new_value the new value resulting from the scroll action.
|
|
* @result true to prevent other handlers from being invoked for the
|
|
* signal, or false to propagate the signal further.
|
|
*/
|
|
|
|
/**
|
|
* @par Prototype:
|
|
* <tt>bool %change_value(ScrollType scroll, double new_value)</tt>
|
|
*/
|
|
|
|
Glib::SignalProxy2< bool,ScrollType,double > signal_change_value();
|
|
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** How the range should be updated on the screen.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy<UpdateType> property_update_policy() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** How the range should be updated on the screen.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly<UpdateType> property_update_policy() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** The GtkAdjustment that contains the current value of this range object.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy<Adjustment*> property_adjustment() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** The GtkAdjustment that contains the current value of this range object.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly<Adjustment*> property_adjustment() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** Invert direction slider moves to increase range value.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy<bool> property_inverted() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** Invert direction slider moves to increase range value.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly<bool> property_inverted() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** The sensitivity policy for the stepper that points to the adjustment's lower side.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy<SensitivityType> property_lower_stepper_sensitivity() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** The sensitivity policy for the stepper that points to the adjustment's lower side.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly<SensitivityType> property_lower_stepper_sensitivity() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** The sensitivity policy for the stepper that points to the adjustment's upper side.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy<SensitivityType> property_upper_stepper_sensitivity() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** The sensitivity policy for the stepper that points to the adjustment's upper side.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly<SensitivityType> property_upper_stepper_sensitivity() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
|
|
protected:
|
|
#ifdef GLIBMM_VFUNCS_ENABLED
|
|
virtual void get_range_border_vfunc(GtkBorder* border) const;
|
|
#endif //GLIBMM_VFUNCS_ENABLED
|
|
|
|
|
|
};
|
|
|
|
} // namespace Gtk
|
|
|
|
|
|
namespace Glib
|
|
{
|
|
/** @relates Gtk::Range
|
|
* @param object The C instance
|
|
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
|
|
* @result A C++ instance that wraps this C instance.
|
|
*/
|
|
Gtk::Range* wrap(GtkRange* object, bool take_copy = false);
|
|
} //namespace Glib
|
|
|
|
|
|
#endif /* _GTKMM_RANGE_H */
|
|
|