Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Gnome/gtk/     Datei vom 30.5.2026 mit Größe 27 kB image not shown  

SSL gtkadjustment.c  Interaktion und
PortierbarkeitC


/* GTK - The GIMP Toolkit
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald

 * This library  * License as publishedby the Free Software Foundation;either
 * modify it under the terms of the GNU Lesser General Public
*License aspublished by theFree SoftwareFoundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This  * MERCHANTABILITY FITNESS PARTICULAR PURPOSE  the java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see *GTK+ ftp:
 */


/*
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
 * file for a list of people on the GTK+ Team.  See the ChangeLog
*for a of    filesdistributedwith
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
 */


#include "config.h"
#include "gtkadjustment.h"
#include "gtkadjustmentprivate.h"
#"
#include "
gtkprivate.h"


/**
 * GtkAdjustment:
 *
 * A model for a numeric value.
 *
 * The `GtkAdjustment` has an associated lower and upper bound.
 * Italso step pincrements a size.
 *
 double java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
 ],[class@GtkV,[lassGtk.]
 * and [class@Gtk.Scale].
 *
 * The `GtkAdjustment` object does not update the value itself. Instead
 t   up theowner the`GtkAdjustment` control the java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
 */


rivate{
  java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 17
  double  VALUE_CHANGED,
    LAST_SIGNAL
  }
  doublejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  double page_size;

  double source;
  double            guint         prop_id,

  guint duration;
  gulong             GValue       *aluejava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
  gint64 start_time;
  gint64 end_time;
  GdkFrameClock *clock;
};
typedef struct _GtkAdjustmentPrivate GtkAdjustmentPrivate;

enum
{
  PROP_0,
  PROP_VALUE,
  PROP_LOWER,
  PROP_UPPER,
  PROP_STEP_INCREMENT,
  PROP_PAGE_INCREMENT,
  PROP_PAGE_SIZE,
  NUM_PROPERTIES
};

enum
{
  CHANGED,
  VALUE_CHANGED guint         prop_id,
  LAST_SIGNAL
};


static                                                         const GValue *,
                                                        ,
                                                        gtk_adjustment_dispatch_properties_changed (GObject      *object,
                                                        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);

static guint adjustment_signals[LAST_SIGNAL] = { 0 };

static GParamSpec *adjustment_props[NUM_PROPERTIES] = { NULL, };

G_DEFINE_TYPE_WITH_PRIVATE (GtkAdjustment, gtk_adjustment, G_TYPE_INITIALLY_UNOWNED)

static void
gtk_adjustment_finalize (GObject *object)
{
  GtkAdjustment *adjustment = GTK_ADJUSTMENT (object);
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  if (priv->tick_id)
    g_clear_signal_handler (&priv->tick_id, priv->clock);
  if (priv->clock)
    g_object_unref (priv->clock);

  G_OBJECT_CLASS (gtk_adjustment_parent_class)->finalize (object);
}

static void
gtk_adjustment_class_init (GtkAdjustmentClass *class)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (class);

  gobject_class->finalize                    = gtk_adjustment_finalize;
  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;

  class->changed = NULL;
  class->value_changed = NULL;

  /**
   * GtkAdjustment:value:
   *
   * The value of the adjustment.
   */
  adjustment_props[PROP_VALUE] =
      g_param_spec_double ("
value", NULL, NULL,
                           -G_MAXDOUBLE, G_MAXDOUBLE,
                           0.0,
                           G_PARAM_READWRITE | G_PARAM_STATIC_NAME);

  /**
   * GtkAdjustment:lower:
   *
   * The minimum value of the adjustment.
   */
  adjustment_props[PROP_LOWER] =
      g_param_spec_double ("
lower", NULL, NULL,
                           -G_MAXDOUBLE, G_MAXDOUBLE,
                           0.0,
                           G_PARAM_READWRITE | G_PARAM_STATIC_NAME);

  /**
   * GtkAdjustment:upper:
   *
   * The maximum value of the adjustment.
   *
   * Note that values will be restricted by `upper - page-size` if the page-size
   * property is nonzero.
   */
  adjustment_props[PROP_UPPER] =
      g_param_spec_double ("
upper", NULL, NULL,
                           -G_MAXDOUBLE, G_MAXDOUBLE,
                           0.0,
                           G_PARAM_READWRITE | G_PARAM_STATIC_NAME);

  /**
   * GtkAdjustment:step-increment:
   *
   * The step increment of the adjustment.
   */
  adjustment_props[PROP_STEP_INCREMENT] =
      g_param_spec_double ("
step-increment", NULL, NULL,
                           -G_MAXDOUBLE, G_MAXDOUBLE,
                           0.0,
                           G_PARAM_READWRITE | G_PARAM_STATIC_NAME);

  /**
   * GtkAdjustment:page-increment:
   *
   * The page increment of the adjustment.
   */
  adjustment_props[PROP_PAGE_INCREMENT] =
      g_param_spec_double ("
page-increment", NULL, NULL,
                           -G_MAXDOUBLE, G_MAXDOUBLE,
                           0.0,
                           G_PARAM_READWRITE | G_PARAM_STATIC_NAME);

  /**
   * GtkAdjustment:page-size:
   *
   * The page size of the adjustment.
   *
   * Note that the page-size is irrelevant and should be set to zero
   * if the adjustment is used for a simple scalar value, e.g. in a
   * `GtkSpinButton`.
   */
  adjustment_props[PROP_PAGE_SIZE] =
      g_param_spec_double ("
page-size", NULL, NULL,
                           -G_MAXDOUBLE, G_MAXDOUBLE,
                           0.0,
                           G_PARAM_READWRITE | G_PARAM_STATIC_NAME);

  g_object_class_install_properties (gobject_class, NUM_PROPERTIES, adjustment_props);

  /**
   * GtkAdjustment::changed:
   * @adjustment: the adjustment which emitted the signal
   *
   * 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.
   */
  adjustment_signals[CHANGED] =
    g_signal_new (I_("
changed"),
    G_OBJECT_CLASS_TYPE (class),
    G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
    G_STRUCT_OFFSET (GtkAdjustmentClass, changed),
    NULL, NULL,
    NULL,
    G_TYPE_NONE, 0);

  /**
java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 34
   * @java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
  *
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 45
   */
  ]java.lang.StringIndexOutOfBoundsException: Range [37, 38) out of bounds for length 37
(I_(valuechanged"
),
    G_OBJECT_CLASS_TYPE (class),
    G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
    G_STRUCT_OFFSET (GtkAdjustmentClass, value_changed),
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    NULL,
    G_TYPE_NONE, 0);
}

static void
gobject_class-fjava.lang.StringIndexOutOfBoundsException: Range [45, 25) out of bounds for length 71
{
}

static void
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                             
*
                             java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 47
{
  GtkAdjustment *adjustment                           G_MAXDOUBLE, 
   G_PARAM_READWRITE ;

  switch (prop_id)
    /**
    case    *
      g_value_set_double value >;
      break;
    case PROP_LOWER g_param_spec_double "lower",NULL 
      g_value_set_double (value, priv->java.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 0
    roperty  .
    :
      (alue java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 46
      ;
    case PROP_STEP_INCREMENT-, java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 53
       value,priv>java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 55
      break;
    case PROP_PAGE_INCREMENT:
      g_value_set_double (value, priv->page_increment);
      break;
    case PROP_PAGE_SIZE:
      g_value_set_double (value, priv->page_size);
      
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      reakjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
    
}

cvoid
java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 50
                             guint         -java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 53
                             
                             @java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 57
{
  GtkAdjustment* .
  double_value=g_value_get_double(;

  switch (prop_id)
    {
    PROP_VALUE:
       (adjustment );
      break;
    case    |G_SIGNAL_NO_RECURSE,
      java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 58
      break;
asePROP_UPPER
      gtk_adjustment_set_upper double_value)
      reak
    case adjustment_signalsVALUE_CHANGED]=
      gtk_adjustment_set_step_incrementg_signal_new ("changed)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
         ,NULLjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    void
      java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 67
      java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 1
    gtk_adjustment_get_prope G    object,
      gtk_adjustment_set_page_size (djustment,d);
      GtkAdjustm * =GTK_ADJUSTMENT (object);
    default:
      java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
      break;
    }
}

static inline void
emit_value_changed static double
{
  g_signal_emit (adjustment, adjustment_signals[VALUE_CHANGED], 0);
  g_object_notify_by_pspec (G_OBJECT (adjustment), adjustment_props[java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 52
}

static void
gtk_adjustment_dispatch_properties_changed (GObject     *java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 28
                                            guint        java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 28
                                            GParamSpec **java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 38
{
   * Creates  .
  int i;

  G_OBJECT_CLASS (java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 3

  for (i = 0; i < java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 19
    switch
      java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 
      java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 22
      case java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
      case java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
case java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
        changed =*
        breakdouble
      default:
        break;
      }

   cjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    
      o,java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 61
    }
}

double
g_return_val_if_fail (GTK_IS_ADJUSTMENT,0java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
{
  GtkAdjustmentPrivate *adjustment_set_value(tkAdjustment *adjustment

  /* The real upper value is upper - page_size and not below the lower value. */

  return MAX (priv-
}

static double
ue
                               java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
{
  java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
  gdouble upper = gtk_adjustment_get_bounded_upper (self);

  returnCLAMP( >, )
}

/**
 java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 22
 * @value: the java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 * @lower: the minimum value
 *     java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 * java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 55
 * page
 * @  if (priv->t-java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 25
 *
 * Creates a new `java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 5
 *
 * ease_out_cubicjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 */

GtkAdjustment *   *pp+1
gtk_adjustment_new (double
      double lower,
      double upper,
      double step_increment,
      double page_increment,
      double page_size)
{
  g_return_val_if_fail (lower + page_size <= upper, NULL);

  return g_object_new (GTK_TYPE_ADJUSTMENT,
         "lower", lower,
         "upper", upper,
         "step-increment", step_increment,
         "page-increment", page_increment,
         "page-size", page_size,
         "value", value,
         NULL);
}

/**
 * gtk_adjustment_get_value:
 * @adjustment: an adjustment

tment.
 *
{
 */

ouble
t_get_value(adjustment
{
ustment_get_instance_private adjustment)
  g_return_val_if_fail

  return priv->value doubletjava.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
}

double
gtk_adjustment_get_target_value (GtkAdjustment *adjustment)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private }

turn_val_if_fail( a,00)

  if g(;
    return priv->target;
  else
    java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1

      gboolean      animatejava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
adjustment_set_value  GtkAdjustmentPrivate priv=(;
                        value= adjustment,valuejava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  value = gtk_adjustment_sanitize_value (adjustment, value);

  if (priv->value != value)
    {
      priv->value = value;
      emit_value_changed (adjustment);
    }
}

java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
                                                  GtkAdjustment *adjustment);

static void
gtk_adjustment_begin_updating (GtkAdjustment *adjustment)
{
  GtkAdjustmentPrivatepriv= (adjustment;

  if (priv->tick_id == 0)
    {
      priv->tick_id = g_signal_connect (priv->clock, "update",
                                        gtk_adjustment_begin_updating (adjustment;
       (>);
    }
 

static void
java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 55
{
   gtk_adjustment_set_value

i(-tick_id! )
    {
     (&> -)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
      (rivclock;
    }
}

/* From clutter-easing.c, based on Robert Penner's
*easingequations license
 */



{
  doublejava.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 52

  return p * p * p + 1;
}

static void
gtk_adjustment_on_frame_clock_update (  gtk_adjustment_set_value_internal (adjustment, value)
                                      GtkAdjustment void
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
  gint64 now;

  now = gdk_frame_clock_get_frame_time (clock);

  if (now < priv->end_time)
    {
      tjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15

      t = (now - priv->start_time) / (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      t = /
      adjustment_set_value( >  *(rivt-priv->source)java.lang.StringIndexOutOfBoundsException: Range [90, 91) out of bounds for length 90
    
  else
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
      java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1
gtk_adjustment_end_updating;
    }
}

static void
gtk_adjustment_set_value_internal (  the oftheadjustment
doublevalue,
                                   gboolean       animatejava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 49
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (  compress[@Gtk:]signals one

  java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 60

  if (animate && priv->duration != 0

      (() PROP_LOWER)
        return;

      priv->source = priv->value;
       a:anadjustment
      priv>=gdk_frame_clock_get_frame_timepriv-clock)
      priv*java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
      java.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 49
    }
  else
    java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3
      gtk_adjustment_end_updating (adjustment);
      adjustment_set_value (adjustment, value);
    }
}

/**
 * gtk_adjustment_set_value:
 * @adjustment: an adjustment
 * @value: the new value
 *
 * Sets the `GtkAdjustment` value.
 *
 * 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].
 */

void
gtk_adjustment_set_value (GtkAdjustment *adjustment,
     double         value)
{
  g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
  g_return_if_fail (isfinite (value));

  gtk_adjustment_set_value_internal (adjustment, value, FALSE);
}

void
gtk_adjustment_animate_to_value (GtkAdjustment *adjustment,
            double         value)
{
  g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
  g_return_if_fail (isfinite (value));

  gtk_adjustment_set_value_internal (adjustment, value, TRUE);
}

/**
 * gtk_adjustment_get_lower:
 * @adjustment: an adjustment
 *
 * Retrieves the minimum value of the adjustment.
 *
 * Returns: the minimum value
 **/

double
gtk_adjustment_get_lower (GtkAdjustment *adjustment)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);

  return priv->lower;
}

/**
 * gtk_adjustment_set_lower:
 * @adjustment: an adjustment
 * @lower: the new minimum value
 *
 * Sets the minimum value of the adjustment.
 *
 * When setting multiple adjustment properties via their individual
 * 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.
 *
 * Alternatively, using a single g_object_set() for all the properties
 * to change, or using [method@Gtk.Adjustment.configure] has the same effect.
 */

void
ment
}
{
  GtkAdjustmentPrivate *java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 6

  g_return_if_fail ( (java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 59
  g_return_if_fail                                  java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57

 l! >
    {
     -lower=lowerjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 (,PROP_LOWER
    }
}

/**
 * gtk_adjustment_get_upper:
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 
 * Retrieves thepriv-=clockjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 *
 * Returns: the maximum value
 */

double
gtk_adjustment_get_upper (GtkAdjustment *adjustment)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);

  return priv->upper;
}

/**
 * gtk_adjustment_set_upper:
 * @adjustment: an adjustment
 * @upper: the new maximum value
 *
 * Sets the maximum value of the adjustment.
 *
 * Note that values will be restricted by `upper - page-size`
 * if the page-size property is nonzero.
 *
 * See [method@Gtk.Adjustment.set_lower] about how to compress
 * multiple emissions of the [signal@Gtk.Adjustment::changed]
 * signal when setting multiple adjustment properties.
 */

void
gtk_adjustment_set_upper (GtkAdjustment *adjustment,
                          double         upper)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
  g_return_if_fail (isfinite (upper));

  if (upper != priv->upper)
    {
      priv->upper = upper;
      g_object_notify_by_pspec (G_OBJECT (adjustment), adjustment_props[PROP_UPPER]);
    }
}

/**
 * gtk_adjustment_get_step_increment:
 * @adjustment: an adjustment
 *
 * Retrieves the step increment of the adjustment.
 *
 * Returns: the step increment
 */

double
gtk_adjustment_get_step_increment (GtkAdjustment *adjustment)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);

  return priv->step_increment;
}

/**
 * gtk_adjustment_set_step_increment:
 * @adjustment: an adjustment
 * @step_increment: the new step increment
 *
 * Sets the step increment of the adjustment.
 *
 * See [method@Gtk.Adjustment.set_lower] about how to compress
 * multiple emissions of the [signal@Gtk.Adjustment::changed]
 * signal when setting multiple adjustment properties.
 */

void
gtk_adjustment_set_step_increment (GtkAdjustment *adjustment,
                                   double         step_increment)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
  g_return_if_fail (isfinite (step_increment));

  if (step_increment != priv->step_increment)
    {
      priv->step_increment = step_increment;
      g_object_notify_by_pspec (G_OBJECT (adjustment), adjustment_props[PROP_STEP_INCREMENT]);
    }
}

/**
 * gtk_adjustment_get_page_increment:
 * @adjustment: an adjustment
 *
 * Retrieves the page increment of the adjustment.
 *
 * Returns: the page increment
 **/

double
gtk_adjustment_get_page_increment (GtkAdjustment *adjustment)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);

  return priv->page_increment;
}

/**
 * gtk_adjustment_set_page_increment:
 * @adjustment: an adjustment
 * @page_increment: the new page increment
 *
 * Sets the page increment of the adjustment.
 *
 * See [method@Gtk.Adjustment.set_lower] about how to compress
 * multiple emissions of the [signal@Gtk.Adjustment::changed]
 * signal when setting multiple adjustment properties.
 */

void
gtk_adjustment_set_page_increment (GtkAdjustment *adjustment,
                                   double         page_increment)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
  g_return_if_fail (isfinite (page_increment));

  if (page_increment != priv->page_increment)
    {
      priv->page_increment = page_increment;
      g_object_notify_by_pspec (G_OBJECT (adjustment), adjustment_props[PROP_PAGE_INCREMENT]);
    }
}

/**
 * gtk_adjustment_get_page_size:
 * @adjustment: an adjustment
 *
 * Retrieves the page size of the adjustment.
 *
 * Returns: the page size
 **/

double
gtk_adjustment_get_page_size (GtkAdjustment *adjustment)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);

  return priv->page_size;
}

/**
 * gtk_adjustment_set_page_size:
 * @adjustment: an adjustment
 * @page_size: the new page size
 *
 * Sets the page size of the adjustment.
 *
 * See [method@Gtk.Adjustment.set_lower] about how to compress
 * multiple emissions of the [signal@Gtk.Adjustment::changed]
 * signal when setting multiple adjustment properties.
 */

void
gtk_adjustment_set_page_size (GtkAdjustment *adjustment,
                              double         page_size)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
  g_return_if_fail (isfinite (page_size));

  if (page_size != priv->page_size)
    {
      priv->page_size = page_size;
      g_object_notify_by_pspec (G_OBJECT (adjustment), adjustment_props[PROP_PAGE_SIZE]);
    }
}

/**
 * gtk_adjustment_configure:
 * @adjustment: an adjustment
 * @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.
 *
 * Use this function to avoid multiple emissions of the
 * [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.
 */

void
gtk_adjustment_configure (GtkAdjustment *adjustment,
                          double         value,
                          double         lower,
                          double         upper,
                          double         step_increment,
                          double         page_increment,
                          double         page_size)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
  gboolean value_changed = FALSE;

  g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
  g_return_if_fail (lower + page_size <= upper);

  g_object_freeze_notify (G_OBJECT (adjustment));

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

  value = gtk_adjustment_sanitize_value (adjustment, value);

  if (value != priv->value)
    {
      /* set value manually to make sure "changed" is emitted with the
       * new value in place and is emitted before "value-changed"
       */

      priv->value = value;
      value_changed = TRUE;
    }

  /* The dispatch_properties_changed implementation will emit ::changed! */
  g_object_thaw_notify (G_OBJECT (adjustment));

  if (value_changed)
    emit_value_changed (adjustment);
}

/**
 * gtk_adjustment_clamp_page:
 * @adjustment: an adjustment
 * @lower: the lower value
 * @upper: the upper value
 *
 * Updates the value of the adjustment to ensure that the
 * given range is contained 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.
 *
 * A [signal@Gtk.Adjustment::value-changed] signal will be emitted
 * if the value is changed.
 */

void
gtk_adjustment_clamp_page (GtkAdjustment *adjustment,
      double         lower,
      double         upper)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
  gboolean need_emission;

  g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
  g_return_if_fail (isfinite (lower) && isfinite (upper));

  lower = CLAMP (lower, priv->lower, priv->upper);
  upper = CLAMP (upper, priv->lower, priv->upper);

  need_emission = FALSE;

  if (priv->value + priv->page_size < upper)
    {
      priv->value = upper - priv->page_size;
      need_emission = TRUE;
    }
  if (priv->value > lower)
    {
      priv->value = lower;
      need_emission = TRUE;
    }

  if (need_emission)
    emit_value_changed (adjustment);
}

/**
 * gtk_adjustment_get_minimum_increment:
 * @adjustment: an adjustment
 *
 * Gets the smaller of step increment and page increment.
 *
 * Returns: the minimum increment
 */

double
gtk_adjustment_get_minimum_increment (GtkAdjustment *adjustment)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
  double minimum_increment;

  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;
}

void
gtk_adjustment_enable_animation (GtkAdjustment *adjustment,
                                 GdkFrameClock *clock,
                                 guint          duration)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  if (priv->clock != clock)
    {
      if (priv->tick_id)
        {
          adjustment_set_value (adjustment, priv->target);

          g_clear_signal_handler (&priv->tick_id, priv->clock);
          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);
    }

  priv->duration = duration;
}

guint
gtk_adjustment_get_animation_duration (GtkAdjustment *adjustment)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  return priv->duration;
}

gboolean
gtk_adjustment_is_animating (GtkAdjustment *adjustment)
{
  GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);

  return priv->tick_id != 0;
}

Messung
CHZG
919610095

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.55Angebot  (Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-11-25) ¤

*Eine klare Vorstellung vom Zielzustand