2008-07-01 22:57:50 +00:00
|
|
|
|
/* GTK - The GIMP Toolkit
|
1997-11-24 22:37:52 +00:00
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
|
* 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
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
|
* files for a list of changes. These files are distributed with
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
1999-02-24 07:37:18 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
|
#include "config.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
#include "gtkadjustment.h"
|
2014-09-06 01:21:49 +00:00
|
|
|
|
#include "gtkadjustmentprivate.h"
|
2001-11-17 23:28:51 +00:00
|
|
|
|
#include "gtkmarshalers.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
|
#include "gtkprivate.h"
|
|
|
|
|
#include "gtkintl.h"
|
2010-07-09 17:22:23 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-10-22 22:16:27 +00:00
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* GtkAdjustment:
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*
|
2021-02-27 22:49:48 +00:00
|
|
|
|
* `GtkAdjustment` is a model for a numeric value.
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*
|
2021-02-27 22:49:48 +00:00
|
|
|
|
* The `GtkAdjustment has an associated lower and upper bound.
|
|
|
|
|
* It also contains step and page increments, and a page size.
|
|
|
|
|
*
|
|
|
|
|
* Adjustments are used within several GTK widgets, including
|
|
|
|
|
* [class@Gtk.SpinButton], [class@Gtk.Viewport], [class@Gtk.Scrollbar]
|
|
|
|
|
* and [class@Gtk.Scale].
|
2021-02-27 15:51:45 +00:00
|
|
|
|
*
|
|
|
|
|
* The `GtkAdjustment` object does not update the value itself. Instead
|
|
|
|
|
* it is left up to the owner of the `GtkAdjustment` to control the value.
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2011-01-05 22:03:57 +00:00
|
|
|
|
struct _GtkAdjustmentPrivate {
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double lower;
|
|
|
|
|
double upper;
|
|
|
|
|
double value;
|
|
|
|
|
double step_increment;
|
|
|
|
|
double page_increment;
|
|
|
|
|
double page_size;
|
2014-06-30 22:09:50 +00:00
|
|
|
|
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double source;
|
|
|
|
|
double target;
|
2014-06-30 22:09:50 +00:00
|
|
|
|
|
|
|
|
|
guint duration;
|
2020-07-25 02:57:34 +00:00
|
|
|
|
guint tick_id;
|
2014-06-30 22:09:50 +00:00
|
|
|
|
gint64 start_time;
|
|
|
|
|
gint64 end_time;
|
|
|
|
|
GdkFrameClock *clock;
|
2011-01-05 22:03:57 +00:00
|
|
|
|
};
|
2017-10-13 10:47:09 +00:00
|
|
|
|
typedef struct _GtkAdjustmentPrivate GtkAdjustmentPrivate;
|
2011-01-05 22:03:57 +00:00
|
|
|
|
|
2004-01-29 23:49:25 +00:00
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
PROP_0,
|
|
|
|
|
PROP_VALUE,
|
|
|
|
|
PROP_LOWER,
|
|
|
|
|
PROP_UPPER,
|
|
|
|
|
PROP_STEP_INCREMENT,
|
|
|
|
|
PROP_PAGE_INCREMENT,
|
2015-09-05 07:58:15 +00:00
|
|
|
|
PROP_PAGE_SIZE,
|
|
|
|
|
NUM_PROPERTIES
|
2004-01-29 23:49:25 +00:00
|
|
|
|
};
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2008-03-14 17:26:12 +00:00
|
|
|
|
enum
|
|
|
|
|
{
|
1997-11-24 22:37:52 +00:00
|
|
|
|
CHANGED,
|
|
|
|
|
VALUE_CHANGED,
|
|
|
|
|
LAST_SIGNAL
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2008-03-14 17:26:12 +00:00
|
|
|
|
static void gtk_adjustment_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_adjustment_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_adjustment_dispatch_properties_changed (GObject *object,
|
|
|
|
|
guint n_pspecs,
|
|
|
|
|
GParamSpec **pspecs);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
1998-03-09 15:16:28 +00:00
|
|
|
|
static guint adjustment_signals[LAST_SIGNAL] = { 0 };
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2015-09-05 07:58:15 +00:00
|
|
|
|
static GParamSpec *adjustment_props[NUM_PROPERTIES] = { NULL, };
|
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
G_DEFINE_TYPE_WITH_PRIVATE (GtkAdjustment, gtk_adjustment, G_TYPE_INITIALLY_UNOWNED)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-06-30 22:09:50 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_adjustment_finalize (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
GtkAdjustment *adjustment = GTK_ADJUSTMENT (object);
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
2014-06-30 22:09:50 +00:00
|
|
|
|
|
|
|
|
|
if (priv->tick_id)
|
|
|
|
|
g_signal_handler_disconnect (priv->clock, priv->tick_id);
|
|
|
|
|
if (priv->clock)
|
|
|
|
|
g_object_unref (priv->clock);
|
|
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (gtk_adjustment_parent_class)->finalize (object);
|
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_adjustment_class_init (GtkAdjustmentClass *class)
|
|
|
|
|
{
|
2004-01-29 23:49:25 +00:00
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
|
|
|
|
|
2014-06-30 22:09:50 +00:00
|
|
|
|
gobject_class->finalize = gtk_adjustment_finalize;
|
2008-03-14 17:26:12 +00:00
|
|
|
|
gobject_class->set_property = gtk_adjustment_set_property;
|
|
|
|
|
gobject_class->get_property = gtk_adjustment_get_property;
|
|
|
|
|
gobject_class->dispatch_properties_changed = gtk_adjustment_dispatch_properties_changed;
|
2004-01-29 23:49:25 +00:00
|
|
|
|
|
doh, this was broken beyond believe.
Tue Dec 12 23:46:44 2000 Tim Janik <timj@gtk.org>
* gtk/stock-icons/Makefile.am: doh, this was broken beyond believe.
* gtk/gtkbox.c: change property types from (u)long to (u)int for
::position and ::padding.
* gtk/gtkcontainer.c: make ::border_width an INT property.
* gtk/gtkpacker.c: make ::position an INT property.
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_adjustment_changed):
guard against NULL h/v scrollbars, since this is used at construction
time.
* gtk/gtkclist.[hc]: nuked gtk_clist_construct(), implemented
internal gtk_clist_constructor().
* gtk/gtkctree.[hc]: nuked gtk_ctree_construct(), implemented
gtk_ctree_constructor().
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): property
::pulse_step should use ARG_PULSE_STEP, not ARG_FRACTION.
* docs/reference/Makefile.am: fun stuff, disabled docs generation
again, gtk-scan.c needs to introspec paramspecs, not GtkAgs.
* gtk/gtkwidget.[hc]:
removed gtk_widget_setv(), gtk_widget_getv(), gtk_widget_newv()
and gtk_widget_get().
(gtk_widget_new): use g_object_new_valist().
(gtk_widget_set): use g_object_set_valist().
* gtk/gtkobject.[hc]:
removed gtk_object_arg_get_info(), gtk_object_getv(),
gtk_object_query_args(), gtk_object_newv(),
gtk_object_class_add_signals(),
gtk_object_class_user_signal_new(),
gtk_object_class_user_signal_newv(),
gtk_object_arg_set(), gtk_object_arg_get(),
gtk_object_args_collect(),
gtk_object_default_construct(),
gtk_object_constructed(),
GTK_CONSTRUCTED and GTK_OBJECT_CONSTRUCTED().
removed nsignals, signals and n_args members from GtkObjectClass.
(gtk_object_new): use g_object_new_valist().
(gtk_object_set): use g_object_set_valist().
(gtk_object_get): use g_object_get_valist().
* gtk/gtkcompat.h: define gtk_object_default_construct().
* gtk/gtktypeutils.c (gtk_type_new): create constructed objects via
g_object_new().
* gtk/*.c: removed gtk_object_class_add_signals() from class_init()
fucntions, cleaned up method assignments (make sure your structures
are setup properly before calling out). removed all GTK_CONSTRUCTED
hacks ;)
2000-12-13 01:34:41 +00:00
|
|
|
|
class->changed = NULL;
|
|
|
|
|
class->value_changed = NULL;
|
|
|
|
|
|
2004-12-27 06:34:10 +00:00
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* GtkAdjustment:value: (attributes org.gtk.Property.get=gtk_adjustment_get_value org.gtk.Property.set=gtk_adjustment_set_value)
|
2015-05-10 06:10:21 +00:00
|
|
|
|
*
|
2004-12-27 06:34:10 +00:00
|
|
|
|
* The value of the adjustment.
|
|
|
|
|
*/
|
2015-09-05 07:58:15 +00:00
|
|
|
|
adjustment_props[PROP_VALUE] =
|
|
|
|
|
g_param_spec_double ("value",
|
|
|
|
|
P_("Value"),
|
|
|
|
|
P_("The value of the adjustment"),
|
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE,
|
|
|
|
|
0.0,
|
|
|
|
|
GTK_PARAM_READWRITE);
|
2015-05-10 06:10:21 +00:00
|
|
|
|
|
2004-12-27 06:34:10 +00:00
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* GtkAdjustment:lower: (attributes org.gtk.Property.get=gtk_adjustment_get_lower org.gtk.Property.set=gtk_adjustment_set_lower)
|
2015-05-10 06:10:21 +00:00
|
|
|
|
*
|
2004-12-27 06:34:10 +00:00
|
|
|
|
* The minimum value of the adjustment.
|
|
|
|
|
*/
|
2015-09-05 07:58:15 +00:00
|
|
|
|
adjustment_props[PROP_LOWER] =
|
|
|
|
|
g_param_spec_double ("lower",
|
|
|
|
|
P_("Minimum Value"),
|
|
|
|
|
P_("The minimum value of the adjustment"),
|
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE,
|
|
|
|
|
0.0,
|
|
|
|
|
GTK_PARAM_READWRITE);
|
2015-05-10 06:10:21 +00:00
|
|
|
|
|
2004-12-27 06:34:10 +00:00
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* GtkAdjustment:upper: (attributes org.gtk.Property.get=gtk_adjustment_get_upper org.gtk.Property.set=gtk_adjustment_set_upper)
|
2015-05-10 06:10:21 +00:00
|
|
|
|
*
|
|
|
|
|
* The maximum value of the adjustment.
|
2021-02-27 15:51:45 +00:00
|
|
|
|
*
|
|
|
|
|
* Note that values will be restricted by `upper - page-size` if the page-size
|
2004-12-27 06:34:10 +00:00
|
|
|
|
* property is nonzero.
|
|
|
|
|
*/
|
2015-09-05 07:58:15 +00:00
|
|
|
|
adjustment_props[PROP_UPPER] =
|
|
|
|
|
g_param_spec_double ("upper",
|
|
|
|
|
P_("Maximum Value"),
|
|
|
|
|
P_("The maximum value of the adjustment"),
|
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE,
|
|
|
|
|
0.0,
|
|
|
|
|
GTK_PARAM_READWRITE);
|
2015-05-10 06:10:21 +00:00
|
|
|
|
|
2004-12-27 06:34:10 +00:00
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* GtkAdjustment:step-increment: (attributes org.gtk.Property.get=gtk_adjustment_get_step_increment org.gtk.Property.set=gtk_adjustment_set_step_increment)
|
2015-05-10 06:10:21 +00:00
|
|
|
|
*
|
2004-12-27 06:34:10 +00:00
|
|
|
|
* The step increment of the adjustment.
|
|
|
|
|
*/
|
2015-09-05 07:58:15 +00:00
|
|
|
|
adjustment_props[PROP_STEP_INCREMENT] =
|
|
|
|
|
g_param_spec_double ("step-increment",
|
|
|
|
|
P_("Step Increment"),
|
|
|
|
|
P_("The step increment of the adjustment"),
|
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE,
|
|
|
|
|
0.0,
|
|
|
|
|
GTK_PARAM_READWRITE);
|
2015-05-10 06:10:21 +00:00
|
|
|
|
|
2004-12-27 06:34:10 +00:00
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* GtkAdjustment:page-increment: (attributes org.gtk.Property.get=gtk_adjustment_get_page_increment org.gtk.Property.set=gtk_adjustment_set_page_increment)
|
2015-05-10 06:10:21 +00:00
|
|
|
|
*
|
2004-12-27 06:34:10 +00:00
|
|
|
|
* The page increment of the adjustment.
|
|
|
|
|
*/
|
2015-09-05 07:58:15 +00:00
|
|
|
|
adjustment_props[PROP_PAGE_INCREMENT] =
|
|
|
|
|
g_param_spec_double ("page-increment",
|
|
|
|
|
P_("Page Increment"),
|
|
|
|
|
P_("The page increment of the adjustment"),
|
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE,
|
|
|
|
|
0.0,
|
|
|
|
|
GTK_PARAM_READWRITE);
|
2015-05-10 06:10:21 +00:00
|
|
|
|
|
2004-12-27 06:34:10 +00:00
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* GtkAdjustment:page-size: (attributes org.gtk.Property.get=gtk_adjustment_get_page_size org.gtk.Property.set=gtk_adjustment_set_page_size)
|
2015-05-10 06:10:21 +00:00
|
|
|
|
*
|
|
|
|
|
* The page size of the adjustment.
|
2021-02-27 15:51:45 +00:00
|
|
|
|
*
|
2004-12-27 06:34:10 +00:00
|
|
|
|
* Note that the page-size is irrelevant and should be set to zero
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* if the adjustment is used for a simple scalar value, e.g. in a
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* `GtkSpinButton`.
|
2004-12-27 06:34:10 +00:00
|
|
|
|
*/
|
2015-09-05 07:58:15 +00:00
|
|
|
|
adjustment_props[PROP_PAGE_SIZE] =
|
|
|
|
|
g_param_spec_double ("page-size",
|
|
|
|
|
P_("Page Size"),
|
|
|
|
|
P_("The page size of the adjustment"),
|
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE,
|
|
|
|
|
0.0,
|
|
|
|
|
GTK_PARAM_READWRITE);
|
|
|
|
|
|
|
|
|
|
g_object_class_install_properties (gobject_class, NUM_PROPERTIES, adjustment_props);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
|
2010-10-22 22:16:27 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkAdjustment::changed:
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* @adjustment: the object which received the signal
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* Emitted when one or more of the `GtkAdjustment` properties have been
|
|
|
|
|
* changed.
|
|
|
|
|
*
|
|
|
|
|
* Note that the [property@Gtk.Adjustment:value] property is
|
|
|
|
|
* covered by the [signal@Gtk.Adjustment::value-changed] signal.
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
adjustment_signals[CHANGED] =
|
2005-09-01 05:11:46 +00:00
|
|
|
|
g_signal_new (I_("changed"),
|
2002-10-09 22:25:18 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
|
|
|
|
|
G_STRUCT_OFFSET (GtkAdjustmentClass, changed),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2002-10-09 22:25:18 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
2008-03-14 17:26:12 +00:00
|
|
|
|
|
2010-10-22 22:16:27 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkAdjustment::value-changed:
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* @adjustment: the object which received the signal
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* Emitted when the value has been changed.
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
adjustment_signals[VALUE_CHANGED] =
|
2008-08-08 13:25:18 +00:00
|
|
|
|
g_signal_new (I_("value-changed"),
|
2002-10-09 22:25:18 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
|
|
|
|
|
G_STRUCT_OFFSET (GtkAdjustmentClass, value_changed),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2002-10-09 22:25:18 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_adjustment_init (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2004-01-29 23:49:25 +00:00
|
|
|
|
static void
|
2008-03-14 17:26:12 +00:00
|
|
|
|
gtk_adjustment_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
2004-01-29 23:49:25 +00:00
|
|
|
|
{
|
|
|
|
|
GtkAdjustment *adjustment = GTK_ADJUSTMENT (object);
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
|
{
|
|
|
|
|
case PROP_VALUE:
|
2011-01-05 22:03:57 +00:00
|
|
|
|
g_value_set_double (value, priv->value);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_LOWER:
|
2011-01-05 22:03:57 +00:00
|
|
|
|
g_value_set_double (value, priv->lower);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_UPPER:
|
2011-01-05 22:03:57 +00:00
|
|
|
|
g_value_set_double (value, priv->upper);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_STEP_INCREMENT:
|
2011-01-05 22:03:57 +00:00
|
|
|
|
g_value_set_double (value, priv->step_increment);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_PAGE_INCREMENT:
|
2011-01-05 22:03:57 +00:00
|
|
|
|
g_value_set_double (value, priv->page_increment);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_PAGE_SIZE:
|
2011-01-05 22:03:57 +00:00
|
|
|
|
g_value_set_double (value, priv->page_size);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2008-03-14 17:26:12 +00:00
|
|
|
|
gtk_adjustment_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
2004-01-29 23:49:25 +00:00
|
|
|
|
{
|
|
|
|
|
GtkAdjustment *adjustment = GTK_ADJUSTMENT (object);
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double double_value = g_value_get_double (value);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
|
{
|
|
|
|
|
case PROP_VALUE:
|
2008-03-14 17:26:12 +00:00
|
|
|
|
gtk_adjustment_set_value (adjustment, double_value);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_LOWER:
|
2018-03-23 12:48:31 +00:00
|
|
|
|
gtk_adjustment_set_lower (adjustment, double_value);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_UPPER:
|
2018-03-23 12:48:31 +00:00
|
|
|
|
gtk_adjustment_set_upper (adjustment, double_value);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_STEP_INCREMENT:
|
2018-03-23 12:48:31 +00:00
|
|
|
|
gtk_adjustment_set_step_increment (adjustment, double_value);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_PAGE_INCREMENT:
|
2018-03-23 12:48:31 +00:00
|
|
|
|
gtk_adjustment_set_page_increment (adjustment, double_value);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_PAGE_SIZE:
|
2018-03-23 12:48:31 +00:00
|
|
|
|
gtk_adjustment_set_page_size (adjustment, double_value);
|
2004-01-29 23:49:25 +00:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-10 06:35:52 +00:00
|
|
|
|
static inline void
|
|
|
|
|
emit_value_changed (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
|
|
|
|
g_signal_emit (adjustment, adjustment_signals[VALUE_CHANGED], 0);
|
2015-09-05 07:58:15 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (adjustment), adjustment_props[PROP_VALUE]);
|
2015-05-10 06:35:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-03-14 17:26:12 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_adjustment_dispatch_properties_changed (GObject *object,
|
|
|
|
|
guint n_pspecs,
|
|
|
|
|
GParamSpec **pspecs)
|
|
|
|
|
{
|
|
|
|
|
gboolean changed = FALSE;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int i;
|
2008-03-14 17:26:12 +00:00
|
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (gtk_adjustment_parent_class)->dispatch_properties_changed (object, n_pspecs, pspecs);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < n_pspecs; i++)
|
|
|
|
|
switch (pspecs[i]->param_id)
|
|
|
|
|
{
|
|
|
|
|
case PROP_LOWER:
|
|
|
|
|
case PROP_UPPER:
|
|
|
|
|
case PROP_STEP_INCREMENT:
|
|
|
|
|
case PROP_PAGE_INCREMENT:
|
|
|
|
|
case PROP_PAGE_SIZE:
|
|
|
|
|
changed = TRUE;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (changed)
|
2008-08-05 14:46:26 +00:00
|
|
|
|
{
|
2018-03-23 13:32:10 +00:00
|
|
|
|
g_signal_emit (object, adjustment_signals[CHANGED], 0);
|
2008-08-05 14:46:26 +00:00
|
|
|
|
}
|
2008-03-14 17:26:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-10-22 22:16:27 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_adjustment_new:
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* @value: the initial value
|
|
|
|
|
* @lower: the minimum value
|
|
|
|
|
* @upper: the maximum value
|
|
|
|
|
* @step_increment: the step increment
|
|
|
|
|
* @page_increment: the page increment
|
|
|
|
|
* @page_size: the page size
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* Creates a new `GtkAdjustment`.
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* Returns: a new `GtkAdjustment`
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*/
|
2010-09-27 12:48:26 +00:00
|
|
|
|
GtkAdjustment *
|
2020-07-24 20:32:16 +00:00
|
|
|
|
gtk_adjustment_new (double value,
|
|
|
|
|
double lower,
|
|
|
|
|
double upper,
|
|
|
|
|
double step_increment,
|
|
|
|
|
double page_increment,
|
|
|
|
|
double page_size)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2008-08-05 14:46:26 +00:00
|
|
|
|
return g_object_new (GTK_TYPE_ADJUSTMENT,
|
2004-01-29 23:49:25 +00:00
|
|
|
|
"lower", lower,
|
|
|
|
|
"upper", upper,
|
|
|
|
|
"step-increment", step_increment,
|
|
|
|
|
"page-increment", page_increment,
|
2005-03-26 05:49:15 +00:00
|
|
|
|
"page-size", page_size,
|
2004-02-03 21:43:10 +00:00
|
|
|
|
"value", value,
|
2004-01-29 23:49:25 +00:00
|
|
|
|
NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
1998-01-30 23:47:09 +00:00
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* gtk_adjustment_get_value: (attributes org.gtk.Method.get_property=value)
|
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* Gets the current value of the adjustment.
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* Returns: The current value of the adjustment
|
2021-02-27 15:51:45 +00:00
|
|
|
|
*/
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double
|
2001-06-24 15:34:48 +00:00
|
|
|
|
gtk_adjustment_get_value (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
2008-03-14 17:26:12 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);
|
2001-06-24 15:34:48 +00:00
|
|
|
|
|
2017-10-13 10:47:09 +00:00
|
|
|
|
return priv->value;
|
2001-06-24 15:34:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double
|
2014-07-08 13:13:31 +00:00
|
|
|
|
gtk_adjustment_get_target_value (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
2014-07-08 13:13:31 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);
|
|
|
|
|
|
2017-10-13 10:47:09 +00:00
|
|
|
|
if (priv->tick_id)
|
|
|
|
|
return priv->target;
|
2014-07-08 13:13:31 +00:00
|
|
|
|
else
|
2017-10-13 10:47:09 +00:00
|
|
|
|
return priv->value;
|
2014-07-08 13:13:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-06-30 22:09:50 +00:00
|
|
|
|
static void
|
|
|
|
|
adjustment_set_value (GtkAdjustment *adjustment,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double value)
|
2014-06-30 22:09:50 +00:00
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
|
|
|
|
if (priv->value != value)
|
2014-06-30 22:09:50 +00:00
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
priv->value = value;
|
2015-05-10 06:35:52 +00:00
|
|
|
|
emit_value_changed (adjustment);
|
2014-06-30 22:09:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-10 06:10:21 +00:00
|
|
|
|
static void gtk_adjustment_on_frame_clock_update (GdkFrameClock *clock,
|
2014-07-02 21:55:20 +00:00
|
|
|
|
GtkAdjustment *adjustment);
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_adjustment_begin_updating (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
2014-07-02 21:55:20 +00:00
|
|
|
|
|
|
|
|
|
if (priv->tick_id == 0)
|
|
|
|
|
{
|
|
|
|
|
priv->tick_id = g_signal_connect (priv->clock, "update",
|
|
|
|
|
G_CALLBACK (gtk_adjustment_on_frame_clock_update), adjustment);
|
|
|
|
|
gdk_frame_clock_begin_updating (priv->clock);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_adjustment_end_updating (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
2014-07-02 21:55:20 +00:00
|
|
|
|
|
|
|
|
|
if (priv->tick_id != 0)
|
|
|
|
|
{
|
|
|
|
|
g_signal_handler_disconnect (priv->clock, priv->tick_id);
|
|
|
|
|
priv->tick_id = 0;
|
|
|
|
|
gdk_frame_clock_end_updating (priv->clock);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-30 22:09:50 +00:00
|
|
|
|
/* From clutter-easing.c, based on Robert Penner's
|
|
|
|
|
* infamous easing equations, MIT license.
|
|
|
|
|
*/
|
2020-07-24 20:32:16 +00:00
|
|
|
|
static double
|
|
|
|
|
ease_out_cubic (double t)
|
2014-06-30 22:09:50 +00:00
|
|
|
|
{
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double p = t - 1;
|
2014-06-30 22:09:50 +00:00
|
|
|
|
|
|
|
|
|
return p * p * p + 1;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-02 21:55:20 +00:00
|
|
|
|
static void
|
2015-05-10 06:10:21 +00:00
|
|
|
|
gtk_adjustment_on_frame_clock_update (GdkFrameClock *clock,
|
2014-07-02 21:55:20 +00:00
|
|
|
|
GtkAdjustment *adjustment)
|
2014-06-30 22:09:50 +00:00
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
2014-07-02 21:55:20 +00:00
|
|
|
|
gint64 now;
|
|
|
|
|
|
|
|
|
|
now = gdk_frame_clock_get_frame_time (clock);
|
2014-06-30 22:09:50 +00:00
|
|
|
|
|
|
|
|
|
if (now < priv->end_time)
|
|
|
|
|
{
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double t;
|
2014-06-30 22:09:50 +00:00
|
|
|
|
|
2020-07-24 20:32:16 +00:00
|
|
|
|
t = (now - priv->start_time) / (double) (priv->end_time - priv->start_time);
|
2014-06-30 22:09:50 +00:00
|
|
|
|
t = ease_out_cubic (t);
|
|
|
|
|
adjustment_set_value (adjustment, priv->source + t * (priv->target - priv->source));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
adjustment_set_value (adjustment, priv->target);
|
2014-07-02 21:55:20 +00:00
|
|
|
|
gtk_adjustment_end_updating (adjustment);
|
2014-06-30 22:09:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2014-07-02 21:55:20 +00:00
|
|
|
|
gtk_adjustment_set_value_internal (GtkAdjustment *adjustment,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double value,
|
2014-07-02 21:55:20 +00:00
|
|
|
|
gboolean animate)
|
2014-06-30 22:09:50 +00:00
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
2014-06-30 22:09:50 +00:00
|
|
|
|
|
2014-07-02 21:55:20 +00:00
|
|
|
|
/* don't use CLAMP() so we don't end up below lower if upper - page_size
|
|
|
|
|
* is smaller than lower
|
|
|
|
|
*/
|
|
|
|
|
value = MIN (value, priv->upper - priv->page_size);
|
|
|
|
|
value = MAX (value, priv->lower);
|
2014-06-30 22:09:50 +00:00
|
|
|
|
|
2014-07-02 21:55:20 +00:00
|
|
|
|
if (animate && priv->duration != 0 && priv->clock != NULL)
|
2014-06-30 22:09:50 +00:00
|
|
|
|
{
|
2014-09-08 02:45:08 +00:00
|
|
|
|
if (priv->tick_id && priv->target == value)
|
2014-07-02 21:55:20 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2014-06-30 22:09:50 +00:00
|
|
|
|
priv->source = priv->value;
|
2014-07-02 21:55:20 +00:00
|
|
|
|
priv->target = value;
|
2014-06-30 22:09:50 +00:00
|
|
|
|
priv->start_time = gdk_frame_clock_get_frame_time (priv->clock);
|
|
|
|
|
priv->end_time = priv->start_time + 1000 * priv->duration;
|
2014-07-02 21:55:20 +00:00
|
|
|
|
gtk_adjustment_begin_updating (adjustment);
|
2014-06-30 22:09:50 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2014-07-02 21:55:20 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_adjustment_end_updating (adjustment);
|
|
|
|
|
adjustment_set_value (adjustment, value);
|
|
|
|
|
}
|
2014-06-30 22:09:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-10-22 22:16:27 +00:00
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* gtk_adjustment_set_value: (attributes org.gtk.Method.set_property=value)
|
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* @value: the new value
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* Sets the `GtkAdjustment` value.
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* The value is clamped to lie between [property@Gtk.Adjustment:lower]
|
|
|
|
|
* and [property@Gtk.Adjustment:upper].
|
|
|
|
|
*
|
|
|
|
|
* Note that for adjustments which are used in a `GtkScrollbar`,
|
|
|
|
|
* the effective range of allowed values goes from
|
|
|
|
|
* [property@Gtk.Adjustment:lower] to
|
|
|
|
|
* [property@Gtk.Adjustment:upper] - [property@Gtk.Adjustment:page-size].
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*/
|
1998-01-30 23:47:09 +00:00
|
|
|
|
void
|
2008-03-14 17:26:12 +00:00
|
|
|
|
gtk_adjustment_set_value (GtkAdjustment *adjustment,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double value)
|
1998-01-30 23:47:09 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
|
|
|
|
|
2014-07-02 21:55:20 +00:00
|
|
|
|
gtk_adjustment_set_value_internal (adjustment, value, FALSE);
|
|
|
|
|
}
|
2011-01-05 22:03:57 +00:00
|
|
|
|
|
2014-07-02 21:55:20 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_adjustment_animate_to_value (GtkAdjustment *adjustment,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double value)
|
2014-07-02 21:55:20 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
1998-05-02 18:35:23 +00:00
|
|
|
|
|
2014-07-02 21:55:20 +00:00
|
|
|
|
gtk_adjustment_set_value_internal (adjustment, value, TRUE);
|
1998-05-02 18:35:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-08-05 14:46:26 +00:00
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* gtk_adjustment_get_lower: (attributes org.gtk.Method.get_property=lower)
|
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2008-08-05 14:46:26 +00:00
|
|
|
|
*
|
|
|
|
|
* Retrieves the minimum value of the adjustment.
|
|
|
|
|
*
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* Returns: The current minimum value of the adjustment
|
2008-08-05 14:46:26 +00:00
|
|
|
|
**/
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double
|
2008-08-05 14:46:26 +00:00
|
|
|
|
gtk_adjustment_get_lower (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
2008-08-05 14:46:26 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);
|
|
|
|
|
|
2017-10-13 10:47:09 +00:00
|
|
|
|
return priv->lower;
|
2008-08-05 14:46:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* gtk_adjustment_set_lower: (attributes org.gtk.Method.set_property=lower)
|
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2008-08-05 14:46:26 +00:00
|
|
|
|
* @lower: the new minimum value
|
|
|
|
|
*
|
|
|
|
|
* Sets the minimum value of the adjustment.
|
|
|
|
|
*
|
|
|
|
|
* When setting multiple adjustment properties via their individual
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* setters, multiple [signal@Gtk.Adjustment::changed] signals will
|
|
|
|
|
* be emitted. However, since the emission of the
|
|
|
|
|
* [signal@Gtk.Adjustment::changed] signal is tied to the emission
|
|
|
|
|
* of the ::notify signals of the changed properties, it’s possible
|
|
|
|
|
* to compress the [signal@Gtk.Adjustment::changed] signals into one
|
|
|
|
|
* by calling g_object_freeze_notify() and g_object_thaw_notify()
|
|
|
|
|
* around the calls to the individual setters.
|
2008-08-05 14:46:26 +00:00
|
|
|
|
*
|
|
|
|
|
* Alternatively, using a single g_object_set() for all the properties
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* to change, or using [method@Gtk.Adjustment.configure] has the same effect.
|
|
|
|
|
*/
|
2008-08-05 14:46:26 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_adjustment_set_lower (GtkAdjustment *adjustment,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double lower)
|
2008-08-05 14:46:26 +00:00
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
2008-08-05 14:46:26 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
|
|
|
|
|
2017-10-13 10:47:09 +00:00
|
|
|
|
if (lower != priv->lower)
|
2018-03-23 12:48:31 +00:00
|
|
|
|
{
|
|
|
|
|
priv->lower = lower;
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (adjustment), adjustment_props[PROP_LOWER]);
|
|
|
|
|
}
|
2008-08-05 14:46:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* gtk_adjustment_get_upper: (attributes org.gtk.Method.get_property=upper)
|
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2008-08-05 14:46:26 +00:00
|
|
|
|
*
|
|
|
|
|
* Retrieves the maximum value of the adjustment.
|
|
|
|
|
*
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* Returns: The current maximum value of the adjustment
|
2021-02-27 15:51:45 +00:00
|
|
|
|
*/
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double
|
2008-08-05 14:46:26 +00:00
|
|
|
|
gtk_adjustment_get_upper (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
2008-08-05 14:46:26 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);
|
|
|
|
|
|
2017-10-13 10:47:09 +00:00
|
|
|
|
return priv->upper;
|
2008-08-05 14:46:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* gtk_adjustment_set_upper: (attributes org.gtk.Method.set_property=upper)
|
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2008-08-05 14:46:26 +00:00
|
|
|
|
* @upper: the new maximum value
|
|
|
|
|
*
|
|
|
|
|
* Sets the maximum value of the adjustment.
|
|
|
|
|
*
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* Note that values will be restricted by `upper - page-size`
|
|
|
|
|
* if the page-size property is nonzero.
|
2008-08-05 14:46:26 +00:00
|
|
|
|
*
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* See [method@Gtk.Adjustment.set_lower] about how to compress
|
|
|
|
|
* multiple emissions of the [signal@Gtk.Adjustment::changed]
|
|
|
|
|
* signal when setting multiple adjustment properties.
|
|
|
|
|
*/
|
2008-08-05 14:46:26 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_adjustment_set_upper (GtkAdjustment *adjustment,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double upper)
|
2008-08-05 14:46:26 +00:00
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
2008-08-05 14:46:26 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
|
|
|
|
|
2017-10-13 10:47:09 +00:00
|
|
|
|
if (upper != priv->upper)
|
2018-03-23 12:48:31 +00:00
|
|
|
|
{
|
|
|
|
|
priv->upper = upper;
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (adjustment), adjustment_props[PROP_UPPER]);
|
|
|
|
|
}
|
2008-08-05 14:46:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* gtk_adjustment_get_step_increment: (attributes org.gtk.Method.get_property=step-increment)
|
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2008-08-05 14:46:26 +00:00
|
|
|
|
*
|
|
|
|
|
* Retrieves the step increment of the adjustment.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The current step increment of the adjustment.
|
2021-02-27 15:51:45 +00:00
|
|
|
|
*/
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double
|
2008-08-05 14:46:26 +00:00
|
|
|
|
gtk_adjustment_get_step_increment (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
2008-08-05 14:46:26 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);
|
|
|
|
|
|
2017-10-13 10:47:09 +00:00
|
|
|
|
return priv->step_increment;
|
2008-08-05 14:46:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* gtk_adjustment_set_step_increment: (attributes org.gtk.Method.set_property=step-increment)
|
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2008-08-05 14:46:26 +00:00
|
|
|
|
* @step_increment: the new step increment
|
|
|
|
|
*
|
|
|
|
|
* Sets the step increment of the adjustment.
|
|
|
|
|
*
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* See [method@Gtk.Adjustment.set_lower] about how to compress
|
|
|
|
|
* multiple emissions of the [signal@Gtk.Adjustment::changed]
|
|
|
|
|
* signal when setting multiple adjustment properties.
|
|
|
|
|
*/
|
2008-08-05 14:46:26 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_adjustment_set_step_increment (GtkAdjustment *adjustment,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double step_increment)
|
2008-08-05 14:46:26 +00:00
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
2008-08-05 14:46:26 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
|
|
|
|
|
2017-10-13 10:47:09 +00:00
|
|
|
|
if (step_increment != priv->step_increment)
|
2018-03-23 12:48:31 +00:00
|
|
|
|
{
|
|
|
|
|
priv->step_increment = step_increment;
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (adjustment), adjustment_props[PROP_STEP_INCREMENT]);
|
|
|
|
|
}
|
2008-08-05 14:46:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* gtk_adjustment_get_page_increment: (attributes org.gtk.Method.get_property=page-increment)
|
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2008-08-05 14:46:26 +00:00
|
|
|
|
*
|
|
|
|
|
* Retrieves the page increment of the adjustment.
|
|
|
|
|
*
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* Returns: The current page increment of the adjustment
|
2008-08-05 14:46:26 +00:00
|
|
|
|
**/
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double
|
2008-08-05 14:46:26 +00:00
|
|
|
|
gtk_adjustment_get_page_increment (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
2008-08-05 14:46:26 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);
|
|
|
|
|
|
2017-10-13 10:47:09 +00:00
|
|
|
|
return priv->page_increment;
|
2008-08-05 14:46:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* gtk_adjustment_set_page_increment: (attributes org.gtk.Method.set_property=page-increment)
|
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2008-08-05 14:46:26 +00:00
|
|
|
|
* @page_increment: the new page increment
|
|
|
|
|
*
|
|
|
|
|
* Sets the page increment of the adjustment.
|
|
|
|
|
*
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* See [method@Gtk.Adjustment.set_lower] about how to compress
|
|
|
|
|
* multiple emissions of the [signal@Gtk.Adjustment::changed]
|
|
|
|
|
* signal when setting multiple adjustment properties.
|
|
|
|
|
*/
|
2008-08-05 14:46:26 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_adjustment_set_page_increment (GtkAdjustment *adjustment,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double page_increment)
|
2008-08-05 14:46:26 +00:00
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
2008-08-05 14:46:26 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
|
|
|
|
|
2017-10-13 10:47:09 +00:00
|
|
|
|
if (page_increment != priv->page_increment)
|
2018-03-23 12:48:31 +00:00
|
|
|
|
{
|
|
|
|
|
priv->page_increment = page_increment;
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (adjustment), adjustment_props[PROP_PAGE_INCREMENT]);
|
|
|
|
|
}
|
2008-08-05 14:46:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* gtk_adjustment_get_page_size: (attributes org.gtk.Method.get_property=page-size)
|
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2008-08-05 14:46:26 +00:00
|
|
|
|
*
|
|
|
|
|
* Retrieves the page size of the adjustment.
|
|
|
|
|
*
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* Returns: The current page size of the adjustment
|
2008-08-05 14:46:26 +00:00
|
|
|
|
**/
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double
|
2008-08-05 14:46:26 +00:00
|
|
|
|
gtk_adjustment_get_page_size (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
2008-08-05 14:46:26 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);
|
|
|
|
|
|
2017-10-13 10:47:09 +00:00
|
|
|
|
return priv->page_size;
|
2008-08-05 14:46:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* gtk_adjustment_set_page_size: (attributes org.gtk.Method.set_property=page-size)
|
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2008-08-05 14:46:26 +00:00
|
|
|
|
* @page_size: the new page size
|
|
|
|
|
*
|
|
|
|
|
* Sets the page size of the adjustment.
|
|
|
|
|
*
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* See [method@Gtk.Adjustment.set_lower] about how to compress
|
|
|
|
|
* multiple emissions of the [signal@Gtk.Adjustment::changed]
|
|
|
|
|
* signal when setting multiple adjustment properties.
|
|
|
|
|
*/
|
2008-08-05 14:46:26 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_adjustment_set_page_size (GtkAdjustment *adjustment,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double page_size)
|
2008-08-05 14:46:26 +00:00
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
2008-08-05 14:46:26 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
|
|
|
|
|
2017-10-13 10:47:09 +00:00
|
|
|
|
if (page_size != priv->page_size)
|
2018-03-23 12:48:31 +00:00
|
|
|
|
{
|
|
|
|
|
priv->page_size = page_size;
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (adjustment), adjustment_props[PROP_PAGE_SIZE]);
|
|
|
|
|
}
|
2008-08-05 14:46:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_adjustment_configure:
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2008-08-05 14:46:26 +00:00
|
|
|
|
* @value: the new value
|
|
|
|
|
* @lower: the new minimum value
|
|
|
|
|
* @upper: the new maximum value
|
|
|
|
|
* @step_increment: the new step increment
|
|
|
|
|
* @page_increment: the new page increment
|
|
|
|
|
* @page_size: the new page size
|
|
|
|
|
*
|
|
|
|
|
* Sets all properties of the adjustment at once.
|
|
|
|
|
*
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* Use this function to avoid multiple emissions of the
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* [signal@Gtk.Adjustment::changed] signal. See
|
|
|
|
|
* [method@Gtk.Adjustment.set_lower] for an alternative
|
|
|
|
|
* way of compressing multiple emissions of
|
|
|
|
|
* [signal@Gtk.Adjustment::changed] into one.
|
|
|
|
|
*/
|
2008-08-05 14:46:26 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_adjustment_configure (GtkAdjustment *adjustment,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double value,
|
|
|
|
|
double lower,
|
|
|
|
|
double upper,
|
|
|
|
|
double step_increment,
|
|
|
|
|
double page_increment,
|
|
|
|
|
double page_size)
|
2008-08-05 14:46:26 +00:00
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
2008-08-05 14:46:26 +00:00
|
|
|
|
gboolean value_changed = FALSE;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
|
|
|
|
|
|
|
|
|
g_object_freeze_notify (G_OBJECT (adjustment));
|
|
|
|
|
|
2018-03-23 13:32:10 +00:00
|
|
|
|
gtk_adjustment_set_lower (adjustment, lower);
|
|
|
|
|
gtk_adjustment_set_upper (adjustment, upper);
|
|
|
|
|
gtk_adjustment_set_step_increment (adjustment, step_increment);
|
|
|
|
|
gtk_adjustment_set_page_increment (adjustment, page_increment);
|
|
|
|
|
gtk_adjustment_set_page_size (adjustment, page_size);
|
2008-08-05 14:46:26 +00:00
|
|
|
|
|
2008-08-11 21:07:36 +00:00
|
|
|
|
/* don't use CLAMP() so we don't end up below lower if upper - page_size
|
|
|
|
|
* is smaller than lower
|
|
|
|
|
*/
|
|
|
|
|
value = MIN (value, upper - page_size);
|
|
|
|
|
value = MAX (value, lower);
|
2008-08-05 14:46:26 +00:00
|
|
|
|
|
2011-01-05 22:03:57 +00:00
|
|
|
|
if (value != priv->value)
|
2008-08-05 14:46:26 +00:00
|
|
|
|
{
|
|
|
|
|
/* set value manually to make sure "changed" is emitted with the
|
|
|
|
|
* new value in place and is emitted before "value-changed"
|
|
|
|
|
*/
|
2011-01-05 22:03:57 +00:00
|
|
|
|
priv->value = value;
|
2008-08-05 14:46:26 +00:00
|
|
|
|
value_changed = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-23 13:32:10 +00:00
|
|
|
|
/* The dispatch_properties_changed implementation will emit ::changed! */
|
2008-08-05 14:46:26 +00:00
|
|
|
|
g_object_thaw_notify (G_OBJECT (adjustment));
|
|
|
|
|
|
|
|
|
|
if (value_changed)
|
2015-05-10 06:35:52 +00:00
|
|
|
|
emit_value_changed (adjustment);
|
2008-08-05 14:46:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-10-22 22:16:27 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_adjustment_clamp_page:
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2015-05-10 06:10:21 +00:00
|
|
|
|
* @lower: the lower value
|
|
|
|
|
* @upper: the upper value
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* Updates the value property to ensure that the range
|
|
|
|
|
* between @lower and @upper is in the current page.
|
|
|
|
|
*
|
|
|
|
|
* The current page goes from `value` to `value` + `page-size`.
|
|
|
|
|
* If the range is larger than the page size, then only the
|
|
|
|
|
* start of it will be in the current page.
|
2015-05-10 06:10:21 +00:00
|
|
|
|
*
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* A [signal@Gtk.Adjustment::value-changed] signal will be emitted
|
|
|
|
|
* if the value is changed.
|
2010-10-22 22:16:27 +00:00
|
|
|
|
*/
|
1998-05-01 04:23:59 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_adjustment_clamp_page (GtkAdjustment *adjustment,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double lower,
|
|
|
|
|
double upper)
|
1998-05-01 04:23:59 +00:00
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
2001-03-16 20:12:40 +00:00
|
|
|
|
gboolean need_emission;
|
1998-05-01 04:23:59 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
|
|
|
|
|
2011-01-05 22:03:57 +00:00
|
|
|
|
lower = CLAMP (lower, priv->lower, priv->upper);
|
|
|
|
|
upper = CLAMP (upper, priv->lower, priv->upper);
|
1998-05-01 04:23:59 +00:00
|
|
|
|
|
|
|
|
|
need_emission = FALSE;
|
|
|
|
|
|
2011-01-05 22:03:57 +00:00
|
|
|
|
if (priv->value + priv->page_size < upper)
|
1998-05-01 04:23:59 +00:00
|
|
|
|
{
|
2011-01-05 22:03:57 +00:00
|
|
|
|
priv->value = upper - priv->page_size;
|
1998-05-01 04:23:59 +00:00
|
|
|
|
need_emission = TRUE;
|
|
|
|
|
}
|
2011-01-05 22:03:57 +00:00
|
|
|
|
if (priv->value > lower)
|
1998-05-01 04:23:59 +00:00
|
|
|
|
{
|
2011-01-05 22:03:57 +00:00
|
|
|
|
priv->value = lower;
|
1998-05-01 04:23:59 +00:00
|
|
|
|
need_emission = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (need_emission)
|
2015-05-10 06:35:52 +00:00
|
|
|
|
emit_value_changed (adjustment);
|
1998-05-01 04:23:59 +00:00
|
|
|
|
}
|
2011-06-28 04:38:20 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_adjustment_get_minimum_increment:
|
2021-02-27 15:51:45 +00:00
|
|
|
|
* @adjustment: a `GtkAdjustment`
|
2011-06-28 04:38:20 +00:00
|
|
|
|
*
|
|
|
|
|
* Gets the smaller of step increment and page increment.
|
|
|
|
|
*
|
|
|
|
|
* Returns: the minimum increment of @adjustment
|
|
|
|
|
*/
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double
|
2011-06-28 04:38:20 +00:00
|
|
|
|
gtk_adjustment_get_minimum_increment (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double minimum_increment;
|
2011-06-28 04:38:20 +00:00
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0);
|
|
|
|
|
|
|
|
|
|
if (priv->step_increment != 0 && priv->page_increment != 0)
|
|
|
|
|
{
|
|
|
|
|
if (ABS (priv->step_increment) < ABS (priv->page_increment))
|
|
|
|
|
minimum_increment = priv->step_increment;
|
|
|
|
|
else
|
|
|
|
|
minimum_increment = priv->page_increment;
|
|
|
|
|
}
|
|
|
|
|
else if (priv->step_increment == 0 && priv->page_increment == 0)
|
|
|
|
|
{
|
|
|
|
|
minimum_increment = 0;
|
|
|
|
|
}
|
|
|
|
|
else if (priv->step_increment == 0)
|
|
|
|
|
{
|
|
|
|
|
minimum_increment = priv->page_increment;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
minimum_increment = priv->step_increment;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return minimum_increment;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-30 22:09:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_adjustment_enable_animation (GtkAdjustment *adjustment,
|
|
|
|
|
GdkFrameClock *clock,
|
|
|
|
|
guint duration)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
2014-06-30 22:09:50 +00:00
|
|
|
|
|
|
|
|
|
if (priv->clock != clock)
|
|
|
|
|
{
|
|
|
|
|
if (priv->tick_id)
|
|
|
|
|
{
|
|
|
|
|
adjustment_set_value (adjustment, priv->target);
|
|
|
|
|
|
|
|
|
|
g_signal_handler_disconnect (priv->clock, priv->tick_id);
|
|
|
|
|
priv->tick_id = 0;
|
|
|
|
|
gdk_frame_clock_end_updating (priv->clock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->clock)
|
|
|
|
|
g_object_unref (priv->clock);
|
|
|
|
|
|
|
|
|
|
priv->clock = clock;
|
|
|
|
|
|
|
|
|
|
if (priv->clock)
|
|
|
|
|
g_object_ref (priv->clock);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-10 06:10:21 +00:00
|
|
|
|
priv->duration = duration;
|
2014-06-30 22:09:50 +00:00
|
|
|
|
}
|
2014-07-14 02:00:30 +00:00
|
|
|
|
|
2014-07-14 03:04:08 +00:00
|
|
|
|
guint
|
2014-07-14 02:00:30 +00:00
|
|
|
|
gtk_adjustment_get_animation_duration (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
|
|
|
|
return priv->duration;
|
2014-07-14 02:00:30 +00:00
|
|
|
|
}
|
2014-07-21 19:16:32 +00:00
|
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_adjustment_is_animating (GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2017-10-13 10:47:09 +00:00
|
|
|
|
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
|
|
|
|
|
|
|
|
|
return priv->tick_id != 0;
|
2014-07-21 19:16:32 +00:00
|
|
|
|
}
|